Exemplo n.º 1
0
  @Override
  public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    // Remove the Pin item
    IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
    menuManager.removeAll();
    //        for(IContributionItem item : menuManager.getItems()) {
    //            if(item instanceof ActionContributionItem) {
    //                if(((ActionContributionItem)item).getAction() instanceof
    // PinPropertySheetAction) {
    //                    menuManager.remove(item);
    //                    break;
    //                }
    //            }
    //        }

    IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
    toolBarManager.removeAll();
    //        for(IContributionItem item : toolBarManager.getItems()) {
    //            if(item instanceof ActionContributionItem) {
    //                if(((ActionContributionItem)item).getAction() instanceof
    // PinPropertySheetAction) {
    //                    toolBarManager.remove(item);
    //                    break;
    //                }
    //            }
    //        }
  }
Exemplo n.º 2
0
 public void fillToolBar(IToolBarManager toolbar) {
   super.fillToolBar(toolbar);
   if (showGotoNotesView) {
     toolbar.add(new Separator());
     toolbar.add(new GotoNotesViewAction());
   }
 }
Exemplo n.º 3
0
  @Override
  protected void createFormContent(IManagedForm mform) {
    mform.getForm().setText("Properties");
    final ScrolledForm form = mform.getForm();
    FormToolkit toolkit = new FormToolkit(getShell().getDisplay());

    GridLayout layout = new GridLayout();
    form.getBody().setLayout(layout);

    final String href = getHelpResource();
    if (href != null) {
      IToolBarManager manager = form.getToolBarManager();
      Action helpAction = new Action("help") { // $NON-NLS-1$
            public void run() {
              BusyIndicator.showWhile(
                  form.getDisplay(),
                  new Runnable() {
                    public void run() {
                      PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(href);
                    }
                  });
            }
          };
      helpAction.setToolTipText(PDEUIMessages.PDEFormPage_help);
      helpAction.setImageDescriptor(PDEPluginImages.DESC_HELP);
      manager.add(helpAction);
      form.updateToolBar();
    }
  }
Exemplo n.º 4
0
 /**
  * Create the GUI.
  *
  * @param frame The Composite handle of parent
  */
 @Override
 public void createPartControl(final Composite frame) {
   imageCanvas = new SWTImageCanvas(frame);
   final IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
   mgr.add(new SaveImageAction());
   mgr.add(new SaveDOTAction());
 }
Exemplo n.º 5
0
 /**
  * Adds actions for "go back", "go home", and "go into" to a tool bar manager.
  *
  * @param toolBar is the target manager to update
  */
 public void addNavigationActions(IToolBarManager toolBar) {
   createActions();
   toolBar.add(homeAction);
   toolBar.add(backAction);
   toolBar.add(forwardAction);
   updateNavigationButtons();
 }
Exemplo n.º 6
0
 private void createToolbar() {
   IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
   toolbar.add(done);
   toolbar.add(change);
   toolbar.add(pass);
   toolbar.add(challenge);
 }
Exemplo n.º 7
0
 private void add(Action action, String imageName) {
   action.setId(action.getText());
   action.setImageDescriptor(
       PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageName));
   IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
   mgr.add(action);
 }
Exemplo n.º 8
0
  /**
   * The <code>PropertySheet</code> implementation of this <code>IWorkbenchPart</code> method
   * creates a <code>PageBook</code> control with its default page showing.
   */
  public void createPartControl(Composite parent) {
    super.createPartControl(parent);

    pinPropertySheetAction.addPropertyChangeListener(
        new IPropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent event) {
            if (IAction.CHECKED.equals(event.getProperty())) {
              updateContentDescription();
            }
          }
        });
    IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
    menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menuManager.add(pinPropertySheetAction);

    IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
    menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    toolBarManager.add(pinPropertySheetAction);

    getSite()
        .getPage()
        .getWorkbenchWindow()
        .getWorkbench()
        .getHelpSystem()
        .setHelp(getPageBook(), IPropertiesHelpContextIds.PROPERTY_SHEET_VIEW);
  }
  /* (non-Javadoc)
   * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars)
   */
  public void setActionBars(IActionBars actionBars) {
    super.setActionBars(actionBars);
    IToolBarManager toolBarManager = actionBars.getToolBarManager();

    LexicalSortingAction action = new LexicalSortingAction(getTreeViewer());
    toolBarManager.add(action);
  }
Exemplo n.º 10
0
 public void createPartControl(Composite parent) {
   super.createPartControl(parent);
   IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
   man.add(
       new OpenPTPairAllAction2(
           getViewSite().getWorkbenchWindow(), "Load", serverId, objType, counter1, counter2));
 }
 /** Creates the toolbar GUI contributions */
 private void createToolbar() {
   IToolBarManager tm = getViewSite().getActionBars().getToolBarManager();
   tm.add(refresh);
   group.fillActionBars(getViewSite().getActionBars());
   tm.add(showRoot);
   tm.add(zoom);
 }
 protected void fillCoolBar(ICoolBarManager coolBar) {
   IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
   coolBar.add(new ToolBarContributionItem(toolbar, "main"));
   toolbar.add(openDbConnectionViewAction);
   toolbar.add(openRepositoriesViewAction);
   toolbar.add(openSoftwareInstalledViewAction);
   // toolbar.add(messagePopupAction);
 }
