// Render action controls based on users permission
actionColumn.setDecorator(new Decorator() {
public String render(Object object, Context context) {
JobAndSimpleTrigger jobAndTrigger = (JobAndSimpleTrigger) object;
HtmlStringBuffer buffer = new HtmlStringBuffer();
editLink.setParameter("job.name", jobAndTrigger.getJob().getName());
editLink.render(buffer);
buffer.append(" | ");
deleteLink.setValue(jobAndTrigger.getJob().getName());
deleteLink.render(buffer);
if (!getSchedulerService().isPaused()) {
if (jobAndTrigger.getTriggerState() == Trigger.STATE_PAUSED) {
buffer.append(" | ");
resumeLink.setValue(jobAndTrigger.getJob().getName());
resumeLink.render(buffer);
} else {
buffer.append(" | ");
pauseLink.setValue(jobAndTrigger.getJob().getName());
pauseLink.render(buffer);
}
buffer.append(" | ");
triggerLink.setValue(jobAndTrigger.getJob().getName());
triggerLink.render(buffer);
if (jobAndTrigger.getTriggerState() == Trigger.STATE_BLOCKED) {
buffer.append(" | ");
interruptLink.setValue(jobAndTrigger.getJob().getName());
interruptLink.render(buffer);
}
}
return buffer.toString();
}
});
actionColumn.setSortable(false);
table.addColumn(actionColumn);