Пример #1
0
 @Override
 public void partOpened(IWorkbenchPartReference partRef) {
   if (partRef.getPart(false) instanceof AutomationEditor) {
     IWorkbenchPage page = partRef.getPage();
     IViewReference view = page.findViewReference(View.ID);
     if (view != null) page.setPartState(view, IWorkbenchPage.STATE_MINIMIZED);
     ++openedEditorNumber;
   }
   partActivated(partRef);
 }
  /**
   * maximum display CheatSheetView.
   *
   * @param view
   */
  public void maxDisplayCheatSheetView(CheatSheetView view) {
    // ADD msjian TDQ-7407 2013-8-23: Only display the Cheat Sheet view on new startup of the studio
    IWorkbenchPage activePage =
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    activePage.setEditorAreaVisible(true);
    // activePage.resetPerspective();
    for (IViewReference ref : activePage.getViewReferences()) {
      if (view.equals(ref.getView(false))) {
        activePage.setPartState(ref, IWorkbenchPage.STATE_MAXIMIZED);
        activePage.bringToTop(ref.getView(false));
      } else {
        activePage.setPartState(ref, IWorkbenchPage.STATE_MINIMIZED);
      }
    }
    for (IEditorReference ref : activePage.getEditorReferences()) {
      activePage.setPartState(ref, IWorkbenchPage.STATE_MINIMIZED);
    }

    PrefUtil.getAPIPreferenceStore().setValue(this.getClass().getSimpleName(), true);
    setFirstTime(!PrefUtil.getAPIPreferenceStore().getBoolean(this.getClass().getSimpleName()));
    // TDQ-7407~
  }
Пример #3
0
 @Override
 public void partClosed(IWorkbenchPartReference partRef) {
   if (partRef.getPart(false) instanceof AutomationEditor) {
     IWorkbenchPage page = partRef.getPage();
     IViewReference view = page.findViewReference(View.ID);
     --openedEditorNumber;
     if (openedEditorNumber == 0) {
       page.setEditorAreaVisible(false);
       if (view != null) page.setPartState(view, IWorkbenchPage.STATE_RESTORED);
     }
   }
   partActivated(partRef);
 }