Exemplo n.º 1
0
 @Override
 public boolean test() {
   if (shell == null) {
     return ShellLookup.getInstance().getCurrentActiveShell() != null;
   } else {
     org.eclipse.swt.widgets.Shell currentActiveShell =
         ShellLookup.getInstance().getCurrentActiveShell();
     if (currentActiveShell == null) {
       log.debug("Current active shell is null");
       return false;
     }
     return currentActiveShell.equals(shell.getSWTWidget());
   }
 }
 @Override
 public boolean test() {
   int childShells = 0;
   org.eclipse.swt.widgets.Shell swtShell = shell.getSWTWidget();
   ShellHandler handler = ShellHandler.getInstance();
   try {
     childShells = handler.getShells(swtShell).length;
   } catch (CoreLayerException e) {
     if (swtShell != null) {
       return handler.isDisposed(swtShell);
     }
     return true;
   }
   log.debug("number of child shells: " + childShells);
   return childShells > 0;
 }