Package org.eclipse.wst.xml.core.internal.document

Examples of org.eclipse.wst.xml.core.internal.document.ElementImpl


  protected void setTagName(String tagName) {
    super.setTagName(tagName);
  }
  public Node cloneNode(boolean deep) {
    ElementImpl cloned = new ElementImplForJSP(this);
    if (deep)
      cloneChildNodes(cloned, deep);
    return cloned;
  }
View Full Code Here


  protected void setTagName(String tagName) {
    super.setTagName(tagName);
  }

  public Node cloneNode(boolean deep) {
    ElementImpl cloned = new ElementStyleImpl(this);
    if (deep)
      cloneChildNodes(cloned, deep);
    return cloned;
  }
View Full Code Here

  protected boolean isNestedClosed(String regionType) {
    return regionType == PHPRegionContext.PHP_CLOSE;
  }

  public Node cloneNode(boolean deep) {
    ElementImpl cloned = new ElementImplForPhp(this);
    if (deep)
      cloneChildNodes(cloned, deep);
    return cloned;
  }
View Full Code Here

   * Highlights the given element in the sourceview of the document
   *
   * @param element The element that should be highlighted
   */
  public void jumpToElement(Element element) {
    ElementImpl elementImpl = (ElementImpl)element;

    dozerEditor.getSourceEditor().setHighlightRange(elementImpl.getStartOffset()+1, elementImpl.getLength(), true);
    dozerEditor.changeToSourcePage();
  }
View Full Code Here

        return regionType == TwigRegionContext.TWIG_STMT_CLOSE;
    }

    public Node cloneNode(boolean deep)
    {
        ElementImpl cloned = new ElementImplForTwig(this);
        if (deep)
            cloneChildNodes(cloned, deep);
        return cloned;
    }
View Full Code Here

      LinkedModeModel linkModel = new LinkedModeModel();
      boolean hasPositions = false;
      for (Element element : constructorArgs) {
        formatter.formatNode(element);
        if (element instanceof ElementImpl) {
          ElementImpl elementImpl = (ElementImpl) element;
          int nodeOffset = elementImpl.getStartEndOffset() - 1;

          LinkedPositionGroup group = new LinkedPositionGroup();

          try {
            group.addPosition(new LinkedPosition(document, nodeOffset, 0));
View Full Code Here

  public static final String createAdditionalProposalInfo(Object obj, IProgressMonitor monitor) {
    if (obj instanceof IBean) {
      return createAdditionalProposalInfo((IBean) obj);
    }
    else if (obj instanceof ElementImpl) {
      ElementImpl node = (ElementImpl) obj;
      IStructuredDocument document = node.getStructuredDocument();
      IFile resource = getFile(document);
      return createAdditionalProposalInfo((Node) obj, resource);
    }
    else if (obj instanceof IMember) {
      return new ProposalInfo((IMember) obj).getInfo(monitor);
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public IStructuredSelection findSelection(Object object) {
    if (object instanceof ElementImpl) {
      ElementImpl element = (ElementImpl) object;
      IStructuredDocument document = element.getStructuredDocument();
      IFile resource = SpringUIUtils.getFile(document);

      // Ensure that if the project is not loaded we skip this in the UI
      IBeansProject project = BeansCorePlugin.getModel().getProject(resource.getProject());
      if (project instanceof ILazyInitializedModelElement
          && !((ILazyInitializedModelElement) project).isInitialized()) {
        return StructuredSelection.EMPTY;
      }
     
      // Make sure that the file is actually a beans config
      if (!BeansCoreUtils.isBeansConfig(resource)) {
        return null;
      }

      // The line number-based approach is the best approximation that we can currently do
      int startLine = document.getLineOfOffset(element.getStartOffset()) + 1;
      int endLine = document.getLineOfOffset(element.getEndOffset()) + 1;

      IModelElement modelElement = BeansModelUtils.getMostSpecificModelElement(startLine, endLine, resource,
          new NullProgressMonitor());
      if (modelElement != null) {
        return new TreeSelection(BeansUIUtils.createTreePath(modelElement));
View Full Code Here

        if (items != null && items.length > 0) {
          wr = items[0].getData();
        }
      }
      else {
        ElementImpl element = (ElementImpl) javaElement;
        IStructuredDocument document = element.getStructuredDocument();
        int startLine = document.getLineOfOffset(element
            .getStartOffset()) + 1;
        int endLine = document.getLineOfOffset(element.getEndOffset()) + 1;
        for (TreeItem element0 : items) {
          Object obj = element0.getData();
          if (obj instanceof IRevealableReferenceNode
              && ((IRevealableReferenceNode) obj).getLineNumber() >= startLine
              && ((IRevealableReferenceNode) obj).getLineNumber() <= endLine) {
View Full Code Here

        nodes.add(new AdviceDeclareParentAopSourceNode(entry.getValue()));
      }
      return nodes.toArray();
    }
    else if (parentElement instanceof ElementImpl) {
      ElementImpl element = (ElementImpl) parentElement;
      IStructuredDocument document = element.getStructuredDocument();
      List<IReferenceNode> nodes = new ArrayList<IReferenceNode>();

      IResource resource = SpringUIUtils.getFile(document);
      // check if resource is a Beans Config
      if (!BeansCoreUtils.isBeansConfig(resource, true) || document == null) {
        return nodes.toArray();
      }
      IBeansConfig beansConfig = BeansCorePlugin.getModel().getConfig((IFile) resource, true);
      int startLine = document.getLineOfOffset(element.getStartOffset()) + 1;
      int endLine = document.getLineOfOffset(element.getEndOffset()) + 1;
      String id = BeansEditorUtils.getAttribute(element, "id");

      nodes.addAll(getChildrenFromXmlLocation(resource, startLine, endLine, id, BeansModelUtils.getBeans(beansConfig)));

      return nodes.toArray();
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.document.ElementImpl

Copyright © 2018 www.massapicom. 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.