com.intellij.openapi.wm.ex.ToolWindowManagerEx Java Examples

The following examples show how to use com.intellij.openapi.wm.ex.ToolWindowManagerEx. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HideSideWindowsAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  String id = toolWindowManager.getActiveToolWindowId();
  if (id != null) {
    presentation.setEnabled(true);
    return;
  }

  id = toolWindowManager.getLastActiveToolWindowId();
  if (id == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindowEx toolWindow = (ToolWindowEx)toolWindowManager.getToolWindow(id);
  presentation.setEnabled(toolWindow.isVisible());
}
 
Example #2
Source File: ToggleFloatingModeAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void setSelected(AnActionEvent event, boolean flag) {
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
  if (id == null) {
    return;
  }
  ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindowEx toolWindow = (ToolWindowEx)mgr.getToolWindow(id);
  ToolWindowType type = toolWindow.getType();
  if (ToolWindowType.FLOATING == type) {
    toolWindow.setType(toolWindow.getInternalType(), null);
  }
  else {
    toolWindow.setType(ToolWindowType.FLOATING, null);
  }
}
 
Example #3
Source File: BaseToolWindowToggleAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public final void setSelected(AnActionEvent e, boolean state) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
  if (id == null) {
    return;
  }

  ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindowEx toolWindow = (ToolWindowEx)mgr.getToolWindow(id);

  setSelected(toolWindow, state);
}
 
Example #4
Source File: EditorPerfDecorations.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Returns the action executed when the icon is left-clicked.
 *
 * @return the action instance, or null if no action is required.
 */
@Nullable
public AnAction getClickAction() {
  return new AnAction() {
    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {
      if (isActive()) {

        final ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(getApp().getProject());
        final ToolWindow flutterPerfToolWindow = toolWindowManager.getToolWindow(FlutterPerformanceView.TOOL_WINDOW_ID);
        if (flutterPerfToolWindow.isVisible()) {
          showPerfViewMessage();
          return;
        }
        flutterPerfToolWindow.show(() -> showPerfViewMessage());
      }
    }
  };
}
 
Example #5
Source File: ToggleWindowedModeAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void setSelected(AnActionEvent event, boolean flag) {
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
  if (id == null) {
    return;
  }
  ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindowEx toolWindow = (ToolWindowEx)mgr.getToolWindow(id);
  ToolWindowType type = toolWindow.getType();
  if (ToolWindowType.WINDOWED == type) {
    toolWindow.setType(toolWindow.getInternalType(), null);
  }
  else {
    toolWindow.setType(ToolWindowType.WINDOWED, null);
  }
}
 
Example #6
Source File: EditorPerfDecorations.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Returns the action executed when the icon is left-clicked.
 *
 * @return the action instance, or null if no action is required.
 */
@Nullable
public AnAction getClickAction() {
  return new AnAction() {
    @Override
    public void actionPerformed(@NotNull AnActionEvent event) {
      if (isActive()) {

        final ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(getApp().getProject());
        final ToolWindow flutterPerfToolWindow = toolWindowManager.getToolWindow(FlutterPerformanceView.TOOL_WINDOW_ID);
        if (flutterPerfToolWindow.isVisible()) {
          showPerfViewMessage();
          return;
        }
        flutterPerfToolWindow.show(() -> showPerfViewMessage());
      }
    }
  };
}
 
Example #7
Source File: ToolWindowManagerBase.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public void runActivity(@Nonnull UIAccess uiAccess, @Nonnull Project project) {
  ToolWindowManagerEx ex = ToolWindowManagerEx.getInstanceEx(project);
  if (ex instanceof ToolWindowManagerBase) {
    ToolWindowManagerBase manager = (ToolWindowManagerBase)ex;
    List<FinalizableCommand> list = new ArrayList<>();
    manager.registerToolWindowsFromBeans(list);
    manager.initAll(list);

    list.add(((ToolWindowManagerBase)ex).connectModuleExtensionListener());

    uiAccess.give(() -> {
      manager.execute(list);
      manager.flushCommands();
    });
  }
}
 
