Esempio n. 1
0
  private void makeActions() {
    startJUnit =
        new Action() {
          public void run() {
            showMessage("Started JUnit Test");
          }
        };
    startJUnit.setText("Start JUnit Test");
    startJUnit.setToolTipText("Action 1 tooltip");
    startJUnit.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    startSWTBot =
        new Action() {
          public void run() {
            showMessage("Started SWTBot Test");
          }
        };
    startSWTBot.setText("Start SWTBot");
    startSWTBot.setToolTipText("Action 2 tooltip");
    startSWTBot.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
    ViewResults =
        new Action() {
          public void run() {
            ISelection selection = viewer.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            showMessage("Double-click detected on " + obj.toString());
          }
        };
  }
  /**
   * Create the toolbar actions
   *
   * @param managedForm
   */
  @Override
  protected void createToolBarActions(IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();

    Action vaction =
        new Action("ver", Action.AS_RADIO_BUTTON) {

          public void run() {
            setSashFormVertical(form);
          }
        };
    vaction.setChecked(vertical);
    vaction.setToolTipText("vertical");
    vaction.setImageDescriptor(POFileEditorPlugin.getImageDescriptor("icons/th_vertical.gif"));

    Action haction =
        new Action("hor", Action.AS_RADIO_BUTTON) {

          public void run() {
            setSashFormHorizontal(form);
          }
        };
    haction.setChecked(horizontal);
    haction.setToolTipText("horizontal");
    haction.setImageDescriptor(POFileEditorPlugin.getImageDescriptor("icons/th_horizontal.gif"));

    form.getToolBarManager().add(haction);
    form.getToolBarManager().add(vaction);
  }
  private void makeActions() {
    newPatientAction =
        new Action() {
          public void run() {
            openPatientenDialog();
          }
        };
    newPatientAction.setText(
        Messages.getString("WeisseSeitenSearchView.popup.newPatient")); // $NON-NLS-1$
    newPatientAction.setToolTipText(
        Messages.getString("WeisseSeitenSearchView.tooltip.newPatient")); // $NON-NLS-1$
    newPatientAction.setImageDescriptor(Images.IMG_PERSON_ADD.getImageDescriptor());

    newKontaktAction =
        new Action() {
          public void run() {
            openKontaktDialog();
          }
        };
    newKontaktAction.setText(
        Messages.getString("WeisseSeitenSearchView.popup.newKontakt")); // $NON-NLS-1$
    newKontaktAction.setToolTipText(
        Messages.getString("WeisseSeitenSearchView.tooltip.newKontakt")); // $NON-NLS-1$
    newKontaktAction.setImageDescriptor(Images.IMG_NEW.getImageDescriptor());
  }
Esempio n. 4
0
  protected void createToolBarActions(IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();

    Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) { // $NON-NLS-1$
          public void run() {
            sashForm.setOrientation(SWT.HORIZONTAL);
            form.reflow(true);
          }
        };
    haction.setChecked(true);
    haction.setToolTipText(PDEUIMessages.DetailsBlock_horizontal);
    haction.setImageDescriptor(PDEPluginImages.DESC_HORIZONTAL);
    haction.setDisabledImageDescriptor(PDEPluginImages.DESC_HORIZONTAL_DISABLED);

    Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { // $NON-NLS-1$
          public void run() {
            sashForm.setOrientation(SWT.VERTICAL);
            form.reflow(true);
          }
        };
    vaction.setChecked(false);
    vaction.setToolTipText(PDEUIMessages.DetailsBlock_vertical);
    vaction.setImageDescriptor(PDEPluginImages.DESC_VERTICAL);
    vaction.setDisabledImageDescriptor(PDEPluginImages.DESC_VERTICAL_DISABLED);
    form.getToolBarManager().add(haction);
    form.getToolBarManager().add(vaction);
  }
