예제 #1
0
 public void update(AnActionEvent e) {
   final Presentation presentation = e.getPresentation();
   presentation.setEnabled(false);
   final TreePath[] selectionPath = myTree.getSelectionPaths();
   if (selectionPath != null) {
     Object[] nodes =
         ContainerUtil.map2Array(
             selectionPath,
             new Function<TreePath, Object>() {
               @Override
               public Object fun(TreePath treePath) {
                 return treePath.getLastPathComponent();
               }
             });
     if (!myCondition.value(nodes)) return;
     presentation.setEnabled(true);
   }
 }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(myContainerNodes.size() > 1);
 }
 @Override
 public void update(AnActionEvent e) {
   super.update(e);
   final Presentation presentation = e.getPresentation();
   presentation.setEnabled(allTargetsAreValid());
 }