use of org.eclipse.ui.IActionBars in project dbeaver by serge-rider.
the class EntityEditorContributor method registerSearchActions.
public static void registerSearchActions(IEditorPart activeEditor) {
if (activeEditor == null) {
return;
}
IActionBars actionBars = activeEditor.getEditorSite().getActionBars();
if (activeEditor instanceof ISearchContextProvider) {
ISearchContextProvider provider = (ISearchContextProvider) activeEditor;
if (provider.isSearchPossible()) {
ContextSearchAction findAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.NONE);
findAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
actionBars.setGlobalActionHandler(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE, findAction);
ContextSearchAction findNextAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.NEXT);
findNextAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_NEXT);
actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_NEXT, findNextAction);
ContextSearchAction findPrevAction = new ContextSearchAction(provider, ISearchContextProvider.SearchType.PREVIOUS);
findPrevAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_PREVIOUS);
actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_PREVIOUS, findPrevAction);
}
} else {
actionBars.setGlobalActionHandler(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE, null);
actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_NEXT, null);
actionBars.setGlobalActionHandler(IWorkbenchActionDefinitionIds.FIND_PREVIOUS, null);
}
actionBars.updateActionBars();
}
use of org.eclipse.ui.IActionBars 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);
}
use of org.eclipse.ui.IActionBars 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);
}
use of org.eclipse.ui.IActionBars 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);
}
use of org.eclipse.ui.IActionBars in project cubrid-manager by CUBRID.
the class CubridQueryNavigatorView method hookRetragetActions.
/**
* Hook the global actions in bars
*/
protected void hookRetragetActions() {
IActionBars bar = this.getViewSite().getActionBars();
bar.setGlobalActionHandler(ActionFactory.COPY.getId(), ActionManager.getInstance().getAction(CopyQueryConnAction.ID));
bar.setGlobalActionHandler(ActionFactory.PASTE.getId(), ActionManager.getInstance().getAction(PasteQueryConnAction.ID));
bar.updateActionBars();
}
Aggregations