org.bibalex.daf.managers.report
Class ReportBuilder

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.bibalex.daf.managers.BaseManagerGUI
                      extended by org.bibalex.daf.managers.report.ReportBuilder
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ReportBuilder
extends BaseManagerGUI

this calss loads DAFv2 components like Job Type, Collection, Language.. and gives the user ability to form a wury. It Saves all reports, user can execute any of them by double click on any of them

Author:
Mohammed.Abuouda
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JComboBox AndOrCollectionComboBox
           
private  javax.swing.JComboBox AndORCollOwnerComboBox
           
private  javax.swing.JComboBox AndOrJobTypeComboBox
           
private  javax.swing.JComboBox AndOrLangComboBox
           
private  CheckBoxList attributesCheckList
           
private  javax.swing.JScrollPane attributesScrollPane
           
private  javax.swing.JLabel AttrLabel
           
private  javax.swing.JButton cancelButton
           
private  javax.swing.JComboBox CollectionComboBox
           
private  javax.swing.JComboBox collectionOwnerComboBox
           
private  javax.swing.JLabel CollLabel
           
private  javax.swing.JLabel collOwnerLabel
           
private  javax.swing.JLabel criteriaLabel
           
private  javax.swing.JButton deleteButton
           
private  javax.swing.JLabel DescLabel
           
private  javax.swing.JTextArea DescriptionTextArea2
           
private  javax.swing.JScrollPane descScrollPane
           
private  javax.swing.JCheckBox directQueryCheckBox
           
private  javax.swing.JLabel directQueryLabel
           
private  javax.swing.JLabel jobStatusLabel
           
private  javax.swing.JTextField jobTitleTextField
           
private  javax.swing.JLabel jobTypeLabel
           
private  javax.swing.JComboBox jobTypesComboBox
           
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master panel and other components
private  javax.swing.JComboBox LangComboBox
           
private  javax.swing.JLabel LangLabel
           
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are reportsScrollPane and other components
private  javax.swing.JTextField nameTextField
           
private  javax.swing.JButton newReportButton
           
private  javax.swing.JLabel oldNewLabel
           
private  javax.swing.JComboBox oldOrNewJobComboBox
           
private  javax.swing.JLabel repNameLabel
           
private  javax.swing.JLabel reportsLabel
           
private  javax.swing.JScrollPane reportsScrollPane
           
private  SortableTable reportsTable
           
private  javax.swing.JComboBox StatusComboBox
           
private  javax.swing.JLabel statusLabel
           
private  javax.swing.JButton submitButton
           
private  javax.swing.JLabel titleLikeLabel
           
 
Fields inherited from class org.bibalex.daf.managers.BaseManagerGUI
currentInstance, resourceManager
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ReportBuilder()
          Class constructor
 
Method Summary
private  javax.swing.JComboBox getAndOrCollectionComboBox()
          This method initializes AndOrCollectionComboBox
private  javax.swing.JComboBox getAndOrCollOwnerComboBox()
          This method initializes AndORCollOwnerComboBox
private  javax.swing.JComboBox getAndOrJobTypeComboBox()
          This method initializes AndOrJobTypeComboBox
private  javax.swing.JComboBox getAndOrLangComboBox()
          This method initializes AndOrLangComboBox
private  javax.swing.JScrollPane getAttributesScrollPane()
          This method initializes attributesScrollPane
private  javax.swing.JButton getCancelButton()
          Cancels report creation and switchs to reports viewing mode
private  javax.swing.JComboBox getCollectionComboBox()
          This method initializes CollectionComboBox which loads all collections
private  javax.swing.JComboBox getCollOwnerComboBox()
          This method initializes jComboBox
private  javax.swing.JButton getDeleteButton()
          This method initializes deleteButton which carries out the report deletion function
private  javax.swing.JTextArea getDescriptionTextArea()
          This method initializes DescriptionTextArea2 which holds the Description of a report
 javax.swing.JScrollPane getDescScrollPane()
          This method initializes descScrollPane
private  javax.swing.JCheckBox getDirectQueryCheckBox()
          This method initializes directQueryCheckBox it helps in writing a query directly to database, this option is available for admin only
private  javax.swing.JTextField getJobTitleTextField()
          This method initializes jobTitleTextField
private  javax.swing.JComboBox getJobTypesComboBox()
          This method initializes jobTypesComboBox which loads all Job types
private  javax.swing.JPanel getJPanel()
          This method initializes ReportBuilder
private  javax.swing.JComboBox getLangComboBox()
          This method initializes LangComboBox which loads all languages
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JTextField getNameTextField()
          This method initializes nameTextField which holds the name of a report
