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

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


  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

    if (handle == null) {
      if (element != null && element instanceof IBeansModelElement) {
        return ((IBeansModelElement) element).getElementID();
      }
      else if (element != null && element instanceof ElementImpl) {
        ElementImpl node = (ElementImpl) element;
        IStructuredDocument document = node.getStructuredDocument();
        IFile resource = SpringUIUtils.getFile(document);
        if (document != null) {
          int startLine = document.getLineOfOffset(node
              .getStartOffset()) + 1;
          int endLine = document.getLineOfOffset(node.getEndOffset()) + 1;
          IModelElement mostspecificElement = BeansModelUtils
              .getMostSpecificModelElement(startLine, endLine,
                  resource, null);
          if (mostspecificElement != null
              && mostspecificElement instanceof IBeansModelElement) {
View Full Code Here

      LinkedModeModel linkModel = new LinkedModeModel();
      boolean hasPositions = false;
      for (Element element : properties) {
        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

TOP

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

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.