org.chorem.jtimer.ui.report
Class ReportView

java.lang.Object
  extended by org.jdesktop.application.AbstractBean
      extended by org.jdesktop.application.View
          extended by org.jdesktop.application.FrameView
              extended by org.chorem.jtimer.ui.report.ReportView
All Implemented Interfaces:
EventListener, DocumentListener

public class ReportView
extends org.jdesktop.application.FrameView
implements DocumentListener

Reports UI.

Version:
$Revision: 2703 $ Last update : $Date: 2009-11-20 11:02:02 +0100 (ven., 20 nov. 2009) $ By : $Author: echatellier $
Author:
chatellier

Field Summary
protected  boolean canSendMail
          Can send mail property.
protected  JCheckBox checkIncludesAnnotations
          Include annotations on reports
protected  TimerCore core
          Timer core.
protected  org.jdesktop.swingx.JXDatePicker datePickerFrom
          Date pickers, from... to
protected  org.jdesktop.swingx.JXDatePicker datePickerTo
          Date pickers, from... to
protected static org.apache.commons.logging.Log log
          Class logger
protected  JTree projectsTree
          Project tree (with checkbox)
protected  JRadioButton radioByDay
          Report sorting : day
protected  JRadioButton radioByMonth
          Report sorting : month
protected  JRadioButton radioByProject
          Report sorting : project
protected  JRadioButton radioByWeek
          Report sorting : week
protected  JRadioButton radioByYear
          Report sorting : year
protected  JTextArea reportArea
          Report output
protected  ReportGenerator reportGenerator
          Report process generator
protected  JButton sendMailButton
          Send by mail button
protected  JCheckBox showHiddenProjectBox
          Show hidden project box.
protected  Set<TimerTask> uncheckedTaskSet
          Unselected task set.
 
Constructor Summary
ReportView(org.jdesktop.application.Application application, TimerCore core)
          Reposts constructor.
 
Method Summary
 void changedUpdate(DocumentEvent e)
           
 void closeView()
          Close action.
protected  void documentChanged()
          Document content changed.
 void generateReport()
          Make report.
protected  JComponent getMainComponent()
          Get main view component.
protected  List<TimerProject> getSelectedProjects(List<TimerProject> projects, Collection<TimerTask> uncheckedTaskList)
          Get project list without project and task unselected in tree.
protected  List<TimerTask> getSelectedTasks(List<? extends TimerTask> tasks, Collection<TimerTask> uncheckedTaskList)
          Get tasks list without tasks unselected in tree.
 void insertUpdate(DocumentEvent e)
           
 boolean isSendMailEnabled()
          Can send mail ?
 void removeUpdate(DocumentEvent e)
           
 void sendMail()
          Send report by mail.
 void setSendMailEnabled(boolean enabled)
          Change can send mail property.
 void showHiddenProjects()
          Update tree, showing hidden projects or not.
 
Methods inherited from class org.jdesktop.application.FrameView
getFrame, getRootPane, setFrame
 
Methods inherited from class org.jdesktop.application.View
getApplication, getComponent, getContext, getMenuBar, getResourceMap, getStatusBar, getToolBar, getToolBars, setComponent, setMenuBar, setStatusBar, setToolBar, setToolBars
 
Methods inherited from class org.jdesktop.application.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Class logger


core

protected TimerCore core
Timer core.


uncheckedTaskSet

protected Set<TimerTask> uncheckedTaskSet
Unselected task set.


radioByDay

protected JRadioButton radioByDay
Report sorting : day


radioByMonth

protected JRadioButton radioByMonth
Report sorting : month


radioByWeek

protected JRadioButton radioByWeek
Report sorting : week


radioByYear

protected JRadioButton radioByYear
Report sorting : year


radioByProject

protected JRadioButton radioByProject
Report sorting : project


checkIncludesAnnotations

protected JCheckBox checkIncludesAnnotations
Include annotations on reports


datePickerFrom

protected org.jdesktop.swingx.JXDatePicker datePickerFrom
Date pickers, from... to


datePickerTo

protected org.jdesktop.swingx.JXDatePicker datePickerTo
Date pickers, from... to


projectsTree

protected JTree projectsTree
Project tree (with checkbox)


showHiddenProjectBox

protected JCheckBox showHiddenProjectBox
Show hidden project box.


reportGenerator

protected ReportGenerator reportGenerator
Report process generator


reportArea

protected JTextArea reportArea
Report output


sendMailButton

protected JButton sendMailButton
Send by mail button


canSendMail

protected boolean canSendMail
Can send mail property.

Constructor Detail

ReportView

public ReportView(org.jdesktop.application.Application application,
                  TimerCore core)
Reposts constructor.

Parameters:
application - parent reference
core - core reference
Method Detail

getMainComponent

protected JComponent getMainComponent()
Get main view component. TODO use less complicated UI (no gbl)


closeView

@Action
public void closeView()
Close action.


generateReport

@Action
public void generateReport()
Make report. Set content in reportArea text area.


getSelectedProjects

protected List<TimerProject> getSelectedProjects(List<TimerProject> projects,
                                                 Collection<TimerTask> uncheckedTaskList)
Get project list without project and task unselected in tree.

Parameters:
projects - original project list
uncheckedTaskList - unselected task list
Returns:
selected project list

getSelectedTasks

protected List<TimerTask> getSelectedTasks(List<? extends TimerTask> tasks,
                                           Collection<TimerTask> uncheckedTaskList)
Get tasks list without tasks unselected in tree.

Parameters:
tasks - original project list
uncheckedTaskList - unselected task list
Returns:
selected project list

showHiddenProjects

@Action
public void showHiddenProjects()
Update tree, showing hidden projects or not.


sendMail

@Action(enabledProperty="sendMailEnabled")
public void sendMail()
Send report by mail.


isSendMailEnabled

public boolean isSendMailEnabled()
Can send mail ?

Returns:
true if can send mail

setSendMailEnabled

public void setSendMailEnabled(boolean enabled)
Change can send mail property.

Parameters:
enabled - can send mail

changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

documentChanged

protected void documentChanged()
Document content changed. Update can send mail property.



Copyright © 2007-2012 CodeLutin. All Rights Reserved.