org.bibalex.daf.managers.admin
Class JobTypesManagerGUI

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.admin.JobTypesManagerGUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class JobTypesManagerGUI
extends BaseManagerGUI

This class manages operations over Job Types like add, remove, update,...

Author:
Mohammed.Abuouda
See Also:
Serialized Form

Nested Class Summary
private static class JobTypesManagerGUI.UIStates
          UIStates is enum indicates to the state of the selected row (Add for new , Edit for update)
 
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.JLabel availableJobTypesLabel
           
private  javax.swing.JScrollPane availableJobTypesScrollPane
          availableJobTypesScrollPane is the container Pane for available JobType table
private  SortableTable availableJobTypesTable
          availableJobTypesTable is the table that shows up the system JobTypes
private  javax.swing.JButton createNewJobTypeButton
          createNewJobTypeButton is the button to craete new JobType
private  javax.swing.JLabel daysLabel
           
private  javax.swing.JButton deleteJobTypeButton
          deleteJobTypeButton is the button to delete JobType
private  javax.swing.JLabel descriptionLabel
           
private  javax.swing.JTextArea descriptionTextArea
          descriptionTextArea is a text field shows the description of selectd JobType
private  javax.swing.JPanel detailsPanel
          detailsPanel is the panel that carry the derived components which are relevant to the selected JobType from the availableWSTable
private  javax.swing.JLabel folderNamingConventionLabel
           
private  javax.swing.JTextField folderNamingConventionTextField
          folderNamingConventionTextField is a text field shows folder naming convention of of selectd JobType
private  javax.swing.JLabel jobTypeNameLabel
           
private  javax.swing.JTextField jobTypeNameTextField
          jobTypeNameTextField is a text field shows the name of selectd JobType
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master and details panels
private  int lastSelectedJobTypeIndex
          lastSelectedJobTypeIndex used to indicate to the last selected row of available JobTypes table
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are availableJobTypesTable,deleteJobTypeButton and createNewJobTypeButton
private  javax.swing.JTextField maximumLifeTimeTextField
          maximumLifeTimeTextField is a text field shows the max Life time of selectd JobType
private  javax.swing.JLabel maxLifeTimeLabel
           
private  javax.swing.JLabel MediaTypeLabel
           
private  CheckBoxList MediaTypesCheckList
          MediaTypesCheckList shows system Media Types as check boxes list
private  javax.swing.JScrollPane MediaTypesScrollPane
          MediaTypesScrollPane is the container of Media types check list
private  boolean recordModified
          recordModified used to check if there are updates or modifications applied but not saved yet to the selected jobType
private  javax.swing.JButton saveButton
          saveButton is the button to save the changes of JobType these changes could be updates or even new data
private  JobTypesManagerGUI.UIStates uiState
           
private  java.awt.event.KeyAdapter updatesKeyAdapter
          key listener handles the events of change the text of text fields.
 
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
JobTypesManagerGUI()
          This is the default constructor
 
Method Summary
private  void adjustCurrentJobTypeMediaTypes()
          This method marks the assigned media types to the selected WS
private  void adjustDetailsPanel()
          Extract the data of the selected JobType and fill up the correspondence fileds
private  void clearDetailsPanel()
          Reset GUI controls
private  boolean confirmDiscardChanges()
          Confirm discard User changes message
 javax.swing.JScrollPane getAvailableJobTypesScrollPane()
          This method initializes availableJobTypesScrollPane
 javax.swing.JTable getAvailableJobTypesTable()
          This method initializes availableJobTypesTable
private  javax.swing.JButton getCreateNewJobTypeButton()
          This method initializes createNewJobTypeButton
private  javax.swing.JButton getDeleteJobTypeButton()
          This method initializes deleteJobTypeButton
private  javax.swing.JTextArea getDescriptionTextArea()
          This method initializes descriptionTextArea
private  javax.swing.JPanel getDetailsPanel()
          This method initializes detailsPanel
private  javax.swing.JTextField getFolderNamingConventionTextField()
          This method initializes folderNamingConventionTextField
private  javax.swing.JTextField getJobTypeNameTextField()
          This method initializes jobTypeNameTextField
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JTextField getMaximumLifeTimeTextField()
          This method initializes maximumLifeTimeTextField
 javax.swing.JScrollPane getMediaTypesScrollPane()
          This method initializes devicesScrollPane devicesScrollPane is the container of devicesCheckList whic represents system devices and highlights already assigned devices to this WS
private  javax.swing.JButton getSaveButton()
          This method initializes saveButton
private  void initialize()
          This method initializes layout
private  void loadAvailableJobTypesTable()
          Load availableJobTypesTable
 void reloadManager()
          Reset controls when JobType tab change
private  void setCreateMode()
          Clear the GUI and set mode to Add
private  void setEditMode()
          Set GUI mode to Edit
private  void showMsg(java.lang.String msg)
          Show message box
private  boolean validateValues()
          Validate filed values
 
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 and details panels


masterPanel

private javax.swing.JPanel masterPanel
masterPanel is the panel that carry the basic components which are availableJobTypesTable,deleteJobTypeButton and createNewJobTypeButton


detailsPanel

private javax.swing.JPanel detailsPanel
detailsPanel is the panel that carry the derived components which are relevant to the selected JobType from the availableWSTable


availableJobTypesScrollPane

private javax.swing.JScrollPane availableJobTypesScrollPane
availableJobTypesScrollPane is the container Pane for available JobType table


MediaTypesScrollPane

private javax.swing.JScrollPane MediaTypesScrollPane
MediaTypesScrollPane is the container of Media types check list


availableJobTypesTable

private SortableTable availableJobTypesTable
availableJobTypesTable is the table that shows up the system JobTypes


