org.bibalex.daf.managers.admin
Class CollectionsManagerGUI

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

public class CollectionsManagerGUI
extends BaseManagerGUI

Author:
Fadi.edward
See Also:
Serialized Form

Nested Class Summary
private static class CollectionsManagerGUI.UIStates
          Enumerates the different states the UI can occupy
 
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 abreviationLabel
           
private  javax.swing.JTextField abreviationTextField
           
private  javax.swing.JButton addUserButton
           
private  javax.swing.JCheckBox anyUserCheckBox
           
private  javax.swing.JCheckBox anyWorkstationCheckBox
           
private  javax.swing.JLabel attachedUsersLabel
           
private  javax.swing.JList attachedUsersList
           
private  javax.swing.JScrollPane attachedUsersScrollPane
           
private  javax.swing.JLabel availableCollectionsLabel
           
private  javax.swing.JScrollPane availableCollectionsScrollPane
           
private  SortableTable availableCollectionsTable
           
private  javax.swing.JLabel availableUsersLabel
           
private  javax.swing.JScrollPane availableUsersScrollPane
           
private  javax.swing.JTree availableUsersTree
           
private  javax.swing.JTextField collectionDefaultPathTextField
           
private  javax.swing.JLabel collectionNameLabel
           
private  javax.swing.JTextField collectionNameTextField
           
private  javax.swing.JLabel commentLabel
           
private  javax.swing.JScrollPane commentScrollPane
           
private  javax.swing.JTextArea commentTextArea
           
private  javax.swing.JButton createNewCollectionButton
           
private  Collection currentCollection
           
private  javax.swing.JLabel defaultPathLabel
           
private  javax.swing.JButton deleteCollectionButton
           
private  javax.swing.JPanel detailsPanel
           
private  javax.swing.JComboBox inChargeComboBox
           
private  javax.swing.JLabel inChargeLabel
           
private  javax.swing.JCheckBox isActiveCheckBox
           
private  javax.swing.JPanel jPanel
           
private  int lastAddedCollID
          lastAddedCollID used to indicate to the last added User ID to be able to identify the correct selected row after a recent addition
private  int lastSelectedCollectionIndex
           
private  javax.swing.JPanel masterPanel
           
private  javax.swing.JComboBox ownerComboBox
           
private  javax.swing.JLabel ownerLabel
           
private  javax.swing.JLabel priorityLabel
           
private  javax.swing.JFormattedTextField priorityTextField
           
private  javax.swing.JComboBox projectComboBox
           
private  javax.swing.JLabel projectLabel
           
private  boolean recordModified
           
private  javax.swing.JButton removeUserButton
           
private  javax.swing.JButton saveButton
           
private  CollectionsManagerGUI.UIStates uiState
           
private  java.awt.event.KeyAdapter updatesKeyAdapter
          A keyAdapter Instance that is frenquently used by this object, it detectects that a key was tapped within Text Based controls
private  javax.swing.JPanel usersPanel
           
private  javax.swing.JPanel workstationPanel
           
private  CheckBoxList workstationsCheckList
           
private  javax.swing.JLabel workstationsLabel
           
private  javax.swing.JScrollPane workstationsScrollPane
           
 
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
CollectionsManagerGUI()
          This is the default constructor
 
Method Summary
private  void adjustCurrentCollectionWorkstations()
          Adjsut current Collection workstations
private  void adjustDetailsPanel()
          Adjusts the details panel (fields) with the current selected collection
private  void clearDetailsPanel()
          clears the details Panel, mostly used in the Create Mode
private  boolean confirmDiscardChanges()
          Displays a confirmation regading discarding changes
private  javax.swing.JTextField getAbreviationTextField()
          This method initializes abreviationTextField
private  javax.swing.JButton getAddUserButton()
          This method initializes addUserButton
private  javax.swing.JCheckBox getAnyUserCheckBox()
          This method initializes anyUserCheckBox
