use of org.eclipse.jface.action.Separator in project dbeaver by serge-rider.
the class ContentValueManager method contributeContentActions.
public static void contributeContentActions(@NotNull IContributionManager manager, @NotNull final IValueController controller, final IValueEditor activeEditor) throws DBCException {
if (controller.getValue() instanceof DBDContent && !((DBDContent) controller.getValue()).isNull()) {
manager.add(new Action(CoreMessages.model_jdbc_save_to_file_, DBeaverIcons.getImageDescriptor(UIIcon.SAVE_AS)) {
@Override
public void run() {
DialogUtils.saveToFile(controller);
}
});
}
manager.add(new Action(CoreMessages.model_jdbc_load_from_file_, DBeaverIcons.getImageDescriptor(UIIcon.LOAD)) {
@Override
public void run() {
if (DialogUtils.loadFromFile(controller)) {
try {
activeEditor.primeEditorValue(controller.getValue());
} catch (DBException e) {
UIUtils.showErrorDialog(null, "Load from file", "Error loading contents from file", e);
}
}
}
});
manager.add(new Separator());
}
use of org.eclipse.jface.action.Separator in project dbeaver by serge-rider.
the class BaseTextEditor method editorContextMenuAboutToShow.
@Override
protected void editorContextMenuAboutToShow(IMenuManager menu) {
//super.editorContextMenuAboutToShow(menu);
menu.add(new Separator(ITextEditorActionConstants.GROUP_UNDO));
menu.add(new GroupMarker(ITextEditorActionConstants.GROUP_SAVE));
menu.add(new Separator(ITextEditorActionConstants.GROUP_COPY));
menu.add(new Separator(ITextEditorActionConstants.GROUP_PRINT));
menu.add(new Separator(ITextEditorActionConstants.GROUP_EDIT));
menu.add(new Separator(ITextEditorActionConstants.GROUP_FIND));
menu.add(new Separator(IWorkbenchActionConstants.GROUP_ADD));
menu.add(new Separator(ITextEditorActionConstants.GROUP_REST));
menu.add(new Separator());
menu.add(new GroupMarker(GROUP_SQL_ADDITIONS));
menu.add(new GroupMarker(GROUP_SQL_EXTRAS));
menu.add(new Separator());
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
menu.add(new GroupMarker(GROUP_SQL_PREFERENCES));
if (isEditable()) {
addAction(menu, ITextEditorActionConstants.GROUP_UNDO, ITextEditorActionConstants.UNDO);
addAction(menu, ITextEditorActionConstants.GROUP_SAVE, ITextEditorActionConstants.SAVE);
addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.CUT);
addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.PASTE);
IAction action = getAction(ITextEditorActionConstants.QUICK_ASSIST);
if (action != null && action.isEnabled()) {
addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.QUICK_ASSIST);
}
} else {
addAction(menu, ITextEditorActionConstants.GROUP_COPY, ITextEditorActionConstants.COPY);
}
IAction preferencesAction = getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES);
if (preferencesAction != null) {
menu.appendToGroup(GROUP_SQL_PREFERENCES, preferencesAction);
}
}
use of org.eclipse.jface.action.Separator in project meclipse by flaper87.
the class MeclipseView method fillLocalPullDown.
private void fillLocalPullDown(IMenuManager manager) {
manager.add(connection);
manager.add(new Separator());
}
use of org.eclipse.jface.action.Separator in project meclipse by flaper87.
the class Database method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager manager) {
manager.add(createCollection);
manager.add(new Separator());
manager.add(setProfileLevel0);
manager.add(setProfileLevel1);
manager.add(setProfileLevel2);
manager.add(new Separator());
super.fillContextMenu(manager);
}
use of org.eclipse.jface.action.Separator in project translationstudio8 by heartsome.
the class ApplicationActionBarAdvisor method createHelpMenu.
/**
* 创建帮助菜单
* @return 返回帮助菜单的 menu manager;
*/
private MenuManager createHelpMenu() {
MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.help"), IWorkbenchActionConstants.M_HELP);
// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
menu.add(helpAction);
// menu.add(helpSearchAction);
// menu.add(dynamicHelpAction);
// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
menu.add(new GroupMarker("help.keyAssist"));
menu.add(new Separator());
menu.add(new GroupMarker("help.updatePlugin"));
menu.add(new Separator());
menu.add(new GroupMarker("help.license"));
// 关于菜单需要始终显示在最底端
menu.add(new GroupMarker("group.about"));
// menu.add(aboutItem);
return menu;
}
Aggregations