Exemplo n.º 13
0
  private void fillLocalToolBar(IToolBarManager manager) {

    manager.add(action1);
    manager.add(action2);
    manager.add(new Separator());

    drillDownAdapter.addNavigationActions(manager);
  }
Exemplo n.º 14
0
 private void fillLocalToolBar(IToolBarManager manager) {
   manager.add(fCodeSelectAction);
   manager.add(fElementAtAction);
   manager.add(fResetAction);
   manager.add(fRefreshAction);
   manager.add(new Separator());
   fDrillDownAdapter.addNavigationActions(manager);
 }
 public void contributeToToolBar(IToolBarManager toolBarManager) {
   toolBarManager.add(getAction(ActionFactory.UNDO.getId()));
   toolBarManager.add(getAction(ActionFactory.REDO.getId()));
   toolBarManager.add(getAction(ActionFactory.DELETE.getId()));
   toolBarManager.add(getAction(GEFActionConstants.ZOOM_IN));
   toolBarManager.add(new ZoomComboContributionItem(getPage()));
   toolBarManager.add(getAction(GEFActionConstants.ZOOM_OUT));
 }
Exemplo n.º 16
0
 /** 初始化工具栏 */
 private void createLocalToolBar() {
   IActionBars bars = getViewSite().getActionBars();
   IToolBarManager manager = bars.getToolBarManager();
   manager.add(testAction);
   manager.add(refreshAction);
   manager.add(openLogWithChartAction);
   manager.add(openResultDirAction);
 }
Exemplo n.º 17
0
 private void fillLocalToolBar() {
   IActionBars bars = getViewSite().getActionBars();
   IToolBarManager manager = bars.getToolBarManager();
   manager.add(this.refreshAction);
   manager.add(this.addTemplateAction);
   manager.add(this.editTemplateAction);
   manager.add(this.deleteTemplateAction);
 }
Exemplo n.º 18
0
 private void initializeToolBar() {
   IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager();
   createToolBarGroups(tbm);
   tbm.appendToGroup(IContextMenuConstants.GROUP_SEARCH, fSearchAgainAction);
   tbm.appendToGroup(IContextMenuConstants.GROUP_SEARCH, fCancelAction);
   tbm.appendToGroup(IContextMenuConstants.GROUP_SEARCH, fSearchesDropDownAction);
   getViewSite().getActionBars().updateActionBars();
 }
Exemplo n.º 19
0
 private void updateToolbar() {
   IActionBars bars = getSite().getActionBars();
   IToolBarManager manager = bars.getToolBarManager();
   manager.removeAll();
   if (fCurrentPage == fTapestryOutlinePage)
     fTapestryOutlinePage.makeContributions(null, manager, null);
   manager.add(fToggleAction);
   bars.updateActionBars();
 }
Exemplo n.º 20
0
 /**
  * Init the toolbar for the receiver
  *
  * <p>You can override this method if you want - but remember to call <code>super.initToolBar()
  * </code>.
  *
  * @param manager the tool bar manager of this view
  */
 private void initToolBar(IToolBarManager manager) {
   if (expandAllAction != null) manager.add(expandAllAction);
   if (collapseAllAction != null) manager.add(collapseAllAction);
   if (hideShowColAction != null) manager.add(hideShowColAction);
   if (exportToCSVAction != null) manager.add(exportToCSVAction);
   if (sortAction != null) manager.add(sortAction);
   contributeToToolbar(manager);
   manager.update(true);
 }
Exemplo n.º 21
0
 protected void hookActions() {
   IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
   IAction collapse = new CollapseAllAction(viewer);
   mgr.add(collapse);
   IAction expand = new ExpandAllAction(viewer);
   mgr.add(expand);
   IAction hideTimeEvent = new HideTimeEventsAction(true);
   mgr.add(hideTimeEvent);
 }
