Examples of FuzzyXMLElement


Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

  public FuzzyXMLAttrIterator(NodePointer parent, QName name) {
    this._parent = parent;
    //        this.name = name;
    if (parent.getNode() instanceof FuzzyXMLElement) {
      FuzzyXMLElement element = (FuzzyXMLElement) parent.getNode();

      String prefix = name.getPrefix();
      String lname = name.getName();
      if (prefix != null && !prefix.equals("")) {
        lname = prefix + ":" + lname;
      }
      if (!lname.equals("*")) {
        _attributes = new ArrayList<FuzzyXMLAttribute>();
        FuzzyXMLAttribute[] allAttributes = element.getAttributes();
        for (int i = 0; i < allAttributes.length; i++) {
          if (allAttributes[i].getName().equals(lname)) {
            _attributes.add(allAttributes[i]);
            break;
          }
        }
      }
      else {
        _attributes = new ArrayList<FuzzyXMLAttribute>();
        FuzzyXMLAttribute[] allAttributes = element.getAttributes();
        for (int i = 0; i < allAttributes.length; i++) {
          _attributes.add(allAttributes[i]);
        }
      }
    }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

      ISelection realSelection = getSelectionProvider().getSelection();
      if (realSelection instanceof ITextSelection) {
        ITextSelection textSelection = (ITextSelection) realSelection;
        FuzzyXMLDocument document = getHtmlXmlDocument(refreshModel);
        if (document != null) {
          FuzzyXMLElement element = document.getElementByOffset(textSelection.getOffset());
          BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
          wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
        }
      }
      else if (realSelection instanceof IStructuredSelection) {
        IStructuredSelection structuredSelection = (IStructuredSelection) realSelection;
        Object obj = structuredSelection.getFirstElement();
        if (obj instanceof FuzzyXMLElement) {
          FuzzyXMLElement element = (FuzzyXMLElement) obj;
          BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
          wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
        }
      }
    }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

    return getViewer().getTextWidget();
  }

  public IWodElement getWodElementAtPoint(Point point, boolean resolveWodElement, boolean refreshModel) throws Exception {
    IWodElement wodElement = null;
    FuzzyXMLElement element = getElementAtPoint(point, refreshModel);
    if (WodHtmlUtils.isWOTag(element)) {
      WodParserCache cache = getParserCache();
      BuildProperties buildProperties = (BuildProperties)cache.getProject().getAdapter(BuildProperties.class);
      wodElement = WodHtmlUtils.getWodElement(element, buildProperties, resolveWodElement, cache);
    }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

    return wodElement;
  }

  public FuzzyXMLElement getElementAtPoint(Point point, boolean refreshModel) throws Exception {
    int offset = getOffsetAtPoint(point);
    FuzzyXMLElement element = getElementAtOffset(offset, refreshModel);
    return element;
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

    FuzzyXMLElement element = getElementAtOffset(offset, refreshModel);
    return element;
  }

  public FuzzyXMLElement getElementAtOffset(int offset, boolean refreshModel) throws Exception {
    FuzzyXMLElement element = null;
    if (offset >= 0) {
      FuzzyXMLDocument xmlDocument = getHtmlXmlDocument(refreshModel);
      if (xmlDocument != null) {
        element = xmlDocument.getElementByOffset(offset);
      }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

    int offset = getOffsetAtPoint(point);
    return getSelectionRegionForElementAtOffset(element, offset, regionForInsert);
  }

  public IRegion getSelectionRegionAtOffset(int offset, boolean regionForInsert, boolean refreshModel) throws Exception {
    FuzzyXMLElement element = getElementAtOffset(offset, refreshModel);
    IRegion region = getSelectionRegionForElementAtOffset(element, offset, regionForInsert);
    return region;
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

  public void appendChildrenFromText(String text, boolean wo54) {
    if (text.length() == 0) {
      return;
    }
    // ��x�G�������g��}��ăI�t�Z�b�g���擾
    FuzzyXMLElement test = new FuzzyXMLElementImpl("test");
    appendChild(test);
    int offset = test.getOffset();
    // �I�t�Z�b�g���擾�����炷���폜
    removeChild(test);

    String parseText = "<root>" + text + "</root>";

    FuzzyXMLElement root = new FuzzyXMLParser(wo54).parse(parseText).getDocumentElement();
    ((AbstractFuzzyXMLNode) root).appendOffset(root, 0, -6);
    ((AbstractFuzzyXMLNode) root).appendOffset(root, 0, offset);
    FuzzyXMLNode[] nodes = ((FuzzyXMLElement) root.getChildren()[0]).getChildren();

    appendOffset(this, offset, text.length());

    for (int i = 0; i < nodes.length; i++) {
      appendChild(nodes[i], false, false);
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

  }

  @Override
  public boolean equals(Object obj) {
    if (obj instanceof FuzzyXMLElement) {
      FuzzyXMLElement element = (FuzzyXMLElement) obj;

      // �^�O�̖��O���������false
      if (!element.getName().equals(getName())) {
        return false;
      }

      // �e������Ƃ�null��������true
      FuzzyXMLNode parent = element.getParentNode();
      if (parent == null) {
        if (getParentNode() == null) {
          return true;
        }
        return false;
      }

      // �J�n�I�t�Z�b�g��������������true
      if (element.getOffset() == getOffset()) {
        return true;
      }

    }
    return false;
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

          if (text.hasLineBreaks())
            textblocks++;
        }
      } else {
        if (child instanceof FuzzyXMLElement) {
          FuzzyXMLElement element = (FuzzyXMLElement)child;
          elementcount++;
          if (!isSelfClosing(element)) {
            //result &= element.isNonBreaking();
            elementcount++;
          }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLElement

    public void run() {
      try {
        ITextSelection templateSelection = (ITextSelection) getSelectionProvider().getSelection();
        if (templateSelection != null) {
          int offset = templateSelection.getOffset();
          FuzzyXMLElement element = getElementAtOffset(offset, true);
          if (element != null) {
            BuildProperties buildProperties = (BuildProperties)getParserCache().getProject().getAdapter(BuildProperties.class);
            DeleteTagRefactoring.run(element, false, buildProperties, getParserCache(), new NullProgressMonitor());
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.