Esempio n. 5
0
  private void makeActions() {
    action1 =
        new Action() {

          @Override
          public void run() {
            showMessage("Action 1 executed");
          }
        };
    action1.setText("Action 1");
    action1.setToolTipText("Action 1 tooltip");
    action1.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    action2 =
        new Action() {

          @Override
          public void run() {
            // testing
            // final IErlModel mdl = ErlangCore.getModel();
            // final List<IErlModule> ms = mdl.findModule("test", ".*");
            // ErlLogger.debug("found(\"*\") " + ms.size());
            // for (IErlModule element : ms) {
            // ErlLogger.debug(" " + element.getName());
            // }
            //
            // final List<IErlFunction> fs = mdl.findFunction("test", ".*",
            // "st.*", IErlModel.UNKNOWN_ARITY);
            // ErlLogger.debug("found(\"*\") " + fs.size());
            // for (IErlFunction element : fs) {
            // ErlLogger.debug(" " + element.getName() + "/"
            // + element.getArity());
            // }
            //
            // viewer.setInput(ms);
            //

            showMessage("Action 2 executed");
          }
        };
    action2.setText("Action 2");
    action2.setToolTipText("Action 2 tooltip");
    action2.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
    doubleClickAction =
        new Action() {

          @Override
          public void run() {
            final ISelection selection = viewer.getSelection();
            final Object obj = ((IStructuredSelection) selection).getFirstElement();
            showMessage("Double-click detected on " + obj.toString());
          }
        };
  }
  private void makeActions() {
    action1 =
        new Action() {
          public void run() {
            showMessage("Action 1 executed");
          }
        };
    action1.setText("Action 1");
    action1.setToolTipText("Action 1 tooltip");
    action1.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    action2 =
        new Action() {
          public void run() {
            showMessage("Action 2 executed");
          }
        };
    action2.setText("Action 2");
    action2.setToolTipText("Action 2 tooltip");
    action2.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
    doubleClickAction =
        new Action() {
          public void run() {
            ISelection selection = viewer.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            showMessage("Double-click detected on " + obj.toString());
          }
        };
  }
