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

Public Member Functions

void onGroupsChange ()
 
void onValuesChange ()
 
- Public Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
final void onChange (Event event)
 
final void onSave ()
 
final void onDelete ()
 
Object getEntity ()
 
Object getWrapper ()
 
void doBeforeComposeChildren (Component comp) throws Exception
 
void doFinally () throws Exception
 
void doAfterCompose (Component comp) throws Exception
 

Protected Member Functions

String getAttributeName ()
 
Product getEntityInstance (Long id)
 
DaoEntity getWrapperInstance (Component comp)
 
void afterSave ()
 
void doOnDelete ()
 
boolean shouldBeSaved ()
 
boolean inSaveRole ()
 
boolean inDeleteRole ()
 
- Protected Member Functions inherited from org.turro.jpa.composer.EntityComposer< E, ID >
abstract E getEntityInstance (ID id)
 
void doOnSave ()
 
boolean beforeSave ()
 
boolean beforeDelete ()
 
void afterDelete ()
 
void doOnChange ()
 
boolean hasChanged ()
 
void retrieveEntity ()
 
boolean canClose ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.jpa.composer.EntityComposer< E, ID >
entity
 
DaoEntity wrapper
 

Detailed Description

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

Definition at line 41 of file ProductComposer.java.

Member Function Documentation

◆ afterSave()

void org.turro.financials.product.logic.ProductComposer.afterSave ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 85 of file ProductComposer.java.

85  {
86  super.afterSave();
87  if(groups != null) {
88  GroupItUtil.saveValues(groups.getValues());
89  FieldItUtil.saveValues(values.getValues());
90  }
91  if(entity != null) {
92  FinancialsMenu.showProduct(entity.getId());
93  }
94  }
Collection< ValueIt > getValues()
Here is the call graph for this function:

◆ doOnDelete()

void org.turro.financials.product.logic.ProductComposer.doOnDelete ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 97 of file ProductComposer.java.

97  {
98  Messages.confirmDeletion().show(() -> {
99  ProductComposer.super.doOnDelete();
100  });
101  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAttributeName()

String org.turro.financials.product.logic.ProductComposer.getAttributeName ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 62 of file ProductComposer.java.

62  {
63  return "product";
64  }

◆ getEntityInstance()

Product org.turro.financials.product.logic.ProductComposer.getEntityInstance ( Long  id)
protected

Definition at line 67 of file ProductComposer.java.

67  {
68  if(id == null) {
69  entity = new Product();
70  } else {
71  entity = new FinancialsPU().find(Product.class, id);
72  }
73  return entity;
74  }

◆ getWrapperInstance()

DaoEntity org.turro.financials.product.logic.ProductComposer.getWrapperInstance ( Component  comp)
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 77 of file ProductComposer.java.

77  {
78  ProductWrapper w = new ProductWrapper(entity);
79  Framework.getCurrent().setSelectedLabel(w.getTabLabel());
80  Framework.getCurrent().setSelectedTooltiptext(w.getTooltiptext());
81  return w;
82  }
Here is the call graph for this function:

◆ inDeleteRole()

boolean org.turro.financials.product.logic.ProductComposer.inDeleteRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 114 of file ProductComposer.java.

114  {
115  return Application.getApplication().isInRole("finan-product:delete");
116  }
Here is the call graph for this function:

◆ inSaveRole()

boolean org.turro.financials.product.logic.ProductComposer.inSaveRole ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 109 of file ProductComposer.java.

109  {
110  return Application.getApplication().isInRole("finan-product:edit");
111  }
Here is the call graph for this function:

◆ onGroupsChange()

void org.turro.financials.product.logic.ProductComposer.onGroupsChange ( )

Definition at line 52 of file ProductComposer.java.

52  {
53  groupsChanged = true;
54  }

◆ onValuesChange()

void org.turro.financials.product.logic.ProductComposer.onValuesChange ( )

Definition at line 57 of file ProductComposer.java.

57  {
58  groupsChanged = true;
59  }

◆ shouldBeSaved()

boolean org.turro.financials.product.logic.ProductComposer.shouldBeSaved ( )
protected

Reimplemented from org.turro.jpa.composer.EntityComposer< E, ID >.

Definition at line 104 of file ProductComposer.java.

104  {
105  return !entity.isEmpty() && (entity.getId() == 0) || super.shouldBeSaved() || groupsChanged;
106  }

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