|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.nqadmin.swingSet.SSDataNavigator
public class SSDataNavigator
SSDataNavigator.java
SwingSet - Open Toolkit For Making Swing Controls Database-Aware
Component that can be used for data navigation. It provides buttons for navigation, insertion, and deletion of records in a SSRowSet. The modification of a SSRowSet can be prevented using the setModificaton() method. Any changes made to the columns of a record will be updated whenever there is a navigation. For example if you are displaying three columns using the JTextField and the user changes the text in the text fields then the columns will be updated to the new values when the user navigates the SSRowSet. If the user wants to revert the changes he made he can press the Undo button, however this must be done before any navigation. Once navigation takes place changes can't be reverted using Undo button (has to be done manually by the user).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Field Summary |
|---|
| 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 | |
|---|---|
SSDataNavigator()
Creates a object of SSDataNavigator. |
|
SSDataNavigator(SSRowSet _sSRowSet)
Constructs a SSDataNavigator for the given SSRowSet |
|
SSDataNavigator(SSRowSet _sSRowSet,
java.awt.Dimension _buttonSize)
Constructs the SSDataNavigator with the given SSRowSet and sets the size of the buttons on the navigator to the given size |
|
| Method Summary | |
|---|---|
boolean |
containsRows()
Returns true if the SSRowSet contains one or more rows, else false. |
void |
doAddButtonClick()
Calls the doClick on Add Button. |
void |
doCommitButtonClick()
Calls the doClick on Commit Button. |
void |
doDeleteButtonClick()
Calls the doClick on Delete Button. |
void |
doFirstButtonClick()
Calls the doClick on First Button. |
void |
doLastButtonClick()
Calls the doClick on Last Button. |
void |
doNextButtonClick()
Calls the doClick on Next Button. |
void |
doPreviousButtonClick()
Calls the doClick on Previous Button. |
void |
doRefreshButtonClick()
Calls the doClick on Refresh Button. |
void |
doUndoButtonClick()
Calls the doClick on Undo Button. |
java.awt.Dimension |
getButtonSize()
Returns the size of buttons on the data navigator. |
boolean |
getCallExecute()
Indicates if the navigator will skip the execute function call on the underlying SSRowSet (needed for MySQL - see FAQ). |
boolean |
getConfirmDeletes()
Returns true if deletions must be confirmed by user, else false. |
SSDBNav |
getDBNav()
Returns any custom implementation of the SSDBNav interface, which is used when the insert button is pressed to perform custom actions. |
boolean |
getDeletion()
Returns true if deletions are allowed, else false. |
boolean |
getInsertion()
Returns true if insertions are allowed, else false. |
boolean |
getModification()
Returns true if the user can modify the data in the SSRowSet, else false. |
SSRowSet |
getRowSet()
Deprecated. |
SSRowSet |
getSSRowSet()
Returns the SSRowSet being used. |
void |
setButtonSize(java.awt.Dimension _buttonSize)
Sets the preferredSize and the MinimumSize of the buttons to the specified size |
void |
setCallExecute(boolean _callExecute)
Method to cause the navigator to skip the execute() function call on the underlying SSRowSet. |
void |
setConfirmDeletes(boolean _confirmDeletes)
Sets the confirm deletion indicator. |
void |
setDBNav(SSDBNav _dBNav)
Function that passes the implementation of the SSDBNav interface. |
void |
setDeletion(boolean _deletion)
Enables or disables the row deletion button. |
void |
setFocusable(boolean focusable)
This will make all the components in the navigator to either focusable components or non focusable components. |
void |
setInsertion(boolean _insertion)
Enables or disables the row insertion button. |
void |
setModification(boolean _modification)
Enables or disables the modification-related buttons on the SSDataNavigator. |
void |
setRowSet(SSRowSet _sSRowSet)
Deprecated. |
void |
setSSRowSet(SSRowSet _sSRowSet)
This method changes the SSRowSet to which the navigator is bound. |
boolean |
updatePresentRow()
Writes the present row back to the SSRowSet. |
| 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, 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, setToolTipText, 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, 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 |
| Constructor Detail |
|---|
public SSDataNavigator()
public SSDataNavigator(SSRowSet _sSRowSet)
_sSRowSet - The SSRowSet to which the SSDataNavigator has to be bound
public SSDataNavigator(SSRowSet _sSRowSet,
java.awt.Dimension _buttonSize)
_sSRowSet - the SSRowSet to which the navigator is bound to_buttonSize - the size to which the button on navigator have to be set| Method Detail |
|---|
public boolean containsRows()
public void setCallExecute(boolean _callExecute)
_callExecute - false if using MySQL database - otherwise truepublic boolean getCallExecute()
public void setButtonSize(java.awt.Dimension _buttonSize)
_buttonSize - the required dimension of the buttonspublic java.awt.Dimension getButtonSize()
public void setDBNav(SSDBNav _dBNav)
_dBNav - implementation of the SSDBNav interfacepublic SSDBNav getDBNav()
public void setModification(boolean _modification)
_modification - indicates whether or not the modification-related
buttons are enabled.public boolean getModification()
public void setDeletion(boolean _deletion)
_deletion - indicates whether or not to allow deletionspublic boolean getDeletion()
public void setInsertion(boolean _insertion)
_insertion - indicates whether or not to allow insertionspublic boolean getInsertion()
public void setConfirmDeletes(boolean _confirmDeletes)
_confirmDeletes - indicates whether or not to confirm deletionspublic boolean getConfirmDeletes()
public void setSSRowSet(SSRowSet _sSRowSet)
_sSRowSet - a SSRowSet object to which the navigator will be boundpublic SSRowSet getSSRowSet()
public boolean updatePresentRow()
public void doFirstButtonClick()
public void doPreviousButtonClick()
public void doNextButtonClick()
public void doLastButtonClick()
public void doRefreshButtonClick()
public void doCommitButtonClick()
public void doUndoButtonClick()
public void doAddButtonClick()
public void doDeleteButtonClick()
public void setFocusable(boolean focusable)
setFocusable in class java.awt.Componentfocusable - - false if you don't want the navigator to receive focus else false.public void setRowSet(SSRowSet _sSRowSet)
_sSRowSet - SSRowSet to which the combo has to update values.setSSRowSet(com.nqadmin.swingSet.datasources.SSRowSet)public SSRowSet getRowSet()
getSSRowSet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||