Package org.aspectj.asm

Examples of org.aspectj.asm.IProgramElement$ExtraInformation


                                                    int row,
                                                    boolean hasFocus) {
    if (treeNode == null) return null;
    this.setFont(StructureTree.DEFAULT_FONT);      
        SwingTreeViewNode viewNode = (SwingTreeViewNode)treeNode;
        IProgramElement node = viewNode.getStructureNode();

        if (viewNode.getKind() == IStructureViewNode.Kind.LINK) {
            ISourceLocation sourceLoc = node.getSourceLocation();
            if ((null != sourceLoc)
                && (null != sourceLoc.getSourceFile().getAbsolutePath())) {
                setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_COLOR);
            } else {
                setTextNonSelectionColor(AjdeWidgetStyles.LINK_NODE_NO_SOURCE_COLOR);
            }
           
        } else if (viewNode.getKind() == IStructureViewNode.Kind.RELATIONSHIP) {
      this.setFont(new Font(this.getFont().getName(), Font.ITALIC, this.getFont().getSize()));
      setTextNonSelectionColor(new Color(0, 0, 0));
     
        } else if (viewNode.getKind() == IStructureViewNode.Kind.DECLARATION) {
      setTextNonSelectionColor(new Color(0, 0, 0));
        }
    super.getTreeCellRendererComponent(tree, treeNode, sel, expanded, leaf, row, hasFocus);      
    if (viewNode.getIcon() != null && viewNode.getIcon().getIconResource() != null) {
      setIcon((Icon)viewNode.getIcon().getIconResource());
    } else {
      setIcon(null);
    }
        
        if (node != null) {
          if (node.isRunnable()) {
            setIcon(Ajde.getDefault().getIconRegistry().getExecuteIcon());
          }  
      if (node.getMessage() != null) {
        if (node.getMessage().getKind().equals(IMessage.WARNING)) {
          setIcon(Ajde.getDefault().getIconRegistry().getWarningIcon());
        } else if (node.getMessage().getKind().equals(IMessage.ERROR)) {
          setIcon(Ajde.getDefault().getIconRegistry().getErrorIcon());
        } else {
          setIcon(Ajde.getDefault().getIconRegistry().getInfoIcon());
        }
      }
View Full Code Here


      for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
        // this ignores relations on the compile unit
        Object nodeObject = it.next();
        // throw new RuntimeException("unimplemented");
        // if (nodeObject instanceof IProgramElement) {
        IProgramElement child = (IProgramElement) nodeObject;
        printDecl(child, true);
        // }
        // else if (nodeObject instanceof LinkNode) {
        // LinkNode child = (LinkNode)nodeObject;
        // printDecl(child.getProgramElementNode(), false);
View Full Code Here

        if (it3.hasNext()) {
          while (it3.hasNext()) {
            // this ignores relations on the compile unit
            Object nodeObject = it3.next();
            if (nodeObject instanceof IProgramElement) {
              IProgramElement currNode = (IProgramElement) nodeObject;
              if (// !currNode.isStmntKind() &&
              !currNode.getKind().equals("<undefined>")) {
                printDecl(currNode, true);
              }
            }
          }
        }
View Full Code Here

   }

  public void setActiveNode(IStructureViewNode node, int lineOffset) {
    if (node == null) return;
//     if (!(node.getStructureNode() instanceof IProgramElement)) return;
    IProgramElement pNode = node.getStructureNode();
     treeManager.highlightNode(pNode);
     if (pNode.getSourceLocation() != null) {
       Ajde.getDefault().getEditorAdapter().showSourceLine(
         pNode.getSourceLocation().getSourceFile().getAbsolutePath(),
         pNode.getSourceLocation().getLine() + lineOffset,
         true
       );
     }
  }
View Full Code Here

     }
  }

   public void highlightActiveNode() {
     if (currentView.getActiveNode() == null) return;
     IProgramElement node = currentView.getActiveNode().getStructureNode();
     if (node!=null) {
       treeManager.highlightNode(node);
     }
   }
