Example usage for org.eclipse.jface.action IToolBarManager add

List of usage examples for org.eclipse.jface.action IToolBarManager add

Introduction

In this page you can find the example usage for org.eclipse.jface.action IToolBarManager add.

Prototype

void add(IAction action);

Source Link

Document

Adds an action as a contribution item to this manager.

Usage

From source file:$packageName$.$contributorClassName$.java

License:Open Source License

public void contributeToToolBar(IToolBarManager manager) {
    // TODO Contribute Actions to the Tool Bar
    manager.add(new Separator());
    manager.add(sampleAction);/* www .  java 2  s  .c  om*/
}

From source file:ac.soton.fmusim.components.presentation.ComponentsActionBarContributor.java

License:Open Source License

/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->//from  w ww  . j a  v a 2s .  com
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(new Separator("components-settings"));
    toolBarManager.add(new Separator("components-additions"));
}

From source file:aml.gui.transformator.views.InternalElementView.java

License:Open Source License

@Override
public void createPartControl(Composite parent) {
    createViewer(parent);/* www.  ja  v  a2  s  .  co m*/
    SkillproService.getUpdateManager().registerUpdatable(this, Domain.class);

    IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
    toolbarManager.add(new SkillproTransformAction());
    toolbarManager.add(new SkillproClearAllAction());
    toolbarManager.add(new SkillproReverseTransformAction());

    getSite().setSelectionProvider(internalTreeTableComposite.getTreeViewer());
}

From source file:ar.com.tadp.xml.rinzo.core.outline.XMLOutlinePage.java

License:Open Source License

public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    toolBarManager.add(new CollapseAllAction(this.getTreeViewer()));
    toolBarManager.add(new ShowFullNameAction(this, this.outlineLabelProvider));
}

From source file:ar.com.tadp.xml.rinzo.core.views.XPathView.java

License:Open Source License

public void createPartControl(Composite parent) {
    parent.setLayout(new GridLayout(1, false));
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    Composite expresionComposite = new Composite(parent, SWT.NONE);
    expresionComposite.setLayout(new GridLayout(3, false));
    expresionComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Composite expresionContainer = new Composite(expresionComposite, SWT.NONE);
    expresionContainer.setLayout(new GridLayout(3, false));
    expresionContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label label = new Label(expresionContainer, SWT.NONE);
    label.setText("Expression:");
    this.expressionsCombo = new Combo(expresionContainer, SWT.DROP_DOWN | SWT.SINGLE | SWT.LEAD);
    this.expressionsCombo.setLayout(new GridLayout(1, false));
    this.expressionsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    this.expressionsCombo.setFocus();
    this.expressionsCombo.setVisibleItemCount(8);
    this.expressionsCombo.setToolTipText("Enter XPath for Source XML");
    this.autoEvaluationListener = new AutoEvaluationKeyListener();
    this.enterEvaluationListener = new EnterEvaluationKeyListener();
    this.expressionsCombo.addKeyListener(this.enterEvaluationListener);
    this.selectionListener = new SelectionListenerImplementation();

    this.evaluateButton = new Button(expresionComposite, SWT.PUSH);
    this.evaluateButton.setText("evaluate");
    this.evaluateButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            super.widgetSelected(e);
            evaluateExpression();/*from ww w.  j a  va2s  .  c o m*/
        }
    });

    Composite resultComposite = new Composite(parent, SWT.NONE);
    resultComposite.setLayout(new FillLayout());
    resultComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    this.resultViewer = new SourceViewer(resultComposite, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    this.resultViewer.setInput(this);
    this.resultViewer.configure(new XMLEditorConfiguration());
    this.resultViewer.setDocument(new Document(""));

    this.clearAllAction = new Action("Clear All") {
        public void run() {
            resultViewer.getDocument().set("");
            resultViewer.refresh();
            expressionsCombo.removeAll();
        }
    };
    this.clearAllAction
            .setImageDescriptor(ImageDescriptor.createFromImage(PluginImages.get(PluginImages.IMG_CLEAR)));

    this.autoEvaluateAction = new Action("Auto Evaluate XPath", IAction.AS_CHECK_BOX) {
        public void run() {
            setAutoEvaluation(!autoEvaluation);
        }
    };
    this.autoEvaluateAction.setImageDescriptor(
            ImageDescriptor.createFromImage(PluginImages.get(PluginImages.IMG_XPATH_AUTO_EVALUATE)));
    this.setAutoEvaluation(
            XMLEditorPlugin.getDefault().getPreferenceStore().getBoolean(XPATH_VIEW_AUTO_EVALUATION));
    this.autoEvaluateAction.setChecked(this.autoEvaluation);

    IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
    toolbarManager.add(this.autoEvaluateAction);
    toolbarManager.add(this.clearAllAction);
}

