/** * {@inheritDoc} * * @see org.eclim.command.Command#execute(CommandLine) */ public String execute(CommandLine commandLine) throws Exception { Object family = getFamily(commandLine.getValue(Options.FAMILY_OPTION)); IJobManager manager = Job.getJobManager(); Job[] jobs = manager.find(family); StringBuffer buffer = new StringBuffer(); int maxlength = 0; for (Job job : jobs) { int length = job.toString().length(); if (length > maxlength) { maxlength = length; } } for (Job job : jobs) { if (buffer.length() > 0) { buffer.append('\n'); } buffer .append(StringUtils.rightPad(job.toString(), maxlength)) .append(" - ") .append(getStatus(job)); } return buffer.toString(); }
@Override public String toString() { return job.toString(); }