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


Java RunnerLayoutUi.removeContent方法代码示例

本文整理汇总了Java中com.intellij.execution.ui.RunnerLayoutUi.removeContent方法的典型用法代码示例。如果您正苦于以下问题:Java RunnerLayoutUi.removeContent方法的具体用法?Java RunnerLayoutUi.removeContent怎么用?Java RunnerLayoutUi.removeContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.execution.ui.RunnerLayoutUi的用法示例。


在下文中一共展示了RunnerLayoutUi.removeContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRemoveConsolePane

import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
public void testRemoveConsolePane() {
  // if this was a JUnit4 test case, we could set the LoggedErrorProcessor to a mock that does
  // not fail the test if an error is logged using @BeforeClass. Since this is a JUnit3 test
  // case, we need to elaborately initialize a user in GoogleLogin
  CloudDebugProcessState state =
      new CloudDebugProcessState(); // Mockito.mock(CloudDebugProcessState.class);
  state.setUserEmail("[email protected]");

  CredentialedUser credentialedUser = mock(CredentialedUser.class);
  when(credentialedUser.getGoogleLoginState()).thenReturn(mock(GoogleLoginState.class));

  LinkedHashMap<String, CredentialedUser> users = new LinkedHashMap<String, CredentialedUser>();
  users.put(state.getUserEmail(), credentialedUser);

  IntegratedGoogleLoginService mockGoogleLoginService =
      TestUtils.installMockService(IntegratedGoogleLoginService.class);
  when(mockGoogleLoginService.getAllUsers()).thenReturn(users);
  process.initialize(state);

  XDebugTabLayouter layouter = process.createTabLayouter();
  RunnerLayoutUi ui = mock(RunnerLayoutUi.class);

  Content console = mock(Content.class);
  when(ui.findContent(DebuggerContentInfo.CONSOLE_CONTENT)).thenReturn(console);
  ui.removeContent(console, false);
  LayoutStateDefaults defaults = mock(LayoutStateDefaults.class);
  when(ui.getDefaults()).thenReturn(defaults);

  layouter.registerAdditionalContent(ui);

  verify(ui, Mockito.atLeast(1)).removeContent(console, false);

  process.getStateController().stopBackgroundListening();
  UIUtil.dispatchAllInvocationEvents();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:36,代码来源:CloudDebugProcessTest.java

示例2: createTabLayouter

import com.intellij.execution.ui.RunnerLayoutUi; //导入方法依赖的package包/类
@Override
@NotNull
public XDebugTabLayouter createTabLayouter() {
  final CloudDebugProcessHandler handler = (CloudDebugProcessHandler) getProcessHandler();

  return new XDebugTabLayouter() {
    @Override
    public void registerAdditionalContent(@NotNull RunnerLayoutUi layout) {
      layout.removeContent(layout.findContent(DebuggerContentInfo.WATCHES_CONTENT), false);

      // remove console since the cloud debugger doesn't use it
      // https://github.com/GoogleCloudPlatform/gcloud-intellij/issues/141
      Content consoleContent = layout.findContent(DebuggerContentInfo.CONSOLE_CONTENT);
      if (consoleContent != null) {
        layout.removeContent(consoleContent, false);
      }

      Content frameContent = layout.findContent(DebuggerContentInfo.FRAME_CONTENT);
      if (frameContent != null) {
        layout.removeContent(frameContent, false);
        layout.addContent(frameContent, 0, PlaceInGrid.center, false);
      }

      Content variablesContent = layout.findContent(DebuggerContentInfo.VARIABLES_CONTENT);
      if (variablesContent != null) {
        layout.removeContent(variablesContent, false);
        layout.addContent(variablesContent, 0, PlaceInGrid.right, false);
      }

      CloudDebugHistoricalSnapshots timeline = new CloudDebugHistoricalSnapshots(handler);
      timeline.onBreakpointListChanged(getProcessState());
      Content snapshots =
          layout.createContent(
              timeline.getTabTitle(),
              (ComponentWithActions) timeline,
              timeline.getTabTitle(),
              GoogleCloudToolsIcons.STACKDRIVER_DEBUGGER,
              null);
      layout.addContent(snapshots, 0, PlaceInGrid.left, false);

      layout
          .getDefaults()
          .initFocusContent(
              timeline.getTabTitle(),
              LayoutViewOptions.STARTUP,
              new LayoutAttractionPolicy.FocusOnce(false));
    }
  };
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:50,代码来源:CloudDebugProcess.java


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