예제 #1
0
 private void handle(MouseEvent e) {
   if (e.isPopupTrigger()) {
     ActionManager mgr = getContext().getActions();
     JPopupMenu menu =
         mgr.createPopup(
             getContext().getResources().getStringArray(ElementNavigator.class, "popupActions"));
     menu.show((JComponent) e.getSource(), e.getX(), e.getY());
   }
 }
예제 #2
0
 public void show(Component invoker, int x, int y) {
   Object o = getTree().getClosestPathForLocation(x, y).getLastPathComponent();
   if (null != o) {
     node = (Node) o;
     if ((node instanceof AttrConfig) || (node instanceof Config)) {
       newAttribute.setEnabled(true);
       duplicate.setEnabled(true);
       delete.setEnabled(true);
     } else {
       newAttribute.setEnabled(false);
       duplicate.setEnabled(false);
       delete.setEnabled(false);
     }
     super.show(invoker, x, y);
   }
 }