コード例 #1
0
  /*
   * (non-Javadoc)
   * @see
   * org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#showViewPane
   * (boolean, java.lang.String)
   */
  public void showViewPane(boolean show, String paneId) {

    Control viewPaneControl = fViewPaneControls.get(paneId);

    if (viewPaneControl != null) {
      Control children[] = fSashForm.getChildren();

      for (int i = 0; i < children.length; i++) {
        if (children[i] == viewPaneControl) {
          children[i].setVisible(show);
          IMemoryViewPane viewPane = fViewPanes.get(paneId);
          if (viewPane != null) viewPane.setVisible(show);
        }
      }
      fSashForm.layout();
    }

    storeViewPaneVisibility();
  }
コード例 #2
0
  public void testCreateView() {
    final MWindow window = createWindowWithOneView();
    wb = new E4Workbench(window, appContext);

    Widget topWidget = (Widget) window.getWidget();
    assertTrue(topWidget instanceof Shell);
    Shell shell = (Shell) topWidget;
    assertEquals("MyWindow", shell.getText());
    Control[] controls = shell.getChildren();
    assertEquals(1, controls.length);
    SashForm sash = (SashForm) controls[0];
    Control[] sashChildren = sash.getChildren();
    assertEquals(1, sashChildren.length);

    CTabFolder folder = (CTabFolder) sashChildren[0];
    assertEquals(1, folder.getItemCount());
    Control c = folder.getItem(0).getControl();
    assertTrue(c instanceof Composite);
    Control[] viewPart = ((Composite) c).getChildren();
    assertEquals(1, viewPart.length);
    assertTrue(viewPart[0] instanceof Tree);
  }