Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.Action


    protected void createToolBarActions( IManagedForm managedForm )
    {
        final ScrolledForm form = managedForm.getForm();

        // Horizontal layout Action
        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.HORIZONTAL );
                form.reflow( true );
            }
        };
        horizontalAction.setChecked( true );
        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
        horizontalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
            ApacheDSConfigurationPluginConstants.IMG_HORIZONTAL_ORIENTATION ) );

        // Vertical layout Action
        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.VERTICAL );
                form.reflow( true );
            }
        };
        verticalAction.setChecked( false );
        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
        verticalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
            ApacheDSConfigurationPluginConstants.IMG_VERTICAL_ORIENTATION ) );

        form.getToolBarManager().add( horizontalAction );
        form.getToolBarManager().add( verticalAction );
    }
View Full Code Here


    protected void createToolBarActions( IManagedForm managedForm )
    {
        final ScrolledForm form = managedForm.getForm();

        // Horizontal layout Action
        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.HORIZONTAL );
                form.reflow( true );
            }
        };
        horizontalAction.setChecked( true );
        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
        horizontalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
            ApacheDSConfigurationPluginConstants.IMG_HORIZONTAL_ORIENTATION ) );

        // Vertical layout Action
        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.VERTICAL );
                form.reflow( true );
            }
        };
        verticalAction.setChecked( false );
        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
        verticalAction.setImageDescriptor( ApacheDSConfigurationPlugin.getDefault().getImageDescriptor(
            ApacheDSConfigurationPluginConstants.IMG_VERTICAL_ORIENTATION ) );

        form.getToolBarManager().add( horizontalAction );
        form.getToolBarManager().add( verticalAction );
    }
View Full Code Here

        if (selectionService != null)
            selectionService.removeSelectionListener(this);
    }

    private void createActions() {
        backAction = new Action("Back", backImg) {
            @Override
            public void run() {
                browser.back();
            }
        };

        forwardAction = new Action("Forward", forwardImg) {
            @Override
            public void run() {
                browser.forward();
            }
        };
View Full Code Here

        if (newFilter != null)
            viewer.expandToLevel(2);
    }

    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) {
View Full Code Here

                                        label = m.group(3);

                                        description = m.group(4);
                                    }
                                    Action a = new Action(label) {
                                        @Override
                                        public void run() {
                                            try {
                                                e.getValue().run();
                                            } catch (Exception e) {
                                                throw new RuntimeException(e);
                                            }
                                            viewer.refresh(act);
                                        }
                                    };
                                    a.setEnabled(enabled);
                                    if (description != null)
                                        a.setDescription(description);
                                    a.setChecked(checked);
                                    manager.add(a);
                                }
                            }
                        }
                    }
View Full Code Here

            } else {
                final String packageName = activatorClassName.substring(0, dotIndex);
                if (!model.isIncludedPackage(packageName)) {
                    warningMessage = "Activator package is not included in the bundle. It will be imported instead.";
                    fixes = new Action[] {
                            new Action(MessageFormat.format("Add \"{0}\" to Private Packages.", packageName)) {
                                @Override
                                public void run() {
                                    model.addPrivatePackage(packageName);
                                    addDirtyProperty(aQute.bnd.osgi.Constants.PRIVATE_PACKAGE);
                                }
                            }, new Action(MessageFormat.format("Add \"{0}\" to Exported Packages.", packageName)) {
                                @Override
                                public void run() {
                                    model.addExportedPackage(new ExportedPackage(packageName, null));
                                    addDirtyProperty(aQute.bnd.osgi.Constants.PRIVATE_PACKAGE);
                                }
View Full Code Here

     * @return
     *      an action associated with the entry editor
     */
    private IAction createAction( final EntryEditorExtension entryEditorExtension )
    {
        Action action = new Action( entryEditorExtension.getName(), entryEditorExtension.getIcon() )
        {
            public void run()
            {
                EntryEditorManager entryEditorManager = BrowserUIPlugin.getDefault().getEntryEditorManager();
                ISelection selection = selectionProvider.getSelection();
View Full Code Here

                {
                    noCommentFound = false;
                }
            }

            Action action;
            if (noCommentFound)
            {
                action = new TextOperationAction(
                    PerlEditorMessages.getResourceBundle(),
                    "Uncomment.",
                    editor,
                    ITextOperationTarget.STRIP_PREFIX);
            }
            else
            {
                action = new TextOperationAction(
                    PerlEditorMessages.getResourceBundle(),
                    "Comment.",
                    editor,
                    ITextOperationTarget.PREFIX);
            }

            action.run();
        }
        catch (BadLocationException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

          setServicesToBindInDescriptor();
        }
      }
    });

    Action addServiceAction = new Action(Messages.COMMONTXT_ADD_SERVICE, CloudFoundryImages.NEW_SERVICE) {

      public void run() {
        // Do not create the service right away.
        boolean deferAdditionOfService = true;
        CloudFoundryServiceWizard wizard = new CloudFoundryServiceWizard(cloudServer, deferAdditionOfService);
View Full Code Here

      manager.add(evaluateAction);
    }

  private void makeActions() {
    //    Validation action
    evaluateAction = new Action() {
      public void run() {
        evaluateExpression();
      }
    };
    evaluateAction.setText("Evaluate Expression");
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.Action

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.