use of com.intellij.ui.content.ContentFactory in project AndroidWiFiADB by pedrovgs.
the class AndroidWiFiADBWindow method createToolWindowContent.
private void createToolWindowContent(ToolWindow toolWindow) {
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(toolWindowContent, "", false);
toolWindow.getContentManager().addContent(content);
}
use of com.intellij.ui.content.ContentFactory in project intellij-community by JetBrains.
the class MavenProjectsNavigator method initToolWindow.
private void initToolWindow() {
initTree();
JPanel panel = new MavenProjectsNavigatorPanel(myProject, myTree);
AnAction removeAction = EmptyAction.wrap(ActionManager.getInstance().getAction("Maven.RemoveRunConfiguration"));
removeAction.registerCustomShortcutSet(CommonShortcuts.getDelete(), myTree, myProject);
AnAction editSource = EmptyAction.wrap(ActionManager.getInstance().getAction("Maven.EditRunConfiguration"));
editSource.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myTree, myProject);
final ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(myProject);
myToolWindow = (ToolWindowEx) manager.registerToolWindow(TOOL_WINDOW_ID, false, ToolWindowAnchor.RIGHT, myProject, true);
myToolWindow.setIcon(MavenIcons.ToolWindowMaven);
final ContentFactory contentFactory = ServiceManager.getService(ContentFactory.class);
final Content content = contentFactory.createContent(panel, "", false);
ContentManager contentManager = myToolWindow.getContentManager();
contentManager.addContent(content);
contentManager.setSelectedContent(content, false);
final ToolWindowManagerAdapter listener = new ToolWindowManagerAdapter() {
boolean wasVisible = false;
@Override
public void stateChanged() {
if (myToolWindow.isDisposed())
return;
boolean visible = myToolWindow.isVisible();
if (!visible || wasVisible) {
return;
}
scheduleStructureUpdate();
wasVisible = true;
}
};
manager.addToolWindowManagerListener(listener, myProject);
ActionManager actionManager = ActionManager.getInstance();
DefaultActionGroup group = new DefaultActionGroup();
group.add(actionManager.getAction("Maven.GroupProjects"));
group.add(actionManager.getAction("Maven.ShowIgnored"));
group.add(actionManager.getAction("Maven.ShowBasicPhasesOnly"));
group.add(actionManager.getAction("Maven.AlwaysShowArtifactId"));
group.add(actionManager.getAction("Maven.ShowVersions"));
myToolWindow.setAdditionalGearActions(group);
}
use of com.intellij.ui.content.ContentFactory in project android by JetBrains.
the class AssistToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
if (myAssistSidePanel == null) {
myAssistSidePanel = new AssistSidePanel(myActionId, project);
}
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(myAssistSidePanel, null, false);
ContentManager contentManager = toolWindow.getContentManager();
contentManager.removeAllContents(true);
contentManager.addContent(content);
contentManager.setSelectedContent(content);
toolWindow.show(null);
}
Aggregations