Example #8
Source File: ExternalSystemUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void ensureToolWindowInitialized(@Nonnull Project project, @Nonnull ProjectSystemId externalSystemId) {
  ToolWindowManager manager = ToolWindowManager.getInstance(project);
  if (!(manager instanceof ToolWindowManagerEx)) {
    return;
  }
  ToolWindowManagerEx managerEx = (ToolWindowManagerEx)manager;
  String id = externalSystemId.getReadableName();
  ToolWindow window = manager.getToolWindow(id);
  if (window != null) {
    return;
  }
  for (final ToolWindowEP bean : ToolWindowEP.EP_NAME.getExtensionList()) {
    if (id.equals(bean.id)) {
      managerEx.initToolWindow(bean);
    }
  }
}
 
Example #9
Source File: HideToolWindowAction.java    From consulo with Apache License 2.0 6 votes vote down vote up
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  String id = toolWindowManager.getActiveToolWindowId();
  if (id != null) {
    presentation.setEnabled(true);
    return;
  }

  id = toolWindowManager.getLastActiveToolWindowId();
  if (id == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
  presentation.setEnabled(toolWindow.isVisible());
}
 
Example #10
Source File: TestResultsPanel.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected TestResultsPanel(@Nonnull JComponent console, AnAction[] consoleActions, TestConsoleProperties properties,
                           @Nonnull String splitterProportionProperty, float splitterDefaultProportion) {
  super(new BorderLayout(0,1));
  myConsole = console;
  myConsoleActions = consoleActions;
  myProperties = properties;
  mySplitterProportionProperty = splitterProportionProperty;
  mySplitterDefaultProportion = splitterDefaultProportion;
  myStatisticsSplitterProportionProperty = mySplitterProportionProperty + "_Statistics";
  final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
    @Override
    public void stateChanged() {
      final boolean splitVertically = splitVertically();
      myStatusLine.setPreferredSize(splitVertically);
      mySplitter.setOrientation(splitVertically);
      revalidate();
      repaint();
    }
  };
  ToolWindowManagerEx.getInstanceEx(properties.getProject()).addToolWindowManagerListener(listener, this);
}
 
Example #11
Source File: TogglePresentationModeAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static boolean hideAllToolWindows(ToolWindowManagerEx manager) {
  // to clear windows stack
  manager.clearSideStack();

  String[] ids = manager.getToolWindowIds();
  boolean hasVisible = false;
  for (String id : ids) {
    final ToolWindow toolWindow = manager.getToolWindow(id);
    if (toolWindow.isVisible()) {
      toolWindow.hide(null);
      hasVisible = true;
    }
  }
  return hasVisible;
}
 
Example #12
Source File: OccurenceNavigatorActionBase.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
@RequiredUIAccess
private static Component getOccurenceNavigatorFromContext(DataContext dataContext) {
  Window window = TargetAWT.to(WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow());

  if (window != null) {
    Component component = window.getFocusOwner();
    for (Component c = component; c != null; c = c.getParent()) {
      if (c instanceof OccurenceNavigator) {
        return c;
      }
    }
  }

  Project project = dataContext.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return null;
  }

  ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);

  String id = mgr.getLastActiveToolWindowId(component -> findNavigator(component) != null);
  if (id == null) {
    return null;
  }
  return (Component)findNavigator(mgr.getToolWindow(id).getComponent());
}
 
Example #13
Source File: StoreDefaultLayoutAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void actionPerformed(AnActionEvent e){
  Project project = e.getData(CommonDataKeys.PROJECT);
  if(project==null){
    return;
  }
  ToolWindowLayout layout = ToolWindowManagerEx.getInstanceEx(project).getLayout();
  WindowManagerEx.getInstanceEx().setLayout(layout);
}
 
Example #14
Source File: HideToolWindowAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }

  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  String id = toolWindowManager.getActiveToolWindowId();
  if (id == null) {
    id = toolWindowManager.getLastActiveToolWindowId();
  }
  toolWindowManager.getToolWindow(id).hide(null);
}
 
