Example usage for org.eclipse.jface.action StatusLineContributionItem StatusLineContributionItem

List of usage examples for org.eclipse.jface.action StatusLineContributionItem StatusLineContributionItem

Introduction

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

Prototype

public StatusLineContributionItem(String id) 

Source Link

Document

Creates a status line contribution item with the given id.

Usage

From source file:br.org.archimedes.gui.rca.editor.Contributor.java

License:Open Source License

@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {

    positionManager = new StatusLineContributionItem(STATUS_BAR_ID);
    statusLineManager.add(positionManager);
}

From source file:com.astra.ses.spell.dev.advisor.WorkbenchActionBuilder.java

License:Open Source License

/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 *///from  w ww. j  a va 2 s . c om
protected void makeActions(final IWorkbenchWindow window) {
    // @issue should obtain from ConfigurationItemFactory
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$

    newWizardAction = ActionFactory.NEW.create(window);
    register(newWizardAction);

    newWizardDropDownAction = new ActionFactory("newWizardDropDown") { //$NON-NLS-1$
        /* (non-javadoc) method declared on ActionFactory */
        public IWorkbenchAction create(IWorkbenchWindow window) {
            if (window == null) {
                throw new IllegalArgumentException();
            }
            // @issue we are creating a NEW action just to pass to NewWizardDropDownAction
            IWorkbenchAction innerAction = ActionFactory.NEW.create(window);
            NewWizard newWizardMenu = new NewWizard(window);
            IWorkbenchAction action = new NewWizardDropDownAction(window, innerAction, newWizardMenu);
            action.setId(getId());
            return action;
        }
    }.create(window);

    IDEActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
    register(newWizardDropDownAction);

    importResourcesAction = ActionFactory.IMPORT.create(window);
    register(importResourcesAction);

    exportResourcesAction = ActionFactory.EXPORT.create(window);
    register(exportResourcesAction);

    buildAllAction = IDEActionFactory.BUILD.create(window);
    register(buildAllAction);

    cleanAction = IDEActionFactory.BUILD_CLEAN.create(window);
    register(cleanAction);

    toggleAutoBuildAction = IDEActionFactory.BUILD_AUTOMATICALLY.create(window);
    register(toggleAutoBuildAction);

    saveAction = ActionFactory.SAVE.create(window);
    register(saveAction);

    saveAsAction = ActionFactory.SAVE_AS.create(window);
    register(saveAsAction);

    saveAllAction = ActionFactory.SAVE_ALL.create(window);
    register(saveAllAction);

    newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(getWindow());
    newWindowAction.setText("New window");
    register(newWindowAction);

    newEditorAction = ActionFactory.NEW_EDITOR.create(window);
    register(newEditorAction);

    undoAction = ActionFactory.UNDO.create(window);
    register(undoAction);

    redoAction = ActionFactory.REDO.create(window);
    register(redoAction);

    closeAction = ActionFactory.CLOSE.create(window);
    register(closeAction);

    closeAllAction = ActionFactory.CLOSE_ALL.create(window);
    register(closeAllAction);

    closeOthersAction = ActionFactory.CLOSE_OTHERS.create(window);
    register(closeOthersAction);

    closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
    register(closeAllSavedAction);

    helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
    register(helpContentsAction);

    helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
    register(helpSearchAction);

    dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
    register(dynamicHelpAction);

    aboutAction = ActionFactory.ABOUT.create(window);
    //        aboutAction
    //                .setImageDescriptor(IDEInternalWorkbenchImages
    //                        .getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
    register(aboutAction);

    openPreferencesAction = ActionFactory.PREFERENCES.create(window);
    register(openPreferencesAction);

    // Actions for invisible accelerators
    showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(showViewMenuAction);

    showPartPaneMenuAction = ActionFactory.SHOW_PART_PANE_MENU.create(window);
    register(showPartPaneMenuAction);

    nextEditorAction = ActionFactory.NEXT_EDITOR.create(window);
    register(nextEditorAction);
    prevEditorAction = ActionFactory.PREVIOUS_EDITOR.create(window);
    register(prevEditorAction);
    ActionFactory.linkCycleActionPair(nextEditorAction, prevEditorAction);

    nextPartAction = ActionFactory.NEXT_PART.create(window);
    register(nextPartAction);
    prevPartAction = ActionFactory.PREVIOUS_PART.create(window);
    register(prevPartAction);
    ActionFactory.linkCycleActionPair(nextPartAction, prevPartAction);

    nextPerspectiveAction = ActionFactory.NEXT_PERSPECTIVE.create(window);
    register(nextPerspectiveAction);
    prevPerspectiveAction = ActionFactory.PREVIOUS_PERSPECTIVE.create(window);
    register(prevPerspectiveAction);
    ActionFactory.linkCycleActionPair(nextPerspectiveAction, prevPerspectiveAction);

    activateEditorAction = ActionFactory.ACTIVATE_EDITOR.create(window);
    register(activateEditorAction);

    maximizePartAction = ActionFactory.MAXIMIZE.create(window);
    register(maximizePartAction);

    minimizePartAction = ActionFactory.MINIMIZE.create(window);
    register(minimizePartAction);

    switchToEditorAction = ActionFactory.SHOW_OPEN_EDITORS.create(window);
    register(switchToEditorAction);

    workbookEditorsAction = ActionFactory.SHOW_WORKBOOK_EDITORS.create(window);
    register(workbookEditorsAction);

    quickAccessAction = ActionFactory.SHOW_QUICK_ACCESS.create(window);

    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
    savePerspectiveAction = ActionFactory.SAVE_PERSPECTIVE.create(window);
    register(savePerspectiveAction);
    editActionSetAction = ActionFactory.EDIT_ACTION_SETS.create(window);
    register(editActionSetAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);
    resetPerspectiveAction = ActionFactory.RESET_PERSPECTIVE.create(window);
    register(resetPerspectiveAction);
    closePerspAction = ActionFactory.CLOSE_PERSPECTIVE.create(window);
    register(closePerspAction);
    closeAllPerspsAction = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
    register(closeAllPerspsAction);

    forwardHistoryAction = ActionFactory.FORWARD_HISTORY.create(window);
    register(forwardHistoryAction);

    backwardHistoryAction = ActionFactory.BACKWARD_HISTORY.create(window);
    register(backwardHistoryAction);

    quitAction = ActionFactory.QUIT.create(window);
    register(quitAction);

    goIntoAction = ActionFactory.GO_INTO.create(window);
    register(goIntoAction);

    backAction = ActionFactory.BACK.create(window);
    register(backAction);

    forwardAction = ActionFactory.FORWARD.create(window);
    register(forwardAction);

    upAction = ActionFactory.UP.create(window);
    register(upAction);

    nextAction = ActionFactory.NEXT.create(window);
    //        nextAction
    //                .setImageDescriptor(IDEInternalWorkbenchImages
    //                        .getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_NEXT_NAV));
    register(nextAction);

    previousAction = ActionFactory.PREVIOUS.create(window);
    //        previousAction
    //                .setImageDescriptor(IDEInternalWorkbenchImages
    //                        .getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_PREVIOUS_NAV));
    register(previousAction);

    buildProjectAction = IDEActionFactory.BUILD_PROJECT.create(window);
    register(buildProjectAction);

    openWorkspaceAction = IDEActionFactory.OPEN_WORKSPACE.create(window);
    register(openWorkspaceAction);

    projectPropertyDialogAction = IDEActionFactory.OPEN_PROJECT_PROPERTIES.create(window);
    register(projectPropertyDialogAction);

    if (window.getWorkbench().getIntroManager().hasIntro()) {
        introAction = ActionFactory.INTRO.create(window);
        register(introAction);
    }

    String showInQuickMenuId = "org.eclipse.ui.navigate.showInQuickMenu"; //$NON-NLS-1$
    showInQuickMenu = new QuickMenuAction(showInQuickMenuId) {
        protected void fillMenu(IMenuManager menu) {
            menu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(window));
        }
    };
    register(showInQuickMenu);

    //        final String newQuickMenuId = "org.eclipse.ui.file.newQuickMenu"; //$NON-NLS-1$
    //        newQuickMenu = new QuickMenuAction(newQuickMenuId) {
    //            protected void fillMenu(IMenuManager menu) {
    //                menu.add(new NewWizardMenu(window));
    //            }
    //        };
    //        register(newQuickMenu);

    pinEditorContributionItem = ContributionItemFactory.PIN_EDITOR.create(window);

}

