BrightSide Workbench Full Report + Source Code
org.turro.hierarchy.HierarchyGrid Class Referenceabstract
Inheritance diagram for org.turro.hierarchy.HierarchyGrid:
Collaboration diagram for org.turro.hierarchy.HierarchyGrid:

Public Member Functions

void setCollection (Collection< Hierarchical > items, int showBreakdownLevel)
 
- Public Member Functions inherited from org.turro.zkoss.grid.PagingGrid
void setColumns (int columns)
 
void setColumns (String hflexs)
 
void refine ()
 
boolean isDefaultBehavior ()
 
void setDefaultBehavior (boolean defaultBehavior)
 
String getRefineValue ()
 
void setRefineValue (String value)
 
int getMaxResults ()
 
void setMaxResults (int maxResults)
 
String getPagingMold ()
 
void setPagingMold (String pagingMold)
 
int getRowCount ()
 
void setRowCount (int rows)
 
void setHeadersVisible (boolean value)
 
boolean isHeadersVisible ()
 
String getVarColumns ()
 
void setVarColumns (String varColumns)
 
Collection< String > getVarColumnsList (String defaultCols)
 
void addDetailColumn ()
 
void addDetailColumn (HtmlBasedComponent caption)
 
void openDetails ()
 
boolean isEmpty ()
 
void clearColumns ()
 
void clearRows ()
 
void clearEmptyGroups ()
 
Columns getColumns (boolean create)
 
Rows getRows (boolean create)
 
Foot getFoot (boolean create)
 
Foot createFoot ()
 
void exportToPdf ()
 

Protected Member Functions

void addRows ()
 
void refreshRows ()
 
Hlayout getNameLayout (final Hierarchical value)
 
abstract void refreshValue (Row row, Hierarchical value)
 
String getBreakdownImage (Hierarchical value)
 
void changeBreakdownState (Hierarchical value)
 
boolean isShowBreakdown (Hierarchical value)
 
boolean isVisible (Hierarchical value)
 

Detailed Description

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

Definition at line 39 of file HierarchyGrid.java.

Member Function Documentation

◆ addRows()

void org.turro.hierarchy.HierarchyGrid.addRows ( )
protected

Definition at line 51 of file HierarchyGrid.java.

51  {
52  Rows rows = getRows(true);
53  rows.getChildren().clear();
54 
55  breakdown = new TreeMap<Hierarchical, Boolean>();
56 
57  for(Hierarchical value : items) {
58  processValue(value);
59  }
60 
61  refreshRows();
62 
63  setRowCount(rows.getChildren().size());
64  }
Rows getRows(boolean create)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeBreakdownState()

void org.turro.hierarchy.HierarchyGrid.changeBreakdownState ( Hierarchical  value)
protected

Definition at line 133 of file HierarchyGrid.java.

133  {
134  breakdown.put(value, !isShowBreakdown(value));
135  }
boolean isShowBreakdown(Hierarchical value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBreakdownImage()

String org.turro.hierarchy.HierarchyGrid.getBreakdownImage ( Hierarchical  value)
protected

Definition at line 125 of file HierarchyGrid.java.

125  {
126  if(isShowBreakdown(value)) {
127  return "/_zul/images/breakdown-open.png";
128  } else {
129  return "/_zul/images/breakdown-closed.png";
130  }
131  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNameLayout()

Hlayout org.turro.hierarchy.HierarchyGrid.getNameLayout ( final Hierarchical  value)
protected

Definition at line 101 of file HierarchyGrid.java.

101  {
102  Hlayout hbox = new Hlayout();
103  Space s = new Space();
104  s.setWidth(getLevel(value) * 15 + "px");
105  hbox.appendChild(s);
106 
107  if(value.children() != null && !value.children().isEmpty()) {
108  Toolbarbutton bd = new Toolbarbutton();
109  bd.setImage(getBreakdownImage(value));
110  bd.addEventListener(Events.ON_CLICK, new EventListener() {
111  @Override
112  public void onEvent(Event event) throws Exception {
113  changeBreakdownState(value);
114  refreshRows();
115  }
116  });
117  hbox.appendChild(bd);
118  }
119 
120  return hbox;
121  }
void changeBreakdownState(Hierarchical value)
String getBreakdownImage(Hierarchical value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isShowBreakdown()

boolean org.turro.hierarchy.HierarchyGrid.isShowBreakdown ( Hierarchical  value)
protected

Definition at line 137 of file HierarchyGrid.java.

137  {
138  return breakdown.get(value);
139  }
Here is the caller graph for this function:

◆ isVisible()

boolean org.turro.hierarchy.HierarchyGrid.isVisible ( Hierarchical  value)
protected

Definition at line 141 of file HierarchyGrid.java.

141  {
142  Hierarchical tmp = (Hierarchical) value.parent();
143  while(tmp != null) {
144  if(!isShowBreakdown(tmp)) {
145  return false;
146  }
147  tmp = (Hierarchical) tmp.parent();
148  }
149  return true;
150  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshRows()

void org.turro.hierarchy.HierarchyGrid.refreshRows ( )
protected

Definition at line 89 of file HierarchyGrid.java.

89  {
90  for(Object row : getRows().getChildren()) {
91  if(row instanceof Row) {
92  if(((Row) row).getValue() instanceof Hierarchical) {
93  ((Row) row).setVisible(isVisible((Hierarchical) ((Row) row).getValue()));
94  ((Row) row).getChildren().clear();
95  refreshValue((Row) row, (Hierarchical) ((Row) row).getValue());
96  }
97  }
98  }
99  }
abstract void refreshValue(Row row, Hierarchical value)
boolean isVisible(Hierarchical value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshValue()

abstract void org.turro.hierarchy.HierarchyGrid.refreshValue ( Row  row,
Hierarchical  value 
)
abstractprotected

Reimplemented in org.turro.erp.clone.EntityCloneGrid.

Here is the caller graph for this function:

◆ setCollection()

void org.turro.hierarchy.HierarchyGrid.setCollection ( Collection< Hierarchical items,
int  showBreakdownLevel 
)

Definition at line 45 of file HierarchyGrid.java.

45  {
46  this.showBreakdownLevel = showBreakdownLevel;
47  this.items = items;
48  addRows();
49  }
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: