Search in sources :

Example 46 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project tdi-studio-se by Talend.

the class AbstractJvmPropertySection method deactivateSection.

/**
     * Deactivates the section.
     */
protected void deactivateSection() {
    isSectionActivated = false;
    if (pageBook.isDisposed() || messagePage.isDisposed() || messageLabel.isDisposed()) {
        return;
    }
    // remove tool bar actions
    IToolBarManager toolBarManager = getToolBarManager();
    if (toolBarManager != null) {
        removeToolBarActions(toolBarManager);
        toolBarManager.update(false);
        updateActionBars();
    }
    // remove local menus
    IMenuManager menuManager = getMenuManager();
    if (menuManager != null) {
        menuManager.remove(preferencesAction.getId());
        removeLocalMenus(menuManager);
        menuManager.update(false);
        updateActionBars();
    }
    // clear status line
    clearStatusLine();
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IMenuManager(org.eclipse.jface.action.IMenuManager)

Example 47 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project eclipse.platform.text by eclipse.

the class AbstractTemplatesPage method fillToolbar.

/**
 * Fill the toolbar.
 *
 * @param actionBars the action bars
 */
private void fillToolbar(IActionBars actionBars) {
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    toolBarManager.add(fInsertAction);
    toolBarManager.add(fAddAction);
    toolBarManager.add(fEditAction);
    toolBarManager.add(fRemoveAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(fLinkWithEditorAction);
    toolBarManager.add(fCollapseAllAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) Separator(org.eclipse.jface.action.Separator)

Example 48 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project linuxtools by eclipse.

the class RpmConsolePageParticipant method init.

@Override
public void init(IPageBookViewPage page, IConsole console) {
    if (!(console instanceof RpmConsole)) {
        return;
    }
    IToolBarManager manager = page.getSite().getActionBars().getToolBarManager();
    StopBuildAction stopBuildAction = new StopBuildAction((RpmConsole) console);
    manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, stopBuildAction);
    CloseConsoleAction closeConsoleAction = new CloseConsoleAction((RpmConsole) console);
    manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeConsoleAction);
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager)

Example 49 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project linuxtools by eclipse.

the class CallgraphView method createPartControl.

/**
 * This is a callback that will allow us to create the viewer and
 * initialize it.
 */
@Override
public void createPartControl(Composite parent) {
    if (masterComposite != null) {
        masterComposite.dispose();
    }
    masterComposite = parent;
    GridLayout layout = new GridLayout(2, false);
    layout.horizontalSpacing = 0;
    GridData gd = new GridData(100, 100);
    parent.setLayout(layout);
    parent.setLayoutData(gd);
    // LOAD ALL ACTIONS
    createActions();
    // MENU FOR SYSTEMTAP BUTTONS
    IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
    // MENU FOR SYSTEMTAP GRAPH OPTIONS
    IMenuManager menu = getViewSite().getActionBars().getMenuManager();
    // ADD OPTIONS TO THE GRAPH MENU
    addFileMenu();
    saveCurDot = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.getString("CallgraphView.SaveViewAsDot")) {

        @Override
        public void run() {
            writeToDot(g.getCollapseMode(), g.nodeMap.keySet());
        }
    };
    saveDot = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.getString("CallgraphView.SaveAllUncollapsedAsDot")) {

        @Override
        public void run() {
            writeToDot(false, g.nodeDataMap.keySet());
        }
    };
    saveColDot = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.getString("CallgraphView.SaveAllCollapsedAsDot")) {

        @Override
        public void run() {
            writeToDot(true, g.nodeDataMap.keySet());
        }
    };
    saveText = new // $NON-NLS-1$
    Action(// $NON-NLS-1$
    Messages.getString("CallgraphView.SaveCollapsedAsASCII")) {

        @Override
        public void run() {
            saveTextAction();
        }
    };
    // $NON-NLS-1$
    IMenuManager saveMenu = new MenuManager(Messages.getString("CallgraphView.SaveMenu"));
    file.add(saveMenu);
    saveMenu.add(saveCurDot);
    saveMenu.add(saveColDot);
    saveMenu.add(saveText);
    saveMenu.add(saveDot);
    // $NON-NLS-1$
    IMenuManager view = new MenuManager(Messages.getString("CallgraphView.ViewMenu"));
    // $NON-NLS-1$
    IMenuManager animation = new MenuManager(Messages.getString("CallgraphView.AnimationMenu"));
    // $NON-NLS-1$
    IMenuManager markers = new MenuManager(Messages.getString("CallgraphView.Markers"));
    // $NON-NLS-1$
    IMenuManager gotoMenu = new MenuManager(Messages.getString("CallgraphView.GoTo"));
    menu.add(view);
    menu.add(gotoMenu);
    addHelpMenu();
    view.add(viewTreeview);
    view.add(viewRadialview);
    view.add(viewAggregateview);
    view.add(viewLevelview);
    view.add(getViewRefresh());
    view.add(modeCollapsedNodes);
    view.add(limits);
    view.add(animation);
    gotoMenu.add(play);
    gotoMenu.add(gotoPrevious);
    gotoMenu.add(gotoNext);
    gotoMenu.add(gotoLast);
    gotoMenu.add(markers);
    addKillButton();
    mgr.add(play);
    mgr.add(viewRadialview);
    mgr.add(viewTreeview);
    mgr.add(viewLevelview);
    mgr.add(viewAggregateview);
    mgr.add(modeCollapsedNodes);
    markers.add(markersNext);
    markers.add(markersPrevious);
    animation.add(animationSlow);
    animation.add(animationFast);
    setGraphOptions(false);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) IToolBarManager(org.eclipse.jface.action.IToolBarManager) GridData(org.eclipse.swt.layout.GridData) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager)

