19 package org.turro.zkoss.filter;
21 import java.util.Collection;
22 import org.turro.command.Command;
23 import org.turro.elephant.util.Images;
24 import org.turro.i18n.I_;
25 import org.turro.zkoss.dialog.SelectionDialog;
26 import org.turro.zkoss.input.CollectionListbox;
27 import org.turro.zul.frame.Framework;
28 import org.zkoss.zk.ui.event.Event;
29 import org.zkoss.zk.ui.event.EventListener;
30 import org.zkoss.zk.ui.event.Events;
31 import org.zkoss.zk.ui.ext.AfterCompose;
32 import org.zkoss.zul.Button;
33 import org.zkoss.zul.Hbox;
34 import org.zkoss.zul.Vlayout;
45 private boolean multiple =
true, checkmark =
true, selectFirst =
false;
49 this.filterGrid = filterGrid;
50 this.entities = entities;
54 this.multiple = multiple;
58 this.checkmark = checkmark;
62 this.selectFirst = selectFirst;
67 entities.setMultiple(multiple);
68 entities.setCheckmark(checkmark);
70 entities.setVflex(
true);
72 search.addEventListener(Events.ON_CLICK,
new EventListener<Event>() {
74 public void onEvent(Event event) throws Exception {
75 if(filterGrid.hasValues()) {
76 entities.updateCollection(filter.getObjectValues(filterGrid.getValues()));
80 appendChild(filterGrid);
82 Hbox hbox =
new Hbox();
83 hbox.setHflex(
"true");
85 hbox.setStyle(
"padding:10px");
86 hbox.setSpacing(
"15px");
87 hbox.appendChild(search);
89 appendChild(entities);
101 public void show(String title, String width, String height, Command command) {
104 title,
this, width, height, command);
static String getImage(String image)
static String get(String msg)
void show(String title, String width, String height, Command command)
void setMultiple(boolean multiple)
void setCheckmark(boolean checkmark)
Collection< E > getObjectValues()
void setSelectFirst(boolean selectFirst)
GenericFilterListbox(Filter< E > filter, FilterGrid filterGrid, CollectionListbox< E > entities)
static Framework getCurrent()