proper.gui.core.dialog
Class DatabaseDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by proper.gui.core.dialog.ProperDialog
                          extended by proper.gui.core.dialog.DatabaseDialog
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, SizeChangeListener

public class DatabaseDialog
extends ProperDialog
implements SizeChangeListener

A simple dialog for picking database and table.

Version:
$Revision: 1.2 $
Author:
FracPete
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
 
Constructor Summary
DatabaseDialog()
          initializes the dialog with a dummy frame
DatabaseDialog(ProperFrame parent)
          initializes the dialog
DatabaseDialog(ProperFrame parent, java.lang.String title)
          initializes the dialog with the given title
DatabaseDialog(java.lang.String title)
          initializes the dialog with the given title
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          invoked when an action occurs
 void addConnectorChangeListener(ConnectorChangeListener listener)
          adds the keylistener for the buttons
 java.lang.String getColumn()
          returns the table
 Connector getConnector()
          returns the connector instance being used
 java.lang.String getDatabase()
          returns the database
 java.lang.String getDriver()
          returns the driver for connecting
 java.lang.String getExcludes()
          returns the patterns for excluding tables
 java.lang.String getPassword()
          returns the password of the user
 java.lang.String getPreferredColumn()
          returns the preferred table
 java.lang.String getPreferredDatabase()
          returns the preferred database
 java.lang.String getPreferredTable()
          returns the preferred table
 boolean getShowColumns()
          returns whether the columns are displayed
 boolean getShowConnect()
          returns whether the connect is displayed
 boolean getShowDriver()
          returns whether the driver is displayed
 boolean getShowTables()
          returns whether the tables are displayed
 java.lang.String getTable()
          returns the table
 java.lang.String getUrl()
          returns the connection URL
 java.lang.String getUser()
          returns the user used for connecting to the DB
 void keyPressed(java.awt.event.KeyEvent e)
          Invoked when a key has been pressed.
 void removeConnectorChangeListener(ConnectorChangeListener listener)
          removes the given listener for connector changes
 void setConnector(Connector conn)
          sets the connector object to use
 void setDriver(java.lang.String driver)
          sets the driver to use for connecting
 void setExcludes(java.lang.String excludes)
          sets the patterns for excluding tables
 void setPassword(java.lang.String password)
          sets the password of the user
 void setPreferredColumn(java.lang.String preferredColumn)
          sets the preferred table, which is preselected after connecting (if it can be found)
 void setPreferredDatabase(java.lang.String preferredDatabase)
          sets the preferred database, which is preselected after connecting (if it can be found)
 void setPreferredTable(java.lang.String preferredTable)
          sets the preferred table, which is preselected after connecting (if it can be found)
 void setShowColumns(boolean show)
          sets whether the columns should be displayed or not
 void setShowConnect(boolean show)
          sets whether the connect part should be displayed or not
 void setShowDriver(boolean show)
          sets whether the driver should be displayed or not
 void setShowTables(boolean show)
          sets whether the tables should be displayed or not
 void setUrl(java.lang.String url)
          sets the connection URL
 void setUser(java.lang.String user)
          sets the user to use for connecting to the DB
 void show()
          corrects the size before showing and also determines whether the connect part of the DB-panel needs to be displayed
 void sizeChanged(SizeChangeEvent e)
          listens to size changes of a component
 
Methods inherited from class proper.gui.core.dialog.ProperDialog
approved, close, getParentFrame, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, refresh, setCenteredLocation, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatabaseDialog

public DatabaseDialog()
initializes the dialog with a dummy frame


DatabaseDialog

public DatabaseDialog(ProperFrame parent)
initializes the dialog


DatabaseDialog

public DatabaseDialog(java.lang.String title)
initializes the dialog with the given title


DatabaseDialog

public DatabaseDialog(ProperFrame parent,
                      java.lang.String title)
initializes the dialog with the given title

Method Detail

setConnector

public void setConnector(Connector conn)
sets the connector object to use


getConnector

public Connector getConnector()
returns the connector instance being used


setDriver

public void setDriver(java.lang.String driver)
sets the driver to use for connecting


getDriver

public java.lang.String getDriver()
returns the driver for connecting


setUrl

public void setUrl(java.lang.String url)
sets the connection URL


getUrl

public java.lang.String getUrl()
returns the connection URL


setUser

public void setUser(java.lang.String user)
sets the user to use for connecting to the DB


getUser

public java.lang.String getUser()
returns the user used for connecting to the DB


setPassword

public void setPassword(java.lang.String password)
sets the password of the user


getPassword

public java.lang.String getPassword()
returns the password of the user


setExcludes

public void setExcludes(java.lang.String excludes)
sets the patterns for excluding tables


getExcludes

public java.lang.String getExcludes()
returns the patterns for excluding tables


setShowDriver

public void setShowDriver(boolean show)
sets whether the driver should be displayed or not


getShowDriver

public boolean getShowDriver()
returns whether the driver is displayed


setShowConnect

public void setShowConnect(boolean show)
sets whether the connect part should be displayed or not


getShowConnect

public boolean getShowConnect()
returns whether the connect is displayed


setShowTables

public void setShowTables(boolean show)
sets whether the tables should be displayed or not


getShowTables

public boolean getShowTables()
returns whether the tables are displayed


setShowColumns

public void setShowColumns(boolean show)
sets whether the columns should be displayed or not


getShowColumns

public boolean getShowColumns()
returns whether the columns are displayed


getDatabase

public java.lang.String getDatabase()
returns the database


setPreferredDatabase

public void setPreferredDatabase(java.lang.String preferredDatabase)
sets the preferred database, which is preselected after connecting (if it can be found)


getPreferredDatabase

public java.lang.String getPreferredDatabase()
returns the preferred database


getTable

public java.lang.String getTable()
returns the table


setPreferredTable

public void setPreferredTable(java.lang.String preferredTable)
sets the preferred table, which is preselected after connecting (if it can be found)


getPreferredTable

public java.lang.String getPreferredTable()
returns the preferred table


getColumn

public java.lang.String getColumn()
returns the table


setPreferredColumn

public void setPreferredColumn(java.lang.String preferredColumn)
sets the preferred table, which is preselected after connecting (if it can be found)


getPreferredColumn

public java.lang.String getPreferredColumn()
returns the preferred table


show

public void show()
corrects the size before showing and also determines whether the connect part of the DB-panel needs to be displayed

Overrides:
show in class ProperDialog

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
invoked when an action occurs

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class ProperDialog

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class ProperDialog

sizeChanged

public void sizeChanged(SizeChangeEvent e)
listens to size changes of a component

Specified by:
sizeChanged in interface SizeChangeListener

removeConnectorChangeListener

public void removeConnectorChangeListener(ConnectorChangeListener listener)
removes the given listener for connector changes


addConnectorChangeListener

public void addConnectorChangeListener(ConnectorChangeListener listener)
adds the keylistener for the buttons