コード例 #1
0
 public static List<ActivateToolWindowAction> getToolWindowActions(@NotNull Project project) {
   ActionManager actionManager = ActionManager.getInstance();
   ToolWindowManager manager = ToolWindowManager.getInstance(project);
   List<ActivateToolWindowAction> result = ContainerUtil.newArrayList();
   for (String id : manager.getToolWindowIds()) {
     if (!manager.getToolWindow(id).isShowStripeButton()) continue;
     String actionId = ActivateToolWindowAction.getActionIdForToolWindow(id);
     AnAction action = actionManager.getAction(actionId);
     if (action instanceof ActivateToolWindowAction) {
       result.add((ActivateToolWindowAction) action);
     }
   }
   Collections.sort(result, COMPARATOR);
   return result;
 }
コード例 #2
0
 public static void updateToolWindows() {
   for (Project project : ProjectManager.getInstance().getOpenProjects()) {
     final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
     for (String id : toolWindowManager.getToolWindowIds()) {
       final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
       for (Content content : toolWindow.getContentManager().getContents()) {
         final JComponent component = content.getComponent();
         if (component != null) {
           IJSwingUtilities.updateComponentTreeUI(component);
         }
       }
       final JComponent c = toolWindow.getComponent();
       if (c != null) {
         IJSwingUtilities.updateComponentTreeUI(c);
       }
     }
   }
 }