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

Public Member Functions

void onHumanResourceSelect (Event evt)
 
void onChange (Event evt)
 
void onStart ()
 
void onCancelSelect ()
 
void onImport ()
 
void onExport ()
 
void onReport ()
 
void onLetter (Event evt)
 
void onPrevious ()
 
void onNext ()
 
void onBack ()
 
void onNumber (Event evt)
 
void doAfterCompose (Component comp) throws Exception
 

Detailed Description

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

Definition at line 54 of file XMLTimeControlComposer.java.

Member Function Documentation

◆ doAfterCompose()

void org.turro.erp.time.XMLTimeControlComposer.doAfterCompose ( Component  comp) throws Exception

Definition at line 211 of file XMLTimeControlComposer.java.

211  {
212  super.doAfterCompose(comp);
213  key = numberBox.getStyle().substring(numberBox.getStyle().indexOf(";key:") + 5);
214  hrList.setFocus(true);
215  }

◆ onBack()

void org.turro.erp.time.XMLTimeControlComposer.onBack ( )

Definition at line 193 of file XMLTimeControlComposer.java.

193  {
194  hrList.setStartsWith(null);
195  tabHr.setSelected(true);
196  }
Here is the call graph for this function:

◆ onCancelSelect()

void org.turro.erp.time.XMLTimeControlComposer.onCancelSelect ( )

Definition at line 113 of file XMLTimeControlComposer.java.

113  {
114  tabHr.setSelected(true);
115  }

◆ onChange()

void org.turro.erp.time.XMLTimeControlComposer.onChange ( Event  evt)

Definition at line 88 of file XMLTimeControlComposer.java.

88  {
89  Object obj = evt.getData();
90  if(obj instanceof XMLTimeControl) {
91  XMLTimeControl tc = (XMLTimeControl) obj;
92  XMLTimeControlUtil tcu = new XMLTimeControlUtil(Application.getApplication().getConstructor());
93  tcu.end(tc);
94  hrList.setStartsWith(null);
95  hrList.afterCompose();
96  tabHr.setSelected(true);
97  }
98  }
Here is the call graph for this function:

◆ onExport()

void org.turro.erp.time.XMLTimeControlComposer.onExport ( )

Definition at line 147 of file XMLTimeControlComposer.java.

147  {
148  File file = new File(ElephantContext.getRealPath(XMLTimeControlSet.XML_TIMECONTROL));
149  FileUtil.getFolderFile(file).mkdirs();
150  if(file.exists()) {
151  try {
152  Filedownload.save(file, "text/xml");
153  //if(ZkossUtils.confirmDeletion(XMLTimeControlSet.XML_TIMECONTROL)) {
154  XMLTimeControlUtil tcu = new XMLTimeControlUtil(Application.getApplication().getConstructor());
155  tcu.deleteCompleted();
156  //}
157  } catch (FileNotFoundException ex) {
158  Logger.getLogger(XMLTimeControlComposer.class.getName()).log(Level.SEVERE, null, ex);
159  }
160  hrList.setStartsWith(null);
161  hrList.afterCompose();
162  tabHr.setSelected(true);
163  }
164  }
Here is the call graph for this function:

◆ onHumanResourceSelect()

void org.turro.erp.time.XMLTimeControlComposer.onHumanResourceSelect ( Event  evt)

Definition at line 77 of file XMLTimeControlComposer.java.

77  {
78  selected = (XMLHumanResource) evt.getData();
79  if(selected != null) {
80  taskList.setHumanResource(selected);
81  info.getChildren().clear();
82  info.appendChild(new Label(selected.getName()));
83  tabTask.setSelected(true);
84  }
85  }
void setHumanResource(XMLHumanResource humanResource)
Here is the call graph for this function:

◆ onImport()

void org.turro.erp.time.XMLTimeControlComposer.onImport ( )

Definition at line 118 of file XMLTimeControlComposer.java.

118  {
119  File file = new File(ElephantContext.getRealPath(XMLHumanResourceSet.XML_HUMANRESOURCE));
120  FileUtil.getFolderFile(file).mkdirs();
121  try {
122  Media media = Fileupload.get(true);
123  if(media != null) {
124  FileOutputStream fos = new FileOutputStream(file);
125  if(media.inMemory()) {
126  fos.write(media.isBinary() ? media.getByteData() : media.getStringData().getBytes());
127  } else {
128  byte[] buffer = new byte[102400];
129  InputStream is = media.isBinary() ? media.getStreamData() : new ReaderInputStream(media.getReaderData());
130  int r;
131  while((r = is.read(buffer)) != -1) {
132  fos.write(buffer, 0, r);
133  }
134  is.close();
135  }
136  fos.close();
137  hrList.setStartsWith(null);
138  hrList.afterCompose();
139  tabHr.setSelected(true);
140  }
141  } catch (Exception ex) {
142  Logger.getLogger(XMLTimeControlComposer.class.getName()).log(Level.SEVERE, null, ex);
143  }
144  }
Here is the call graph for this function:

◆ onLetter()

void org.turro.erp.time.XMLTimeControlComposer.onLetter ( Event  evt)

Definition at line 173 of file XMLTimeControlComposer.java.

173  {
174  hrList.setFocus(true);
175  hrList.setStartsWith(((Button) evt.getTarget()).getLabel());
176  }
Here is the call graph for this function:

◆ onNext()

void org.turro.erp.time.XMLTimeControlComposer.onNext ( )

Definition at line 186 of file XMLTimeControlComposer.java.

186  {
187  currDate = new CheckDate(currDate).addDays(1).getDate();
188  currDay.setValue(DateFormats.format(currDate, true));
189  timeList.setDate(currDate);
190  }
Here is the call graph for this function:

◆ onNumber()

void org.turro.erp.time.XMLTimeControlComposer.onNumber ( Event  evt)

Definition at line 199 of file XMLTimeControlComposer.java.

199  {
200  secret += ((Button) evt.getTarget()).getLabel();
201  if(secret.equals(key)) {
202  tabReport.setSelected(true);
203  currDay.setValue(DateFormats.format(currDate, true));
204  timeList.setDate(currDate);
205  } else if(key.length() <= secret.length()) {
206  tabHr.setSelected(true);
207  }
208  }
Here is the call graph for this function:

◆ onPrevious()

void org.turro.erp.time.XMLTimeControlComposer.onPrevious ( )

Definition at line 179 of file XMLTimeControlComposer.java.

179  {
180  currDate = new CheckDate(currDate).addDays(-1).getDate();
181  currDay.setValue(DateFormats.format(currDate, true));
182  timeList.setDate(currDate);
183  }
Here is the call graph for this function:

◆ onReport()

void org.turro.erp.time.XMLTimeControlComposer.onReport ( )

Definition at line 167 of file XMLTimeControlComposer.java.

167  {
168  secret = "";
169  tabKey.setSelected(true);
170  }

◆ onStart()

void org.turro.erp.time.XMLTimeControlComposer.onStart ( )

Definition at line 101 of file XMLTimeControlComposer.java.

101  {
102  if(selected != null) {
103  XMLTimeControlUtil tcu = new XMLTimeControlUtil(Application.getApplication().getConstructor());
104  tcu.setHumanResource(selected);
105  tcu.start();
106  hrList.setStartsWith(null);
107  hrList.afterCompose();
108  tabHr.setSelected(true);
109  }
110  }
Here is the call graph for this function:

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