use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class GridCellImpl method saveUiState.
public void saveUiState() {
saveProportions();
for (Content each : myContents.getKeys()) {
saveState(each, false);
}
for (Content each : myMinimizedContents) {
saveState(each, true);
}
final DimensionService service = DimensionService.getInstance();
final Dimension size = myContext.getContentManager().getComponent().getSize();
service.setSize(getDimensionKey(), size, myContext.getProject());
if (myContext.getWindow() != 0) {
final Window frame = SwingUtilities.getWindowAncestor(myPlaceholder);
if (frame != null) {
service.setLocation(getDimensionKey(), frame.getLocationOnScreen());
}
}
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class GridCellImpl method minimize.
public void minimize(Content[] contents) {
if (contents.length == 0)
return;
myContext.saveUiState();
for (final Content each : contents) {
myMinimizedContents.add(each);
remove(each);
boolean isShowing = myTabs.getComponent().getRootPane() != null;
updateSelection(isShowing);
myContainer.minimize(each, new CellTransform.Restore() {
@Override
public ActionCallback restoreInGrid() {
return restore(each);
}
});
}
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class GridCellImpl method closeOrMinimize.
public void closeOrMinimize(MouseEvent e) {
TabInfo tabInfo = myTabs.findInfo(e);
if (tabInfo == null)
return;
Content content = getContentFor(tabInfo);
if (CloseViewAction.isEnabled(new Content[] { content })) {
CloseViewAction.perform(myContext, content);
} else if (MinimizeViewAction.isEnabled(myContext, getContents(), ViewContext.CELL_TOOLBAR_PLACE)) {
minimize(content);
}
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class ProjectViewImpl method removeProjectPane.
@Override
public synchronized void removeProjectPane(@NotNull AbstractProjectViewPane pane) {
ApplicationManager.getApplication().assertIsDispatchThread();
myUninitializedPanes.remove(pane);
//assume we are completely initialized here
String idToRemove = pane.getId();
if (!myId2Pane.containsKey(idToRemove))
return;
pane.removeTreeChangeListener();
for (int i = getContentManager().getContentCount() - 1; i >= 0; i--) {
Content content = getContentManager().getContent(i);
String id = content != null ? content.getUserData(ID_KEY) : null;
if (id != null && id.equals(idToRemove)) {
getContentManager().removeContent(content, true);
}
}
myId2Pane.remove(idToRemove);
mySelectInTargets.remove(idToRemove);
viewSelectionChanged();
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class ShowModuleDependenciesAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getProject();
if (project == null)
return;
Module[] modules = LangDataKeys.MODULE_CONTEXT_ARRAY.getData(e.getDataContext());
if (modules == null) {
PsiElement element = CommonDataKeys.PSI_FILE.getData(e.getDataContext());
Module module = element != null ? ModuleUtilCore.findModuleForPsiElement(element) : null;
if (module != null && ModuleManager.getInstance(project).getModules().length > 1) {
MyModuleOrProjectScope dlg = new MyModuleOrProjectScope(module.getName());
if (!dlg.showAndGet()) {
return;
}
if (!dlg.useProjectScope()) {
modules = new Module[] { module };
}
}
}
ModulesDependenciesPanel panel = new ModulesDependenciesPanel(project, modules);
AnalysisScope scope = modules != null ? new AnalysisScope(modules) : new AnalysisScope(project);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, scope.getDisplayName(), false);
content.setDisposer(panel);
panel.setContent(content);
DependenciesAnalyzeManager.getInstance(project).addContent(content);
}
Aggregations