View Javadoc

    1   package net.sourceforge.pmd.util.viewer.gui.menu;
    2
    3   import javax.swing.JPopupMenu;
    4
    5   import net.sourceforge.pmd.lang.ast.Node;
    6   import net.sourceforge.pmd.util.viewer.model.ViewerModel;
    7
    8   /**
    9    * context sensetive menu for the AST Panel
    10   *
    11   * @author Boris Gruschko ( boris at gruschko.org )
    12   * @version $Id$
    13   */
    14  public class ASTNodePopupMenu extends JPopupMenu {
    15      private ViewerModel model;
    16      private Node node;
    17
    18      public ASTNodePopupMenu(ViewerModel model, Node node) {
    19          this.model = model;
    20          this.node = node;
    21          init();
    22      }
    23
    24      private void init() {
    25          add(new SimpleNodeSubMenu(model, node));
    26          addSeparator();
    27          add(new AttributesSubMenu(model, node));
    28      }
    29  }