From source file:com.bdaum.zoom.rcp.internal.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void makeActions(IWorkbenchWindow window) {
    Action quitAction = new Action(Messages.getString("ApplicationActionBarAdvisor.quit")) { //$NON-NLS-1$
        @Override// w  w w.  j a v  a  2  s  .com
        public void run() {
            BatchActivator.setFastExit(false);
            getActionBarConfigurer().getWindowConfigurer().getWindow().getWorkbench().close();
        }
    };
    quitAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_EXIT);
    quitAction.setToolTipText(
            NLS.bind(Messages.getString("ApplicationActionBarAdvisor.exit_app"), Constants.APPLICATION_NAME)); //$NON-NLS-1$
    quitAction.setId(ActionFactory.QUIT.getId());
    register(quitAction);
    IWorkbenchAction prefAction = ActionFactory.PREFERENCES.create(window);
    prefAction.setActionDefinitionId(IWorkbenchCommandConstants.WINDOW_PREFERENCES);
    register(prefAction);
    register(ActionFactory.PRINT.create(window));
    register(ActionFactory.EDIT_ACTION_SETS.create(window));
    register(ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window));
    register(ActionFactory.RESET_PERSPECTIVE.create(window));
    register(ActionFactory.SAVE_PERSPECTIVE.create(window));
    register(ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window));
    register(ActionFactory.CLOSE_PERSPECTIVE.create(window));
    IWorkbenchAction helpAction = ActionFactory.HELP_CONTENTS.create(window);
    helpAction.setActionDefinitionId(IWorkbenchCommandConstants.HELP_HELP_CONTENTS);
    register(helpAction);
    register(ActionFactory.HELP_SEARCH.create(window));
    register(ActionFactory.ABOUT.create(window));
    register(ActionFactory.INTRO.create(window));
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
    undoStatusLineItem = new ClickableStatusLineContributionItem("UndoContributionItem", //$NON-NLS-1$
            ActionFactory.UNDO.create(window));
    redoStatusLineItem = new ClickableStatusLineContributionItem("RedoContributionItem", //$NON-NLS-1$
            ActionFactory.REDO.create(window));
}

