BrightSide Workbench Full Report + Source Code
org.turro.erp.time.XMLTaskSelector Class Reference
Inheritance diagram for org.turro.erp.time.XMLTaskSelector:
Collaboration diagram for org.turro.erp.time.XMLTaskSelector:

Public Member Functions

void setHumanResource (XMLHumanResource humanResource)
 

Detailed Description

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

Definition at line 39 of file XMLTaskSelector.java.

Member Function Documentation

◆ setHumanResource()

void org.turro.erp.time.XMLTaskSelector.setHumanResource ( XMLHumanResource  humanResource)

Definition at line 41 of file XMLTaskSelector.java.

41  {
42  boolean canGetIn = true;
43 
44  Rows rows = getRows();
45  if(rows != null) {
46  rows.getChildren().clear();
47  } else {
48  rows = new Rows();
49  appendChild(rows);
50  }
51 
52  XMLTimeControlUtil tcu = new XMLTimeControlUtil(Application.getApplication().getConstructor());
53  tcu.setHumanResource(humanResource);
54  List<XMLTimeControl> pending = tcu.getPendingControl();
55 
56  for(XMLTimeControl tc : pending) {
57  canGetIn = false;
58 
59  final Row row = new Row();
60  row.setValue(tc);
61  rows.appendChild(row);
62 
63  row.appendChild(new LabelExtended().setDateTime(tc.getStartTime()));
64 
65  Button select = new Button(Application.getString("lGetOut"));
66  select.setHflex("true");
67  select.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
68  @Override
69  public void onEvent(Event event) throws Exception {
70  Events.postEvent(new Event(Events.ON_CHANGE, XMLTaskSelector.this, row.getValue()));
71  }
72  });
73  row.appendChild(select);
74  }
75 
76  if(canGetIn) {
77  final Row rowStart = new Row();
78  rows.appendChild(rowStart);
79 
80  rowStart.appendChild(new Label(Application.getString("lNow")));
81 
82  Button butStart = new Button(Application.getString("lGetIn"));
83  butStart.setHflex("true");
84  butStart.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
85  @Override
86  public void onEvent(Event event) throws Exception {
87  Events.postEvent(new Event(Events.ON_USER, XMLTaskSelector.this, null));
88  }
89  });
90  rowStart.appendChild(butStart);
91  }
92 
93  final Row rowCancel = new Row();
94  rows.appendChild(rowCancel);
95 
96  rowCancel.appendChild(new Space());
97 
98  Button butCancel = new Button(Application.getString("lCancel"));
99  butCancel.setHflex("true");
100  butCancel.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
101  @Override
102  public void onEvent(Event event) throws Exception {
103  Events.postEvent(new Event(Events.ON_CANCEL, XMLTaskSelector.this));
104  }
105  });
106  rowCancel.appendChild(butCancel);
107 
108  }
Here is the call graph for this function:

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