Example #15
Source File: IMWindowFactory.java    From SmartIM4IntelliJ with Apache License 2.0 5 votes vote down vote up
@Override public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
    instance = this;
    this.project = project;
    toolWindow.setToHideOnEmptyContent(true);
    createContents(project, toolWindow);
    ToolWindowManager manager = ToolWindowManager.getInstance(project);
    if (manager instanceof ToolWindowManagerEx) {
        ToolWindowManagerEx managerEx = ((ToolWindowManagerEx)manager);
        managerEx.addToolWindowManagerListener(new ToolWindowManagerListener() {
            @Override public void toolWindowRegistered(@NotNull String id) {
            }

            @Override public void stateChanged() {
                ToolWindow window =
                    ToolWindowManager.getInstance(project).getToolWindow(IMWindowFactory.TOOL_WINDOW_ID);
                if (window != null) {
                    boolean visible = window.isVisible();
                    if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                        createContents(project, window);
                    }
                }
            }
        });
    }

    //        Disposer.register(project, new Disposable() {
    //            @Override
    //            public void dispose() {
    //                if (panel != null && panel.isEnabled()) {
    //                    panel.setEnabled(false);
    //                    panel = null;
    //                }
    //            }
    //        });
}
 
Example #16
Source File: TogglePresentationModeAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
static boolean storeToolWindows(@Nullable Project project) {
  if (project == null) return false;
  ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);

  ToolWindowLayout layout = new ToolWindowLayout();
  layout.copyFrom(manager.getLayout());
  boolean hasVisible = hideAllToolWindows(manager);

  if (hasVisible) {
    manager.setLayoutToRestoreLater(layout);
    manager.activateEditorComponent();
  }
  return hasVisible;
}
 
Example #17
Source File: TogglePresentationModeAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
static void restoreToolWindows(Project project, boolean needsRestore, boolean inPresentation) {
  if (project == null || !needsRestore) return;
  ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
  ToolWindowLayout restoreLayout = manager.getLayoutToRestoreLater();
  if (!inPresentation && restoreLayout != null) {
    manager.setLayout(restoreLayout);
  }
}
 
Example #18
Source File: RestoreDefaultLayoutAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void actionPerformed(AnActionEvent e){
  Project project = e.getData(CommonDataKeys.PROJECT);
  if(project==null){
    return;
  }
  ToolWindowLayout layout=WindowManagerEx.getInstanceEx().getLayout();
  ToolWindowManagerEx.getInstanceEx(project).setLayout(layout);
}
 
Example #19
Source File: JumpToLastWindowAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void actionPerformed(AnActionEvent e) {
  Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    return;
  }
  ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
  String id = manager.getLastActiveToolWindowId();
  if(id==null||!manager.getToolWindow(id).isAvailable()){
    return;
  }
  manager.getToolWindow(id).activate(null);
}
 
Example #20
Source File: JumpToLastWindowAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void update(AnActionEvent event){
  Presentation presentation = event.getPresentation();
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  ToolWindowManagerEx manager=(ToolWindowManagerEx)ToolWindowManager.getInstance(project);
  String id = manager.getLastActiveToolWindowId();
  presentation.setEnabled(id != null && manager.getToolWindow(id).isAvailable());
}
 
Example #21
Source File: DockablePopupManager.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void restorePopupBehavior() {
  if (myToolWindow != null) {
    PropertiesComponent.getInstance().setValue(getShowInToolWindowProperty(), Boolean.FALSE.toString());
    ToolWindowManagerEx toolWindowManagerEx = ToolWindowManagerEx.getInstanceEx(myProject);
    toolWindowManagerEx.hideToolWindow(getToolwindowId(), false);
    toolWindowManagerEx.unregisterToolWindow(getToolwindowId());
    Disposer.dispose(myToolWindow.getContentManager());
    myToolWindow = null;
    restartAutoUpdate(false);
  }
}
 