View Full Code Here

    }

    public void singleClickNavigation(MouseEvent e) {
        SwingTreeViewNode treeNode = (SwingTreeViewNode)tree.getLastSelectedPathComponent();
        if (treeNode != null && !e.isControlDown() && !e.isShiftDown() && e.getModifiers() != 4) {
            IProgramElement currNode = (IProgramElement)treeNode.getUserObject();
            if (currNode!=null && !e.isControlDown()
                && !e.isShiftDown() && e.getModifiers() != 4) {
                //AjdeUIManager.getDefault().getViewManager().showNodeInMasterView((ProgramElementNode)currNode);
                //if (AjdeUIManager.getDefault().getViewManager().isSplitViewMode()) {
                //    AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView((ProgramElementNode)currNode);
View Full Code Here

        public void doubleClickNavigation(MouseEvent e) {
//            int clickCount = e.getClickCount();
            SwingTreeViewNode treeNode = (SwingTreeViewNode)tree.getLastSelectedPathComponent();
            if (treeNode != null) {
                IProgramElement currNode = (IProgramElement)treeNode.getUserObject();
                if (currNode!=null && !e.isControlDown() && !e.isShiftDown()
                    && e.getModifiers() != 4) {
                    //AjdeUIManager.getDefault().getViewManager().showNodeInMasterView(((LinkNode)currNode).getProgramElementNode());
                    //AjdeUIManager.getDefault().getViewManager().showNodeInSlaveView(((LinkNode)currNode).getProgramElementNode());
                }
View Full Code Here

  }

  private void highlightNode(SwingTreeViewNode parent, IProgramElement node) {
    for (int i = 0; i < parent.getChildCount(); i++) {
      SwingTreeViewNode currNode = (SwingTreeViewNode) parent.getChildAt(i);
      IProgramElement sNode = currNode.getStructureNode();
      if (sNode != null && sNode.equals(node) && currNode.getKind() != IStructureViewNode.Kind.LINK) {
        TreePath path = new TreePath(currNode.getPath());
        structureTree.setSelectionPath(path);
        int currRow = structureTree.getRowForPath(path);
        structureTree.expandRow(currRow);
        structureTree.scrollRowToVisible(currRow);
View Full Code Here

  private void expandTreeToFiles() {
    for (int i = 0; i < structureTree.getRowCount(); i++) {
      TreePath path = structureTree.getPathForRow(i);
      SwingTreeViewNode node = (SwingTreeViewNode) path.getLastPathComponent();
      if (node.getUserObject() instanceof IProgramElement) {
        IProgramElement pNode = (IProgramElement) node.getUserObject();
        IProgramElement.Kind kind = pNode.getKind();
        if (kind == IProgramElement.Kind.PROJECT || kind == IProgramElement.Kind.PACKAGE) {
          structureTree.expandPath(path);
        } else {
          structureTree.collapsePath(path);
        }
View Full Code Here

      // push the node on the stack
      // and traverse

      // -- create node to add
      final File file = new File(new String(unit.getFileName()));
      final IProgramElement cuNode;
      {
        // AMC - use the source start and end from the compilation unit decl
        int startLine = getStartLine(unit);
        int endLine = getEndLine(unit);
        SourceLocation sourceLocation = new SourceLocation(file, startLine, endLine);
        sourceLocation.setOffset(unit.sourceStart);
        cuNode = new ProgramElement(structureModel, new String(file.getName()), IProgramElement.Kind.FILE_JAVA,
            sourceLocation, 0, null, null);
      }

      // container for import declarations - this may move to position 1 in the child list, if there
      // is a package declaration
      cuNode.addChild(new ProgramElement(structureModel, "", IProgramElement.Kind.IMPORT_REFERENCE, null, 0, null, null));

      final IProgramElement addToNode = genAddToNode(file, unit, structureModel);

      // -- remove duplicates before adding (XXX use them instead?)
      if (addToNode != null && addToNode.getChildren() != null) {
        for (ListIterator itt = addToNode.getChildren().listIterator(); itt.hasNext();) {
          IProgramElement child = (IProgramElement) itt.next();
          ISourceLocation childLoc = child.getSourceLocation();
          if (null == childLoc) {
            // XXX ok, packages have null source locations
            // signal others?
          } else if (childLoc.getSourceFile().equals(file)) {
            itt.remove();
View Full Code Here

TOP

Related Classes of org.aspectj.asm.IProgramElement$ExtraInformation

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.