use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class FavoritesViewToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
final ContentManager contentManager = toolWindow.getContentManager();
final FavoritesTreeViewPanel panel = new FavoritesPanel(project).getPanel();
panel.setupToolWindow((ToolWindowEx) toolWindow);
final Content content = contentManager.getFactory().createContent(panel, null, false);
contentManager.addContent(content);
}
use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class GridCellImpl method updateSelection.
public void updateSelection(final boolean isShowing) {
ContentManager contentManager = myContext.getContentManager();
if (contentManager.isDisposed())
return;
for (Content each : myContents.getKeys()) {
final TabInfo eachTab = getTabFor(each);
boolean isSelected = eachTab != null && myTabs.getSelectedInfo() == eachTab;
if (isSelected && isShowing) {
contentManager.addSelectedContent(each);
} else {
contentManager.removeFromSelection(each);
}
}
for (Content each : myMinimizedContents) {
contentManager.removeFromSelection(each);
}
}
use of com.intellij.ui.content.ContentManager 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.ContentManager in project intellij-community by JetBrains.
the class DynamicToolWindowWrapper method getToolWindow.
public ToolWindow getToolWindow() {
if (myToolWindow == null) {
myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(GroovyBundle.message("dynamic.tool.window.id"), true, ToolWindowAnchor.RIGHT);
myToolWindow.setIcon(JetgroovyIcons.Groovy.DynamicProperty_13);
myToolWindow.setTitle(GroovyBundle.message("dynamic.window"));
myToolWindow.setToHideOnEmptyContent(true);
final JPanel panel = buildBigPanel();
final ContentManager contentManager = myToolWindow.getContentManager();
final Content content = contentManager.getFactory().createContent(panel, "", false);
content.setPreferredFocusableComponent(myTreeTable);
contentManager.addContent(content);
}
return myToolWindow;
}
use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.
the class MvcProjectViewPane method setup.
public void setup(ToolWindowEx toolWindow) {
JPanel p = new JPanel(new BorderLayout());
p.add(myComponent, BorderLayout.CENTER);
ContentManager contentManager = toolWindow.getContentManager();
Content content = contentManager.getFactory().createContent(p, null, false);
content.setDisposer(this);
content.setCloseable(false);
content.setPreferredFocusableComponent(createComponent());
contentManager.addContent(content);
contentManager.setSelectedContent(content, true);
DefaultActionGroup group = new DefaultActionGroup();
group.add(new HideEmptyMiddlePackagesAction());
group.add(myAutoScrollToSourceHandler.createToggleAction());
group.add(myAutoScrollFromSourceHandler.createToggleAction());
toolWindow.setAdditionalGearActions(group);
TreeExpander expander = new DefaultTreeExpander(myTree);
CommonActionsManager actionsManager = CommonActionsManager.getInstance();
AnAction collapseAction = actionsManager.createCollapseAllAction(expander, myTree);
collapseAction.getTemplatePresentation().setIcon(AllIcons.General.CollapseAll);
toolWindow.setTitleActions(new AnAction[] { new ScrollFromSourceAction(), collapseAction });
}
Aggregations