Search in sources :

Example 11 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.

the class ActionBuilder method buildToolBar.

/**
	 * Build CUBRID Manager toolBar
	 *
	 * @param parent the coolbar manager
	 * @return the toolbar manager
	 */
public IToolBarManager[] buildToolBar(ICoolBarManager parent) {
    IToolBarManager newToolbarManager = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    newToolbarManager.add(ActionManager.getInstance().getAction(AddHostAction.ID));
    newToolbarManager.add(ActionManager.getInstance().getAction(CreateDatabaseAction.ID));
    newToolbarManager.add(ActionManager.getInstance().getAction(QueryNewAction.ID));
    parent.add(newToolbarManager);
    IToolBarManager statusToolbarManager = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    statusToolbarManager.add(ActionManager.getInstance().getAction(StartRetargetAction.ID));
    statusToolbarManager.add(ActionManager.getInstance().getAction(StopRetargetAction.ID));
    parent.add(statusToolbarManager);
    return new IToolBarManager[] { newToolbarManager, statusToolbarManager };
}
Also used : IToolBarManager(org.eclipse.jface.action.IToolBarManager) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager)

Example 12 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.

the class AbsActionAdvisor method getToolbarManaeger.

protected IToolBarManager getToolbarManaeger(ICoolBarManager coolBarManager) {
    IToolBarManager newToolbarManager = null;
    for (IContributionItem item : coolBarManager.getItems()) {
        if (item instanceof ToolBarContributionItem && "new1".equals(item.getId())) {
            ToolBarContributionItem toolBarContributionItem = (ToolBarContributionItem) item;
            newToolbarManager = toolBarContributionItem.getToolBarManager();
            break;
        // }
        }
    }
    return newToolbarManager;
}
Also used : ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IContributionItem(org.eclipse.jface.action.IContributionItem)

Example 13 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.

the class HostSystemMonitorViewPart method makeActions.

/**
	 * This method is to create actions at tool bar
	 *
	 */
private void makeActions() {
    Action settingAction = new Action() {

        public void run() {
            compositePart.fireChartSetting();
        }
    };
    settingAction.setText(Messages.chartSettingTxt);
    settingAction.setToolTipText(Messages.chartSettingTxt);
    settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    final IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(settingAction);
    RecordAction recordAction = new RecordAction();
    recordAction.setRecorder(this);
    recordAction.setPrepareTooltip(Messages.hostSysMonStartRecordTooltip);
    recordAction.setRecordTooltip(Messages.hostSysMonRecordingTooltip);
    recordAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/monitor/prepare_record.png"));
    recordAction.setToolTipText(Messages.hostSysMonStartRecordTooltip);
    manager.add(recordAction);
}
Also used : RecordAction(com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction) Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) RecordAction(com.cubrid.cubridmanager.ui.monitoring.editor.internal.RecordAction) IActionBars(org.eclipse.ui.IActionBars)

Example 14 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.

the class DbStatusHistoryViewPart method makeActions.

/**
	 * This method is to create actions at tool bar
	 * 
	 */
private void makeActions() {
    Action settingAction = new Action() {

        public void run() {
            chartPart.fireChartSetting();
        }
    };
    settingAction.setText(Messages.chartSettingTxt);
    settingAction.setToolTipText(Messages.chartSettingTxt);
    settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(dbCombo);
    manager.add(new Separator());
    manager.add(settingAction);
}
Also used : Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars) Separator(org.eclipse.jface.action.Separator)

Example 15 with IToolBarManager

use of org.eclipse.jface.action.IToolBarManager in project cubrid-manager by CUBRID.

the class DbSystemMonitorHistoryViewPart method makeActions.

/**
	 * This method is to create actions at tool bar
	 *
	 */
private void makeActions() {
    Action settingAction = new Action() {

        public void run() {
            fireChartSetting();
        }
    };
    settingAction.setText(Messages.chartSettingTxt);
    settingAction.setToolTipText(Messages.chartSettingTxt);
    settingAction.setImageDescriptor(CubridManagerUIPlugin.getImageDescriptor("icons/action/setting-small.png"));
    final IActionBars bars = getViewSite().getActionBars();
    IToolBarManager manager = bars.getToolBarManager();
    manager.add(dbCombo);
    manager.add(new Separator());
    manager.add(settingAction);
}
Also used : Action(org.eclipse.jface.action.Action) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IActionBars(org.eclipse.ui.IActionBars) Separator(org.eclipse.jface.action.Separator)

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