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


Java DesktopLayout类代码示例

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

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

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

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

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

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

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

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

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

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

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

示例12: getLayout

import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
 * @return layout of tool windows.
 */
public abstract DesktopLayout getLayout();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ToolWindowManagerEx.java

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

示例14: getLayout

import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
 * @return default layout for tool windows.
 */
public abstract DesktopLayout getLayout();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:WindowManagerEx.java

示例15: setLayout

import com.intellij.openapi.wm.impl.DesktopLayout; //导入依赖的package包/类
/**
 * Copies <code>layout</code> into internal default layout.
 */
public abstract void setLayout(DesktopLayout layout);
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:WindowManagerEx.java


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