18 package org.turro.scheduler.zul;
20 import java.util.HashSet;
21 import java.util.List;
22 import org.turro.string.Strings;
23 import org.turro.elephant.context.Application;
24 import org.turro.elephant.context.IConstructor;
25 import org.turro.elephant.impl.context.ContextFactory;
26 import org.turro.reflection.Instances;
27 import org.turro.scheduler.motor.DefaultTask;
28 import org.turro.scheduler.motor.ScheduledTask;
29 import org.zkoss.zul.Listbox;
30 import org.zkoss.zul.Listitem;
44 return getSelectedItem() !=
null ? (
ScheduledTask) getSelectedItem().getValue() :
null;
47 private void addItems() {
48 HashSet<String> doneNames =
new HashSet<>();
52 if(st !=
null && !Strings.isBlank(st.
getName())) {
53 if(!doneNames.contains(st.
getName())) {
56 Listitem item =
new Listitem(st.
getName());
59 if(getSelectedItem() ==
null) {
60 setSelectedItem(item);
65 for(ScheduledTask s : Instances.cached().bySuper(DefaultTask.class, ScheduledTask.class)) {
66 if(s !=
null && !Strings.isBlank(s.getName())) {
67 if(!doneNames.contains(s.getName())) {
68 doneNames.add(s.getName());
69 s.setImplementation(s.getClass().getName());
70 Listitem item =
new Listitem(s.getName());
73 if(getSelectedItem() ==
null) {
74 setSelectedItem(item);
IConstructor getConstructor()
static Application getApplication()
static Object getImplementation(IElement iel, String name)
static List getImplementationNamesByType(String type)
void setImplementation(String value)