Exemplo n.º 1
0
 protected void fillContextMenu(IMenuManager manager) {
   manager.add(getAction("change_value"));
   manager.add(new Separator());
   drillDownAdapter.addNavigationActions(manager);
   // Other plug-ins can contribute there actions here
   manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
 }
  void fillContextMenu(IMenuManager manager) {
    addFocusActionOrNot(manager);
    manager.add(fResetAction);
    manager.add(fRefreshAction);
    manager.add(new Separator());

    if (!getSite().getSelectionProvider().getSelection().isEmpty()) {
      MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
      IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
      showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(workbenchWindow));
      manager.add(showInSubMenu);
    }
    addElementActionsOrNot(manager);
    manager.add(new Separator());

    manager.add(fCopyAction);
    manager.add(new Separator());

    fDrillDownAdapter.addNavigationActions(manager);
    manager.add(new Separator());
    // Other plug-ins can contribute there actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new Separator());
    addCompareActionOrNot(manager);
    manager.add(fPropertiesAction);
  }
Exemplo n.º 3
0
 private void fillContextMenu(IMenuManager manager) {
   manager.add(action1);
   manager.add(action2);
   manager.add(new Separator());
   drillDownAdapter.addNavigationActions(manager);
   manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
 }
Exemplo n.º 4
0
 void fillContextMenu(final IMenuManager manager) {
   manager.add(action1);
   manager.add(action2);
   manager.add(new Separator());
   drillDownAdapter.addNavigationActions(manager);
   // Other plug-ins can contribute there actions here
   manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
 }
 private void fillLocalToolBar(IToolBarManager manager) {
   manager.add(fCodeSelectAction);
   manager.add(fElementAtAction);
   manager.add(fResetAction);
   manager.add(fRefreshAction);
   manager.add(new Separator());
   fDrillDownAdapter.addNavigationActions(manager);
 }
Exemplo n.º 6
0
  private void fillLocalToolBar(IToolBarManager manager) {

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

    drillDownAdapter.addNavigationActions(manager);
  }
Exemplo n.º 7
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);
  }
 void setInput(Collection<?> javaElementsOrResources) {
   fInput = new JERoot(javaElementsOrResources);
   fViewer.setInput(fInput);
   ITreeContentProvider tcp = (ITreeContentProvider) fViewer.getContentProvider();
   Object[] elements = tcp.getElements(fInput);
   if (elements.length > 0) {
     fViewer.setSelection(new StructuredSelection(elements[0]));
     if (elements.length == 1) {
       fViewer.setExpandedState(elements[0], true);
     }
   }
   fDrillDownAdapter.reset();
 }
Exemplo n.º 9
0
  @Override
  public void createPartControl(Composite parent) {

    viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    drillDownAdapter = new DrillDownAdapter(viewer);
    viewer.setContentProvider(new VMTreeContentProvider());
    viewer.setLabelProvider(new VMTreeGroupLabelProvider());
    viewer.setInput(invisibleRoot);
    drillDownAdapter.addNavigationActions(getViewSite().getActionBars().getToolBarManager());

    viewer
        .getTree()
        .addListener(
            SWT.Selection,
            new Listener() {
              public void handleEvent(Event event) {

                VMTreeObject object = (VMTreeObject) GetSelectedObject();
                VMTreeObject select = null;
                if (object instanceof VMTreeObjectVMinGroup) {
                  select = ((VMTreeObjectVMinGroup) object).getVmObject();
                } else if (object instanceof VMTreeObjectPoolinGroup) {
                  select = ((VMTreeObjectPoolinGroup) object).getPoolObject();
                } else if (object instanceof VMTreeObjectHostinGroup) {
                  select = ((VMTreeObjectHostinGroup) object).getHostObject();
                }
                if (select != null && !select.getItemState().equals(ItemState.changing)) {
                  ISelection selection = new StructuredSelection(new Object[] {select});
                  if (Constants.treeView != null && Constants.treeView.getViewer() != null) {
                    Constants.treeView.getViewer().setSelection(selection);
                    Constants.pageBookView.selectionChanged(
                        Constants.treeView, Constants.treeView.getViewer().getSelection());
                    PageBookViewState.addState();
                  }
                }
              }
            });

    invisibleRoot.addChild(Constants.VMGROUPS_TREE);

    CreateContextMenu();

    viewer.expandAll();
    viewer.refresh();
    ISelection selection = new StructuredSelection(new Object[] {Constants.VMGROUPS_TREE});
    viewer.setSelection(selection);

    Constants.groupView = this;
  }
Exemplo n.º 10
0
 public void fillContextMenu(IMenuManager menu, IStructuredSelection selection) {
   MenuManager subMenu = new MenuManager("New");
   menu.add(subMenu);
   for (int i = 0; i < this.addRemoteRepositoryActions.length; i++) {
     subMenu.add(this.addRemoteRepositoryActions[i]);
   }
   subMenu.add(new Separator());
   subMenu.add(this.addSpaceAction);
   subMenu.add(this.addPageAction);
   subMenu.add(new Separator());
   subMenu.add(this.newOtherAction);
   openFileAction.selectionChanged(selection);
   menu.add(openFileAction);
   fillOpenWithMenu(menu, selection.getFirstElement());
   menu.add(new Separator());
   drillDownAdapter.addNavigationActions(menu);
   menu.add(new Separator());
   menu.add(this.deleteAction);
   menu.add(new Separator());
   menu.add(this.refreshAction);
   menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
   menu.add(new Separator());
   menu.add(this.propertyDialogAction);
 }
Exemplo n.º 11
0
 @Override
 protected void configureToolBar(IToolBarManager manager) {
   // manager.add(getAction("action2"));
   manager.add(new Separator());
   drillDownAdapter.addNavigationActions(manager);
 }