コード例 #1
0
 public void update(AnActionEvent e) {
   boolean enabled = true;
   for (DependenciesBuilder builder : myBuilders) {
     enabled &= builder.getScope().isValid();
   }
   e.getPresentation().setEnabled(enabled);
 }
コード例 #2
0
 public void update(final AnActionEvent e) {
   super.update(e);
   final PatternDialectProvider provider =
       PatternDialectProvider.getInstance(mySettings.SCOPE_TYPE);
   e.getPresentation().setText(provider.getDisplayName());
   e.getPresentation().setIcon(provider.getIcon());
 }
コード例 #3
0
 public void update(final AnActionEvent e) {
   final boolean[] direct = new boolean[] {true};
   processDependencies(
       getSelectedScope(myLeftTree),
       getSelectedScope(myRightTree),
       new Processor<List<PsiFile>>() {
         public boolean process(final List<PsiFile> path) {
           direct[0] = false;
           return false;
         }
       });
   e.getPresentation().setEnabled(!direct[0]);
 }
コード例 #4
0
 public void update(final AnActionEvent e) {
   final Presentation presentation = e.getPresentation();
   presentation.setEnabled(false);
   final PackageDependenciesNode leftNode = myLeftTree.getSelectedNode();
   final PackageDependenciesNode rightNode = myRightTree.getSelectedNode();
   if (leftNode != null && rightNode != null) {
     final PatternDialectProvider provider =
         PatternDialectProvider.getInstance(mySettings.SCOPE_TYPE);
     presentation.setEnabled(
         (provider.createPackageSet(leftNode, true) != null
                 || provider.createPackageSet(leftNode, false) != null)
             && (provider.createPackageSet(rightNode, true) != null
                 || provider.createPackageSet(rightNode, false) != null));
   }
 }
コード例 #5
0
 public void actionPerformed(final AnActionEvent e) {
   @NonNls final String delim = "&nbsp;-&gt;&nbsp;";
   final StringBuffer buf = new StringBuffer();
   processDependencies(
       getSelectedScope(myLeftTree),
       getSelectedScope(myRightTree),
       new Processor<List<PsiFile>>() {
         public boolean process(final List<PsiFile> path) {
           if (buf.length() > 0) buf.append("<br>");
           buf.append(
               StringUtil.join(
                   path,
                   new Function<PsiFile, String>() {
                     public String fun(final PsiFile psiFile) {
                       return psiFile.getName();
                     }
                   },
                   delim));
           return true;
         }
       });
   final JEditorPane pane =
       new JEditorPane(UIUtil.HTML_MIME, "<html>" + buf.toString() + "</html>");
   pane.setForeground(Color.black);
   pane.setBackground(HintUtil.INFORMATION_COLOR);
   pane.setOpaque(true);
   final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(pane);
   final Dimension dimension = pane.getPreferredSize();
   scrollPane.setMinimumSize(new Dimension(dimension.width, dimension.height + 20));
   scrollPane.setPreferredSize(new Dimension(dimension.width, dimension.height + 20));
   JBPopupFactory.getInstance()
       .createComponentPopupBuilder(scrollPane, pane)
       .setTitle("Dependencies")
       .setMovable(true)
       .createPopup()
       .showInBestPositionFor(e.getDataContext());
 }
コード例 #6
0
 public void update(AnActionEvent e) {
   PackageDependenciesNode node = myRightTree.getSelectedNode();
   e.getPresentation().setEnabled(node != null && node.canSelectInLeftTree(myDependencies));
 }
コード例 #7
0
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setEnabled(getScope() != null);
 }
コード例 #8
0
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setEnabled(!getSelectedScope(myLeftTree).isEmpty());
 }
コード例 #9
0
 public void update(final AnActionEvent e) {
   super.update(e);
   e.getPresentation().setEnabled(mySettings.UI_SHOW_MODULES);
 }