Esempio n. 7
0
  /**
   * Create toolbar actions to change the layout from vertical to horizontal orientation.
   *
   * @param managedForm form reference for toolbar manager
   */
  protected void createToolBarActions(IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();

    Action haction =
        new Action("hor", Action.AS_RADIO_BUTTON) {
          public void run() {
            sashForm.setOrientation(SWT.HORIZONTAL);
            form.reflow(true);
          }
        };
    haction.setChecked(true);
    haction.setToolTipText("Horizontal orientation");
    haction.setImageDescriptor(
        Activator.getDefault()
            .getImageRegistry()
            .getDescriptor(Activator.EXAMPLE_HORIZONTAL_IMAGE));

    Action vaction =
        new Action("ver", Action.AS_RADIO_BUTTON) {
          public void run() {
            sashForm.setOrientation(SWT.VERTICAL);
            form.reflow(true);
          }
        };
    vaction.setChecked(false);
    vaction.setToolTipText("Vertical orientation");
    vaction.setImageDescriptor(
        Activator.getDefault().getImageRegistry().getDescriptor(Activator.EXAMPLE_VERTICAL_IMAGE));

    form.getToolBarManager().add(haction);
    form.getToolBarManager().add(vaction);
  }
  @Override
  protected void addButtons(final ToolBar toolBar) {
    AbstractDropDown dropdown =
        new AbstractDropDown(toolBar, getClient().getBaseCurrency()) {
          @Override
          public void menuAboutToShow(IMenuManager manager) {
            List<CurrencyUnit> available = CurrencyUnit.getAvailableCurrencyUnits();
            Collections.sort(available);
            for (final CurrencyUnit unit : available) {
              Action action =
                  new Action(unit.getLabel()) {
                    @Override
                    public void run() {
                      setLabel(unit.getCurrencyCode());
                      getClient().setBaseCurrency(unit.getCurrencyCode());
                    }
                  };
              action.setChecked(getClient().getBaseCurrency().equals(unit.getCurrencyCode()));
              manager.add(action);
            }
          }
        };
    currencyChangeListener = e -> dropdown.setLabel(e.getNewValue().toString());
    getClient().addPropertyChangeListener("baseCurrency", currencyChangeListener); // $NON-NLS-1$

    Action export =
        new Action() {
          @Override
          public void run() {
            new TableViewerCSVExporter(assetViewer.getTableViewer()) //
                .export(Messages.LabelStatementOfAssets + ".csv"); // $NON-NLS-1$
          }
        };
    export.setImageDescriptor(Images.EXPORT.descriptor());
    export.setToolTipText(Messages.MenuExportData);
    new ActionContributionItem(export).fill(toolBar, -1);

    Action save =
        new Action() {
          @Override
          public void run() {
            assetViewer.showSaveMenu(getActiveShell());
          }
        };
    save.setImageDescriptor(Images.SAVE.descriptor());
    save.setToolTipText(Messages.MenuSaveColumns);
    new ActionContributionItem(save).fill(toolBar, -1);

    Action config =
        new Action() {
          @Override
          public void run() {
            assetViewer.showConfigMenu(toolBar.getShell());
          }
        };
    config.setImageDescriptor(Images.CONFIG.descriptor());
    config.setToolTipText(Messages.MenuShowHideColumns);
    new ActionContributionItem(config).fill(toolBar, -1);
  }
  /**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.emfstore.internal.client.ui.views.emfstorebrowser.dialogs.admin.TabContent#initActions()
   */
  @Override
  protected List<Action> initActions() {

    Action createNewGroup =
        new Action("Create new group") {
          @Override
          public void run() {
            try {
              getAdminBroker().createGroup("New Group");
            } catch (ESException e) {
              EMFStoreMessageDialog.showExceptionDialog(e);
            }
            getTableViewer().refresh();
            getForm().getTableViewer().refresh();
          }
        };

    createNewGroup.setImageDescriptor(Activator.getImageDescriptor("icons/Group.gif"));
    createNewGroup.setToolTipText("Create new group");

    Action deleteGroup =
        new Action("Delete group") {
          @Override
          public void run() {
            IStructuredSelection selection = (IStructuredSelection) getTableViewer().getSelection();
            Iterator<?> iterator = selection.iterator();
            while (iterator.hasNext()) {
              ACGroup ou = (ACGroup) iterator.next();
              if (ou == null) {
                return;
              }
              try {
                getAdminBroker().deleteGroup(ou.getId());
              } catch (ESException e) {
                EMFStoreMessageDialog.showExceptionDialog(e);
              }

              if (getForm().getCurrentInput() instanceof ACOrgUnit
                  && getForm().getCurrentInput().equals(ou)) {
                getForm().setInput(null);
              }
            }
            getTableViewer().refresh();
          }
        };

    deleteGroup.setImageDescriptor(Activator.getImageDescriptor("icons/delete.gif"));
    deleteGroup.setToolTipText("Delete group");

    Action importOrgUnit = new AcUserImportAction(getAdminBroker());
    importOrgUnit.addPropertyChangeListener(this);

    return Arrays.asList(createNewGroup, deleteGroup, importOrgUnit);
  }
  private void makeActions() {
    action1 =
        new Action() {
          public void run() {
            showMessage("Action 1 executed");
          }
        };
    action1.setText("Action 1");
    action1.setToolTipText("Action 1 tooltip");
    action1.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    action2 =
        new Action() {
          public void run() {
            showMessage("Action 2 executed");
          }
        };
    action2.setText("Action 2");
    action2.setToolTipText("Action 2 tooltip");
    action2.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
    doubleClickAction =
        new Action() {
          public void run() {
            ISelection selection = viewer.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            showMessage("Double-click detected on " + obj.toString());
          }
        };

    pageForwardAction = createPageAction(true);
    pageBackwardsAction = createPageAction(false);

    refreshAction =
        new Action("Refresh", Activator.getImageDescriptor("icons/refresh_tab.gif")) {
          @Override
          public void run() {
            refresh();
          }
        };

    contentProvider.setPageLength(20);
    contentProvider.setPageOffset(1);
    createItemAction(20, true);
    createItemAction(50, false);
    createItemAction(100, false);
  }
