use of com.intellij.ui.content.impl.ContentImpl in project intellij-community by JetBrains.
the class InternalCompilerRefServiceView method createViewTab.
private static InternalCompilerRefServiceView createViewTab(PsiElement element) {
Project project = element.getProject();
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = toolWindowManager.getToolWindow(TOOL_WINDOW_ID);
if (toolWindow == null) {
toolWindow = toolWindowManager.registerToolWindow(TOOL_WINDOW_ID, true, ToolWindowAnchor.TOP);
}
final InternalCompilerRefServiceView view = new InternalCompilerRefServiceView(project);
ToolWindow finalToolWindow = toolWindow;
toolWindow.activate(() -> {
final String text = SymbolPresentationUtil.getSymbolPresentableText(element);
final ContentImpl content = new ContentImpl(view, text, true);
finalToolWindow.getContentManager().addContent(content);
finalToolWindow.getContentManager().setSelectedContent(content, true);
});
return view;
}
use of com.intellij.ui.content.impl.ContentImpl in project intellij-community by JetBrains.
the class AbstractExternalSystemToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setTitle(myExternalSystemId.getReadableName());
ContentManager contentManager = toolWindow.getContentManager();
final ExternalProjectsViewImpl projectsView = new ExternalProjectsViewImpl(project, (ToolWindowEx) toolWindow, myExternalSystemId);
ExternalProjectsManager.getInstance(project).registerView(projectsView);
ContentImpl tasksContent = new ContentImpl(projectsView, ExternalSystemBundle.message("tool.window.title.projects"), true);
contentManager.addContent(tasksContent);
}
use of com.intellij.ui.content.impl.ContentImpl 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.ui.content.impl.ContentImpl in project android by JetBrains.
the class AndroidUtils method activateConsoleToolWindow.
public static void activateConsoleToolWindow(@NotNull Project project, @NotNull final Runnable runAfterActivation) {
final ToolWindowManager manager = ToolWindowManager.getInstance(project);
final String toolWindowId = AndroidBundle.message("android.console.tool.window.title");
ToolWindow toolWindow = manager.getToolWindow(toolWindowId);
if (toolWindow != null) {
runAfterActivation.run();
return;
}
toolWindow = manager.registerToolWindow(toolWindowId, true, ToolWindowAnchor.BOTTOM);
final ConsoleView console = new ConsoleViewImpl(project, false);
project.putUserData(CONSOLE_VIEW_KEY, console);
toolWindow.getContentManager().addContent(new ContentImpl(console.getComponent(), "", false));
final ToolWindowManagerListener listener = new ToolWindowManagerListener() {
@Override
public void toolWindowRegistered(@NotNull String id) {
}
@Override
public void stateChanged() {
ToolWindow window = manager.getToolWindow(toolWindowId);
if (window != null && !window.isVisible()) {
((ToolWindowManagerEx) manager).removeToolWindowManagerListener(this);
getApplication().invokeLater(() -> manager.unregisterToolWindow(toolWindowId));
}
}
};
toolWindow.show(() -> {
runAfterActivation.run();
((ToolWindowManagerEx) manager).addToolWindowManagerListener(listener);
});
}
use of com.intellij.ui.content.impl.ContentImpl in project intellij-plugins by JetBrains.
the class MessagesTabTest method testContent.
public void testContent() throws Exception {
Content content = new ContentImpl(new JLabel(), "text", true);
myMessagesTab.attachTo(content);
assertSame(myMessagesTab, MessagesTab.getTab(content));
assertSame(content, myMessagesTab.getContent());
}
Aggregations