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