org.bibalex.daf.managers.admin
Class UsersManagerGUI

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

public class UsersManagerGUI
extends BaseManagerGUI

This class manages operations over System Users like add, remove, assign phases,...

Author:
Mohammed.Abuouda
See Also:
Serialized Form

Nested Class Summary
private static class UsersManagerGUI.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.JButton addAllButton
           
private  javax.swing.JButton addPhaseButton
          addPhaseButton used to add phase to assigned phases list
private  javax.swing.JCheckBox anyPhaseCheckBox
          anyPhaseCheckBox is check box indicates if the selected User can work on any phase or not
private  javax.swing.JLabel anyPhaseLabel
           
private  javax.swing.JLabel assignedPhasesLabel
           
private  javax.swing.JList assignedPhasesList
          assignedPhasesList shows up the phases already assigned to the selected User
private  javax.swing.JScrollPane assignedPhasesScrollPane
          assignedPhasesScrollPane is the container of assignedPhasesList
private  javax.swing.JLabel assignedRoleLabel
           
private  javax.swing.JLabel availablePhasesLabel
           
private  javax.swing.JScrollPane AvailablePhasesScrollPane
          AvailablePhasesScrollPane is the container of availablePhasesTree
private  javax.swing.JTree availablePhasesTree
          availablePhasesTree conatines system job types associated with their phases
private  javax.swing.JLabel availableUsersLabel
           
private  javax.swing.JScrollPane availableUsersScrollPane
          availableUsersScrollPane is the container Pane for available Users table
private  SortableTable availableUsersTable
          availableUsersTable is the table that shows up the system Users
private  javax.swing.JButton createNewUserButton
          createNewUserButton is the button to craete new User
private  javax.swing.JButton deleteUserButton
          deleteUserButton is the button to delete User
private  javax.swing.JPanel detailsPanel
          detailsPanel is the panel that carry the derived components which are relevant to the selected User from the availableUsersTable
private  javax.swing.JCheckBox isActiveCheckBox
          isActiveCheckBox is check box indicates if the selected User active or not
private  javax.swing.JLabel isActiveLabel
           
private  javax.swing.JCheckBox isLDAPCheckBox
          isLDAPCheckBox is check box indicates if the selected User can be authenticated through LDAP or not
private  javax.swing.JLabel isLDAPLabel
           
private  javax.swing.JLabel jobTypeLabel
           
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master and details panels
private  int lastAddedUserID
          lastAddedUserID used to indicate to the last added User ID to be able to identify the correct selected row after a recent addition
private  int lastSelectedUserIndex
          lastSelectedUserIndex used to indicate to the last selected row of available User table
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are availableUsersTable,deleteUserButton and createNewUserButton
private  javax.swing.JLabel MaxJobsLabel
           
private  javax.swing.JTextField MaxJobsTextField
          MaxJobsTextField is a text field shows the Max Job of selectd User
private  boolean recordModified
          recordModified used to check if there are updates or modifications applied but not saved yet to the selected User
private  javax.swing.JButton removeAllButton
           
private  javax.swing.JButton removePhaseButton
          removePhaseButton used to remove phase from assigned phases list
private  javax.swing.JComboBox roleComboBox
          roleComboBox conatines system roles
private  javax.swing.JButton saveButton
          saveButton is the button to save the changes of User these changes could be updates or even new data
private  UsersManagerGUI.UIStates uiState
           
private  java.awt.event.KeyAdapter updatesKeyAdapter
          key listener handles the events of change the text of text fields, chnage the selected index of combo boxes and check boxes.
private  javax.swing.JLabel userNameLabel
           
private  javax.swing.JTextField userNameTextField
          userNameTextField is a text field shows the name of selectd User
private  javax.swing.JLabel userPWDLabel
           
private  javax.swing.JTextField userPWDTextField
          userPWDTextField is a text field shows the password of selectd User
 
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
UsersManagerGUI()
          This is the default constructor
 
Method Summary
private  void adjustDetailsPanel()
          Extract the data of the selected WS and fill up the correspondence fileds
private  void clearDetailsPanel()
          reset GUI controls
private  boolean confirmDiscardChanges()
          Confirm discard User changes message
private  javax.swing.JButton getAddAllButton()
          This method initializes addAllButton
private  javax.swing.JCheckBox getAnyPhaseCheckBox()
          This method initializes anyPhaseCheckBox this check box indicates if the User can work on any phase or not
 javax.swing.JScrollPane getAssignedPhasesScrollPane()
          This method initializes assignedPhasesScrollPane
private  javax.swing.JComboBox getAssignedRoleComboBox()
          This method initializes roleComboBox
 javax.swing.JScrollPane getAvailablePhasesScrollPane()
          This method initializes AvailablePhasesScrollPane