Exemplo n.º 22
0
  public void testExecPidMenu() throws Exception {
    ILaunchConfigurationWorkingCopy config =
        createConfiguration(proj.getProject()).getWorkingCopy();
    config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
    config.doSave();
    doLaunch(config, "testExec"); // $NON-NLS-1$

    ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
    MassifViewPart dynamicView = (MassifViewPart) view.getDynamicView();
    MassifOutput output = dynamicView.getOutput();

    MassifPidMenuAction menuAction = null;
    IToolBarManager manager = view.getViewSite().getActionBars().getToolBarManager();
    for (IContributionItem item : manager.getItems()) {
      if (item instanceof ActionContributionItem
          && ((ActionContributionItem) item).getAction() instanceof MassifPidMenuAction) {
        menuAction = (MassifPidMenuAction) ((ActionContributionItem) item).getAction();
      }
    }

    assertNotNull(menuAction);

    Integer[] pids = dynamicView.getOutput().getPids();
    Shell shell = new Shell(Display.getCurrent());
    Menu pidMenu = menuAction.getMenu(shell);

    assertEquals(2, pidMenu.getItemCount());
    ActionContributionItem firstPid = (ActionContributionItem) pidMenu.getItem(0).getData();
    ActionContributionItem secondPid = (ActionContributionItem) pidMenu.getItem(1).getData();

    // check initial state
    assertTrue(firstPid.getAction().isChecked());
    assertFalse(secondPid.getAction().isChecked());
    assertEquals(output.getSnapshots(pids[0]), dynamicView.getSnapshots());

    // select second pid
    selectItem(pidMenu, 1);

    assertFalse(firstPid.getAction().isChecked());
    assertTrue(secondPid.getAction().isChecked());
    assertEquals(output.getSnapshots(pids[1]), dynamicView.getSnapshots());

    // select second pid again
    selectItem(pidMenu, 1);

    assertFalse(firstPid.getAction().isChecked());
    assertTrue(secondPid.getAction().isChecked());
    assertEquals(output.getSnapshots(pids[1]), dynamicView.getSnapshots());

    // select first pid
    selectItem(pidMenu, 0);

    assertTrue(firstPid.getAction().isChecked());
    assertFalse(secondPid.getAction().isChecked());
    assertEquals(output.getSnapshots(pids[0]), dynamicView.getSnapshots());
  }
Exemplo n.º 23
0
 /**
  * Create a toolbar containing the specified actions
  *
  * @param actions a collection of actions and null-values (that represent separators)
  */
 public void createToolbar(IAction... actions) {
   IToolBarManager tmg = site.getActionBars().getToolBarManager();
   for (IAction ac : actions) {
     if (ac == null) {
       tmg.add(new Separator());
     } else {
       tmg.add(ac);
     }
   }
 }
Exemplo n.º 24
0
 private void createActions() {
   IPageSite site = getSite();
   IActionBars actionBars = site.getActionBars();
   IToolBarManager toolBarManager = actionBars.getToolBarManager();
   List<IAction> actions =
       new org.emftext.language.xpath3.resource.xpath3.ui.Xpath3OutlinePageActionProvider()
           .getActions(treeViewer);
   for (IAction action : actions) {
     toolBarManager.add(action);
   }
 }
 public void addActionsToMenu() {
   for (Action action : additionalActions) {
     if (toolbarMM.getItems().length != additionalActions.size() + 2) {
       barMM.add(action);
       barMM.update(true);
       toolbarMM.add(action);
       toolbarMM.update(true);
     }
   }
   additionalActions.clear();
 }
Exemplo n.º 26
0
  @Override
  public void contributeToToolBar(IToolBarManager toolBarManager) {
    logger.debug("contributeToToolBar() activeEditor = " + activeEditor); // $NON-NLS-1$
    super.contributeToToolBar(toolBarManager);

    printLayoutFromViewerAction =
        new PrintLayoutFromViewerAction((ReportViewerEditor) activeEditor);
    refreshLayoutFromViewerAction =
        new RefreshLayoutFromViewerAction((ReportViewerEditor) activeEditor);
    toolBarManager.add(printLayoutFromViewerAction);
    toolBarManager.add(refreshLayoutFromViewerAction);
  }
Exemplo n.º 27
0
 private boolean toggle(Action action, boolean input) {
   action.setChecked(!action.isChecked());
   IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
   for (IContributionItem item : mgr.getItems()) {
     if (item instanceof ActionContributionItem
         && ((ActionContributionItem) item).getAction() == action) {
       action.setChecked(!action.isChecked());
       return !input;
     }
   }
   return input;
 }
Exemplo n.º 28
0
 private IAction getChartAction(IViewPart view) {
   IAction result = null;
   IToolBarManager manager = view.getViewSite().getActionBars().getToolBarManager();
   for (IContributionItem item : manager.getItems()) {
     if (item instanceof ActionContributionItem) {
       ActionContributionItem actionItem = (ActionContributionItem) item;
       if (actionItem.getAction().getId().equals(MassifViewPart.CHART_ACTION)) {
         result = actionItem.getAction();
       }
     }
   }
   return result;
 }
Exemplo n.º 29
0
  /** Adds the actions in this group and its subgroups to the action bars. */
  public void fillActionBars(IActionBars actionBars) {
    actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertyDialogAction);

    IToolBarManager toolBar = actionBars.getToolBarManager();
    drillDownAdapter.addNavigationActions(toolBar);
    toolBar.add(new Separator());
    toolBar.add(this.collapseAllAction);
    toolBar.add(this.refreshAction);

    IMenuManager menu = actionBars.getMenuManager();
    menu.add(new Separator());
    menu.add(this.refreshAction);
  }
Exemplo n.º 30
0
  @Override
  public void createPartControl(Composite parent) {
    canvas3D = new SWTCanvas3D(parent, SWT.NONE);
    parent.setLayout(new FillLayout());

    final IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager();
    toolBarManager.add(new RefreshAction());

    getSite()
        .getWorkbenchWindow()
        .getSelectionService()
        .addPostSelectionListener(SceneExplorerView.VIEW_ID, this);
  }