Example #22
Source File: DocumentationComponent.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void update(@Nonnull AnActionEvent e) {
  Presentation presentation = e.getPresentation();
  if (myManager == null) {
    presentation.setEnabledAndVisible(false);
  }
  else {
    presentation.setIcon(ToolWindowManagerEx.getInstanceEx(myManager.myProject).getLocationIcon(ToolWindowId.DOCUMENTATION, consulo.ui.image.Image.empty(16)));
    presentation.setEnabledAndVisible(myToolwindowCallback != null);
  }
}
 
Example #23
Source File: RunContentManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@RequiredUIAccess
private void registerToolWindow(@Nonnull final Executor executor, @Nonnull ToolWindowManagerEx toolWindowManager) {
  final String toolWindowId = executor.getToolWindowId();
  if (toolWindowManager.getToolWindow(toolWindowId) != null) {
    return;
  }

  final ToolWindow toolWindow = toolWindowManager.registerToolWindow(toolWindowId, true, ToolWindowAnchor.BOTTOM, this, true);
  final ContentManager contentManager = toolWindow.getContentManager();
  contentManager.addDataProvider(new DataProvider() {
    private int myInsideGetData = 0;

    @Override
    public Object getData(@Nonnull Key<?> dataId) {
      myInsideGetData++;
      try {
        if (PlatformDataKeys.HELP_ID == dataId) {
          return executor.getHelpId();
        }
        else {
          return myInsideGetData == 1 ? DataManager.getInstance().getDataContext(contentManager.getComponent()).getData(dataId) : null;
        }
      }
      finally {
        myInsideGetData--;
      }
    }
  });

  toolWindow.setIcon(executor.getToolWindowIcon());
  new ContentManagerWatcher(toolWindow, contentManager);
  initToolWindow(executor, toolWindowId, executor.getToolWindowIcon(), contentManager);
}
 
Example #24
Source File: HideAllToolWindowsAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  Project project = event.getData(CommonDataKeys.PROJECT);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }

  ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  String[] ids = toolWindowManager.getToolWindowIds();
  for (String id : ids) {
    if (toolWindowManager.getToolWindow(id).isVisible()) {
      presentation.setEnabled(true);
      presentation.setText(IdeBundle.message("action.hide.all.windows"), true);
      return;
    }
  }

  final ToolWindowLayout layout = toolWindowManager.getLayoutToRestoreLater();
  if (layout != null) {
    presentation.setEnabled(true);
    presentation.setText(IdeBundle.message("action.restore.windows"));
    return;
  }

  presentation.setEnabled(false);
}
 
Example #25
Source File: ReactNativeConsole.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
     * Init and show this console pane.
     * @param toolWindow
     */
    public void init(final ToolWindow toolWindow) {
        toolWindow.setToHideOnEmptyContent(true);
        toolWindow.setStripeTitle("RN Console");
        toolWindow.setIcon(PluginIcons.React);
        Content content = createConsoleTabContent(toolWindow, true, "Welcome", null);
//        toolWindow.getContentManager().addContent(content);
//        toolWindow.getContentManager().addContent(new ContentImpl(new JButton("Test"), "Build2", false));

        // ======= test a terminal create ======
//        LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
//        Content testTerminalContent = createTerminalInContentPanel(terminalRunner, toolWindow);
//        toolWindow.getContentManager().addContent(testTerminalContent);

//        SimpleTerminal term  = new SimpleTerminal();
//        term.sendString("ls\n");
//        toolWindow.getContentManager().addContent(new ContentImpl(term.getComponent(), "terminal", false));
        toolWindow.setShowStripeButton(true);// if set to false, then sometimes the window will be hidden from the dock area for ever 2017-05-26
//        toolWindow.setTitle(" - ");
        // TODO Change to Eventbus
        ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
            @Override
            public void toolWindowRegistered(@NotNull String s) {
            }

            @Override
            public void stateChanged() {
                ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(RNToolWindowFactory.TOOL_WINDOW_ID);
                if (window != null) {
                    boolean visible = window.isVisible();
                    if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                        init(window);
                    }
                }
            }
        });
        toolWindow.show(null);
    }
 
