19 package org.turro.contacts.zul.organigram;
21 import java.util.EnumSet;
22 import org.turro.contacts.organigram.RelationType;
23 import org.turro.contacts.organigram.TargetItem;
24 import org.zkoss.zk.ui.event.Event;
25 import org.zkoss.zk.ui.event.EventListener;
26 import org.zkoss.zk.ui.event.Events;
27 import org.zkoss.zk.ui.ext.AfterCompose;
28 import org.zkoss.zul.Hlayout;
37 setSclass(
"z-valign-middle");
47 EnumSet<RelationType> rts = EnumSet.complementOf(getSelector().getTargetArray().getRelationTypes());
53 ol.addEventListener(Events.ON_SELECT,
new EventListener<Event>() {
55 public void onEvent(Event event) throws Exception {
56 if(ol.getObjectValue() != null) {
57 TargetItem ti = new TargetItem();
58 ti.setRelationType(ol.getObjectValue());
59 getSelector().getTargetArray().add(ti);
60 Events.postEvent(new Event(Events.ON_CHANGE, getSelector()));
61 getSelector().refresh();