proper.gui.core.text
Class DatabaseTextField

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 proper.gui.core.text.ProperTextField
                      extended by proper.gui.core.text.DatabaseTextField
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class DatabaseTextField
extends ProperTextField

This Panel represents a combination of a JTextField and a Button with which you can open a dialog to choose database/table.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int TYPE_COLUMN
          represents a textfield for Columns
static int TYPE_DATABASE
          represents a textfield for Databases
static int TYPE_TABLE
          represents a textfield for Tables
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
DatabaseTextField(ProperFrame parent, int type)
          initializes the field with a standard size
DatabaseTextField(ProperFrame parent, int type, int columns)
          initializes the field with the given size
DatabaseTextField(ProperFrame parent, int type, java.lang.String text, int columns)
          initializes the field the given text and the given size
DatabaseTextField(ProperFrame parent, int type, java.lang.String text, int columns, boolean useIcon)
          initializes the field the given text and the given size
 
Method Summary
 void addConnectorChangeListener(ConnectorChangeListener listener)
          adds the keylistener for the buttons
 java.lang.String getColumn()
          returns the columns
 Connector getConnector()
          returns the connector instance
 java.lang.String getDatabase()
          returns the database
 java.lang.String getPreferredColumn()
          returns the preferred table
 java.lang.String getPreferredDatabase()
          returns the preferred database
 java.lang.String getPreferredTable()
          returns the preferred table
 java.lang.String getTable()
          returns the table
 int getType()
          returns the type of the textfield
 void removeConnectorChangeListener(ConnectorChangeListener listener)
          removes the given listener for connector changes
 void setConnector(Connector conn)
          sets the connector instance
 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)
 
Methods inherited from class proper.gui.core.text.ProperTextField
actionPerformed, getColumns, getDocument, getParentFrame, getText, getToolTipText, getUseIcon, setColumns, setText, setToolTipText
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_DATABASE

public static final int TYPE_DATABASE
represents a textfield for Databases

See Also:
Constant Field Values

TYPE_TABLE

public static final int TYPE_TABLE
represents a textfield for Tables

See Also:
Constant Field Values

TYPE_COLUMN

public static final int TYPE_COLUMN
represents a textfield for Columns

See Also:
Constant Field Values
Constructor Detail

DatabaseTextField

public DatabaseTextField(ProperFrame parent,
                         int type)
initializes the field with a standard size

Parameters:
parent - the parent frame
type - the type of dialog, see TYPE_* constants

DatabaseTextField

public DatabaseTextField(ProperFrame parent,
                         int type,
                         int columns)
initializes the field with the given size

Parameters:
parent - the parent frame
type - the type of dialog, see TYPE_* constants
columns - the size of the textfield

DatabaseTextField

public DatabaseTextField(ProperFrame parent,
                         int type,
                         java.lang.String text,
                         int columns)
initializes the field the given text and the given size

Parameters:
parent - the parent frame
type - the type of dialog, see TYPE_* constants
text - the text to display initially
columns - the size of the textfield

DatabaseTextField

public DatabaseTextField(ProperFrame parent,
                         int type,
                         java.lang.String text,
                         int columns,
                         boolean useIcon)
initializes the field the given text and the given size

Parameters:
parent - the parent frame
type - the type of dialog, see TYPE_* constants
text - the text to display initially
columns - the size of the textfield
useIcon - whether to display an Icon instead of "..."
Method Detail

getType

public int getType()
returns the type of the textfield


setConnector

public void setConnector(Connector conn)
sets the connector instance


getConnector

public Connector getConnector()
returns the connector instance


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 columns


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


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