private  javax.swing.JButton getNewButton()
          initializes newReportButton which switches the GUI into reports creation mode instead of reports viewing mode
private  javax.swing.JComboBox getOldNewComboBox()
          This method initializes oldOrNewJobComboBox which holds Job classification (Old or New)
 javax.swing.JScrollPane getReportsScrollPane()
          This method initializes reportsScrollPane
 javax.swing.JTable getReportsTable()
          Loads all saved reports and prepare mouse actions
private  java.lang.String getSelectedAttributes()
          Gets the selected attributes
private  javax.swing.JComboBox getStatusComboBox()
          This method initializes StatusComboBox which loads all system states
private  javax.swing.JButton getSubmitButton()
          This method initializes submitButton which saves and exexute the report
private  void initialize()
          This method initializes this
private  java.util.ArrayList prepareSearchArguments()
          Formulate the where condition
 void reloadManager()
          Reseta controls
private  void resetData()
          Resets controls
private  void setControlsEnabled(boolean state)
          enablea or disablea controls according to View or Create modes
private  void setControlsVisible(boolean state)
          seta controls visiable or not controls according to View or Create modes
private  void showMsg(java.lang.String msg)
          show a message
private  boolean validateQuery()
          validates the query return true if query is valid, false otherwise.
 
Methods inherited from class org.bibalex.daf.managers.BaseManagerGUI
setFocus, updateTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jPanel

private javax.swing.JPanel jPanel
jPanel is Main panel which containes master panel and other components


masterPanel

private javax.swing.JPanel masterPanel
masterPanel is the panel that carry the basic components which are reportsScrollPane and other components


reportsScrollPane

private javax.swing.JScrollPane reportsScrollPane

descScrollPane

private javax.swing.JScrollPane descScrollPane

attributesScrollPane

private javax.swing.JScrollPane attributesScrollPane

reportsTable

private SortableTable reportsTable

newReportButton

private javax.swing.JButton newReportButton

cancelButton

private javax.swing.JButton cancelButton

submitButton

private javax.swing.JButton submitButton

deleteButton

private javax.swing.JButton deleteButton

jobTypesComboBox

private javax.swing.JComboBox jobTypesComboBox

AndOrLangComboBox

private javax.swing.JComboBox AndOrLangComboBox

AndOrCollectionComboBox

private javax.swing.JComboBox AndOrCollectionComboBox

AndORCollOwnerComboBox

private javax.swing.JComboBox AndORCollOwnerComboBox

CollectionComboBox

private javax.swing.JComboBox CollectionComboBox

collectionOwnerComboBox

private javax.swing.JComboBox collectionOwnerComboBox

LangComboBox

private javax.swing.JComboBox LangComboBox

StatusComboBox

private javax.swing.JComboBox StatusComboBox

AndOrJobTypeComboBox

private javax.swing.JComboBox AndOrJobTypeComboBox

oldOrNewJobComboBox

private javax.swing.JComboBox oldOrNewJobComboBox

nameTextField

private javax.swing.JTextField nameTextField

jobTitleTextField

private javax.swing.JTextField jobTitleTextField

DescriptionTextArea2

private javax.swing.JTextArea DescriptionTextArea2

attributesCheckList

private CheckBoxList attributesCheckList

directQueryCheckBox

private javax.swing.JCheckBox directQueryCheckBox

reportsLabel

private javax.swing.JLabel reportsLabel

repNameLabel

private javax.swing.JLabel repNameLabel

DescLabel

private javax.swing.JLabel DescLabel

jobTypeLabel

private javax.swing.JLabel jobTypeLabel

CollLabel

private javax.swing.JLabel CollLabel

LangLabel

private javax.swing.JLabel LangLabel

AttrLabel

private javax.swing.JLabel AttrLabel

statusLabel

private javax.swing.JLabel statusLabel

titleLikeLabel

private javax.swing.JLabel titleLikeLabel

oldNewLabel

private javax.swing.JLabel oldNewLabel

criteriaLabel

private javax.swing.JLabel criteriaLabel

jobStatusLabel

private javax.swing.JLabel jobStatusLabel

directQueryLabel

private javax.swing.JLabel directQueryLabel

collOwnerLabel

private javax.swing.JLabel collOwnerLabel
Constructor Detail

ReportBuilder

public ReportBuilder()
Class constructor

Method Detail

initialize

private void initialize()
This method initializes this


getJPanel

private javax.swing.JPanel getJPanel()
This method initializes ReportBuilder

Returns:
javax.swing.JPanel

getMasterPanel

private javax.swing.JPanel getMasterPanel()
This method initializes masterPanel

