use of com.intellij.openapi.wm.ToolWindow 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.ToolWindow in project android by JetBrains.
the class AndroidThemePreviewToolWindowManager method initToolWindow.
private void initToolWindow() {
myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.RIGHT, myProject, false);
myToolWindow.setIcon(AndroidIcons.ThemesPreview);
myToolWindow.setAvailable(false, null);
myToolWindow.setAutoHide(false);
// Add a listener so we only update the preview when it's visible
((ToolWindowManagerEx) ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerAdapter() {
@Override
public void stateChanged() {
if (myProject.isDisposed()) {
return;
}
final ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TOOL_WINDOW_ID);
if (window != null && window.isAvailable()) {
final boolean visible = window.isVisible();
AndroidEditorSettings.getInstance().getGlobalState().setVisible(visible);
if (visible && !myIsToolWindowVisible) {
updatePreview();
}
myIsToolWindowVisible = visible;
}
}
});
}
use of com.intellij.openapi.wm.ToolWindow in project buck by facebook.
the class BuckToolWindowFactory method updateBuckToolWindowTitle.
public static void updateBuckToolWindowTitle(Project project) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(TOOL_WINDOW_ID);
String target = BuckBuildManager.getInstance(project).getCurrentSavedTarget(project);
if (target != null) {
toolWindow.setTitle("Target: " + target);
}
}
use of com.intellij.openapi.wm.ToolWindow 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);
}
use of com.intellij.openapi.wm.ToolWindow in project android by JetBrains.
the class GradleBuildTreeViewPanel method fillRightToolbarGroup.
@Override
protected void fillRightToolbarGroup(DefaultActionGroup group) {
super.fillRightToolbarGroup(group);
group.add(new DumbAwareAction("Show Console Output", null, AndroidIcons.GradleConsole) {
@Override
public void actionPerformed(AnActionEvent e) {
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(GradleConsoleToolWindowFactory.ID);
if (window != null) {
window.activate(null, false);
}
}
@Override
public void update(AnActionEvent e) {
e.getPresentation().setEnabledAndVisible(true);
}
});
DefaultActionGroup filterGroup = new DefaultActionGroup("GradleBuildMessagesFilter", true) {
@Override
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
presentation.setDescription("Filter messages to display");
presentation.setIcon(AllIcons.General.Filter);
}
@Override
public boolean isDumbAware() {
return true;
}
};
// We could have iterated through ErrorTreeElementKind.values() and have less code, but we want to keep this order:
filterGroup.add(new FilterMessagesByKindAction(ErrorTreeElementKind.ERROR));
filterGroup.add(new FilterMessagesByKindAction(ErrorTreeElementKind.WARNING));
filterGroup.add(new FilterMessagesByKindAction(ErrorTreeElementKind.INFO));
filterGroup.add(new FilterMessagesByKindAction(ErrorTreeElementKind.NOTE));
filterGroup.add(new FilterMessagesByKindAction(ErrorTreeElementKind.GENERIC));
group.add(filterGroup);
}
Aggregations