当前位置: 首页>>代码示例>>Java>>正文


Java DesktopLayout.copyFrom方法代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:HideAllToolWindowsAction.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:TogglePresentationModeAction.java

示例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);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:34,代码来源:HideAllToolWindowsAction.java

示例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);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:TogglePresentationModeAction.java


注:本文中的com.intellij.openapi.wm.impl.DesktopLayout.copyFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。