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

Public Member Functions

 ProductByContractorCombobox ()
 
 ProductByContractorCombobox (Contract contract)
 
Contract getContract ()
 
void setContract (Contract contract)
 
Product getProduct ()
 
void setProduct (Product product)
 
void populateList (String value, LinkedList list, int nRows)
 
String getTextFromObject (ProductByContractor value)
 
- Public Member Functions inherited from org.turro.zkoss.input.GenericCombobox< V >
 GenericCombobox ()
 
getObjectValue ()
 
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
 

Protected Attributes

Contract contract
 
Product product
 

Detailed Description

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

Definition at line 34 of file ProductByContractorCombobox.java.

Constructor & Destructor Documentation

◆ ProductByContractorCombobox() [1/2]

org.turro.financials.product.ProductByContractorCombobox.ProductByContractorCombobox ( )

Definition at line 39 of file ProductByContractorCombobox.java.

39  {
40  }

◆ ProductByContractorCombobox() [2/2]

org.turro.financials.product.ProductByContractorCombobox.ProductByContractorCombobox ( Contract  contract)

Member Function Documentation

◆ getContract()

Contract org.turro.financials.product.ProductByContractorCombobox.getContract ( )

Definition at line 46 of file ProductByContractorCombobox.java.

46  {
47  return contract;
48  }

◆ getProduct()

Product org.turro.financials.product.ProductByContractorCombobox.getProduct ( )

◆ getTextFromObject()

String org.turro.financials.product.ProductByContractorCombobox.getTextFromObject ( ProductByContractor  value)

Definition at line 89 of file ProductByContractorCombobox.java.

89  {
90  return "#" + value.getContractorCode() + " " + value.getProduct().getDescription();
91  }
Here is the call graph for this function:

◆ populateList()

void org.turro.financials.product.ProductByContractorCombobox.populateList ( String  value,
LinkedList  list,
int  nRows 
)

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

Definition at line 63 of file ProductByContractorCombobox.java.

63  {
64  Dao dao = new FinancialsPU();
65  WhereClause wc = new WhereClause();
66  wc.addClause("select pbp from ProductByContractor as pbp");
67  wc.addClause("where pbp.contract = :contract");
68  wc.addNamedValue("contract", contract);
69  wc.addClause("and (");
70  if(!Strings.isBlank(value)) {
71  wc.setPrefix("");
72  wc.addLikeFields(new String[] { "pbp.product.description" }, value);
73  wc.addClause("or");
74  }
75  wc.addClause("pbp.contractorCode = :pcode");
76  wc.addNamedValue("pcode", value);
77  wc.addClause(")");
78  if(product != null) {
79  wc.addClause("and pbp.product = :product");
80  wc.addNamedValue("product", product);
81  }
82  wc.addClause("order by pbp.product.description");
83  for(Object o : dao.getResultList(wc, nRows)) {
84  list.add((ProductByContractor) o);
85  }
86  }
Here is the call graph for this function:

◆ setContract()

void org.turro.financials.product.ProductByContractorCombobox.setContract ( Contract  contract)

Definition at line 50 of file ProductByContractorCombobox.java.

50  {
51  this.contract = contract;
52  }

◆ setProduct()

void org.turro.financials.product.ProductByContractorCombobox.setProduct ( Product  product)

Definition at line 58 of file ProductByContractorCombobox.java.

58  {
59  this.product = product;
60  }

Member Data Documentation

◆ contract

Contract org.turro.financials.product.ProductByContractorCombobox.contract
protected

Definition at line 36 of file ProductByContractorCombobox.java.

◆ product

Product org.turro.financials.product.ProductByContractorCombobox.product
protected

Definition at line 37 of file ProductByContractorCombobox.java.


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