Esempio n. 11
0
  void createActions() {
    collapseAllAction =
        new Action() {
          @Override
          public void run() {
            viewer.collapseAll();
          }
        };
    collapseAllAction.setText("Collapse All");
    collapseAllAction.setToolTipText("Collapse All");
    collapseAllAction.setImageDescriptor(
        AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "/icons/collapseall.gif"));

    refreshAction =
        new Action() {
          @Override
          public void run() {
            doRefresh();
          }
        };
    refreshAction.setText("Refresh");
    refreshAction.setToolTipText("Refresh Repositories Tree");
    refreshAction.setImageDescriptor(
        AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "/icons/arrow_refresh.png"));

    addBundlesAction =
        new Action() {
          @Override
          public void run() {
            IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
            Object element = selection.getFirstElement();
            if (element != null && element instanceof RepositoryPlugin) {
              RepositoryPlugin repo = (RepositoryPlugin) element;
              if (repo.canWrite()) {
                AddFilesToRepositoryWizard wizard =
                    new AddFilesToRepositoryWizard(repo, new File[0]);
                WizardDialog dialog = new WizardDialog(getViewSite().getShell(), wizard);
                dialog.open();

                viewer.refresh(repo);
              }
            }
          }
        };
    addBundlesAction.setEnabled(false);
    addBundlesAction.setText("Add");
    addBundlesAction.setToolTipText("Add Bundles to Repository");
    addBundlesAction.setImageDescriptor(
        AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "/icons/brick_add.png"));
  }
Esempio n. 12
0
  /** Create the actions for navigation. */
  private void createActions() {
    // Only do this once.
    if (homeAction != null) {
      return;
    }

    // Home.
    homeAction =
        new Action(Messages.GoHome_text) {
          public void run() {
            goHome();
          }
        };
    homeAction.setToolTipText(Messages.GoHome_toolTip);
    homeAction.setImageDescriptor(
        ImageDescriptor.createFromImage(pool.getImageUnchecked(SharedImageKeys.IMG_TOOL_HOME_NAV)));

    // Back.
    backAction =
        new Action(Messages.GoBack_text) {
          public void run() {
            goBack();
          }
        };
    backAction.setToolTipText(Messages.GoBack_toolTip);
    backAction.setImageDescriptor(
        ImageDescriptor.createFromImage(pool.getImageUnchecked(SharedImageKeys.IMG_TOOL_BACK)));
    backAction.setDisabledImageDescriptor(
        ImageDescriptor.createFromImage(
            pool.getImageUnchecked(SharedImageKeys.IMG_TOOL_BACK_DISABLED)));

    // Forward.
    forwardAction =
        new Action(Messages.GoInto_text) {
          public void run() {
            goInto();
          }
        };
    forwardAction.setToolTipText(Messages.GoInto_toolTip);
    forwardAction.setImageDescriptor(
        ImageDescriptor.createFromImage(pool.getImageUnchecked(SharedImageKeys.IMG_TOOL_FORWARD)));
    forwardAction.setDisabledImageDescriptor(
        ImageDescriptor.createFromImage(
            pool.getImageUnchecked(SharedImageKeys.IMG_TOOL_FORWARD_DISABLED)));

    // Update the buttons when a selection change occurs.
    fChildTree.addSelectionChangedListener(this);
    updateNavigationButtons();
  }
