use of org.eclipse.ui.services.IServiceLocator in project tdi-studio-se by Talend.
the class MultiPageSqlBuilderEditor method createPartControl2.
public final void createPartControl2(Composite parent) {
//super.createPartControl(parent);
Composite pageContainer = createPageContainer(parent);
this.container = createContainer(pageContainer);
createPages();
// done
if (getActivePage() == -1) {
setActivePage(0);
IEditorPart part = getEditor(0);
if (part != null) {
final IServiceLocator serviceLocator = part.getEditorSite();
if (serviceLocator instanceof INestable) {
activeServiceLocator = (INestable) serviceLocator;
activeServiceLocator.activate();
}
}
}
}
use of org.eclipse.ui.services.IServiceLocator in project dbeaver by serge-rider.
the class NodeListControl method openNodeEditor.
protected void openNodeEditor(DBNNode node) {
IServiceLocator serviceLocator = workbenchSite != null ? workbenchSite : DBeaverUI.getActiveWorkbenchWindow();
NavigatorUtils.executeNodeAction(DBXTreeNodeHandler.Action.open, node, serviceLocator);
}
use of org.eclipse.ui.services.IServiceLocator in project dbeaver by dbeaver.
the class NodeListControl method openNodeEditor.
protected void openNodeEditor(DBNNode node) {
IServiceLocator serviceLocator = workbenchSite != null ? workbenchSite : DBeaverUI.getActiveWorkbenchWindow();
NavigatorUtils.executeNodeAction(DBXTreeNodeHandler.Action.open, node, serviceLocator);
}
use of org.eclipse.ui.services.IServiceLocator in project core by jcryptool.
the class ApplicationActionBarAdvisor method createEditMenu.
private IMenuManager createEditMenu() {
MenuManager menu = new MenuManager(Messages.applicationActionBarAdvisor_Menu_Edit, IWorkbenchActionConstants.M_EDIT);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
IServiceLocator serviceLocator = PlatformUI.getWorkbench();
// undo, redo
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_UNDO));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_REDO));
menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
menu.add(new Separator());
// cut, copy, paste
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_CUT));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_COPY));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_PASTE));
menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
menu.add(new Separator());
// delete, select all
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_DELETE));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_SELECT_ALL));
menu.add(new Separator());
// find
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE));
menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
// provide a uniform location for the "show in" or "open with" actions
// $NON-NLS-1$
MenuManager showin = new MenuManager(Messages.ApplicationActionBarAdvisor_1, "showin");
// $NON-NLS-1$
showin.add(new GroupMarker("start"));
menu.add(showin);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
use of org.eclipse.ui.services.IServiceLocator in project core by jcryptool.
the class ApplicationActionBarAdvisor method fillCoolBar.
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
// ToolBar File & Additions
IToolBarManager fileToolBar = new ToolBarManager(coolBar.getStyle());
IServiceLocator serviceLocator = PlatformUI.getWorkbench();
fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE));
fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE_ALL));
fileToolBar.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_PRINT));
fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
fileToolBar.add(new Separator());
fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
// $NON-NLS-1$
coolBar.add(new ToolBarContributionItem(fileToolBar, CorePlugin.PLUGIN_ID + ".toolbar"));
// ToolBar Help
IToolBarManager helpToolBar = new ToolBarManager(coolBar.getStyle());
// $NON-NLS-1$
coolBar.add(new ToolBarContributionItem(helpToolBar, CorePlugin.PLUGIN_ID + ".helpToolBar"));
// CoolBar Context Menu
// $NON-NLS-1$
MenuManager coolBarContextMenuManager = new MenuManager(null, CorePlugin.PLUGIN_ID + ".contextMenu");
coolBar.setContextMenuManager(coolBarContextMenuManager);
coolBarContextMenuManager.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.WINDOW_LOCK_TOOLBAR));
coolBarContextMenuManager.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.WINDOW_CUSTOMIZE_PERSPECTIVE));
coolBarContextMenuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
Aggregations