Ejemplo n.º 1
0
  /**
   * {@inheritDoc}
   *
   * @see org.eclipse.jface.action.Action#run()
   */
  @Override
  public void run() {
    // Server may have already been selected by the action
    // having its updateSelection called. If it hasn't then find
    // a server to edit accordingly
    if (this.serverBeingEdited == null) {
      // Choose Server to Edit
      serverBeingEdited = RuntimeAssistant.selectServer(getShell(), false);
      if (RuntimeAssistant.selectServerWasCancelled()) return;
    }

    if (serverBeingEdited == null) {
      String title = UTIL.getString("noServerAvailableTitle"); // $NON-NLS-1$
      String message = UTIL.getString("noServerAvailableMessage"); // $NON-NLS-1$
      MessageDialog.openError(getShell(), title, message);
      return;
    }

    ServerUIPlugin.editServer(serverBeingEdited.getParent());
  }
Ejemplo n.º 2
0
  public String getText(Object element) {
    if (element instanceof ModuleServer) {
      ModuleServer ms = (ModuleServer) element;
      if (ms.module == null) return "";
      return ms.getModuleDisplayName();
    }

    if (element instanceof IServer) {
      IServer server = (IServer) element;
      return notNull(server.getName());
    }

    if (element == ServerContentProvider.INITIALIZING) return Messages.viewInitializing;

    if (element instanceof IWorkspaceRoot) {
      return Platform.getResourceString(ServerUIPlugin.getInstance().getBundle(), "%viewServers");
    }

    return "";
  }