edu.udo.cs.yale.gui.wizards
Class DBExampleSourceConfigurationWizard

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 edu.udo.cs.yale.gui.wizards.DBExampleSourceConfigurationWizard
All Implemented Interfaces:
ConfigurationWizardCreator, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class DBExampleSourceConfigurationWizard
extends javax.swing.JDialog
implements ConfigurationWizardCreator

This class is the creator for wizard dialogs defining the configuration for DatabaseExampleSource operators.

Version:
$Id: DBExampleSourceConfigurationWizard.java,v 1.6 2006/09/29 10:29:10 ingomierswa Exp $
Author:
Ingo Mierswa
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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.JList attributeList
          The list with all attribute names.
(package private)  java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributeNameMap
          All attribute names for the available tables.
private  java.util.Map<java.lang.String,java.lang.String> attributeTypeMap
          This map contains all information for the attribute types.
private  java.awt.CardLayout cardLayout
           
private  int currentStep
           
private  javax.swing.JTextField databaseNameField
          This field contains the database name.
private  DBExampleSourceConfigurationWizardDataTable dataView
          The definition of all attribute types.
private  DatabaseHandler handler
          The database handler.
private  boolean isConnected
          Indicates if the handler is currently connected.
private  ConfigurationListener listener
           
private  javax.swing.JPanel mainPanel
           
private  javax.swing.JButton next
           
private  int numberOfSteps
           
private  java.lang.String password
          Remembers the password during connections.
private  javax.swing.JPasswordField passwordField
          This field contains the password.
private  boolean passwordFromTextField
          Indicates if the password was defined in the text field (and hence should be set as operator parameter).
private  javax.swing.JButton previous
           
private static long serialVersionUID
           
private  javax.swing.JTextField serverField
          This field contains the server name or IP.
private  javax.swing.JTextArea sqlQueryTextArea
          The text area with the where clause.
private static int STEP_TABLE_SELECTION
           
private static int STEP_TYPE_DEFINITION
           
private static int STEP_USER_DATA
           
private  javax.swing.JComboBox systemComboBox
          This combo box contains all available database drivers.
private  javax.swing.JList tableList
          The list with all tables.
private  javax.swing.JTextField urlField
          This field contains the complete url string for the defined driver.
private static java.lang.String USER_DEFINED_STRING
           
private  javax.swing.JTextField userNameField
          This field contains the user name.
private  javax.swing.JTextArea whereTextArea
          The text area with the where clause.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DBExampleSourceConfigurationWizard(ConfigurationListener listener)
          Creates a new wizard.
 
Method Summary
private  void addDBSystemSelectionStep()
           
private  void addSpecialAttributesStep()
           
private  void addStep(java.awt.Component c)
           
private  void addTableSelectionStep()
           
private  void addTitleStep()
           
private  void addUserDataStep()
           
private  void appendAttributeName(java.lang.StringBuffer result, java.lang.Object o, boolean first, boolean singleTable)
           
private  void cancel()
           
private  void connect()
           
private  java.lang.String createAttributeName(java.lang.String attributeName, boolean singleTable)
           
 void createConfigurationWizard(ConfigurationListener listener)
           
private  java.lang.String createPredefinedDatabaseURL()
           
private  void disconnect()
           
private  void ensureAttributeTypeIsUnique(java.lang.String type)
           
private  void finish()
           
private  java.lang.String getDatabaseURL()
           
private  java.lang.String getQueryString()
           
private  void retrieveTableAndAttributeNames()
           
private  void showConnectionError(java.lang.String message, java.sql.SQLException e)
           
private  void step(int dir)
           
private  void testConnection()
           
private  void updateAttributeNames()
           
private  void updateDataView()
           
private  void updateSQLQuery()
           
private  void updateSystemSelection()
           
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, 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, processEvent, processWindowFocusEvent, processWindowStateEvent, 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, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, 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
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

USER_DEFINED_STRING

private static final java.lang.String USER_DEFINED_STRING
See Also:
Constant Field Values

STEP_USER_DATA

private static final int STEP_USER_DATA
See Also:
Constant Field Values

STEP_TABLE_SELECTION

private static final int STEP_TABLE_SELECTION
See Also:
Constant Field Values

STEP_TYPE_DEFINITION

private static final int STEP_TYPE_DEFINITION
See Also:
Constant Field Values

next

private javax.swing.JButton next

previous

private javax.swing.JButton previous

cardLayout

private java.awt.CardLayout cardLayout

mainPanel

private javax.swing.JPanel mainPanel

currentStep

private int currentStep

numberOfSteps

private int numberOfSteps

listener

private ConfigurationListener listener

handler

private DatabaseHandler handler
The database handler.


isConnected

private boolean isConnected
Indicates if the handler is currently connected.


attributeNameMap

java.util.Map<java.lang.String,java.util.List<java.lang.String>> attributeNameMap
All attribute names for the available tables.


systemComboBox

private javax.swing.JComboBox systemComboBox
This combo box contains all available database drivers.


serverField

private javax.swing.JTextField serverField
This field contains the server name or IP.


urlField

private javax.swing.JTextField urlField
This field contains the complete url string for the defined driver.


databaseNameField

private javax.swing.JTextField databaseNameField
This field contains the database name.


userNameField

private javax.swing.JTextField userNameField
This field contains the user name.


passwordField

private javax.swing.JPasswordField passwordField
This field contains the password.


password

private java.lang.String password
Remembers the password during connections.


passwordFromTextField

private boolean passwordFromTextField
Indicates if the password was defined in the text field (and hence should be set as operator parameter).


tableList

private javax.swing.JList tableList
The list with all tables.


attributeList

private javax.swing.JList attributeList
The list with all attribute names.


whereTextArea

private javax.swing.JTextArea whereTextArea
The text area with the where clause.


sqlQueryTextArea

private javax.swing.JTextArea sqlQueryTextArea
The text area with the where clause.


attributeTypeMap

private java.util.Map<java.lang.String,java.lang.String> attributeTypeMap
This map contains all information for the attribute types.


dataView

private DBExampleSourceConfigurationWizardDataTable dataView
The definition of all attribute types.

Constructor Detail

DBExampleSourceConfigurationWizard

public DBExampleSourceConfigurationWizard(ConfigurationListener listener)
Creates a new wizard.

Method Detail

addTitleStep

private void addTitleStep()

addDBSystemSelectionStep

private void addDBSystemSelectionStep()

addUserDataStep

private void addUserDataStep()

addTableSelectionStep

private void addTableSelectionStep()

addSpecialAttributesStep

private void addSpecialAttributesStep()

addStep

private void addStep(java.awt.Component c)

step

private void step(int dir)

updateSystemSelection

private void updateSystemSelection()

getDatabaseURL

private java.lang.String getDatabaseURL()

createPredefinedDatabaseURL

private java.lang.String createPredefinedDatabaseURL()

testConnection

private void testConnection()

connect

private void connect()
              throws java.sql.SQLException
Throws:
java.sql.SQLException

disconnect

private void disconnect()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

retrieveTableAndAttributeNames

private void retrieveTableAndAttributeNames()
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

updateAttributeNames

private void updateAttributeNames()

updateDataView

private void updateDataView()
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

appendAttributeName

private void appendAttributeName(java.lang.StringBuffer result,
                                 java.lang.Object o,
                                 boolean first,
                                 boolean singleTable)

updateSQLQuery

private void updateSQLQuery()

getQueryString

private java.lang.String getQueryString()

showConnectionError

private void showConnectionError(java.lang.String message,
                                 java.sql.SQLException e)

finish

private void finish()

ensureAttributeTypeIsUnique

private void ensureAttributeTypeIsUnique(java.lang.String type)

createAttributeName

private java.lang.String createAttributeName(java.lang.String attributeName,
                                             boolean singleTable)

cancel

private void cancel()

createConfigurationWizard

public void createConfigurationWizard(ConfigurationListener listener)
Specified by:
createConfigurationWizard in interface ConfigurationWizardCreator


Copyright © 2001-2006