@Override public IServiceLocator getServiceLocator() { IServiceLocator serviceLocator = fContainer.getServiceLocator(); if (serviceLocator == null && !fContainerProvided) { // The old way to find the service locator return Utilities.findSite(fComposite); } return serviceLocator; }
public IServiceLocator getServiceLocator() { IServiceLocator serviceLocator = fContainer.getServiceLocator(); if (serviceLocator == null && !fContainerProvided) { // The old way to find the service locator return Utilities.findSite(fComposite); } return serviceLocator; }
private void initialize() { if (fHandlerService == null) { IServiceLocator serviceLocator = fContainer.getServiceLocator(); if (serviceLocator != null) { IHandlerService service = serviceLocator.getService(IHandlerService.class); if (service != null) fHandlerService = service; } if (fHandlerService == null && fContainer.getWorkbenchPart() == null && fExpression != null) { // We're in a dialog so we can use an active shell expression IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class); if (service != null) { fHandlerService = service; } } } }
private void initialize() { if (fHandlerService == null) { IServiceLocator serviceLocator = fContainer.getServiceLocator(); if (serviceLocator != null) { IHandlerService service = (IHandlerService)serviceLocator.getService(IHandlerService.class); if (service != null) fHandlerService = service; } if (fHandlerService == null && fContainer.getWorkbenchPart() == null && fExpression != null) { // We're in a dialog so we can use an active shell expression IHandlerService service = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class); if (service != null) { fHandlerService = service; } } } }
public static CompareHandlerService createFor(ICompareContainer container, Shell shell) { IServiceLocator serviceLocator = container.getServiceLocator(); if (serviceLocator != null) { IHandlerService service = serviceLocator.getService(IHandlerService.class); if (service != null) return new CompareHandlerService(container, null); } if (container.getWorkbenchPart() == null && shell != null) { // We're in a dialog so we can use an active shell expression IHandlerService service = PlatformUI.getWorkbench().getService(IHandlerService.class); if (service != null) { Expression e = new ActiveShellExpression(shell); return new CompareHandlerService(container, e); } } return new CompareHandlerService(null, null); }
public static CompareHandlerService createFor(ICompareContainer container, Shell shell) { IServiceLocator serviceLocator = container.getServiceLocator(); if (serviceLocator != null) { IHandlerService service = (IHandlerService)serviceLocator.getService(IHandlerService.class); if (service != null) return new CompareHandlerService(container, null); } if (container.getWorkbenchPart() == null && shell != null) { // We're in a dialog so we can use an active shell expression IHandlerService service = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class); if (service != null) { Expression e = new ActiveShellExpression(shell); return new CompareHandlerService(container, e); } } return new CompareHandlerService(null, null); }