job = newMonth;
runtime = job;
}
}
// test
TreeItem run = null;
boolean hasSchedulesAttribut = Utils.getAttributeValue("schedule", _runtime).trim().length() > 0;
if (hasSchedulesAttribut) {
for (int i = 0; i < item.getItemCount(); i++) {
if (item.getItem(i).equals("Run Time")) {
run = item.getItem(i);
}
}
}
if (item.getText().equals("Run Time")) {
run = item;
}
// ende test
// if(run == null) {
if (runtime != null) {
if (type == SchedulerDom.LIFE_SCHEDULE) {
run = item;
}
else
if (run == null) {
run = new TreeItem(item, SWT.NONE);
}
run.setData("max_occur", "1");
run.setText(run_time);
if (run_time.equals("run_time")) {
run.setText("Run Time");
}
else {
run.setText(run_time);
}
if (run_time.equals("run_time")) {
run.setData(new TreeData(Editor.RUNTIME, job, Options.getHelpURL("job.run_time"), "run_time"));
run.setData("key", "run_time");
run.setData("override_attributes", "true");
run.setData("max_occur", "1");
run.setData("copy_element", job);
if (disable) {
run.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
_gui.updateFont(run);
}
else
if (job.getName().equals("schedule")) {
run.setData(new TreeData(Editor.SCHEDULE, job, Options.getHelpURL("job.schedule"), "schedule"));
run.setData("key", "schedules_@_schedule");
run.setData("copy_element", job);
}
item = new TreeItem(run, SWT.NONE);
item.setText("Everyday");
item.setData(new TreeData(Editor.EVERYDAY, runtime, Options.getHelpURL("job.run_time.everyday")));
// item.setData("key", "run_time_@_everyday");
item.setData("key", "period");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
_gui.updateFont(item);
item = new TreeItem(run, SWT.NONE);
item.setText("Weekdays");
item.setData(new TreeData(Editor.WEEKDAYS, runtime, Options.getHelpURL("job.run_time.weekdays"), "weekdays"));
item.setData("key", "weekdays");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillDays(item, runtime, 0, false);
_gui.updateFont(item);
item = new TreeItem(run, SWT.NONE);
item.setText("Monthdays");
item.setData(new TreeData(Editor.MONTHDAYS, runtime, Options.getHelpURL("job.run_time.monthdays"), "monthdays"));
item.setData("key", "monthdays");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillDays(item, runtime, 1, false);
_gui.updateFont(item);
item = new TreeItem(run, SWT.NONE);
item.setText("Ultimos");
item.setData(new TreeData(Editor.ULTIMOS, runtime, Options.getHelpURL("job.run_time.ultimos"), "ultimos"));
item.setData("key", "ultimos");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillDays(item, runtime, 2, false);
_gui.updateFont(item);
item = new TreeItem(run, SWT.NONE);
item.setText("Specific Weekdays");
item.setData(new TreeData(Editor.SPECIFIC_WEEKDAYS, runtime, Options.getHelpURL("job.run_time.monthdays"), "monthdays"));
item.setData("key", "monthdays");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillSpecificWeekdays(item, runtime, false);
_gui.updateFont(item);
// Specific Days
if (run_time.equals("run_time") || job.getName().equals("schedule")) {
item = new TreeItem(run, SWT.NONE);
item.setText("Specific Days");
item.setData(new TreeData(Editor.DAYS, runtime, Options.getHelpURL("job.run_time.specific_days")));
item.setData("key", "specific_days");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
treeFillDays(item, runtime, 6, false);
// item.getParent().setSelection(new TreeItem[] {item});
// setFontForRuntimeChild(item);
_gui.updateFont(item);
}
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
// Specific Monthdays
if (run_time.equals("run_time") || job.getName().equals("schedule")) {
item = new TreeItem(run, SWT.NONE);
item.setText("Specific Month");
// item.setData(new TreeData(Editor.SPECIFIC_MONTHS, runtime,
// Options.getHelpURL("job.run_time.monthdays"),"specific_monthdays"));
item.setData(new TreeData(Editor.SPECIFIC_MONTHS, runtime, Options.getHelpURL("job.run_time.monthdays"), "month"));
item.setData("key", "specific_monthdays");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));
if (disable) {
item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
}
treeFillDays(item, runtime, DaysListener.SPECIFIC_MONTHS, false);
_gui.updateFont(item);
}
// holidays
if (run_time.equals("run_time") || job.getName().equals("schedule")) {
item = new TreeItem(run, SWT.NONE);
item.setData(new TreeData(Editor.HOLIDAYS, runtime, Options.getHelpURL("holidays"), "holidays"));
item.setData("key", "holidays");
item.setData("override_attributes", "true");
item.setData("max_occur", "1");
item.setData("copy_element", job.getChild("run_time"));