Example #26
Source File: ToolWindowTracker.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private ToolWindowTracker(@NotNull Project project, @NotNull Analytics analytics) {
  myAnalytics = analytics;

  myToolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  myToolWindowManager.addToolWindowManagerListener(this);

  update();
}
 
Example #27
Source File: ToolWindowTracker.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private ToolWindowTracker(@NotNull Project project, @NotNull Analytics analytics) {
  myAnalytics = analytics;

  myToolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
  myToolWindowManager.addToolWindowManagerListener(this);

  update();
}
 
Example #28
Source File: FreelineTerminal.java    From freeline with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void initTerminal(final ToolWindow toolWindow) {
    toolWindow.setToHideOnEmptyContent(true);
    LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
    toolWindow.setStripeTitle("Freeline");
    Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
    toolWindow.getContentManager().addContent(content);
    toolWindow.setShowStripeButton(true);
    toolWindow.setTitle("Console");
    ((ToolWindowManagerEx) ToolWindowManager.getInstance(this.myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {
        @Override
        public void toolWindowRegistered(@NotNull String s) {

        }

        @Override
        public void stateChanged() {
            ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(FreelineToolWindowFactory.TOOL_WINDOW_ID);
            if (window != null) {
                boolean visible = window.isVisible();
                if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                    initTerminal(window);
                }
            }
        }
    });
    toolWindow.show(null);
    JBTabbedTerminalWidget terminalWidget = getTerminalWidget(toolWindow);
    if (terminalWidget != null && terminalWidget.getCurrentSession() != null) {
        Terminal terminal = terminalWidget.getCurrentSession().getTerminal();
        if (terminal != null) {
            terminal.setCursorVisible(false);
        }
    }
}
 
Example #29
Source File: SlingPluginToolWindowFactory.java    From aem-ide-tooling-4-intellij with Apache License 2.0 5 votes vote down vote up
public void createToolWindowContent(final Project project, final ToolWindow toolWindow) {
    // Plugin is now placed into a Tabbed Pane to add additional views to it
    JBTabbedPane master = new JBTabbedPane(SwingConstants.BOTTOM);
    SlingPluginExplorer explorer = new SlingPluginExplorer(project);
    LOGGER.debug("CTWC: Explorer: '" + explorer + "'");
    master.insertTab("Plugin", null, explorer, "Plugin Windows", 0);

    WebContentFXPanel info = new WebContentFXPanel();
    master.insertTab("Info", null, info, "Plugin Info", 1);

    final AemdcPanel aemdcPanel = ComponentProvider.getComponent(project, AemdcPanel.class);
    LOGGER.debug("AEMDC Panel found: '{}'", aemdcPanel);
    aemdcPanel.setContainer(master);

    final ContentManager contentManager = toolWindow.getContentManager();
    final Content content = contentManager.getFactory().createContent(master, null, false);
    contentManager.addContent(content);
    Disposer.register(project, explorer);

    final ToolWindowManagerAdapter listener = new ToolWindowManagerAdapter() {
        boolean wasVisible = false;

        @Override
        public void stateChanged() {
            if (toolWindow.isDisposed()) {
                return;
            }
            boolean visible = toolWindow.isVisible();
            // If the Plugin became visible then we let the AEMDC Panel know to recrate the JFX Panel
            // to avoid the double buffering
            if(!wasVisible && visible) {
                aemdcPanel.reset();
            }
            wasVisible = visible;
        }
    };
    final ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
    manager.addToolWindowManagerListener(listener, project);
}
 
Example #30
Source File: PantsMakeBeforeRun.java    From intellij-pants-plugin with Apache License 2.0 5 votes vote down vote up
private void prepareIDE(Project project) {
  ApplicationManager.getApplication().invokeAndWait(() -> {
    /* Clear message window. */
    ConsoleView executionConsole = PantsConsoleManager.getConsole(project);
    executionConsole.getComponent().setVisible(true);
    executionConsole.clear();
    ToolWindowManagerEx.getInstance(project).getToolWindow(PantsConstants.PANTS_CONSOLE_NAME).activate(null);
  }, ModalityState.NON_MODAL);
}