use of com.intellij.openapi.wm.ToolWindowManager in project intellij-plugins by JetBrains.
the class ActionScriptProfileRunner method startProfiling.
private static void startProfiling(final String runConfigurationName, final Module module) {
if (!initProfilingAgent(module)) {
return;
}
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(module.getProject());
if (toolWindowManager == null) {
return;
}
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ToolWindow toolWindow = toolWindowManager.getToolWindow(TOOLWINDOW_ID);
if (toolWindow == null) {
toolWindow = toolWindowManager.registerToolWindow(TOOLWINDOW_ID, true, ToolWindowAnchor.BOTTOM, module.getProject());
final ContentManager contentManager = toolWindow.getContentManager();
contentManager.addContentManagerListener(new ContentManagerAdapter() {
@Override
public void contentRemoved(ContentManagerEvent event) {
super.contentRemoved(event);
if (contentManager.getContentCount() == 0) {
toolWindowManager.unregisterToolWindow(TOOLWINDOW_ID);
}
}
});
}
final ActionScriptProfileControlPanel profileControlPanel = new ActionScriptProfileControlPanel(runConfigurationName, module);
final SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
toolWindowPanel.setContent(profileControlPanel.getMainPanel());
final Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, runConfigurationName, false);
toolWindow.getContentManager().addContent(content);
toolWindow.getContentManager().setSelectedContent(content);
content.setDisposer(profileControlPanel);
final DefaultActionGroup actionGroup = profileControlPanel.createProfilerActionGroup();
actionGroup.addSeparator();
final AnAction closeTabAction = new TabbedContentAction.CloseAction(content);
closeTabAction.getTemplatePresentation().setIcon(AllIcons.Actions.Cancel);
actionGroup.add(closeTabAction);
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("FlexProfiler", actionGroup, false);
toolbar.setTargetComponent(toolWindowPanel);
toolWindowPanel.setToolbar(toolbar.getComponent());
final ToolWindow finalToolWindow = toolWindow;
profileControlPanel.setConnectionCallback(() -> {
finalToolWindow.show(null);
removePreloadingOfProfilerSwf();
});
toolWindow.hide(null);
profileControlPanel.startProfiling();
}
});
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-plugins by JetBrains.
the class FlashPlayerTrustUtil method showWarningBalloonIfNeeded.
private static void showWarningBalloonIfNeeded(final Project project, final boolean isDebug, final boolean runTrusted, final String message) {
if (runTrusted) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
manager.notifyByBalloon(isDebug ? ToolWindowId.DEBUG : ToolWindowId.RUN, MessageType.WARNING, message);
}
}
use of com.intellij.openapi.wm.ToolWindowManager in project android by JetBrains.
the class OpenAssistSidePanelAction method actionPerformed.
@Override
public final void actionPerformed(AnActionEvent event) {
final Project thisProject = event.getProject();
final String actionId = ActionManager.getInstance().getId(this);
ApplicationManager.getApplication().invokeLater(() -> {
AssistToolWindowFactory factory = new AssistToolWindowFactory(actionId);
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(thisProject);
ToolWindow toolWindow = toolWindowManager.getToolWindow(TOOL_WINDOW_TITLE);
if (toolWindow == null) {
// NOTE: canWorkInDumbMode must be true or the window will close on gradle sync.
toolWindow = toolWindowManager.registerToolWindow(TOOL_WINDOW_TITLE, false, ToolWindowAnchor.RIGHT, thisProject, true);
}
toolWindow.setIcon(AndroidIcons.Assistant.Assist);
factory.createToolWindowContent(thisProject, toolWindow);
// Always active the window, in case it was previously minimized.
toolWindow.activate(null);
});
onActionPerformed(event);
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class ThumbnailViewImpl method dispose.
public void dispose() {
// Dispose UI
Disposer.dispose(getUI());
// Unregister ToolWindow
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
windowManager.unregisterToolWindow(TOOLWINDOW_ID);
}
use of com.intellij.openapi.wm.ToolWindowManager in project freeline by alibaba.
the class FreelineUtil method processConsole.
/* process attach to console,show the log */
// TODO: 2016/9/14 0014 need refactor console method
private static void processConsole(Project project, ProcessHandler processHandler) {
ConsoleView consoleView = FreeUIManager.getInstance(project).getConsoleView(project);
consoleView.clear();
consoleView.attachToProcess(processHandler);
ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow;
toolWindow = toolWindowManager.getToolWindow(TOOL_ID);
// if already exist tool window then show it
if (toolWindow != null) {
toolWindow.show(null);
return;
}
toolWindow = toolWindowManager.registerToolWindow(TOOL_ID, true, ToolWindowAnchor.BOTTOM);
toolWindow.setTitle("free....");
toolWindow.setStripeTitle("Free Console");
toolWindow.setShowStripeButton(true);
toolWindow.setIcon(PluginIcons.ICON_TOOL_WINDOW);
toolWindow.getContentManager().addContent(new ContentImpl(consoleView.getComponent(), "Build", true));
toolWindow.show(null);
}
Aggregations