com.ibm.db
Class LogonDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--com.ibm.db.LogonDialog

public class LogonDialog
extends java.awt.Dialog
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.WindowListener

LogonDialog represents a dialog to obtain the userID and password prior to making a connection to the database.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  java.awt.Button buttonCancel
           
private  java.awt.Button buttonOK
           
private  boolean cancelPrompt
           
private static java.lang.String copyright
           
private  java.awt.Component parentRef
           
private  java.lang.String pwd
           
private  java.awt.TextField textFieldLogonID
           
private  java.awt.TextField textFieldPassword
           
private  java.lang.String uid
           
 
Fields inherited from class java.awt.Dialog
base, keepBlocking, modal, nameCounter, resizable, serialVersionUID, title
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, nativeActive, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
LogonDialog(java.awt.Component c)
          Constructs a new LogonDialog.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles actionPerformed events.
protected static void buildCons(java.awt.GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx, int wy)
           
protected static void centerWindowOnComponent(java.awt.Window w, java.awt.Component c)
           
protected static void centerWindowOnRectangle(java.awt.Window w, java.awt.Rectangle r)
           
private  void connButtonOK()
           
protected  boolean getCancelPrompt()
           
static java.awt.Frame getFrameForComponent(java.awt.Component parentComponent)
          Returns the specified component's Frame.
 java.awt.Insets getInsets()
          Returns the insets for the dialog.
protected  java.lang.String getPwd()
           
private  java.awt.TextField getTextFieldLogonID()
           
private  java.awt.TextField getTextFieldPassword()
           
protected  java.lang.String getUid()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 boolean promptAndSetUID(DatabaseConnectionSpec c)
          Displays a logon dialog to obtain the userid and password.
 boolean promptAndSetUID(java.lang.String[] uid, java.lang.String[] pwd)
          Displays a logon dialog to obtain the userid and password.
private  void setCancelPrompt(boolean c)
           
protected  void setPwd(java.lang.String s)
           
protected  void setUid(java.lang.String s)
           
protected  void showDialog()
           
 void windowActivated(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowClosed(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowClosing(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowDeactivated(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowDeiconified(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowIconified(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 void windowOpened(java.awt.event.WindowEvent e)
          Method to handle events for the WindowListener interface.
 
Methods inherited from class java.awt.Dialog
, addNotify, conditionalShow, constructComponentName, dispose, getTitle, hide, hideAndDisposeHandler, initIDs, isModal, isResizable, paramString, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, eventEnabled, finalize, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postProcessKeyEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, readObject, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, toBack, toFront, transferFocus, writeObject
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getIntrinsicCursor, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

textFieldLogonID

private java.awt.TextField textFieldLogonID

textFieldPassword

private java.awt.TextField textFieldPassword

buttonOK

private java.awt.Button buttonOK

buttonCancel

private java.awt.Button buttonCancel

parentRef

private java.awt.Component parentRef

uid

private java.lang.String uid

pwd

private java.lang.String pwd

cancelPrompt

private boolean cancelPrompt

copyright

private static final java.lang.String copyright
Constructor Detail

LogonDialog

public LogonDialog(java.awt.Component c)
Constructs a new LogonDialog.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles actionPerformed events.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionPerformed event

buildCons

protected static void buildCons(java.awt.GridBagConstraints gbc,
                                int gx,
                                int gy,
                                int gw,
                                int gh,
                                int wx,
                                int wy)

centerWindowOnComponent

protected static void centerWindowOnComponent(java.awt.Window w,
                                              java.awt.Component c)

centerWindowOnRectangle

protected static void centerWindowOnRectangle(java.awt.Window w,
                                              java.awt.Rectangle r)

connButtonOK

private void connButtonOK()

getCancelPrompt

protected boolean getCancelPrompt()

getFrameForComponent

public static java.awt.Frame getFrameForComponent(java.awt.Component parentComponent)
Returns the specified component's Frame.
Parameters:
parentComponent - the Component to check for a Frame
Returns:
the Frame that contains the component, or the default frame if the component is null, or does not have a valid Frame parent

getInsets

public java.awt.Insets getInsets()
Returns the insets for the dialog.
Overrides:
getInsets in class java.awt.Container

getPwd

protected java.lang.String getPwd()

getTextFieldLogonID

private java.awt.TextField getTextFieldLogonID()

getTextFieldPassword

private java.awt.TextField getTextFieldPassword()

getUid

protected java.lang.String getUid()

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

promptAndSetUID

public boolean promptAndSetUID(java.lang.String[] uid,
                               java.lang.String[] pwd)
Displays a logon dialog to obtain the userid and password. The passed userid and password are used to initialize the dialog.
Parameters:
uid - the userid
pwd - password

promptAndSetUID

public boolean promptAndSetUID(DatabaseConnectionSpec c)
                        throws DataException
Displays a logon dialog to obtain the userid and password. The userid and password from the specified DatabaseConnectionSpec are used to initialize the dialog. If a connection has already been established for the connection alias name specified in the DatabaseConnectionSpec, no dialog is displayed since the connection is already established.
Parameters:
c - the DatabaseConnectionSpec
Throws:
DataException - driverNotFound - if JDBC driver not found

setCancelPrompt

private void setCancelPrompt(boolean c)

setPwd

protected void setPwd(java.lang.String s)

setUid

protected void setUid(java.lang.String s)

showDialog

protected void showDialog()

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Method to handle events for the WindowListener interface.
Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
e - java.awt.event.WindowEvent