private  javax.swing.JCheckBox getAnyWorkstationCheckBox()
          This method initializes anyWorkstationCheckBox
private  javax.swing.JList getAttachedUsersList()
          This method initializes availableRolesList
private  javax.swing.JScrollPane getAttachedUsersScrollPane()
           
private  javax.swing.JScrollPane getAvailableCollectionsScrollPane()
          Initializes availableCollectionsScrollPane
private  javax.swing.JTable getAvailableCollectionsTable()
          Initializes availableCollectionsTable
private  javax.swing.JScrollPane getAvailableUsersScrollPane()
           
private  javax.swing.JTree getAvailableUsersTree()
          This method initializes availableUsersTree
private  javax.swing.JTextField getCollectionDefaultPathTextField()
          This method initializes roleNameTextField
private  javax.swing.JTextField getCollectionNameTextField()
          This method initializes collectionNameTextField
private  javax.swing.JScrollPane getCommentScrollPane()
          Initializes commentScrollPane
private  javax.swing.JTextArea getCommentTextArea()
          This method initializes commentTextArea
private  javax.swing.JButton getCreateNewCollectionButton()
          This method initializes jButton1
private  javax.swing.JButton getDeleteCollectionButton()
          This method initializes jButton
private  javax.swing.JPanel getDetailsPanel()
          This method initializes detailsPanel
private  javax.swing.JComboBox getInChargeComboBox()
          This method initializes inChargeComboBox
private  javax.swing.JCheckBox getIsActiveCheckBox()
           
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JComboBox getOwnerComboBox()
          This method initializes ownerComboBox
private  javax.swing.JFormattedTextField getPriorityTextField()
          This method initializes priorityTextField
private  javax.swing.JComboBox getProjectComboBox()
          This method initializes projectComboBox
private  javax.swing.JButton getRemoveUserButton()
          This method initializes removeUserButton
private  javax.swing.JButton getSaveButton()
          This method initializes saveButton
private  javax.swing.JPanel getUsersPanel()
          This method initializes usersPanel
private  javax.swing.JPanel getWorkstationPanel()
          This method initializes workstationPanel
private  javax.swing.JScrollPane getWorkstationsScrollPane()
          This method initializes workstationsScrollPane
private  void initialize()
          Initiliazes the Component
private  void loadAttachedUsersList()
          Loads attached Users to the collection into attachedUsersList
private  void loadAvailableCollectionsTable()
          Loads available collections table
private  void loadAvaillableUsersTree()
           
 void reloadManager()
           
private  void setCreateMode()
          Sets the component to Create Mode
private  void setEditMode()
          Set the Component to the Edit Mode
private  void updateCollectionObject(Collection collection)
          update the collection object from the UI fields
private  boolean validateValues()
          Validates the UI Fields 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

availableCollectionsLabel

private javax.swing.JLabel availableCollectionsLabel

masterPanel

private javax.swing.JPanel masterPanel

detailsPanel

private javax.swing.JPanel detailsPanel

deleteCollectionButton

private javax.swing.JButton deleteCollectionButton

createNewCollectionButton

private javax.swing.JButton createNewCollectionButton

saveButton

private javax.swing.JButton saveButton

uiState

private CollectionsManagerGUI.UIStates uiState

collectionNameLabel

private javax.swing.JLabel collectionNameLabel

defaultPathLabel

private javax.swing.JLabel defaultPathLabel

collectionNameTextField

private javax.swing.JTextField collectionNameTextField

collectionDefaultPathTextField

private javax.swing.JTextField collectionDefaultPathTextField

availableCollectionsTable

private SortableTable availableCollectionsTable

lastSelectedCollectionIndex

private int lastSelectedCollectionIndex

lastAddedCollID

private int lastAddedCollID
lastAddedCollID used to indicate to the last added User ID to be able to identify the correct selected row after a recent addition


availableCollectionsScrollPane

private javax.swing.JScrollPane availableCollectionsScrollPane

commentScrollPane