Esempio n. 13
0
  private void makeActions() {
    final MeclipseView mView = this;
    connection =
        new Action() {

          public void run() {

            ConnectionWizard wizard = new ConnectionWizard();
            Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

            WizardDialog dialog = new WizardDialog(shell, wizard);
            dialog.create();
            dialog.open();
            mView.refreshMe();
          }
        };

    connection.setText(getCaption("connection.new"));
    connection.setToolTipText(getCaption("connection.new"));
    connection.setImageDescriptor(Images.getDescriptor(Images.PageCommit));

    doubleClickAction =
        new Action() {
          public void run() {
            ISelection selection = viewer.getSelection();
            TreeObject obj = (TreeObject) ((IStructuredSelection) selection).getFirstElement();
            obj.doubleClickAction();
          }
        };
  }
Esempio n. 14
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();
    }
  }
Esempio n. 15
0
  private void addCreateSecurityButton(ToolBar toolBar) {
    Action createSecurity =
        new Action() {
          @Override
          public void run() {
            Security newSecurity = new Security();
            newSecurity.setFeed(QuoteFeed.MANUAL);
            Dialog dialog =
                new WizardDialog(
                    getClientEditor().getSite().getShell(),
                    new EditSecurityWizard(getClient(), newSecurity));
            if (dialog.open() == Dialog.OK) {
              markDirty();
              getClient().addSecurity(newSecurity);

              if (watchlist != null) watchlist.getSecurities().add(newSecurity);

              setSecurityTableInput();
              securities.updateQuotes(newSecurity);
            }
          }
        };
    createSecurity.setImageDescriptor(PortfolioPlugin.descriptor(PortfolioPlugin.IMG_PLUS));
    createSecurity.setToolTipText(Messages.SecurityMenuAddNewSecurity);

    new ActionContributionItem(createSecurity).fill(toolBar, -1);
  }
 @Override
 protected void configureAction(Action action) {
   action.setText(Messages.FilterTerminalRulesContribution_title);
   action.setDescription(Messages.FilterTerminalRulesContribution_description);
   action.setToolTipText(Messages.FilterTerminalRulesContribution_tooltip);
   action.setImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
   action.setDisabledImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
 }
 @Override
 protected void configureAction(Action action) {
   action.setText(Messages.HideReturnTypesAction_title);
   action.setToolTipText(Messages.HideReturnTypesAction_tooltip);
   action.setDescription(Messages.HideReturnTypesAction_description);
   action.setImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
   action.setDisabledImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
 }
Esempio n. 18
0
  private void fillLocalToolBar(final IToolBarManager manager) {
    final Action viewInPlotter =
        new Action() {
          @Override
          public void run() {
            openPlotter();
          }
        };
    viewInPlotter.setText("View in LPD");
    viewInPlotter.setToolTipText("View 2D overview of scenario");
    viewInPlotter.setImageDescriptor(CorePlugin.getImageDescriptor("icons/overview.gif"));

    final Action actionReloadDatafiles =
        new Action() {
          @Override
          public void run() {
            _myPresenter.reloadDataFiles();
          }
        };
    actionReloadDatafiles.setText("Reload");
    actionReloadDatafiles.setToolTipText("Reload data files");
    final ImageDescriptor desc = CorePlugin.getImageDescriptor("icons/repaint.gif");
    actionReloadDatafiles.setImageDescriptor(desc);

    final Action doNetwork =
        new Action("Broadcast", SWT.TOGGLE) {
          @Override
          public void run() {
            doNetwork(this.isChecked());
          }
        };
    doNetwork.setChecked(true);
    doNetwork.setToolTipText("Broadcast scenarios on network");
    doNetwork.setImageDescriptor(Activator.getImageDescriptor("icons/app_link.png"));

    // and display them
    manager.add(doNetwork);
    manager.add(viewInPlotter);
    manager.add(actionReloadDatafiles);

    manager.add(new Separator());
    manager.add(
        CorePlugin.createOpenHelpAction("org.mwc.asset.help.ScenarioController", null, this));
  }
 private ActionContributionItem buildRestoreModelACI() {
   Action action =
       new Action("Restore model", IAction.AS_PUSH_BUTTON) {
         @Override
         public void run() {
           TreeContentProviderUiTest.this.restoreModel();
         }
       };
   action.setToolTipText("Restore the model");
   return new ActionContributionItem(action);
 }
