BrightSide Workbench Full Report + Source Code
org.turro.publication.model.ConstraintKeyBox Class Reference
Inheritance diagram for org.turro.publication.model.ConstraintKeyBox:
Collaboration diagram for org.turro.publication.model.ConstraintKeyBox:

Public Member Functions

String getValue ()
 
void setValue (String keyId)
 
void afterCompose ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 38 of file ConstraintKeyBox.java.

Member Function Documentation

◆ afterCompose()

void org.turro.publication.model.ConstraintKeyBox.afterCompose ( )

Definition at line 90 of file ConstraintKeyBox.java.

90  {
91  appendChild(new Space());
92  Toolbarbutton social = new Toolbarbutton();
93  social.setImage("/_zul/images/contact.png");
94  social.addEventListener(Events.ON_CLICK, (Event event) -> {
95  mode = ConstraintKeyMode.SOCIAL_GROUP;
96  updateControl(null);
97  });
98  appendChild(social);
99  Toolbarbutton entity = new Toolbarbutton();
100  entity.setImage("/_zul/images/entity.png");
101  entity.addEventListener(Events.ON_CLICK, (Event event) -> {
102  mode = ConstraintKeyMode.ENTITY;
103  updateControl(null);
104  });
105  appendChild(entity);
106  Toolbarbutton delete = new Toolbarbutton();
107  delete.setImage("/_zul/images/delete.png");
108  delete.addEventListener(Events.ON_CLICK, (Event event) -> {
109  mode = ConstraintKeyMode.EMPTY;
110  updateControl(null);
111  Events.postEvent(new InputEvent("onChange", this, "", null));
112  });
113  appendChild(delete);
114  }

◆ getValue()

String org.turro.publication.model.ConstraintKeyBox.getValue ( )

Definition at line 42 of file ConstraintKeyBox.java.

42  {
43  if(mode == ConstraintKeyMode.ENTITY) {
44  EntityCombobox combo = (EntityCombobox) getChildren().get(0);
45  return combo.getEntityPath();
46  } else if(mode == ConstraintKeyMode.SOCIAL_GROUP) {
47  SocialGroupListbox list = (SocialGroupListbox) getChildren().get(0);
48  return list.getKeyString();
49  }
50  return null;
51  }
Here is the call graph for this function:

◆ setValue()

void org.turro.publication.model.ConstraintKeyBox.setValue ( String  keyId)

Definition at line 53 of file ConstraintKeyBox.java.

53  {
54  if(Strings.isBlank(keyId)) {
55  mode = ConstraintKeyMode.EMPTY;
56  } else if(keyId.startsWith("/")) {
57  mode = ConstraintKeyMode.ENTITY;
58  } else {
59  mode = ConstraintKeyMode.SOCIAL_GROUP;
60  }
61  updateControl(keyId);
62  }

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