private javax.swing.JScrollPane commentScrollPane

commentLabel

private javax.swing.JLabel commentLabel

workstationsLabel

private javax.swing.JLabel workstationsLabel

availableUsersLabel

private javax.swing.JLabel availableUsersLabel

attachedUsersLabel

private javax.swing.JLabel attachedUsersLabel

workstationsScrollPane

private javax.swing.JScrollPane workstationsScrollPane

workstationsCheckList

private CheckBoxList workstationsCheckList

currentCollection

private Collection currentCollection

recordModified

private boolean recordModified

commentTextArea

private javax.swing.JTextArea commentTextArea

abreviationLabel

private javax.swing.JLabel abreviationLabel

abreviationTextField

private javax.swing.JTextField abreviationTextField

anyUserCheckBox

private javax.swing.JCheckBox anyUserCheckBox

anyWorkstationCheckBox

private javax.swing.JCheckBox anyWorkstationCheckBox

isActiveCheckBox

private javax.swing.JCheckBox isActiveCheckBox

priorityLabel

private javax.swing.JLabel priorityLabel

priorityTextField

private javax.swing.JFormattedTextField priorityTextField

workstationPanel

private javax.swing.JPanel workstationPanel

usersPanel

private javax.swing.JPanel usersPanel

attachedUsersList

private javax.swing.JList attachedUsersList

availableUsersTree

private javax.swing.JTree availableUsersTree

removeUserButton

private javax.swing.JButton removeUserButton

addUserButton

private javax.swing.JButton addUserButton

availableUsersScrollPane

private javax.swing.JScrollPane availableUsersScrollPane

attachedUsersScrollPane

private javax.swing.JScrollPane attachedUsersScrollPane

updatesKeyAdapter

private java.awt.event.KeyAdapter updatesKeyAdapter
A keyAdapter Instance that is frenquently used by this object, it detectects that a key was tapped within Text Based controls


ownerLabel

private javax.swing.JLabel ownerLabel

ownerComboBox

private javax.swing.JComboBox ownerComboBox

projectLabel

private javax.swing.JLabel projectLabel

inChargeLabel

private javax.swing.JLabel inChargeLabel

projectComboBox

private javax.swing.JComboBox projectComboBox

inChargeComboBox

private javax.swing.JComboBox inChargeComboBox
Constructor Detail

CollectionsManagerGUI

public CollectionsManagerGUI()
This is the default constructor

Method Detail

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

getDeleteCollectionButton

private javax.swing.JButton getDeleteCollectionButton()
This method initializes jButton

Returns:
javax.swing.JButton

getCreateNewCollectionButton

private javax.swing.JButton getCreateNewCollectionButton()
This method initializes jButton1

Returns:
javax.swing.JButton

getDetailsPanel

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

Returns:
javax.swing.JPanel

getCollectionNameTextField

private javax.swing.JTextField getCollectionNameTextField()
This method initializes collectionNameTextField

Returns:
javax.swing.JTextField

getCollectionDefaultPathTextField

private javax.swing.JTextField getCollectionDefaultPathTextField()
This method initializes roleNameTextField

Returns:
javax.swing.JTextField

getSaveButton

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

Returns:
javax.swing.JButton

getAvailableCollectionsScrollPane

private javax.swing.JScrollPane getAvailableCollectionsScrollPane()
Initializes availableCollectionsScrollPane

Returns:
availableCollectionsScrollPane

getAvailableCollectionsTable

private javax.swing.JTable getAvailableCollectionsTable()
Initializes availableCollectionsTable

Returns:
availableCollectionsTable

getCommentScrollPane

private javax.swing.JScrollPane getCommentScrollPane()
Initializes commentScrollPane

Returns:
commentScrollPane

getCommentTextArea

private javax.swing.JTextArea getCommentTextArea()
This method initializes commentTextArea

Returns:
javax.swing.JTextArea

getWorkstationsScrollPane