From source file:com.google.dart.tools.deploy.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 *///from   w ww  . j  a v a2  s . c  o  m
@Override
protected void makeActions(final IWorkbenchWindow window) {
    // @issue should obtain from ConfigurationItemFactory
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$

    dartRunAction = new DartRunAction(window);

    deployOptimizedAction = new GenerateJavascriptAction(window);

    generateDartdocAction = new GenerateDartdocAction(window);

    pubInstallAction = RunPubAction.createPubInstallAction(window);

    pubUpdateAction = RunPubAction.createPubUpdateAction(window);

    newApplicationWizardAction = new OpenNewApplicationWizardAction();

    register(newApplicationWizardAction);

    importResourcesAction = ActionFactory.IMPORT.create(window);
    register(importResourcesAction);

    exportResourcesAction = ActionFactory.EXPORT.create(window);
    register(exportResourcesAction);

    cleanAllAction = new CleanLibrariesAction(window);
    register(cleanAllAction);

    saveAction = ActionFactory.SAVE.create(window);
    register(saveAction);

    //TODO (keertip) : re-enable when we have save as implemented
    //    saveAsAction = ActionFactory.SAVE_AS.create(window);
    //    register(saveAsAction);

    saveAllAction = ActionFactory.SAVE_ALL.create(window);
    register(saveAllAction);

    refreshAction = ActionFactory.REFRESH.create(window);
    register(refreshAction);

    newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(getWindow());
    newWindowAction.setText(IDEWorkbenchMessages.Workbench_openNewWindow);
    register(newWindowAction);

    newEditorAction = ActionFactory.NEW_EDITOR.create(window);
    register(newEditorAction);

    copyAction = ActionFactory.COPY.create(window);
    register(copyAction);

    pasteAction = ActionFactory.PASTE.create(window);
    register(pasteAction);

    undoAction = ActionFactory.UNDO.create(window);
    register(undoAction);

    redoAction = ActionFactory.REDO.create(window);
    register(redoAction);

    closeAction = ActionFactory.CLOSE.create(window);
    register(closeAction);

    closeAllAction = ActionFactory.CLOSE_ALL.create(window);
    register(closeAllAction);

    closeOthersAction = ActionFactory.CLOSE_OTHERS.create(window);
    register(closeOthersAction);

    closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
    register(closeAllSavedAction);

    helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
    register(helpContentsAction);

    helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
    register(helpSearchAction);

    aboutAction = new AboutDartAction(window);
    register(aboutAction);

    openPreferencesAction = ActionFactory.PREFERENCES.create(window);
    register(openPreferencesAction);

    makeFeatureDependentActions(window);

    // Actions for invisible accelerators
    showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(showViewMenuAction);

    showPartPaneMenuAction = ActionFactory.SHOW_PART_PANE_MENU.create(window);
    register(showPartPaneMenuAction);

    activateEditorAction = ActionFactory.ACTIVATE_EDITOR.create(window);
    register(activateEditorAction);

    maximizePartAction = ActionFactory.MAXIMIZE.create(window);
    register(maximizePartAction);

    minimizePartAction = ActionFactory.MINIMIZE.create(window);
    register(minimizePartAction);

    switchToEditorAction = ActionFactory.SHOW_OPEN_EDITORS.create(window);
    register(switchToEditorAction);

    workbookEditorsAction = ActionFactory.SHOW_WORKBOOK_EDITORS.create(window);
    register(workbookEditorsAction);

    quickAccessAction = ActionFactory.SHOW_QUICK_ACCESS.create(window);

    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);

    forwardHistoryAction = ActionFactory.FORWARD_HISTORY.create(window);
    register(forwardHistoryAction);

    backwardHistoryAction = ActionFactory.BACKWARD_HISTORY.create(window);
    register(backwardHistoryAction);

    quitAction = ActionFactory.QUIT.create(window);
    register(quitAction);

    goIntoAction = ActionFactory.GO_INTO.create(window);
    register(goIntoAction);

    upAction = ActionFactory.UP.create(window);
    register(upAction);

    String showInQuickMenuId = IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU;
    showInQuickMenu = new QuickMenuAction(showInQuickMenuId) {
        @Override
        protected void fillMenu(IMenuManager menu) {
            menu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(window));
        }
    };
    register(showInQuickMenu);

    final String newQuickMenuId = "org.eclipse.ui.file.newQuickMenu"; //$NON-NLS-1$
    newQuickMenu = new QuickMenuAction(newQuickMenuId) {
        @Override
        protected void fillMenu(IMenuManager menu) {
            menu.add(new NewWizardMenu(window));
        }
    };
    register(newQuickMenu);

    openOnlineDocsAction = new OpenOnlineDocsAction();
    register(openOnlineDocsAction);

    openApiDocsAction = new OpenApiDocsAction();
    register(openApiDocsAction);

    //    if (Util.isCocoa()) {
    //
    //      CommandContributionItemParameter minimizeParam = new CommandContributionItemParameter(window,
    //          null, "org.eclipse.ui.cocoa.minimizeWindow", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
    //      minimizeItem = new CommandContributionItem(minimizeParam);
    //      CommandContributionItemParameter zoomParam = new CommandContributionItemParameter(window,
    //          null, "org.eclipse.ui.cocoa.zoomWindow", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
    //      zoomItem = new CommandContributionItem(zoomParam);
    //      CommandContributionItemParameter arrangeWindowsParam = new CommandContributionItemParameter(
    //          window, null,
    //          "org.eclipse.ui.cocoa.arrangeWindowsInFront", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
    //      arrangeWindowsItem = new CommandContributionItem(arrangeWindowsParam);
    //    }

}

