public class SqlViewer extends JPanel implements ConnectionListener, HistoryChangedListener, QueryExecuteListener, ResultChangedListener
JComponent.AccessibleJComponent
Component.BaselineResizeBehavior
Modifier and Type | Field and Description |
---|---|
static String |
HEIGHT
the height property in the history file.
|
static String |
WIDTH
the width property in the history file.
|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, PROPERTIES, SOMEBITS
Constructor and Description |
---|
SqlViewer(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.
|
String |
getPassword()
returns the password from the currently active tab in the ResultPanel,
otherwise an empty string.
|
String |
getQuery()
returns the query from the currently active tab in the ResultPanel,
otherwise an empty string.
|
String |
getURL()
returns the database URL from the currently active tab in the ResultPanel,
otherwise an empty string.
|
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.
|
static void |
main(String[] args)
starts the SQL-Viewer interface.
|
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.
|
void |
saveSize()
obtains the size of the panel and saves it in the history.
|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate
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, transferFocusBackward, transferFocusUpCycle
public static final String WIDTH
public static final String HEIGHT
public SqlViewer(JFrame parent)
parent
- the parent of this panelpublic void connectionChange(ConnectionEvent evt)
connectionChange
in interface ConnectionListener
evt
- the eventpublic void queryExecuted(QueryExecuteEvent evt)
queryExecuted
in interface QueryExecuteListener
evt
- the eventpublic void resultChanged(ResultChangedEvent evt)
resultChanged
in interface ResultChangedListener
evt
- the eventpublic void historyChanged(HistoryChangedEvent evt)
historyChanged
in interface HistoryChangedListener
evt
- the eventpublic void saveSize()
saveHistory()
public void clear()
public String getURL()
ResultPanel
public String getUser()
ResultPanel
public String getPassword()
ResultPanel
public String getQuery()
ResultPanel
public 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(String[] args)
args
- the commandline arguments - ignoredCopyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.