if(disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
*/
// Options
TreeItem item = new TreeItem(parent, SWT.NONE);
item.setText("Options");
item.setData("max_occur", "1");
item.setData(new TreeData(Editor.JOB_OPTION, job, Options.getHelpURL("job")));
item.setData("key", "job");
item.setData("override_attributes", "true");
item.setData("copy_element", job);
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
// Parameter
item = new TreeItem(parent, SWT.NONE);
item.setData(new TreeData(Editor.PARAMETER, job, Options.getHelpURL("parameter")));
item.setData("key", "params_@_param");
ArrayList ll = new ArrayList();
ll.add("params_@_param");
ll.add("params_@_include");
// l.add("environment");
item.setData("key", ll);
item.setData("copy_element", job);
item.setText("Parameter");
// Mail
item = new TreeItem(parent, SWT.NONE);
item.setData(new TreeData(Editor.SETTINGS, job, Options.getHelpURL("settings")));
item.setData("key", "settings");
item.setData("copy_element", job);
item.setText("Job Settings");
item.setData("max_occur", "1");
// Monitor
item = new TreeItem(parent, SWT.NONE);
item.setText(MONITOR);
item.setData(new TreeData(Editor.MONITORS, job, Options.getHelpURL("job.monitor"), "monitor"));
item.setData("key", "monitor");
item.setData("copy_element", job);
if (disable) {
setDisabled(item); // .setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillScripts(item, job, disable);
// RunOptions
item = new TreeItem(parent, SWT.NONE);
item.setText("Run Options");
item.setData(new TreeData(Editor.OPTIONS, job, Options.getHelpURL("job.options")));
l = new ArrayList<String>();
l.add("start_when_directory_changed");
l.add("delay_after_error");
l.add("delay_order_after_setback");
// item.setData("key", "job.options");
item.setData("key", l);
item.setData("copy_element", job);
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
item = new TreeItem(parent, SWT.NONE);
item.setText("Locks ");
item.setData(new TreeData(Editor.LOCKUSE, job, Options.getHelpURL("job.locks")));
// item.setData("key", "job.locks");
item.setData("key", "lock.use");
item.setData("copy_element", job);
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillRunTimes(parent, job, disable, "run_time");
/*List l = job.getChild("run_time").getChildren("month");
for(int i =0; i < l.size(); i++) {
Element e = (Element)l.get(i);
treeFillRunTimes(parent.getItem(parent.getItemCount()-1).getItem(parent.getItem(parent.getItemCount()-1).getItemCount()-1), e, !Utils.isElementEnabled("job", _dom, job), Utils.getAttributeValue("month", e), false);
}*/
List commands = job.getChildren("commands");
item = new TreeItem(parent, SWT.NONE);
item.setText("Commands");
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
if (commands != null)
treeFillCommands(item, job, false);
item.setData(new TreeData(Editor.JOB_COMMANDS, job, Options.getHelpURL("job.commands")));
// item.setData("key", "job_@_commands");
item.setData("key", "commands");
item.setData("copy_element", job);
parent.setExpanded(expand);
// Documentation
item = new TreeItem(parent, SWT.NONE);
item.setText("Documentation");
item.setData("max_occur", "1");
item.setData(new TreeData(Editor.JOB_DOCUMENTATION, job, Options.getHelpURL("job")));
// ArrayList l = new ArrayList();
// l.add("process");
// l.add("script");
item.setData("key", "job_@_description");
item.setData("copy_element", job);
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
}