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

Public Member Functions

void setContract (Contract contract)
 
void addFlow (final ContractFlow contractFlow)
 

Detailed Description

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

Definition at line 48 of file ContractFlowTabbox.java.

Member Function Documentation

◆ addFlow()

void org.turro.financials.contract.ContractFlowTabbox.addFlow ( final ContractFlow  contractFlow)

Definition at line 57 of file ContractFlowTabbox.java.

57  {
58  InputDialog.getInput(
59  getPage(),
60  I_.get("Expiry"),
61  new InputField[] {
62  new InputField("Document model", null, null, 0) {
63  @Override
64  protected HtmlBasedComponent createEditor() {
65  DocumentDefinitionListbox ddl = new DocumentDefinitionListbox(contract.getContractDefinition());
66  ddl.setMold("select");
67  if(contractFlow != null) {
68  ddl.setObjectValue(contractFlow.getDocumentDefinition());
69  }
70  return ddl;
71  }
72  },
73  new InputField("Description", contractFlow == null ? "" : contractFlow.getDescription(), null, 0)
74  }, new Command() {
75  @Override
76  public Object execute(Context context) {
77  InputField[] fields = (InputField[]) context.get("fields");
78  if(fields.length > 0) {
79  String description = null;
80  DocumentDefinition documentDefinition = null;
81  for(InputField f : fields) {
82  if("Description".equals(f.getLabel())) {
83  description = (String) f.getValue();
84  } else if("Document model".equals(f.getLabel())) {
85  documentDefinition = (DocumentDefinition) f.getValue();
86  }
87  }
88  if(!Strings.isBlank(description) && documentDefinition != null) {
89  if(contractFlow == null) {
90  ContractFlow cf = new ContractFlow();
91  cf.setDescription(description);
92  cf.setDocumentDefinition(documentDefinition);
93  cf.setContract(contract);
94  contract.getContractFlows().add(cf);
95  } else {
96  contractFlow.setDescription(description);
97  contractFlow.setDocumentDefinition(documentDefinition);
98  }
99  addTabs();
100  }
101  }
102  return null;
103  }
104  });
105  }
Set< ContractFlow > getContractFlows()
Definition: Contract.java:137
Here is the call graph for this function:

◆ setContract()

void org.turro.financials.contract.ContractFlowTabbox.setContract ( Contract  contract)

Definition at line 52 of file ContractFlowTabbox.java.

52  {
53  this.contract = contract;
54  addTabs();
55  }

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