ehsbe CommonsTM
Version 1.1.0rc3

com.ehsbe.commons.gui
Class JxLoginPanel

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.jdesktop.swingx.JXPanel
                      extended by org.jdesktop.swingx.JXImagePanel
                          extended by com.ehsbe.commons.gui.JxLoginPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class JxLoginPanel
extends org.jdesktop.swingx.JXImagePanel

JxLoginPanel is a JPanel that implements a Login dialog with support for saving passwords supplied for future use in a secure manner. It is intended to work with LoginService and PasswordStore and UserNameStore to obtain the values for the appropriate controls.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdesktop.swingx.JXImagePanel
org.jdesktop.swingx.JXImagePanel.Style
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
JxLoginPanel()
          Create a login panel with no pusername and password store controls enabled.
JxLoginPanel(org.jdesktop.swingx.auth.UserNameStore userStore, org.jdesktop.swingx.auth.LoginService service, org.jdesktop.swingx.auth.PasswordStore passwordStore)
          Create a new login panel.
 
Method Summary
 org.jdesktop.swingx.auth.LoginService getLoginService()
          Get the service used to find the server url
 char[] getPassword()
          Gets the Password for this panel.
 org.jdesktop.swingx.auth.PasswordStore getPasswordStore()
          Get the PasswordStore for this panel.
 String getUserName()
          Gets the User name entered/selected in the user name field/list.
 org.jdesktop.swingx.auth.UserNameStore getUserNameStore()
          Get the UserNameStore for this panel.
 boolean isSaveEnabled()
          Check, whether the username/password should be saved.
 void setLoginService(org.jdesktop.swingx.auth.LoginService service)
          Set the login service, used to retrieve the server url, which is in turn used to retrieve the correct user name list/password from the user name and password store.
 void setPassword(char[] password)
          Sets the Password for this panel.
 void setPasswordStore(org.jdesktop.swingx.auth.PasswordStore store)
          Sets the PasswordStore used to retrieve stored passwords.
 void setSaveEnable(boolean enable)
          Explicitly enable/disable username/password saving.
 void setUserName(String username)
          Populate the User name field with the given name or select it from the given list (which has been generated from the user name store).
 void setUserNameStore(org.jdesktop.swingx.auth.UserNameStore store)
          Sets the UserNameStore used to retrieve user names for the user name combo selection box.
 
Methods inherited from class org.jdesktop.swingx.JXImagePanel
getImage, getPreferredSize, getStyle, isEditable, paintComponent, setDefaultImage, setEditable, setImage, setImageLoader, setStyle
 
Methods inherited from class org.jdesktop.swingx.JXPanel
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, isInheritAlpha, isPaintBorderInsets, paint, setAlpha, setBackground, setBackgroundPainter, setInheritAlpha, setPaintBorderInsets, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth
 
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, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, 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, 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
 

Constructor Detail

JxLoginPanel

public JxLoginPanel()
Create a login panel with no pusername and password store controls enabled.


JxLoginPanel

public JxLoginPanel(org.jdesktop.swingx.auth.UserNameStore userStore,
                    org.jdesktop.swingx.auth.LoginService service,
                    org.jdesktop.swingx.auth.PasswordStore passwordStore)
Create a new login panel.

Parameters:
userStore - where to obtain user names for combo selection box
service - where to obtain the server aka url for login, which is in turn used, to get password information from the password store
passwordStore - where to obtain stored passwords.
Method Detail

setSaveEnable

public void setSaveEnable(boolean enable)
Explicitly enable/disable username/password saving. Only the selection state of the checkbox is effected. So if no username or password store is given, the checkbox is not visible, but has the given state, which is returned by isSaveEnabled().

Parameters:
enable - true if username/password saving should be enabled.

setUserName

public void setUserName(String username)
Populate the User name field with the given name or select it from the given list (which has been generated from the user name store).

Parameters:
username - User name

getUserName

public String getUserName()
Gets the User name entered/selected in the user name field/list.

Returns:
the user name, whichmight be an empty string, but not null

setPasswordStore

public void setPasswordStore(org.jdesktop.swingx.auth.PasswordStore store)
Sets the PasswordStore used to retrieve stored passwords.

Parameters:
store - a PasswordStore, which might be null

getPasswordStore

public org.jdesktop.swingx.auth.PasswordStore getPasswordStore()
Get the PasswordStore for this panel.

Returns:
null if not set, the password store otherwise.

setUserNameStore

public void setUserNameStore(org.jdesktop.swingx.auth.UserNameStore store)
Sets the UserNameStore used to retrieve user names for the user name combo selection box.

Parameters:
store - a store, which might be null

getUserNameStore

public org.jdesktop.swingx.auth.UserNameStore getUserNameStore()
Get the UserNameStore for this panel.

Returns:
null if not set, the username store otherwise.

setLoginService

public void setLoginService(org.jdesktop.swingx.auth.LoginService service)
Set the login service, used to retrieve the server url, which is in turn used to retrieve the correct user name list/password from the user name and password store.

Parameters:
service - service to use, might be null

getLoginService

public org.jdesktop.swingx.auth.LoginService getLoginService()
Get the service used to find the server url

Returns:
null if not set, the service otherwise.

setPassword

public void setPassword(char[] password)
Sets the Password for this panel.

Parameters:
password - Password

getPassword

public char[] getPassword()
Gets the Password for this panel.

Returns:
password Password

isSaveEnabled

public boolean isSaveEnabled()
Check, whether the username/password should be saved.

Returns:
true, if the corresponding checkox is selected.

ehsbe CommonsTM
Version 1.1.0rc3

Copyright ©2005-2009 EHSBE, Walther-Rathenau-Str. 58, 39104 Magdeburg, Sachsen-Anhalt, Germany. All Rights Reserved.