From source file:at.bestsolution.eclipse.properties.PropertyContentOutlinePage.java

License:Open Source License

@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    super.makeContributions(menuManager, toolBarManager, statusLineManager);
    toolBarManager.add(hierarchicalAction);
    toolBarManager.add(sortAction);//w w w .  ja  v a2s  .c  o  m

    Action a = new Action("", IAction.AS_PUSH_BUTTON) {
        @Override
        public void run() {
            try {
                getTreeViewer().getTree().setRedraw(false);
                getTreeViewer().collapseAll();
            } finally {
                getTreeViewer().getTree().setRedraw(true);
            }
        }
    };
    a.setImageDescriptor(Activator.getDefault().getImageRegistry().getDescriptor(Activator.COLLAPSE_ICON));
    toolBarManager.add(a);
}

From source file:at.bestsolution.efxclipse.tooling.jdt.ui.internal.editors.JFXBuildConfigurationEditor.java

License:Open Source License

/**
 * initialize tool bar for a form.//w w w .  j a  va  2s.  co  m
 */
private void initToolbar(final Form form) {
    IToolBarManager mgr = form.getToolBarManager();
    // TODO do not use the hard coded image name here
    mgr.add(new Action("Build & Export FX Application", ImageDescriptor
            .createFromURL(getClass().getClassLoader().getResource("/icons/exportrunnablejar_wiz.gif"))) {
        @Override
        public void run() {
            try {
                executeExport();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    });
    // mgr.add(new Action("Export Ant File",ImageDescriptor.createFromURL(getClass().getClassLoader().getResource("/icons/exportAnt_co.gif"))) {
    // @Override
    // public void run() {
    //
    // }
    // });
    form.updateToolBar();
}

From source file:at.bestsolution.efxclipse.tooling.jdt.ui.internal.editors.outline.PropertyContentOutlinePage.java

License:Open Source License

@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    super.makeContributions(menuManager, toolBarManager, statusLineManager);
    toolBarManager.add(hierarchicalAction);
    toolBarManager.add(sortAction);// ww  w . j a  va  2 s .  c o  m

    Action a = new Action("", IAction.AS_PUSH_BUTTON) {
        @Override
        public void run() {
            try {
                getTreeViewer().getTree().setRedraw(false);
                getTreeViewer().collapseAll();
            } finally {
                getTreeViewer().getTree().setRedraw(true);
            }
        }
    };
    a.setImageDescriptor(
            JavaFXUIPlugin.getDefault().getImageRegistry().getDescriptor(JavaFXUIPlugin.COLLAPSE_ICON));
    toolBarManager.add(a);
}

From source file:at.bitandart.zoubek.mervin.model.modelreview.presentation.ModelReviewActionBarContributor.java

License:Open Source License

/**
 * This adds Separators for editor additions to the tool bar. <!--
 * begin-user-doc --> <!-- end-user-doc -->
 * /*from   w  w w .j  a  v a  2  s.  c  om*/
 * @generated
 */
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(new Separator("modelreview-settings"));
    toolBarManager.add(new Separator("modelreview-additions"));
}

From source file:at.spardat.xma.guidesign.presentation.action.GuidesignActionBarContributor.java

License:Open Source License

/**
 * This adds Separators for editor additions to the tool bar.
 * <!-- begin-user-doc -->//w w  w.  j  av  a2  s .  com
 * <!-- end-user-doc -->
 * @generated
 */
public void contributeToToolBar(IToolBarManager toolBarManager) {
    toolBarManager.add(new Separator("guidesign-settings"));
    toolBarManager.add(new Separator("guidesign-additions"));
}