Example 50 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project linuxtools by eclipse.

the class ScriptConsolePageParticipant method init.

@Override
public void init(IPageBookViewPage page, IConsole iConsole) {
    if (!(iConsole instanceof ScriptConsole)) {
        return;
    }
    fPage = page;
    fConsole = (ScriptConsole) iConsole;
    fView = (IConsoleView) fPage.getSite().getPage().findView(IConsoleConstants.ID_CONSOLE_VIEW);
    StopScriptAction stopScriptAction = new StopScriptAction(fConsole);
    CloseStapConsoleAction closeConsoleAction = new CloseStapConsoleAction(fConsole);
    SaveLogAction saveLogAction = new SaveLogAction(fConsole);
    // contribute to toolbar
    IToolBarManager manager = fPage.getSite().getActionBars().getToolBarManager();
    manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, stopScriptAction);
    manager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, closeConsoleAction);
    manager.appendToGroup(IConsoleConstants.OUTPUT_GROUP, saveLogAction);
    // TODO if {@link ModifyParsingAction} is restored, it is to be used here,
    // in the same way stopScriptAction and saveLogAction are used.
    DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).addDebugContextListener(this);
}
Also used : ScriptConsole(org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole) SaveLogAction(org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.SaveLogAction) IToolBarManager(org.eclipse.jface.action.IToolBarManager) StopScriptAction(org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.StopScriptAction) CloseStapConsoleAction(org.eclipse.linuxtools.internal.systemtap.ui.consolelog.actions.CloseStapConsoleAction)

Aggregations

IToolBarManager (org.eclipse.jface.action.IToolBarManager)58 IActionBars (org.eclipse.ui.IActionBars)20 Action (org.eclipse.jface.action.Action)18 Separator (org.eclipse.jface.action.Separator)10 IMenuManager (org.eclipse.jface.action.IMenuManager)9 ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)8 IAction (org.eclipse.jface.action.IAction)7 RecordAction (com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction)6 ToolBarManager (org.eclipse.jface.action.ToolBarManager)6 IContributionItem (org.eclipse.jface.action.IContributionItem)5 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)5 GridData (org.eclipse.swt.layout.GridData)5 MenuManager (org.eclipse.jface.action.MenuManager)4 ISelection (org.eclipse.jface.viewers.ISelection)4 DropDownAction (com.cubrid.common.ui.common.action.DropDownAction)3 ActionManager (com.cubrid.common.ui.spi.action.ActionManager)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 TableLayout (org.eclipse.jface.viewers.TableLayout)3 Composite (org.eclipse.swt.widgets.Composite)3