本文整理汇总了Java中com.intellij.openapi.wm.impl.DesktopLayout.copyFrom方法的典型用法代码示例。如果您正苦于以下问题:Java DesktopLayout.copyFrom方法的具体用法?Java DesktopLayout.copyFrom怎么用?Java DesktopLayout.copyFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.impl.DesktopLayout
的用法示例。
在下文中一共展示了DesktopLayout.copyFrom方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performAction
import com.intellij.openapi.wm.impl.DesktopLayout; //导入方法依赖的package包/类
public static void performAction(final Project project) {
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
DesktopLayout layout = new DesktopLayout();
layout.copyFrom(toolWindowManager.getLayout());
// to clear windows stack
toolWindowManager.clearSideStack();
//toolWindowManager.activateEditorComponent();
String[] ids = toolWindowManager.getToolWindowIds();
boolean hasVisible = false;
for (String id : ids) {
if (HideToolWindowAction.shouldBeHiddenByShortCut(toolWindowManager, id)) {
toolWindowManager.getToolWindow(id).hide(null);
hasVisible = true;
}
}
if (hasVisible) {
toolWindowManager.setLayoutToRestoreLater(layout);
toolWindowManager.activateEditorComponent();
}
else {
final DesktopLayout restoredLayout = toolWindowManager.getLayoutToRestoreLater();
if (restoredLayout != null) {
toolWindowManager.setLayoutToRestoreLater(null);
toolWindowManager.setLayout(restoredLayout);
}
}
}
示例2: storeToolWindows
import com.intellij.openapi.wm.impl.DesktopLayout; //导入方法依赖的package包/类
static boolean storeToolWindows(@Nullable Project project) {
if (project == null) return false;
ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
DesktopLayout layout = new DesktopLayout();
layout.copyFrom(manager.getLayout());
boolean hasVisible = hideAllToolWindows(manager);
if (hasVisible) {
manager.setLayoutToRestoreLater(layout);
manager.activateEditorComponent();
}
return hasVisible;
}
示例3: performAction
import com.intellij.openapi.wm.impl.DesktopLayout; //导入方法依赖的package包/类
public static void performAction(final Project project) {
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
DesktopLayout layout = new DesktopLayout();
layout.copyFrom(toolWindowManager.getLayout());
// to clear windows stack
toolWindowManager.clearSideStack();
//toolWindowManager.activateEditorComponent();
String[] ids = toolWindowManager.getToolWindowIds();
boolean hasVisible = false;
for (String id : ids) {
ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
if (toolWindow.isVisible()) {
toolWindow.hide(null);
hasVisible = true;
}
}
if (hasVisible) {
toolWindowManager.setLayoutToRestoreLater(layout);
toolWindowManager.activateEditorComponent();
}
else {
final DesktopLayout restoredLayout = toolWindowManager.getLayoutToRestoreLater();
if (restoredLayout != null) {
toolWindowManager.setLayoutToRestoreLater(null);
toolWindowManager.setLayout(restoredLayout);
}
}
}
示例4: hideToolWindows
import com.intellij.openapi.wm.impl.DesktopLayout; //导入方法依赖的package包/类
private static void hideToolWindows(Project project) {
final ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
final DesktopLayout layout = new DesktopLayout();
layout.copyFrom(mgr.getLayout());
// to clear windows stack
mgr.clearSideStack();
final String[] ids = mgr.getToolWindowIds();
boolean hasVisible = false;
for (String id : ids) {
final ToolWindow toolWindow = mgr.getToolWindow(id);
if (toolWindow.isVisible()) {
toolWindow.hide(null);
hasVisible = true;
}
}
if (hasVisible && UISettings.getInstance().PRESENTATION_MODE) {
mgr.setLayoutToRestoreLater(layout);
mgr.activateEditorComponent();
}
else if (!UISettings.getInstance().PRESENTATION_MODE && !hasVisible) {
final DesktopLayout restoreLayout = mgr.getLayoutToRestoreLater();
if (restoreLayout != null) {
mgr.setLayout(restoreLayout);
}
}
}