private javax.swing.JScrollPane getWorkstationsScrollPane()
This method initializes workstationsScrollPane

Returns:
javax.swing.JScrollPane

getAbreviationTextField

private javax.swing.JTextField getAbreviationTextField()
This method initializes abreviationTextField

Returns:
javax.swing.JTextField

getAnyUserCheckBox

private javax.swing.JCheckBox getAnyUserCheckBox()
This method initializes anyUserCheckBox

Returns:
javax.swing.JCheckBox

getAnyWorkstationCheckBox

private javax.swing.JCheckBox getAnyWorkstationCheckBox()
This method initializes anyWorkstationCheckBox

Returns:
javax.swing.JCheckBox

getIsActiveCheckBox

private javax.swing.JCheckBox getIsActiveCheckBox()
Returns:
javax.swing.JCheckBox

getPriorityTextField

private javax.swing.JFormattedTextField getPriorityTextField()
This method initializes priorityTextField

Returns:
javax.swing.JTextField

getWorkstationPanel

private javax.swing.JPanel getWorkstationPanel()
This method initializes workstationPanel

Returns:
javax.swing.JPanel

getUsersPanel

private javax.swing.JPanel getUsersPanel()
This method initializes usersPanel

Returns:
javax.swing.JPanel

getAttachedUsersScrollPane

private javax.swing.JScrollPane getAttachedUsersScrollPane()

getAttachedUsersList

private javax.swing.JList getAttachedUsersList()
This method initializes availableRolesList

Returns:
javax.swing.JList

getAvailableUsersScrollPane

private javax.swing.JScrollPane getAvailableUsersScrollPane()

getAvailableUsersTree

private javax.swing.JTree getAvailableUsersTree()
This method initializes availableUsersTree

Returns:
javax.swing.JTree

getRemoveUserButton

private javax.swing.JButton getRemoveUserButton()
This method initializes removeUserButton

Returns:
javax.swing.JButton

getAddUserButton

private javax.swing.JButton getAddUserButton()
This method initializes addUserButton

Returns:
javax.swing.JButton

initialize

private void initialize()
Initiliazes the Component


validateValues

private boolean validateValues()
Validates the UI Fields Values

Returns:
true if all fields are valid and false otherwise

updateCollectionObject

private void updateCollectionObject(Collection collection)
update the collection object from the UI fields

Parameters:
collection - the collection object to be updated

setEditMode

private void setEditMode()
Set the Component to the Edit Mode


setCreateMode

private void setCreateMode()
Sets the component to Create Mode


adjustDetailsPanel

private void adjustDetailsPanel()
Adjusts the details panel (fields) with the current selected collection


clearDetailsPanel

private void clearDetailsPanel()
clears the details Panel, mostly used in the Create Mode


confirmDiscardChanges

private boolean confirmDiscardChanges()
Displays a confirmation regading discarding changes

Returns:
true if confirmed and false if not

loadAvailableCollectionsTable

private void loadAvailableCollectionsTable()
Loads available collections table


adjustCurrentCollectionWorkstations

private void adjustCurrentCollectionWorkstations()
Adjsut current Collection workstations


loadAttachedUsersList

private void loadAttachedUsersList()
Loads attached Users to the collection into attachedUsersList


loadAvaillableUsersTree

private void loadAvaillableUsersTree()

reloadManager

public void reloadManager()
Specified by:
reloadManager in class BaseManagerGUI
See Also:
org.bibalex.managers.BaseManagerGUI#reloadManager()

getOwnerComboBox

private javax.swing.JComboBox getOwnerComboBox()
This method initializes ownerComboBox

Returns:
javax.swing.JComboBox

getProjectComboBox

private javax.swing.JComboBox getProjectComboBox()
This method initializes projectComboBox

Returns:
javax.swing.JComboBox

getInChargeComboBox

private javax.swing.JComboBox getInChargeComboBox()
This method initializes inChargeComboBox

Returns:
javax.swing.JComboBox