Java Code Examples for org.eclipse.jface.bindings.BindingManager#setLocale()
The following examples show how to use
org.eclipse.jface.bindings.BindingManager#setLocale() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeyController2.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
private static BindingManager loadModelBackend(IServiceLocator locator) { IBindingService bindingService = (IBindingService) locator.getService(IBindingService.class); BindingManager bindingManager = new BindingManager(new ContextManager(), new CommandManager()); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); try { Scheme modelActiveScheme = null; for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; final Scheme copy = bindingManager.getScheme(scheme.getId()); copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId()); if (definedSchemes[i] == bindingService.getActiveScheme()) { modelActiveScheme = copy; } } bindingManager.setActiveScheme(modelActiveScheme); } catch (final NotDefinedException e) { StatusManager.getManager() .handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ } bindingManager.setLocale(bindingService.getLocale()); bindingManager.setPlatform(bindingService.getPlatform()); bindingManager.setBindings(bindingService.getBindings()); return bindingManager; }
Example 2
Source File: KeyController2.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
private static BindingManager loadModelBackend(IServiceLocator locator) { IBindingService bindingService = (IBindingService) locator.getService(IBindingService.class); BindingManager bindingManager = new BindingManager(new ContextManager(), new CommandManager()); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); try { Scheme modelActiveScheme = null; for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; final Scheme copy = bindingManager.getScheme(scheme.getId()); copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId()); if (definedSchemes[i] == bindingService.getActiveScheme()) { modelActiveScheme = copy; } } bindingManager.setActiveScheme(modelActiveScheme); } catch (final NotDefinedException e) { StatusManager.getManager() .handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ } bindingManager.setLocale(bindingService.getLocale()); bindingManager.setPlatform(bindingService.getPlatform()); bindingManager.setBindings(bindingService.getBindings()); return bindingManager; }
Example 3
Source File: KeyController2.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
private static BindingManager loadModelBackend(IServiceLocator locator) { IBindingService bindingService = (IBindingService) locator.getService(IBindingService.class); BindingManager bindingManager = new BindingManager(new ContextManager(), new CommandManager()); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); try { Scheme modelActiveScheme = null; for (int i = 0; i < definedSchemes.length; i++) { final Scheme scheme = definedSchemes[i]; final Scheme copy = bindingManager.getScheme(scheme.getId()); copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId()); if (definedSchemes[i] == bindingService.getActiveScheme()) { modelActiveScheme = copy; } } bindingManager.setActiveScheme(modelActiveScheme); } catch (final NotDefinedException e) { StatusManager.getManager() .handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH, "Keys page found an undefined scheme", e)); //$NON-NLS-1$ } bindingManager.setLocale(bindingService.getLocale()); bindingManager.setPlatform(bindingService.getPlatform()); bindingManager.setBindings(bindingService.getBindings()); return bindingManager; }