Esempio n. 20
0
 private void makeActions() {
   actionTestQuery =
       new Action() {
         public void run() {
           testQuery();
         }
       };
   actionTestQuery.setText("Test Query");
   actionTestQuery.setToolTipText("Test Query");
   actionTestQuery.setImageDescriptor(
       SmartRule1Plugin.getImageDescriptor("/icons/db_execute.gif"));
 }
Esempio n. 21
0
  private void makeActions() {

    action2 =
        new Action() {
          public void run() {
            showMessage("Action 2 executed");
          }
        };
    action2.setText("Action 2");
    action2.setToolTipText("Action 2 tooltip");
    action2.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    AddServiceCodeAction =
        new Action() {
          public void run() {
            ISelection selection = viewer.getSelection();
            Object TreeObj = ((IStructuredSelection) selection).getFirstElement();

            FederationOffice.NamedElement obj = ((ui_TaxonomyTreeItem) TreeObj).getOfficeElement();
            if (!(obj instanceof FederationOffice.services.Service)
                && !(obj instanceof FederationOffice.resources.Resource)) return;

            // System.out.println("============ AddServiceCodeAction: "+ obj.toString() );
            FSDLSourceCompletion sc = new FSDLSourceCompletion();
            sc.AddOfferedService(
                ((Office) obj.eContainer()), (FederationOffice.services.Service) obj);
          }
        };

    AddServiceCodeAction.setText("Insert selected object");
    AddServiceCodeAction.setToolTipText("Insert code for selected object");
    AddServiceCodeAction.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
  }