From source file:com.minres.scviewer.ui.TxEditorPart.java

License:Open Source License

@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    // Initialize the editor part
    setSite(site);/*  w ww  . ja va 2  s .  c  o m*/
    setInput(input);
    zoomStatusLineItem = new StatusLineContributionItem("TxEditorZoomContributionItem");
    cursorStatusLineItem = new StatusLineContributionItem("TxEditorCursorContributionItem");
    IActionBars actionBars = getEditorSite().getActionBars();
    IStatusLineManager manager = actionBars.getStatusLineManager();
    manager.add(zoomStatusLineItem);
    manager.add(cursorStatusLineItem);
    actionBars.updateActionBars();
}

From source file:edu.harvard.i2b2.eclipse.ApplicationActionBarAdvisor.java

License:Open Source License

@Override
protected void fillStatusLine(IStatusLineManager statusLine) {
    // TODO Auto-generated method stub
    //super.fillStatusLine(statusLine);
    statusItem = new StatusLineContributionItem("Status");
    statusItem.setText("");
    statusLine.add(statusItem);/* w  w w.  ja  v  a 2  s .co  m*/
}

From source file:org.eclipse.datatools.enablement.rcp.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 *///from   ww w.  jav a  2s  .c  o  m
protected void makeActions(final IWorkbenchWindow window) {
    // @issue should obtain from ConfigurationItemFactory
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$

    newWizardAction = ActionFactory.NEW.create(window);
    register(newWizardAction);

    newWizardDropDownAction = IDEActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
    register(newWizardDropDownAction);

    importResourcesAction = ActionFactory.IMPORT.create(window);
    register(importResourcesAction);

    exportResourcesAction = ActionFactory.EXPORT.create(window);
    register(exportResourcesAction);

    buildAllAction = IDEActionFactory.BUILD.create(window);
    register(buildAllAction);

    cleanAction = IDEActionFactory.BUILD_CLEAN.create(window);
    register(cleanAction);

    toggleAutoBuildAction = IDEActionFactory.BUILD_AUTOMATICALLY.create(window);
    register(toggleAutoBuildAction);

    saveAction = ActionFactory.SAVE.create(window);
    register(saveAction);

    saveAsAction = ActionFactory.SAVE_AS.create(window);
    register(saveAsAction);

    saveAllAction = ActionFactory.SAVE_ALL.create(window);
    register(saveAllAction);

    newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(getWindow());
    newWindowAction.setText(IDEWorkbenchMessages.Workbench_openNewWindow);
    register(newWindowAction);

    newEditorAction = ActionFactory.NEW_EDITOR.create(window);
    register(newEditorAction);

    undoAction = ActionFactory.UNDO.create(window);
    register(undoAction);

    redoAction = ActionFactory.REDO.create(window);
    register(redoAction);

    closeAction = ActionFactory.CLOSE.create(window);
    register(closeAction);

    closeAllAction = ActionFactory.CLOSE_ALL.create(window);
    register(closeAllAction);

    closeOthersAction = ActionFactory.CLOSE_OTHERS.create(window);
    register(closeOthersAction);

    closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
    register(closeAllSavedAction);

    helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
    register(helpContentsAction);

    helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
    register(helpSearchAction);

    dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
    register(dynamicHelpAction);

    aboutAction = ActionFactory.ABOUT.create(window);
    aboutAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
    register(aboutAction);

    openPreferencesAction = ActionFactory.PREFERENCES.create(window);
    register(openPreferencesAction);

    makeFeatureDependentActions(window);

    // Actions for invisible accelerators
    showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(showViewMenuAction);

    showPartPaneMenuAction = ActionFactory.SHOW_PART_PANE_MENU.create(window);
    register(showPartPaneMenuAction);

    nextEditorAction = ActionFactory.NEXT_EDITOR.create(window);
    register(nextEditorAction);
    prevEditorAction = ActionFactory.PREVIOUS_EDITOR.create(window);
    register(prevEditorAction);
    ActionFactory.linkCycleActionPair(nextEditorAction, prevEditorAction);

    nextPartAction = ActionFactory.NEXT_PART.create(window);
    register(nextPartAction);
    prevPartAction = ActionFactory.PREVIOUS_PART.create(window);
    register(prevPartAction);
    ActionFactory.linkCycleActionPair(nextPartAction, prevPartAction);

    nextPerspectiveAction = ActionFactory.NEXT_PERSPECTIVE.create(window);
    register(nextPerspectiveAction);
    prevPerspectiveAction = ActionFactory.PREVIOUS_PERSPECTIVE.create(window);
    register(prevPerspectiveAction);
    ActionFactory.linkCycleActionPair(nextPerspectiveAction, prevPerspectiveAction);

    activateEditorAction = ActionFactory.ACTIVATE_EDITOR.create(window);
    register(activateEditorAction);

    maximizePartAction = ActionFactory.MAXIMIZE.create(window);
    register(maximizePartAction);

    minimizePartAction = ActionFactory.MINIMIZE.create(window);
    register(minimizePartAction);

    switchToEditorAction = ActionFactory.SHOW_OPEN_EDITORS.create(window);
    register(switchToEditorAction);

    workbookEditorsAction = ActionFactory.SHOW_WORKBOOK_EDITORS.create(window);
    register(workbookEditorsAction);

    quickAccessAction = ActionFactory.SHOW_QUICK_ACCESS.create(window);

    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
    savePerspectiveAction = ActionFactory.SAVE_PERSPECTIVE.create(window);
    register(savePerspectiveAction);
    editActionSetAction = ActionFactory.EDIT_ACTION_SETS.create(window);
    register(editActionSetAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);
    resetPerspectiveAction = ActionFactory.RESET_PERSPECTIVE.create(window);
    register(resetPerspectiveAction);
    closePerspAction = ActionFactory.CLOSE_PERSPECTIVE.create(window);
    register(closePerspAction);
    closeAllPerspsAction = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
    register(closeAllPerspsAction);

    forwardHistoryAction = ActionFactory.FORWARD_HISTORY.create(window);
    register(forwardHistoryAction);

    backwardHistoryAction = ActionFactory.BACKWARD_HISTORY.create(window);
    register(backwardHistoryAction);

    quitAction = ActionFactory.QUIT.create(window);
    register(quitAction);

    goIntoAction = ActionFactory.GO_INTO.create(window);
    register(goIntoAction);

    backAction = ActionFactory.BACK.create(window);
    register(backAction);

    forwardAction = ActionFactory.FORWARD.create(window);
    register(forwardAction);

    upAction = ActionFactory.UP.create(window);
    register(upAction);

    nextAction = ActionFactory.NEXT.create(window);
    nextAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_NEXT_NAV));
    register(nextAction);

    previousAction = ActionFactory.PREVIOUS.create(window);
    previousAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_PREVIOUS_NAV));
    register(previousAction);

    buildProjectAction = IDEActionFactory.BUILD_PROJECT.create(window);
    register(buildProjectAction);

    openWorkspaceAction = IDEActionFactory.OPEN_WORKSPACE.create(window);
    register(openWorkspaceAction);

    projectPropertyDialogAction = IDEActionFactory.OPEN_PROJECT_PROPERTIES.create(window);
    register(projectPropertyDialogAction);

    if (window.getWorkbench().getIntroManager().hasIntro()) {
        introAction = ActionFactory.INTRO.create(window);
        register(introAction);
    }

    String showInQuickMenuId = "org.eclipse.ui.navigate.showInQuickMenu"; //$NON-NLS-1$
    showInQuickMenu = new QuickMenuAction(showInQuickMenuId) {
        protected void fillMenu(IMenuManager menu) {
            menu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(window));
        }
    };
    register(showInQuickMenu);

    final String newQuickMenuId = "org.eclipse.ui.file.newQuickMenu"; //$NON-NLS-1$
    newQuickMenu = new QuickMenuAction(newQuickMenuId) {
        protected void fillMenu(IMenuManager menu) {
            menu.add(new NewWizardMenu(window));
        }
    };
    register(newQuickMenu);

    pinEditorContributionItem = ContributionItemFactory.PIN_EDITOR.create(window);

    //        searchComboItem = ContributionItemFactory.HELP_SEARCH.create(window);
}

