19 package org.turro.command;
21 import org.turro.string.Strings;
22 import org.turro.auth.Authentication;
23 import org.turro.entities.Entities;
24 import org.turro.entities.IElephantEntity;
25 import org.turro.zkoss.label.LabelTypes;
26 import org.zkoss.zk.ui.event.Event;
27 import org.zkoss.zk.ui.event.EventListener;
28 import org.zkoss.zk.ui.event.Events;
29 import org.zkoss.zk.ui.ext.AfterCompose;
30 import org.zkoss.zul.*;
38 private Object entity;
39 private boolean showDescription =
false, linkEntity =
true;
48 public EntityControl(Object entity,
boolean showDescription,
boolean linkEntity) {
50 this.showDescription = showDescription;
51 this.linkEntity = linkEntity;
67 this.linkEntity = linkEntity;
71 return showDescription;
75 this.showDescription = showDescription;
82 private void createComponents() {
83 getChildren().clear();
88 link.addEventListener(Events.ON_CLICK,
new EventListener() {
90 public void onEvent(Event event)
throws Exception {
96 Hlayout hbox =
new Hlayout();
97 if(!Strings.isBlank(ee.
getImage())) {
98 hbox.appendChild(
new Image(ee.
getImage()));
100 if(!Strings.isBlank(ee.
getName())) {
101 hbox.appendChild(
new Label(ee.
getName()));
static IContact getIContact()
void setLinkEntity(boolean linkEntity)
EntityControl(Object entity)
void setShowDescription(boolean showDescription)
boolean isShowDescription()
void setEntity(Object entity)
EntityControl(Object entity, boolean showDescription, boolean linkEntity)
static IElephantEntity getController(String path)
boolean canEdit(IContact contact)