@Override public void selectionChanged(IStructuredSelection selection) { final Object element = getStructuredSelection().getFirstElement(); if (element instanceof Problem && !CoreUtil.empty(((Problem) element).getTicket())) { setEnabled(true); } else { setEnabled(false); } }
@Override protected Status compute() { Status retval = Status.createOkStatus(); String serverName = op().getBundleName().content(); if (CoreUtil.empty(serverName)) { retval = Status.createErrorStatus("The Server Name is empty. Please input one."); return retval; } if (ServerPlugin.isNameInUse(null, serverName)) { retval = Status.createErrorStatus( "The Server Name \"" + serverName + "\"+ is already in use. Specify a different name."); return retval; } return retval; }