Esempio n. 22
0
  private void makeActions() {
    refreshAction =
        new Action() {

          @Override
          public void run() {
            viewer.refresh();
          }
        };
    refreshAction.setText("Refresh");
    refreshAction.setToolTipText("Refresh process list");
    refreshAction.setImageDescriptor(
        PlatformUI.getWorkbench()
            .getSharedImages()
            .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

    doubleClickAction =
        new Action() {

          @Override
          public void run() {
            final ISelection selection = viewer.getSelection();
            final Object obj = ((IStructuredSelection) selection).getFirstElement();

            if (obj == null) {
              return;
            }

            final OtpErlangPid pid = (OtpErlangPid) ((OtpErlangTuple) obj).elementAt(0);

            final OtpErlangObject r = ErlideProclist.getProcessInfo(getBackend(), pid);
            if (r instanceof OtpErlangList) {
              final OtpErlangList l = (OtpErlangList) r;
              final StringBuilder s = new StringBuilder();
              for (int i = 0; i < l.arity(); i++) {
                final OtpErlangTuple e = (OtpErlangTuple) l.elementAt(i);
                s.append(' ')
                    .append(e.elementAt(0).toString())
                    .append("\t= ")
                    .append(e.elementAt(1).toString())
                    .append('\n');
              }
              showMessage(s.toString());
            } else {
              showMessage(
                  "Process " + pid.toString() + " is probably dead.\nPlease refresh process list.");
            }
          }
        };
  }
Esempio n. 23
0
  private void addExportButton(ToolBar toolBar) {
    Action export =
        new Action() {
          @Override
          public void run() {
            new TableViewerCSVExporter(securities.getTableViewer()) //
                .export(getTitle() + ".csv"); // $NON-NLS-1$
          }
        };
    export.setImageDescriptor(PortfolioPlugin.descriptor(PortfolioPlugin.IMG_EXPORT));
    export.setToolTipText(Messages.MenuExportData);

    new ActionContributionItem(export).fill(toolBar, -1);
  }
  private void addConfigButton(ToolBar toolBar) {
    Action save =
        new Action() {
          @Override
          public void run() {
            picker.showSaveMenu(getActiveShell());
          }
        };
    save.setImageDescriptor(PortfolioPlugin.descriptor(PortfolioPlugin.IMG_SAVE));
    save.setToolTipText(Messages.MenuSaveChart);
    new ActionContributionItem(save).fill(toolBar, -1);

    Action config =
        new Action() {
          @Override
          public void run() {
            picker.showMenu(getActiveShell());
          }
        };
    config.setImageDescriptor(PortfolioPlugin.descriptor(PortfolioPlugin.IMG_CONFIG));
    config.setToolTipText(Messages.MenuConfigureChart);
    new ActionContributionItem(config).fill(toolBar, -1);
  }
Esempio n. 25
0
 private void makeActions() {
   action1 =
       new Action() {
         public void run() {
           // _chart.rescale();
         }
       };
   action1.setText("Action 1");
   action1.setToolTipText("Action 1 tooltip");
   action1.setImageDescriptor(
       PlatformUI.getWorkbench()
           .getSharedImages()
           .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
 }
 private void createActions() {
   sampleAction =
       new Action() {
         public void run() {
           MessageDialog.openInformation(null, "EWicket", "Sample Action Executed");
         }
       };
   sampleAction.setText("Sample Action");
   sampleAction.setToolTipText("Sample Action tool tip");
   sampleAction.setImageDescriptor(
       PlatformUI.getWorkbench()
           .getSharedImages()
           .getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
 }
Esempio n. 27
0
  private void createActionMonitor() {
    actionMonitor =
        new Action("Monitor", IAction.AS_CHECK_BOX) {
          public void run() {
            if (actionMonitor.isChecked()) {
              Display display = output.getDisplay();
              display.timerExec(100, trackWidgets);
            }
          }
        };

    actionMonitor.setToolTipText("Enable/Disable monitoring of widgets");
    actionMonitor.setChecked(false);
  }
Esempio n. 28
0
  private void addConfigButton(ToolBar toolBar) {
    Action config =
        new Action() {
          @Override
          public void run() {
            securities
                .getColumnHelper()
                .showHideShowColumnsMenu(getClientEditor().getSite().getShell());
          }
        };
    config.setImageDescriptor(PortfolioPlugin.descriptor(PortfolioPlugin.IMG_CONFIG));
    config.setToolTipText(Messages.MenuShowHideColumns);

    new ActionContributionItem(config).fill(toolBar, -1);
  }
 private void makeActions() {
   showHierarchyOfModulesAction =
       new Action("", IAction.AS_CHECK_BOX) {
         @Override
         public void run() {
           setShowModuleHierarchy(isChecked());
         }
       };
   showHierarchyOfModulesAction.setText(CALUIMessages.CALWorkspace_showHierarchyOfModules);
   showHierarchyOfModulesAction.setChecked(getModuleContentProvider().getShowModuleHierarchy());
   showHierarchyOfModulesAction.setToolTipText(
       CALUIMessages.CALWorkspace_showHierarchyOfModules_tooltip);
   //
   // showHierarchyOfModulesAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
   //                getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
 }
 private ActionContributionItem buildAddChildACI() {
   final Action action =
       new Action("Add child", IAction.AS_PUSH_BUTTON) {
         @Override
         public void run() {
           TreeContentProviderUiTest.this.addChild();
         }
       };
   action.setToolTipText("Add a child with the given name");
   this.selectedNodeModel.addPropertyChangeListener(
       PropertyValueModel.VALUE,
       new PropertyChangeListener() {
         public void propertyChanged(PropertyChangeEvent event) {
           action.setEnabled(((TreeNode) event.getNewValue()).canHaveChildren());
         }
       });
   return new ActionContributionItem(action);
 }