deleteJobTypeButton

private javax.swing.JButton deleteJobTypeButton
deleteJobTypeButton is the button to delete JobType


createNewJobTypeButton

private javax.swing.JButton createNewJobTypeButton
createNewJobTypeButton is the button to craete new JobType


saveButton

private javax.swing.JButton saveButton
saveButton is the button to save the changes of JobType these changes could be updates or even new data


jobTypeNameTextField

private javax.swing.JTextField jobTypeNameTextField
jobTypeNameTextField is a text field shows the name of selectd JobType


maximumLifeTimeTextField

private javax.swing.JTextField maximumLifeTimeTextField
maximumLifeTimeTextField is a text field shows the max Life time of selectd JobType


folderNamingConventionTextField

private javax.swing.JTextField folderNamingConventionTextField
folderNamingConventionTextField is a text field shows folder naming convention of of selectd JobType


descriptionTextArea

private javax.swing.JTextArea descriptionTextArea
descriptionTextArea is a text field shows the description of selectd JobType


MediaTypesCheckList

private CheckBoxList MediaTypesCheckList
MediaTypesCheckList shows system Media Types as check boxes list


availableJobTypesLabel

private javax.swing.JLabel availableJobTypesLabel

jobTypeNameLabel

private javax.swing.JLabel jobTypeNameLabel

descriptionLabel

private javax.swing.JLabel descriptionLabel

maxLifeTimeLabel

private javax.swing.JLabel maxLifeTimeLabel

folderNamingConventionLabel

private javax.swing.JLabel folderNamingConventionLabel

daysLabel

private javax.swing.JLabel daysLabel

lastSelectedJobTypeIndex

private int lastSelectedJobTypeIndex
lastSelectedJobTypeIndex used to indicate to the last selected row of available JobTypes table


recordModified

private boolean recordModified
recordModified used to check if there are updates or modifications applied but not saved yet to the selected jobType


uiState

private JobTypesManagerGUI.UIStates uiState

updatesKeyAdapter

private java.awt.event.KeyAdapter updatesKeyAdapter
key listener handles the events of change the text of text fields. Once the event fired, the key adapter enables the saveButton and set recordModified to true. The value of recordModified utilized when the user decides to change to selected JobType to another one, here the system generates a confirmation message that asks the user to discared the changes he done or to commit them.


MediaTypeLabel

private javax.swing.JLabel MediaTypeLabel
Constructor Detail

JobTypesManagerGUI

public JobTypesManagerGUI()
This is the default constructor

Method Detail

initialize

private void initialize()
This method initializes layout


getJPanel

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

Returns:
javax.swing.JPanel

getMasterPanel

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

Returns:
javax.swing.JPanel

getDetailsPanel

private javax.swing.JPanel getDetailsPanel()
This method initializes detailsPanel

Returns:
javax.swing.JPanel

getAvailableJobTypesScrollPane

public javax.swing.JScrollPane getAvailableJobTypesScrollPane()
This method initializes availableJobTypesScrollPane

Returns:
javax.swing.JScrollPane

getDeleteJobTypeButton

private javax.swing.JButton getDeleteJobTypeButton()
This method initializes deleteJobTypeButton

Returns:
javax.swing.JButton

getCreateNewJobTypeButton

private javax.swing.JButton getCreateNewJobTypeButton()
This method initializes createNewJobTypeButton

Returns:
javax.swing.JButton

getSaveButton

private javax.swing.JButton getSaveButton()
This method initializes saveButton

Returns:
javax.swing.JButton

getJobTypeNameTextField

private javax.swing.JTextField getJobTypeNameTextField()
This method initializes jobTypeNameTextField

Returns:
javax.swing.JTextField

getMaximumLifeTimeTextField

private javax.swing.JTextField getMaximumLifeTimeTextField()
This method initializes maximumLifeTimeTextField

Returns:
javax.swing.JTextField

getFolderNamingConventionTextField

private javax.swing.JTextField getFolderNamingConventionTextField()
This method initializes folderNamingConventionTextField

Returns:
javax.swing.JTextField

getDescriptionTextArea

private javax.swing.JTextArea getDescriptionTextArea()
This method initializes descriptionTextArea

Returns:
javax.swing.JTextArea

getMediaTypesScrollPane

public javax.swing.JScrollPane getMediaTypesScrollPane()
This method initializes devicesScrollPane devicesScrollPane is the container of devicesCheckList whic represents system devices and highlights already assigned devices to this WS

Returns:
JScrollPane

validateValues

private boolean validateValues()
Validate filed values

Returns:
true if all values are valid , false other wise

showMsg

private void showMsg(java.lang.String msg)
Show message box

Parameters:
msg - string in Resource File

confirmDiscardChanges

private boolean confirmDiscardChanges()
Confirm discard User changes message

Returns:
true if confirmed and false otherwise

setEditMode

private void setEditMode()
Set GUI mode to Edit


setCreateMode

private void setCreateMode()
Clear the GUI and set mode to Add


adjustDetailsPanel

private void adjustDetailsPanel()
Extract the data of the selected JobType and fill up the correspondence fileds


clearDetailsPanel

private void clearDetailsPanel()
Reset GUI controls


getAvailableJobTypesTable

public javax.swing.JTable getAvailableJobTypesTable()
This method initializes availableJobTypesTable

Returns:
javax.swing.JTable

loadAvailableJobTypesTable

private void loadAvailableJobTypesTable()
Load availableJobTypesTable


adjustCurrentJobTypeMediaTypes

private void adjustCurrentJobTypeMediaTypes()
This method marks the assigned media types to the selected WS


reloadManager

public void reloadManager()
Reset controls when JobType tab change

Specified by:
reloadManager in class BaseManagerGUI