BrightSide Workbench Full Report + Source Code
org.turro.zkoss.input.MultiLabelBox< E > Class Template Referenceabstract
Inheritance diagram for org.turro.zkoss.input.MultiLabelBox< E >:
Collaboration diagram for org.turro.zkoss.input.MultiLabelBox< E >:

Public Member Functions

 MultiLabelBox ()
 
getEntity ()
 
void setEntity (E entity)
 
boolean isReadOnly ()
 
void setReadOnly (boolean readOnly)
 
void afterCompose ()
 
void onEvent (Event event) throws Exception
 

Protected Member Functions

abstract boolean checkVisible ()
 
abstract boolean checkNew ()
 
abstract boolean checkEditable ()
 
abstract boolean checkDelete ()
 
abstract String getNewImage ()
 
abstract Collection< E > getCollection ()
 
abstract String convertToString (E label)
 
abstract Collection< String > getLabelChoices ()
 
abstract void addChoice (String choice, Command command)
 
abstract void changeChoice (String oldChoice, String choice, Command command)
 
abstract void deleteChoice (String oldChoice, Command command)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Parameters
<E>

Definition at line 36 of file MultiLabelBox.java.

Constructor & Destructor Documentation

◆ MultiLabelBox()

Definition at line 41 of file MultiLabelBox.java.

41  {
42  setSclass("z-valign-middle multiLabel");
43  setAlign("center");
44  }

Member Function Documentation

◆ addChoice()

abstract void org.turro.zkoss.input.MultiLabelBox< E >.addChoice ( String  choice,
Command  command 
)
abstractprotected

◆ afterCompose()

void org.turro.zkoss.input.MultiLabelBox< E >.afterCompose ( )

Definition at line 63 of file MultiLabelBox.java.

63  {
64  setVisible(checkVisible());
65  getChildren().clear();
66  LabelEditable le;
67  if(getCollection() != null) {
68  for(E label : getCollection()) {
69  le = new LabelEditable(convertToString(label));
70  le.setEditable(!readOnly && checkEditable());
71  le.setEditorCols(12);
72  le.setValues(getLabelChoices());
73  appendChild(le);
74  le.addEventListener(Events.ON_CHANGE, this);
75  }
76  }
77  if(!readOnly && checkNew()) {
78  le = new LabelEditable("", getNewImage());
79  le.setEditorCols(12);
80  le.setValues(getLabelChoices());
81  appendChild(le);
82  le.addEventListener(Events.ON_CHANGE, this);
83  }
84  for(Object obj : getChildren()) {
85  if(obj instanceof AfterCompose) {
86  ((AfterCompose) obj).afterCompose();
87  }
88  }
89  }
abstract Collection< E > getCollection()
abstract String convertToString(E label)
abstract Collection< String > getLabelChoices()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeChoice()

abstract void org.turro.zkoss.input.MultiLabelBox< E >.changeChoice ( String  oldChoice,
String  choice,
Command  command 
)
abstractprotected

◆ checkDelete()

abstract boolean org.turro.zkoss.input.MultiLabelBox< E >.checkDelete ( )
abstractprotected

◆ checkEditable()

abstract boolean org.turro.zkoss.input.MultiLabelBox< E >.checkEditable ( )
abstractprotected

◆ checkNew()

abstract boolean org.turro.zkoss.input.MultiLabelBox< E >.checkNew ( )
abstractprotected

◆ checkVisible()

abstract boolean org.turro.zkoss.input.MultiLabelBox< E >.checkVisible ( )
abstractprotected

◆ convertToString()

abstract String org.turro.zkoss.input.MultiLabelBox< E >.convertToString ( label)
abstractprotected
Here is the caller graph for this function:

◆ deleteChoice()

abstract void org.turro.zkoss.input.MultiLabelBox< E >.deleteChoice ( String  oldChoice,
Command  command 
)
abstractprotected

◆ getCollection()

abstract Collection<E> org.turro.zkoss.input.MultiLabelBox< E >.getCollection ( )
abstractprotected

◆ getEntity()

Definition at line 46 of file MultiLabelBox.java.

46  {
47  return entity;
48  }

◆ getLabelChoices()

abstract Collection<String> org.turro.zkoss.input.MultiLabelBox< E >.getLabelChoices ( )
abstractprotected

◆ getNewImage()

abstract String org.turro.zkoss.input.MultiLabelBox< E >.getNewImage ( )
abstractprotected

◆ isReadOnly()

boolean org.turro.zkoss.input.MultiLabelBox< E >.isReadOnly ( )

Definition at line 54 of file MultiLabelBox.java.

54  {
55  return readOnly;
56  }

◆ onEvent()

void org.turro.zkoss.input.MultiLabelBox< E >.onEvent ( Event  event) throws Exception

Definition at line 92 of file MultiLabelBox.java.

92  {
93  if(event.getData() instanceof LabelEditable) {
94  LabelEditable le = (LabelEditable) event.getData();
95  if(!Strings.isBlank(le.getLabel())) {
96  if(!Strings.isBlank(le.getImage())) {
97  addChoice(le.getLabel(), null);
98  Events.postEvent(new Event(Events.ON_CHANGE, MultiLabelBox.this));
99  } else {
100  changeChoice(le.getOldLabel(), le.getLabel(), null);
101  Events.postEvent(new Event(Events.ON_CHANGE, MultiLabelBox.this));
102  }
103  } else {
104  if(!Strings.isBlank(le.getImage())) {
105  // nothing, insertion cancelled
106  } else {
107  if(!readOnly && checkDelete()) {
108  deleteChoice(le.getOldLabel(), null);
109  Events.postEvent(new Event(Events.ON_CHANGE, MultiLabelBox.this));
110  }
111  }
112  }
113  }
114  afterCompose();
115  }
abstract void addChoice(String choice, Command command)
abstract void changeChoice(String oldChoice, String choice, Command command)
abstract void deleteChoice(String oldChoice, Command command)
Here is the call graph for this function:

◆ setEntity()

void org.turro.zkoss.input.MultiLabelBox< E >.setEntity ( entity)

Definition at line 50 of file MultiLabelBox.java.

50  {
51  this.entity = entity;
52  }

◆ setReadOnly()

void org.turro.zkoss.input.MultiLabelBox< E >.setReadOnly ( boolean  readOnly)

Definition at line 58 of file MultiLabelBox.java.

58  {
59  this.readOnly = readOnly;
60  }

The documentation for this class was generated from the following file: