BrightSide Workbench Full Report + Source Code
org.turro.financials.document.ConceptCombobox Class Reference
Inheritance diagram for org.turro.financials.document.ConceptCombobox:
Collaboration diagram for org.turro.financials.document.ConceptCombobox:

Public Member Functions

DocumentDefinition getDocumentDefinition ()
 
void setDocumentDefinition (DocumentDefinition documentDefinition)
 
void populateList (String value, LinkedList list, int nRows)
 
String getTextFromObject (String value)
 
void setObjectValue (String value) throws WrongValueException
 
String getObjectValue () throws WrongValueException
 
void afterCompose ()
 
void onEvent (Event event) throws Exception
 
- Public Member Functions inherited from org.turro.zkoss.input.GenericCombobox< V >
 GenericCombobox ()
 
void setObjectValue (V value)
 
boolean isAllowNotInModelValues ()
 
void setAllowNotInModelValues (boolean allowNotInModelValues)
 
void refreshModel ()
 
abstract String getTextFromObject (V value)
 
Object getRelatedEntity ()
 
void setRelatedEntity (Object relatedEntity)
 
void render (Comboitem item, Object data, int index) throws Exception
 

Static Public Member Functions

static String formatValue (String value)
 

Detailed Description

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

Definition at line 44 of file ConceptCombobox.java.

Member Function Documentation

◆ afterCompose()

void org.turro.financials.document.ConceptCombobox.afterCompose ( )

Definition at line 93 of file ConceptCombobox.java.

93  {
94  addEventListener(Events.ON_DOUBLE_CLICK, this);
95  }

◆ formatValue()

static String org.turro.financials.document.ConceptCombobox.formatValue ( String  value)
static

Definition at line 88 of file ConceptCombobox.java.

88  {
89  return value == null ? null : ((String) value).replaceAll("\\n", Chars.nl().toString());
90  }
Here is the caller graph for this function:

◆ getDocumentDefinition()

DocumentDefinition org.turro.financials.document.ConceptCombobox.getDocumentDefinition ( )

Definition at line 48 of file ConceptCombobox.java.

48  {
49  return documentDefinition;
50  }

◆ getObjectValue()

String org.turro.financials.document.ConceptCombobox.getObjectValue ( ) throws WrongValueException

Reimplemented from org.turro.zkoss.input.GenericCombobox< V >.

Definition at line 83 of file ConceptCombobox.java.

83  {
84  String tmp = super.getObjectValue();
85  return tmp == null ? null : tmp.replaceAll(Chars.nl().regexp().toString(), "\n");
86  }
Here is the caller graph for this function:

◆ getTextFromObject()

String org.turro.financials.document.ConceptCombobox.getTextFromObject ( String  value)

Definition at line 69 of file ConceptCombobox.java.

69  {
70  return value;
71  }

◆ onEvent()

void org.turro.financials.document.ConceptCombobox.onEvent ( Event  event) throws Exception

Definition at line 98 of file ConceptCombobox.java.

98  {
99  if(isReadonly()) {
100  Collection c = Listeners.cancelListener(this, Events.ON_BLUR);
101  Messages.info(I_.get("Concept")).add(this.getObjectValue()).show();
102  Listeners.activateListeners(this, Events.ON_BLUR, c);
103  } else {
104  final Collection c = Listeners.cancelListener(this, Events.ON_BLUR);
105  InputDialog.getInput(getPage(), I_.get("Concept"), "Description",
106  this.getObjectValue(), null, 10, new Command() {
107  @Override
108  public Object execute(Context context) {
109  String value = (String) context.get("value");
110  if(value != null) {
111  ConceptCombobox.this.setObjectValue(value);
112  }
113  return null;
114  }
115  }, new Command() {
116  @Override
117  public Object execute(Context context) {
118  Listeners.activateListeners(ConceptCombobox.this, Events.ON_BLUR, c);
119  return null;
120  }
121  });
122  }
123  }
Here is the call graph for this function:

◆ populateList()

void org.turro.financials.document.ConceptCombobox.populateList ( String  value,
LinkedList  list,
int  nRows 
)

Reimplemented from org.turro.zkoss.input.GenericCombobox< V >.

Definition at line 57 of file ConceptCombobox.java.

57  {
58  Dao dao = new FinancialsPU();
59  WhereClause wc = new WhereClause();
60  wc.addClause("select distinct concept from DocumentLine as documentLine");
61  wc.addClause("where documentLine.document.documentDefinition.id = :id");
62  wc.addNamedValue("id", documentDefinition.getId());
63  wc.addLikeFields(new String[] { "documentLine.concept" }, value);
64  wc.addClause("order by documentLine.concept");
65  list.addAll(dao.getResultList(wc, nRows));
66  }
Here is the call graph for this function:

◆ setDocumentDefinition()

void org.turro.financials.document.ConceptCombobox.setDocumentDefinition ( DocumentDefinition  documentDefinition)

Definition at line 52 of file ConceptCombobox.java.

52  {
53  this.documentDefinition = documentDefinition;
54  }
Here is the caller graph for this function:

◆ setObjectValue()

void org.turro.financials.document.ConceptCombobox.setObjectValue ( String  value) throws WrongValueException

Definition at line 74 of file ConceptCombobox.java.

74  {
75  if(value != null && value.contains("\n")) {
76  super.setValue(formatValue(value));
77  } else {
78  super.setValue(value);
79  }
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

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