public class SqlViewer extends javax.swing.JPanel implements ConnectionListener, HistoryChangedListener, QueryExecuteListener, ResultChangedListener
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HEIGHT
the height property in the history file.
|
protected static java.lang.String |
HISTORY_FILE
the name of the history file (in the home directory).
|
protected ConnectionPanel |
m_ConnectionPanel
the connection panel.
|
protected java.util.Properties |
m_History
stores the history.
|
protected InfoPanel |
m_InfoPanel
the info panel.
|
protected javax.swing.JFrame |
m_Parent
the parent of this panel.
|
protected java.lang.String |
m_Password
the password that was used to connect to the DB.
|
protected java.lang.String |
m_Query
the currently selected query.
|
protected QueryPanel |
m_QueryPanel
the query panel.
|
protected ResultPanel |
m_ResultPanel
the result panel.
|
protected java.lang.String |
m_URL
the connect string with which the query was run.
|
protected java.lang.String |
m_User
the user that was used to connect to the DB.
|
static java.lang.String |
WIDTH
the width property in the history file.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
SqlViewer(javax.swing.JFrame parent)
initializes the SqlViewer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(ConnectionListener l)
adds the given listener to the list of listeners.
|
void |
addHistoryChangedListener(HistoryChangedListener l)
adds the given listener to the list of listeners.
|
void |
addQueryExecuteListener(QueryExecuteListener l)
adds the given listener to the list of listeners.
|
void |
addResultChangedListener(ResultChangedListener l)
adds the given listener to the list of listeners.
|
void |
clear()
calls the clear method of all sub-panels to set back to default values and
free up memory.
|
void |
connectionChange(ConnectionEvent evt)
This method gets called when the connection is either established or
disconnected.
|
protected void |
createPanel()
builds the interface.
|
protected java.lang.String |
getHistoryFilename()
returns the filename of the history file.
|
java.lang.String |
getPassword()
returns the password from the currently active tab in the ResultPanel,
otherwise an empty string.
|
java.lang.String |
getQuery()
returns the query from the currently active tab in the ResultPanel,
otherwise an empty string.
|
java.lang.String |
getURL()
returns the database URL from the currently active tab in the ResultPanel,
otherwise an empty string.
|
java.lang.String |
getUser()
returns the user from the currently active tab in the ResultPanel,
otherwise an empty string.
|
void |
historyChanged(HistoryChangedEvent evt)
This method gets called when a history is modified.
|
protected void |
loadHistory(boolean set)
loads the history properties of the SqlViewer in the user's home directory.
|
static void |
main(java.lang.String[] args)
starts the SQL-Viewer interface.
|
protected java.lang.String |
modelToString(javax.swing.DefaultListModel m)
converts the given model into a comma-separated string.
|
void |
queryExecuted(QueryExecuteEvent evt)
This method gets called when a query has been executed.
|
void |
removeConnectionListener(ConnectionListener l)
removes the given listener from the list of listeners.
|
void |
removeHistoryChangedListener(HistoryChangedListener l)
removes the given listener from the list of listeners.
|
void |
removeQueryExecuteListener(QueryExecuteListener l)
removes the given listener from the list of listeners.
|
void |
removeResultChangedListener(ResultChangedListener l)
removes the given listener from the list of listeners.
|
void |
resultChanged(ResultChangedEvent evt)
This method gets called when a query has been executed.
|
protected void |
saveHistory()
saves the history properties of the SqlViewer in the user's home directory.
|
void |
saveSize()
obtains the size of the panel and saves it in the history.
|
protected javax.swing.DefaultListModel |
stringToModel(java.lang.String s)
transforms the given, comma-separated string into a DefaultListModel.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, 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, transferFocusBackward, transferFocusUpCycleprotected static final java.lang.String HISTORY_FILE
public static final java.lang.String WIDTH
public static final java.lang.String HEIGHT
protected javax.swing.JFrame m_Parent
protected ConnectionPanel m_ConnectionPanel
protected QueryPanel m_QueryPanel
protected ResultPanel m_ResultPanel
protected InfoPanel m_InfoPanel
protected java.lang.String m_URL
protected java.lang.String m_User
protected java.lang.String m_Password
protected java.lang.String m_Query
protected java.util.Properties m_History
public SqlViewer(javax.swing.JFrame parent)
parent - the parent of this panelprotected void createPanel()
public void connectionChange(ConnectionEvent evt)
connectionChange in interface ConnectionListenerevt - the eventpublic void queryExecuted(QueryExecuteEvent evt)
queryExecuted in interface QueryExecuteListenerevt - the eventpublic void resultChanged(ResultChangedEvent evt)
resultChanged in interface ResultChangedListenerevt - the eventpublic void historyChanged(HistoryChangedEvent evt)
historyChanged in interface HistoryChangedListenerevt - the eventprotected java.lang.String getHistoryFilename()
protected javax.swing.DefaultListModel stringToModel(java.lang.String s)
s - the string to break up and transform into a list modelprotected java.lang.String modelToString(javax.swing.DefaultListModel m)
m - the model to convertprotected void loadHistory(boolean set)
set - whether to set the read properties in the panels or notHISTORY_FILEprotected void saveHistory()
HISTORY_FILEpublic void saveSize()
saveHistory()public void clear()
public java.lang.String getURL()
ResultPanelpublic java.lang.String getUser()
ResultPanelpublic java.lang.String getPassword()
ResultPanelpublic java.lang.String getQuery()
ResultPanelpublic void addConnectionListener(ConnectionListener l)
l - the listener to add to the listpublic void removeConnectionListener(ConnectionListener l)
l - the listener to removepublic void addQueryExecuteListener(QueryExecuteListener l)
l - the listener to add to the listpublic void removeQueryExecuteListener(QueryExecuteListener l)
l - the listener to removepublic void addResultChangedListener(ResultChangedListener l)
l - the listener to add to the listpublic void removeResultChangedListener(ResultChangedListener l)
l - the listener to removepublic void addHistoryChangedListener(HistoryChangedListener l)
l - the listener to add to the listpublic void removeHistoryChangedListener(HistoryChangedListener l)
l - the listener to removepublic static void main(java.lang.String[] args)
args - the commandline arguments - ignored