private  javax.swing.JTree getavailablePhasesTree()
          This method initializes availablePhasesTree
 javax.swing.JScrollPane getAvailableUsersScrollPane()
          This method initializes availableUsersScrollPane
 javax.swing.JTable getAvailableUsersTable()
          This method initilize availableUsersTable
private  javax.swing.JButton getCreateNewUserButton()
          /* This method initializes createNewUserButton
private  javax.swing.JButton getDeleteUserButton()
          This method initializes deleteUserButton
private  javax.swing.JPanel getDetailsPanel()
          This method initializes detailsPanel
private  javax.swing.JCheckBox getIsActiveCheckBox()
          This method initializes isActiveCheckBox this check box indicates if the User is active or not active Users only considered as worker Users
private  javax.swing.JCheckBox getIsLDAPCheckBox()
          This method initializes isLDAPCheckBox this check box indicates if the User can be authenticated using LDAP or not
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JTextField getMaxJobsTextField()
          This method initializes MaxJobsTextField
private  javax.swing.JButton getPhaseButton()
          This method initializes addPhaseButton
private  javax.swing.JButton getRemoveAllButton()
          This method initializes removeAllButton
private  javax.swing.JButton getRemovePhaseButton()
          This method initializes removeUserButton
private  javax.swing.JButton getSaveButton()
          This method initializes saveButton
private  javax.swing.JTextField getUserNameTextField()
          This method initializes userNameTextField
private  javax.swing.JTextField getUserPWDTextField()
          This method initializes userPWDTextField
private  void initialize()
          This method initializes layout
private  javax.swing.JList loadAssignedPhasesList()
          This method initializes assignedPhasesList
private  void loadAttachedPhasesList()
          Loads assignedPhasesList to selected user
private  void loadAvailableUsersTable()
          This method loads availableUsersTable
 void reloadManager()
          Reset controls when WS 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 availableUsersTable,deleteUserButton and createNewUserButton


detailsPanel

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


availableUsersScrollPane

private javax.swing.JScrollPane availableUsersScrollPane
availableUsersScrollPane is the container Pane for available Users table


AvailablePhasesScrollPane

private javax.swing.JScrollPane AvailablePhasesScrollPane
AvailablePhasesScrollPane is the container of availablePhasesTree


assignedPhasesScrollPane

private javax.swing.JScrollPane assignedPhasesScrollPane
assignedPhasesScrollPane is the container of assignedPhasesList


availableUsersTable

private SortableTable availableUsersTable
availableUsersTable is the table that shows up the system Users


deleteUserButton

private javax.swing.JButton deleteUserButton
deleteUserButton is the button to delete User


createNewUserButton

private javax.swing.JButton createNewUserButton
createNewUserButton is the button to craete new User


saveButton

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


removePhaseButton

private javax.swing.JButton removePhaseButton
removePhaseButton used to remove phase from assigned phases list


addPhaseButton

private javax.swing.JButton addPhaseButton
addPhaseButton used to add phase to assigned phases list


userNameTextField

private javax.swing.JTextField userNameTextField
userNameTextField is a text field shows the name of selectd User


userPWDTextField

private javax.swing.JTextField userPWDTextField
userPWDTextField is a text field shows the password of selectd User


MaxJobsTextField

private javax.swing.JTextField MaxJobsTextField
MaxJobsTextField is a text field shows the Max Job of selectd User


roleComboBox

private javax.swing.JComboBox roleComboBox
roleComboBox conatines system roles


availablePhasesTree

private javax.swing.JTree availablePhasesTree
availablePhasesTree conatines system job types associated with their phases


assignedPhasesList

private javax.swing.JList assignedPhasesList
assignedPhasesList shows up the phases already assigned to the selected User


isLDAPCheckBox

private javax.swing.JCheckBox isLDAPCheckBox
isLDAPCheckBox is check box indicates if the selected User can be authenticated through LDAP or not


anyPhaseCheckBox

private javax.swing.JCheckBox anyPhaseCheckBox
anyPhaseCheckBox is check box indicates if the selected User can work on any phase or not


isActiveCheckBox

private javax.swing.JCheckBox isActiveCheckBox
isActiveCheckBox is check box indicates if the selected User active or not


userNameLabel

private javax.swing.JLabel userNameLabel

userPWDLabel

private javax.swing.JLabel userPWDLabel

availableUsersLabel

private javax.swing.JLabel availableUsersLabel

jobTypeLabel

private javax.swing.JLabel jobTypeLabel

anyPhaseLabel

private javax.swing.JLabel anyPhaseLabel

isLDAPLabel

private javax.swing.JLabel isLDAPLabel

isActiveLabel

private javax.swing.JLabel isActiveLabel

assignedRoleLabel

private javax.swing.JLabel assignedRoleLabel

assignedPhasesLabel

private javax.swing.JLabel assignedPhasesLabel

availablePhasesLabel

private javax.swing.JLabel availablePhasesLabel

MaxJobsLabel

private javax.swing.JLabel MaxJobsLabel

lastSelectedUserIndex

private int lastSelectedUserIndex
lastSelectedUserIndex used to indicate to the last selected row of available User table


lastAddedUserID

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


recordModified

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


uiState

private UsersManagerGUI.UIStates uiState

updatesKeyAdapter

private java.awt.event.KeyAdapter updatesKeyAdapter
key listener handles the events of change the text of text fields, chnage the selected index of combo boxes and check boxes. 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 User to another one, here the system generates a confirmation message that asks the user to discared the changes he done or to commit them.


addAllButton

private javax.swing.JButton addAllButton

removeAllButton

private javax.swing.JButton removeAllButton
Constructor Detail

UsersManagerGUI

public UsersManagerGUI()
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

getAvailableUsersScrollPane

public javax.swing.JScrollPane getAvailableUsersScrollPane()
This method initializes availableUsersScrollPane

Returns:
javax.swing.JScrollPane

getAvailablePhasesScrollPane

public javax.swing.JScrollPane getAvailablePhasesScrollPane()
This method initializes AvailablePhasesScrollPane

Returns:
javax.swing.JScrollPane

getAssignedPhasesScrollPane

public javax.swing.JScrollPane getAssignedPhasesScrollPane()
This method initializes assignedPhasesScrollPane

Returns:
javax.swing.JScrollPane

getDeleteUserButton

private javax.swing.JButton getDeleteUserButton()
This method initializes deleteUserButton

Returns:
javax.swing.JButton

getCreateNewUserButton

private javax.swing.JButton getCreateNewUserButton()
/* This method initializes createNewUserButton

Returns:
javax.swing.JButton

getSaveButton

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

Returns:
javax.swing.JButton

getRemovePhaseButton

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

Returns:
javax.swing.JButton

getPhaseButton

private javax.swing.JButton getPhaseButton()
This method initializes addPhaseButton

Returns:
javax.swing.JButton

getUserNameTextField

private javax.swing.JTextField getUserNameTextField()
This method initializes userNameTextField

Returns:
javax.swing.JTextField

getUserPWDTextField

private javax.swing.JTextField getUserPWDTextField()
This method initializes userPWDTextField

Returns:
javax.swing.JTextField

getMaxJobsTextField

private javax.swing.JTextField getMaxJobsTextField()
This method initializes MaxJobsTextField

Returns:
JFormattedTextField

getAssignedRoleComboBox

private javax.swing.JComboBox getAssignedRoleComboBox()
This method initializes roleComboBox

Returns:
JComboBox

getIsLDAPCheckBox

private javax.swing.JCheckBox getIsLDAPCheckBox()
This method initializes isLDAPCheckBox this check box indicates if the User can be authenticated using LDAP or not

Returns:
JCheckBox

getAnyPhaseCheckBox

private javax.swing.JCheckBox getAnyPhaseCheckBox()
This method initializes anyPhaseCheckBox this check box indicates if the User can work on any phase or not

Returns:
javax.swing.JCheckBox

getIsActiveCheckBox

private javax.swing.JCheckBox getIsActiveCheckBox()
This method initializes isActiveCheckBox this check box indicates if the User is active or not active Users only considered as worker Users

Returns:
JCheckBox

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 WS and fill up the correspondence fileds


clearDetailsPanel

private void clearDetailsPanel()
reset GUI controls


getAvailableUsersTable

public javax.swing.JTable getAvailableUsersTable()
This method initilize availableUsersTable


loadAvailableUsersTable

private void loadAvailableUsersTable()
This method loads availableUsersTable


getavailablePhasesTree

private javax.swing.JTree getavailablePhasesTree()
This method initializes availablePhasesTree

Returns:
javax.swing.JTree

loadAssignedPhasesList

private javax.swing.JList loadAssignedPhasesList()
This method initializes assignedPhasesList

Returns:
JList

loadAttachedPhasesList

private void loadAttachedPhasesList()
Loads assignedPhasesList to selected user


reloadManager

public void reloadManager()
Reset controls when WS tab change

Specified by:
reloadManager in class BaseManagerGUI

getAddAllButton

private javax.swing.JButton getAddAllButton()
This method initializes addAllButton

Returns:
javax.swing.JButton

getRemoveAllButton

private javax.swing.JButton getRemoveAllButton()
This method initializes removeAllButton

Returns:
javax.swing.JButton