本文整理汇总了Java中com.intellij.openapi.wm.impl.DesktopLayout类的典型用法代码示例。如果您正苦于以下问题:Java DesktopLayout类的具体用法?Java DesktopLayout怎么用?Java DesktopLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DesktopLayout类属于com.intellij.openapi.wm.impl包,在下文中一共展示了DesktopLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: update
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
String[] ids = toolWindowManager.getToolWindowIds();
for (String id : ids) {
if (HideToolWindowAction.shouldBeHiddenByShortCut(toolWindowManager, id)) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.hide.all.windows"), true);
return;
}
}
final DesktopLayout layout = toolWindowManager.getLayoutToRestoreLater();
if (layout != null) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.restore.windows"));
return;
}
presentation.setEnabled(false);
}
示例3: actionPerformed
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e){
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if(project==null){
return;
}
DesktopLayout layout=ToolWindowManagerEx.getInstanceEx(project).getLayout();
WindowManagerEx.getInstanceEx().setLayout(layout);
}
示例4: 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;
}
示例5: restoreToolWindows
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
static void restoreToolWindows(Project project, boolean needsRestore, boolean inPresentation) {
if (project == null || !needsRestore) return;
ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
DesktopLayout restoreLayout = manager.getLayoutToRestoreLater();
if (!inPresentation && restoreLayout != null) {
manager.setLayout(restoreLayout);
}
}
示例6: actionPerformed
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e){
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if(project==null){
return;
}
DesktopLayout layout=WindowManagerEx.getInstanceEx().getLayout();
ToolWindowManagerEx.getInstanceEx(project).setLayout(layout);
}
示例7: 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);
}
}
}
示例8: update
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext());
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
String[] ids = toolWindowManager.getToolWindowIds();
for (String id : ids) {
if (toolWindowManager.getToolWindow(id).isVisible()) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.hide.all.windows"), true);
return;
}
}
final DesktopLayout layout = toolWindowManager.getLayoutToRestoreLater();
if (layout != null) {
presentation.setEnabled(true);
presentation.setText(IdeBundle.message("action.restore.windows"));
return;
}
presentation.setEnabled(false);
}
示例9: actionPerformed
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e){
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
if(project==null){
return;
}
DesktopLayout layout=ToolWindowManagerEx.getInstanceEx(project).getLayout();
WindowManagerEx.getInstanceEx().setLayout(layout);
}
示例10: 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);
}
}
}
示例11: actionPerformed
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e){
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
if(project==null){
return;
}
DesktopLayout layout=WindowManagerEx.getInstanceEx().getLayout();
ToolWindowManagerEx.getInstanceEx(project).setLayout(layout);
}
示例12: getLayout
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
* @return layout of tool windows.
*/
public abstract DesktopLayout getLayout();
示例13: setLayout
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
* Copied <code>layout</code> into internal layout and rearranges tool windows.
*/
public abstract void setLayout(@NotNull DesktopLayout layout);
示例14: getLayout
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
* @return default layout for tool windows.
*/
public abstract DesktopLayout getLayout();
示例15: setLayout
import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
* Copies <code>layout</code> into internal default layout.
*/
public abstract void setLayout(DesktopLayout layout);