From source file:org.eclipse.debug.internal.ui.views.variables.details.DefaultDetailPane.java

License:Open Source License

/**
 * Creates listeners and other components that should only be added to the
 * source viewer when this detail pane is inside a view.
 *//*from w ww  . j  a v a 2  s  .  c  o m*/
private void createViewSpecificComponents() {

    // Add a document listener so actions get updated when the document changes
    getDetailDocument().addDocumentListener(new IDocumentListener() {
        public void documentAboutToBeChanged(DocumentEvent event) {
        }

        public void documentChanged(DocumentEvent event) {
            updateSelectionDependentActions();
        }
    });

    // Add the selection listener so selection dependent actions get updated.
    fSourceViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            updateSelectionDependentActions();
        }
    });

    // Add a focus listener to update actions when details area gains focus
    fSourceViewer.getControl().addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) {
            setGlobalAction(IDebugView.SELECT_ALL_ACTION, getAction(DETAIL_SELECT_ALL_ACTION));
            setGlobalAction(IDebugView.CUT_ACTION, getAction(DETAIL_CUT_ACTION));
            setGlobalAction(IDebugView.COPY_ACTION, getAction(DETAIL_COPY_ACTION));
            setGlobalAction(IDebugView.PASTE_ACTION, getAction(DETAIL_PASTE_ACTION));
            setGlobalAction(IDebugView.FIND_ACTION, getAction(DETAIL_FIND_REPLACE_TEXT_ACTION));
            IAction action = getAction(DETAIL_ASSIGN_VALUE_ACTION);
            setGlobalAction(action.getActionDefinitionId(), action);
            action = getAction(DETAIL_CONTENT_ASSIST_ACTION);
            setGlobalAction(action.getActionDefinitionId(), action);

            getViewSite().getActionBars().updateActionBars();

            updateAction(DETAIL_FIND_REPLACE_TEXT_ACTION);

        }

        public void focusLost(FocusEvent e) {
            setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
            setGlobalAction(IDebugView.CUT_ACTION, null);
            setGlobalAction(IDebugView.COPY_ACTION, null);
            setGlobalAction(IDebugView.PASTE_ACTION, null);
            setGlobalAction(IDebugView.FIND_ACTION, null);
            setGlobalAction(getAction(DETAIL_ASSIGN_VALUE_ACTION).getActionDefinitionId(), null);
            setGlobalAction(getAction(DETAIL_CONTENT_ASSIST_ACTION).getActionDefinitionId(), null);

            getViewSite().getActionBars().updateActionBars();

        }
    });

    // Create a status line item displaying the current cursor location
    fStatusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$
    IStatusLineManager manager = getViewSite().getActionBars().getStatusLineManager();
    manager.add(fStatusLineItem);
    fSourceViewer.getTextWidget().addMouseListener(getCursorListener());
    fSourceViewer.getTextWidget().addKeyListener(getCursorListener());

    // Add a context menu to the detail area
    createDetailContextMenu(fSourceViewer.getTextWidget());

}

