title: Getting the Visibility of a Handler
body: <p>Out base plug-ins define commands and handler, which the application later enables or disables or makes (in)visible. Now I'm trying to evaluate a double click and need to access a command. That's easy:</p>
  
  <pre><code>private boolean executeCommand(String commandId) {
      IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
      try {
          handlerService.executeCommand(commandId, null);
          return true;
      } catch (ExecutionException | NotDefinedException | NotEnabledException
              | NotHandledException e) {
          MessageUtil.logError(e);
          return false;
      }
  }
  </code></pre>
  
  <p>Now the problem is: There are two handlers ("edit" and "view") which are possible to be executed, and I want to only execute "edit" when it's there, else "view".</p>
  
  <pre><code>    ICommandService commandService = (ICommandService) getSite().getService(ICommandService.class);
      Command command = commandService.getCommand(commandId);
      IHandler handler = command.getHandler();
  </code></pre>
  
  <p>I tried asking the command for <code>isDefined()</code>, <code>isEnabled()</code> and <code>isHandled()</code> and the handler for <code>isEnabled()</code> and <code>isHandled()</code>, but everything returns true.</p>
  
  <p>How do I find out if the handler is visible?</p>