Returns:
javax.swing.JPanel

getNewButton

private javax.swing.JButton getNewButton()
initializes newReportButton which switches the GUI into reports creation mode instead of reports viewing mode

Returns:
JButton

getReportsScrollPane

public javax.swing.JScrollPane getReportsScrollPane()
This method initializes reportsScrollPane

Returns:
javax.swing.JScrollPane

getDescScrollPane

public javax.swing.JScrollPane getDescScrollPane()
This method initializes descScrollPane

Returns:
javax.swing.JScrollPane

getDescriptionTextArea

private javax.swing.JTextArea getDescriptionTextArea()
This method initializes DescriptionTextArea2 which holds the Description of a report

Returns:
javax.swing.JTextArea

getReportsTable

public javax.swing.JTable getReportsTable()
Loads all saved reports and prepare mouse actions

Returns:
JTable

getJobTypesComboBox

private javax.swing.JComboBox getJobTypesComboBox()
This method initializes jobTypesComboBox which loads all Job types

Returns:
javax.swing.JComboBox

getNameTextField

private javax.swing.JTextField getNameTextField()
This method initializes nameTextField which holds the name of a report

Returns:
javax.swing.JTextArea

getAttributesScrollPane

private javax.swing.JScrollPane getAttributesScrollPane()
This method initializes attributesScrollPane

Returns:
javax.swing.JScrollPane

getSubmitButton

private javax.swing.JButton getSubmitButton()
This method initializes submitButton which saves and exexute the report

Returns:
javax.swing.JButton

showMsg

private void showMsg(java.lang.String msg)
show a message


validateQuery

private boolean validateQuery()
validates the query return true if query is valid, false otherwise.


getCancelButton

private javax.swing.JButton getCancelButton()
Cancels report creation and switchs to reports viewing mode

Returns:
JButton

getCollectionComboBox

private javax.swing.JComboBox getCollectionComboBox()
This method initializes CollectionComboBox which loads all collections

Returns:
javax.swing.JComboBox

getLangComboBox

private javax.swing.JComboBox getLangComboBox()
This method initializes LangComboBox which loads all languages

Returns:
javax.swing.JComboBox

getCollOwnerComboBox

private javax.swing.JComboBox getCollOwnerComboBox()
This method initializes jComboBox

Returns:
javax.swing.JComboBox

getStatusComboBox

private javax.swing.JComboBox getStatusComboBox()
This method initializes StatusComboBox which loads all system states

Returns:
javax.swing.JComboBox

getAndOrLangComboBox

private javax.swing.JComboBox getAndOrLangComboBox()
This method initializes AndOrLangComboBox

Returns:
javax.swing.JComboBox

getOldNewComboBox

private javax.swing.JComboBox getOldNewComboBox()
This method initializes oldOrNewJobComboBox which holds Job classification (Old or New)

Returns:
javax.swing.JComboBox

getAndOrCollectionComboBox

private javax.swing.JComboBox getAndOrCollectionComboBox()
This method initializes AndOrCollectionComboBox

Returns:
javax.swing.JComboBox

getAndOrCollOwnerComboBox

private javax.swing.JComboBox getAndOrCollOwnerComboBox()
This method initializes AndORCollOwnerComboBox

Returns:
javax.swing.JComboBox

getSelectedAttributes

private java.lang.String getSelectedAttributes()
Gets the selected attributes

Returns:
select stmt with selected att.

prepareSearchArguments

private java.util.ArrayList prepareSearchArguments()
Formulate the where condition

Returns:
String

getDeleteButton

private javax.swing.JButton getDeleteButton()
This method initializes deleteButton which carries out the report deletion function

Returns:
javax.swing.JButton

getJobTitleTextField

private javax.swing.JTextField getJobTitleTextField()
This method initializes jobTitleTextField

Returns:
javax.swing.JTextField

getAndOrJobTypeComboBox

private javax.swing.JComboBox getAndOrJobTypeComboBox()
This method initializes AndOrJobTypeComboBox

Returns:
javax.swing.JComboBox

getDirectQueryCheckBox

private javax.swing.JCheckBox getDirectQueryCheckBox()
This method initializes directQueryCheckBox it helps in writing a query directly to database, this option is available for admin only

Returns:
JCheckBox

resetData

private void resetData()
Resets controls


setControlsEnabled

private void setControlsEnabled(boolean state)
enablea or disablea controls according to View or Create modes


setControlsVisible

private void setControlsVisible(boolean state)
seta controls visiable or not controls according to View or Create modes


reloadManager

public void reloadManager()
Reseta controls

Specified by:
reloadManager in class BaseManagerGUI