예제 #1
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 public static void removeFocusTracker(IServiceLocator serviceLocator, Control control) {
   if (PlatformUI.getWorkbench().isClosing()) {
     // TODO: it is a bug in eclipse. During workbench shutdown disposed service returned.
     return;
   }
   final IFocusService focusService = serviceLocator.getService(IFocusService.class);
   if (focusService != null) {
     focusService.removeFocusTracker(control);
   } else {
     log.debug("Focus service not found in " + serviceLocator);
   }
 }
예제 #2
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 public static boolean isContextActive(String contextId) {
   Collection<?> contextIds =
       PlatformUI.getWorkbench()
           .getActiveWorkbenchWindow()
           .getService(IContextService.class)
           .getActiveContextIds();
   for (Object id : contextIds) {
     if (contextId.equals(id)) {
       return true;
     }
   }
   return false;
 }
예제 #3
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 public static void setHelp(Control control, String pluginId, String helpContextID) {
   PlatformUI.getWorkbench()
       .getHelpSystem()
       .setHelp(control, pluginId + "." + helpContextID); // $NON-NLS-1$
 }
예제 #4
0
파일: UIUtils.java 프로젝트: ralic/dbeaver
 @Nullable
 public static Shell getActiveShell() {
   IWorkbench workbench = PlatformUI.getWorkbench();
   return workbench == null ? null : getShell(workbench.getActiveWorkbenchWindow());
 }