use of org.eclipse.ui.services.IServiceLocator in project core by jcryptool.
the class ApplicationActionBarAdvisor method createFileMenu.
private IMenuManager createFileMenu() {
MenuManager menu = new MenuManager(Messages.applicationActionBarAdvisor_Menu_File, IWorkbenchActionConstants.M_FILE);
IServiceLocator serviceLocator = PlatformUI.getWorkbench();
// $NON-NLS-1$
menu.add(new MenuManager(Messages.applicationActionBarAdvisor_Menu_New_File, "newfile"));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
menu.add(new Separator());
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_CLOSE));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_CLOSE_ALL));
menu.add(new Separator());
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE_AS));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_SAVE_ALL));
menu.add(new Separator());
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_PRINT));
menu.add(ContributionItemFactory.REOPEN_EDITORS.create(window));
menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
menu.add(new Separator());
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.FILE_EXIT));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
use of org.eclipse.ui.services.IServiceLocator in project core by jcryptool.
the class RecordPropertyTester method test.
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
final IServiceLocator locator = (IServiceLocator) receiver;
final ICommandService commandService = (ICommandService) locator.getService(ICommandService.class);
// $NON-NLS-1$
final Command command = commandService.getCommand("org.jcryptool.actions.recordCommand");
// $NON-NLS-1$
return (Boolean) command.getState("org.jcryptool.actions.recordCommand.toggleState").getValue();
}
Aggregations