From source file:org.eclipse.tm.te.rcp.application.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 *//*from w w  w . j  a v a 2 s .c  o m*/
@Override
protected void makeActions(final IWorkbenchWindow window) {
    // @issue should obtain from ConfigurationItemFactory
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$

    newWizardAction = ActionFactory.NEW.create(window);
    register(newWizardAction);

    newWizardDropDownAction = IDEActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
    register(newWizardDropDownAction);

    importResourcesAction = ActionFactory.IMPORT.create(window);
    register(importResourcesAction);

    exportResourcesAction = ActionFactory.EXPORT.create(window);
    register(exportResourcesAction);

    saveAction = ActionFactory.SAVE.create(window);
    register(saveAction);

    saveAsAction = ActionFactory.SAVE_AS.create(window);
    register(saveAsAction);

    saveAllAction = ActionFactory.SAVE_ALL.create(window);
    register(saveAllAction);

    newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(getWindow());
    newWindowAction.setText(IDEWorkbenchMessages.Workbench_openNewWindow);
    register(newWindowAction);

    newEditorAction = ActionFactory.NEW_EDITOR.create(window);
    register(newEditorAction);

    undoAction = ActionFactory.UNDO.create(window);
    register(undoAction);

    redoAction = ActionFactory.REDO.create(window);
    register(redoAction);

    closeAction = ActionFactory.CLOSE.create(window);
    register(closeAction);

    closeAllAction = ActionFactory.CLOSE_ALL.create(window);
    register(closeAllAction);

    closeOthersAction = ActionFactory.CLOSE_OTHERS.create(window);
    register(closeOthersAction);

    closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
    register(closeAllSavedAction);

    helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
    register(helpContentsAction);

    helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
    register(helpSearchAction);

    dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
    register(dynamicHelpAction);

    aboutAction = ActionFactory.ABOUT.create(window);
    aboutAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
    register(aboutAction);

    openPreferencesAction = ActionFactory.PREFERENCES.create(window);
    register(openPreferencesAction);

    makeFeatureDependentActions(window);

    // Actions for invisible accelerators
    showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(showViewMenuAction);

    showPartPaneMenuAction = ActionFactory.SHOW_PART_PANE_MENU.create(window);
    register(showPartPaneMenuAction);

    nextEditorAction = ActionFactory.NEXT_EDITOR.create(window);
    register(nextEditorAction);
    prevEditorAction = ActionFactory.PREVIOUS_EDITOR.create(window);
    register(prevEditorAction);
    ActionFactory.linkCycleActionPair(nextEditorAction, prevEditorAction);

    nextPartAction = ActionFactory.NEXT_PART.create(window);
    register(nextPartAction);
    prevPartAction = ActionFactory.PREVIOUS_PART.create(window);
    register(prevPartAction);
    ActionFactory.linkCycleActionPair(nextPartAction, prevPartAction);

    nextPerspectiveAction = ActionFactory.NEXT_PERSPECTIVE.create(window);
    register(nextPerspectiveAction);
    prevPerspectiveAction = ActionFactory.PREVIOUS_PERSPECTIVE.create(window);
    register(prevPerspectiveAction);
    ActionFactory.linkCycleActionPair(nextPerspectiveAction, prevPerspectiveAction);

    activateEditorAction = ActionFactory.ACTIVATE_EDITOR.create(window);
    register(activateEditorAction);

    maximizePartAction = ActionFactory.MAXIMIZE.create(window);
    register(maximizePartAction);

    minimizePartAction = ActionFactory.MINIMIZE.create(window);
    register(minimizePartAction);

    switchToEditorAction = ActionFactory.SHOW_OPEN_EDITORS.create(window);
    register(switchToEditorAction);

    workbookEditorsAction = ActionFactory.SHOW_WORKBOOK_EDITORS.create(window);
    register(workbookEditorsAction);

    quickAccessAction = ActionFactory.SHOW_QUICK_ACCESS.create(window);

    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
    savePerspectiveAction = ActionFactory.SAVE_PERSPECTIVE.create(window);
    register(savePerspectiveAction);
    editActionSetAction = ActionFactory.EDIT_ACTION_SETS.create(window);
    register(editActionSetAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);
    resetPerspectiveAction = ActionFactory.RESET_PERSPECTIVE.create(window);
    register(resetPerspectiveAction);
    closePerspAction = ActionFactory.CLOSE_PERSPECTIVE.create(window);
    register(closePerspAction);
    closeAllPerspsAction = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
    register(closeAllPerspsAction);

    forwardHistoryAction = ActionFactory.FORWARD_HISTORY.create(window);
    register(forwardHistoryAction);

    backwardHistoryAction = ActionFactory.BACKWARD_HISTORY.create(window);
    register(backwardHistoryAction);

    quitAction = ActionFactory.QUIT.create(window);
    register(quitAction);

    goIntoAction = ActionFactory.GO_INTO.create(window);
    register(goIntoAction);

    backAction = ActionFactory.BACK.create(window);
    register(backAction);

    forwardAction = ActionFactory.FORWARD.create(window);
    register(forwardAction);

    upAction = ActionFactory.UP.create(window);
    register(upAction);

    nextAction = ActionFactory.NEXT.create(window);
    nextAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_NEXT_NAV));
    register(nextAction);

    previousAction = ActionFactory.PREVIOUS.create(window);
    previousAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_PREVIOUS_NAV));
    register(previousAction);

    if (window.getWorkbench().getIntroManager().hasIntro()) {
        introAction = ActionFactory.INTRO.create(window);
        register(introAction);
    }

    String showInQuickMenuId = IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU;
    showInQuickMenu = new QuickMenuAction(showInQuickMenuId) {
        @Override
        protected void fillMenu(IMenuManager menu) {
            menu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(window));
        }
    };
    register(showInQuickMenu);

    final String newQuickMenuId = "org.eclipse.ui.file.newQuickMenu"; //$NON-NLS-1$
    newQuickMenu = new QuickMenuAction(newQuickMenuId) {
        @Override
        protected void fillMenu(IMenuManager menu) {
            menu.add(new NewWizardMenu(window));
        }
    };
    register(newQuickMenu);

}

