ASTNodePopupMenu.java
01 package net.sourceforge.pmd.util.viewer.gui.menu;
02 
03 import javax.swing.JPopupMenu;
04 
05 import net.sourceforge.pmd.lang.ast.Node;
06 import net.sourceforge.pmd.util.viewer.model.ViewerModel;
07 
08 /**
09  * context sensetive menu for the AST Panel
10  *
11  @author Boris Gruschko ( boris at gruschko.org )
12  @version $Id: ASTNodePopupMenu.java 5954 2008-04-04 03:51:12Z rgustav $
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 }