18 package org.turro.scheduler.zul;
21 import org.turro.elephant.context.Application;
22 import org.turro.i18n.I_;
23 import org.turro.scheduler.motor.Motor;
24 import org.turro.scheduler.motor.ScheduledTask;
25 import org.zkoss.zk.ui.event.Event;
26 import org.zkoss.zk.ui.event.EventListener;
27 import org.zkoss.zk.ui.event.Events;
28 import org.zkoss.zul.Column;
29 import org.zkoss.zul.Columns;
30 import org.zkoss.zul.Grid;
31 import org.zkoss.zul.Rows;
32 import org.zkoss.zul.Toolbar;
33 import org.zkoss.zul.Toolbarbutton;
43 private Toolbar toolbar;
52 if(toolbar !=
null) getParent().removeChild(toolbar);
53 toolbar =
new Toolbar();
54 getParent().insertBefore(toolbar,
this);
59 private void addColumns() {
60 Columns cols =
new Columns();
61 cols.setSizable(
true);
62 cols.setMenupopup(
"auto");
65 Column col =
new Column(
I_.
get(
"Name"));
66 col.setWidth(
"300px");
67 cols.appendChild(col);
68 col =
new Column(
I_.
get(
"Description"));
69 cols.appendChild(col);
70 col =
new Column(
I_.
get(
"Active"));
72 cols.appendChild(col);
73 col =
new Column(
I_.
get(
"Start date"));
74 col.setWidth(
"150px");
75 cols.appendChild(col);
76 col =
new Column(
I_.
get(
"End date"));
77 col.setWidth(
"150px");
78 cols.appendChild(col);
82 cols.appendChild(col);
86 private void addRows() {
88 if(rows !=
null) removeChild(rows);
102 private void addToolbarButtons() {
103 final TaskListbox tl =
new TaskListbox();
104 toolbar.appendChild(tl);
106 Toolbarbutton addButton =
new Toolbarbutton(
108 "/_zul/images/new.png"
110 addButton.addEventListener(Events.ON_CLICK,
new EventListener() {
112 public void onEvent(Event event)
throws Exception {
117 toolbar.appendChild(addButton);
119 addButton.setDisabled(tl.getTask() ==
null);
boolean isInRole(String role)
static Application getApplication()
static String get(String msg)
void setAddToolbar(boolean addToolbar)