From source file:org.eclipse.ui.internal.ide.WorkbenchActionBuilder.java

License:Open Source License

/**
 * Creates actions (and contribution items) for the menu bar, toolbar and status line.
 *///  www  . ja  v  a  2s  .co m
protected void makeActions(final IWorkbenchWindow window) {
    // @issue should obtain from ConfigurationItemFactory
    statusLineItem = new StatusLineContributionItem("ModeContributionItem"); //$NON-NLS-1$

    newWizardAction = ActionFactory.NEW.create(window);
    register(newWizardAction);

    newWizardDropDownAction = IDEActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
    register(newWizardDropDownAction);

    importResourcesAction = ActionFactory.IMPORT.create(window);
    register(importResourcesAction);

    exportResourcesAction = ActionFactory.EXPORT.create(window);
    register(exportResourcesAction);

    buildAllAction = IDEActionFactory.BUILD.create(window);
    register(buildAllAction);

    cleanAction = IDEActionFactory.BUILD_CLEAN.create(window);
    register(cleanAction);

    toggleAutoBuildAction = IDEActionFactory.BUILD_AUTOMATICALLY.create(window);
    register(toggleAutoBuildAction);

    saveAction = ActionFactory.SAVE.create(window);
    register(saveAction);

    saveAsAction = ActionFactory.SAVE_AS.create(window);
    register(saveAsAction);

    saveAllAction = ActionFactory.SAVE_ALL.create(window);
    register(saveAllAction);

    newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(getWindow());
    newWindowAction.setText(IDEWorkbenchMessages.Workbench_openNewWindow);
    register(newWindowAction);

    newEditorAction = ActionFactory.NEW_EDITOR.create(window);
    register(newEditorAction);

    undoAction = ActionFactory.UNDO.create(window);
    register(undoAction);

    redoAction = ActionFactory.REDO.create(window);
    register(redoAction);

    closeAction = ActionFactory.CLOSE.create(window);
    register(closeAction);

    closeAllAction = ActionFactory.CLOSE_ALL.create(window);
    register(closeAllAction);

    closeOthersAction = ActionFactory.CLOSE_OTHERS.create(window);
    register(closeOthersAction);

    closeAllSavedAction = ActionFactory.CLOSE_ALL_SAVED.create(window);
    register(closeAllSavedAction);

    helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
    register(helpContentsAction);

    helpSearchAction = ActionFactory.HELP_SEARCH.create(window);
    register(helpSearchAction);

    dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create(window);
    register(dynamicHelpAction);

    aboutAction = ActionFactory.ABOUT.create(window);
    aboutAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
    register(aboutAction);

    openPreferencesAction = ActionFactory.PREFERENCES.create(window);
    register(openPreferencesAction);

    makeFeatureDependentActions(window);

    // Actions for invisible accelerators
    showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
    register(showViewMenuAction);

    showPartPaneMenuAction = ActionFactory.SHOW_PART_PANE_MENU.create(window);
    register(showPartPaneMenuAction);

    nextEditorAction = ActionFactory.NEXT_EDITOR.create(window);
    register(nextEditorAction);
    prevEditorAction = ActionFactory.PREVIOUS_EDITOR.create(window);
    register(prevEditorAction);
    ActionFactory.linkCycleActionPair(nextEditorAction, prevEditorAction);

    nextPartAction = ActionFactory.NEXT_PART.create(window);
    register(nextPartAction);
    prevPartAction = ActionFactory.PREVIOUS_PART.create(window);
    register(prevPartAction);
    ActionFactory.linkCycleActionPair(nextPartAction, prevPartAction);

    nextPerspectiveAction = ActionFactory.NEXT_PERSPECTIVE.create(window);
    register(nextPerspectiveAction);
    prevPerspectiveAction = ActionFactory.PREVIOUS_PERSPECTIVE.create(window);
    register(prevPerspectiveAction);
    ActionFactory.linkCycleActionPair(nextPerspectiveAction, prevPerspectiveAction);

    activateEditorAction = ActionFactory.ACTIVATE_EDITOR.create(window);
    register(activateEditorAction);

    maximizePartAction = ActionFactory.MAXIMIZE.create(window);
    register(maximizePartAction);

    minimizePartAction = ActionFactory.MINIMIZE.create(window);
    register(minimizePartAction);

    switchToEditorAction = ActionFactory.SHOW_OPEN_EDITORS.create(window);
    register(switchToEditorAction);

    workbookEditorsAction = ActionFactory.SHOW_WORKBOOK_EDITORS.create(window);
    register(workbookEditorsAction);

    quickAccessAction = ActionFactory.SHOW_QUICK_ACCESS.create(window);

    hideShowEditorAction = ActionFactory.SHOW_EDITOR.create(window);
    register(hideShowEditorAction);
    editActionSetAction = ActionFactory.EDIT_ACTION_SETS.create(window);
    register(editActionSetAction);
    lockToolBarAction = ActionFactory.LOCK_TOOL_BAR.create(window);
    register(lockToolBarAction);
    closePerspAction = ActionFactory.CLOSE_PERSPECTIVE.create(window);
    register(closePerspAction);
    closeAllPerspsAction = ActionFactory.CLOSE_ALL_PERSPECTIVES.create(window);
    register(closeAllPerspsAction);

    forwardHistoryAction = ActionFactory.FORWARD_HISTORY.create(window);
    register(forwardHistoryAction);

    backwardHistoryAction = ActionFactory.BACKWARD_HISTORY.create(window);
    register(backwardHistoryAction);

    quitAction = ActionFactory.QUIT.create(window);
    register(quitAction);

    goIntoAction = ActionFactory.GO_INTO.create(window);
    register(goIntoAction);

    backAction = ActionFactory.BACK.create(window);
    register(backAction);

    forwardAction = ActionFactory.FORWARD.create(window);
    register(forwardAction);

    upAction = ActionFactory.UP.create(window);
    register(upAction);

    nextAction = ActionFactory.NEXT.create(window);
    nextAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_NEXT_NAV));
    register(nextAction);

    previousAction = ActionFactory.PREVIOUS.create(window);
    previousAction.setImageDescriptor(
            IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_ETOOL_PREVIOUS_NAV));
    register(previousAction);

    buildProjectAction = IDEActionFactory.BUILD_PROJECT.create(window);
    register(buildProjectAction);

    openWorkspaceAction = IDEActionFactory.OPEN_WORKSPACE.create(window);
    register(openWorkspaceAction);

    projectPropertyDialogAction = IDEActionFactory.OPEN_PROJECT_PROPERTIES.create(window);
    register(projectPropertyDialogAction);

    if (window.getWorkbench().getIntroManager().hasIntro()) {
        introAction = ActionFactory.INTRO.create(window);
        register(introAction);
    }

    String showInQuickMenuId = IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU;
    showInQuickMenu = new QuickMenuAction(showInQuickMenuId) {
        protected void fillMenu(IMenuManager menu) {
            menu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(window));
        }
    };
    register(showInQuickMenu);

    final String newQuickMenuId = "org.eclipse.ui.file.newQuickMenu"; //$NON-NLS-1$
    newQuickMenu = new QuickMenuAction(newQuickMenuId) {
        protected void fillMenu(IMenuManager menu) {
            menu.add(new NewWizardMenu(window));
        }
    };
    register(newQuickMenu);

    if (Util.isCocoa()) {

        CommandContributionItemParameter minimizeParam = new CommandContributionItemParameter(window, null,
                "org.eclipse.ui.cocoa.minimizeWindow", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
        minimizeItem = new CommandContributionItem(minimizeParam);
        CommandContributionItemParameter zoomParam = new CommandContributionItemParameter(window, null,
                "org.eclipse.ui.cocoa.zoomWindow", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
        zoomItem = new CommandContributionItem(zoomParam);
        CommandContributionItemParameter fullscreenParam = new CommandContributionItemParameter(window, null,
                "org.eclipse.ui.cocoa.fullscreenWindow", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
        fullscreenItem = new CommandContributionItem(fullscreenParam);
        CommandContributionItemParameter arrangeWindowsParam = new CommandContributionItemParameter(window,
                null, "org.eclipse.ui.cocoa.arrangeWindowsInFront", CommandContributionItem.STYLE_PUSH); //$NON-NLS-1$
        arrangeWindowsItem = new CommandContributionItem(arrangeWindowsParam);
    }

}