public final class DBObjectChooser
extends javax.swing.JPanel
implements javax.swing.ListCellRenderer
The DBObjectChooser also supports child-parent relationships. A DBObjectChooser can be created with a specified parent DBObjectChooser. The synchronization between the two controls will then be built automatically.
Modifier and Type | Class and Description |
---|---|
static interface |
DBObjectChooser.ChangeListener |
static class |
DBObjectChooser.NewObjectProcessor
A utility object to help in the creation of new referenced objects.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DBObjectChooser(DBObjectChooser parent,
DBObjectLister lister,
DBObjectCriteria<SystemObject> criteria,
java.lang.String... types)
Create a DBObjectChooser where the objects are listed using the given DBObjectLister
and DBObjectCriteria, parented by the given DBObjectChooser.
|
DBObjectChooser(DBObjectChooser parent,
java.lang.String... types)
Create a DBObjectChooser to support objects of the given types, parented
by the given DBObjectChooser.
|
DBObjectChooser(java.lang.String... types)
Create a DBObjectChooser to support objects of the given types
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(DBObjectChooser.ChangeListener listener)
Adds the given DBObjectChooser.ChangeListener.
|
void |
addChangeListener(DBObjectChooser.ChangeListener listener,
boolean notifyKeyTyped)
Adds the given DBObjectChooser.ChangeListener with an option to be notifed on KeyTyped events
for an editable DBObjectChooser (see
KeyListener ). |
void |
addIDToList(DBObjectID id)
Adds the given ID to this chooser so that it is present in the list.
|
void |
enableProviderListener(boolean enable) |
DBObject |
getDBObject()
Convenience method to return the DBObject currently represented by the
DBObjectChooser.
|
DBObjectCriteria<SystemObject> |
getDBObjectCriteria() |
DBObjectID |
getDBObjectID()
Get the id of the DBObject currently represented by the DBObjectChooser
|
java.awt.Component |
getDefaultFocusComponent()
Gets the Component that should get default focus for this chooser.
|
java.lang.String |
getDelegateName() |
java.awt.Component |
getEditorComponent() |
DBObjectFilter |
getFilter()
Return any additional DBObjectFilter applied to the chooser.
|
java.awt.Component |
getListCellRendererComponent(javax.swing.JList list,
java.lang.Object value,
int index,
boolean isSelected,
boolean cellHasFocus) |
DBObject |
getOrCreateDBObject() |
java.lang.String[] |
getTypes()
Return the list of DBObject types the DBObjectChooser was constructed with
|
boolean |
isEditable()
Override of the Component.isEditable method.
|
boolean |
isEnabled()
Override of the Component.isEnabled method.
|
void |
removeChangeListener(DBObjectChooser.ChangeListener listener)
Removes the given DBObjectChooser.ChangeListener
|
void |
resetCaches() |
void |
setAddButtonProcessor(DBObjectChooser.NewObjectProcessor processor)
Sets a NewObjectProcessor that will be called to process a newly
created object prior to its display in the Create dialog when
the user presses the add button.
|
void |
setContextDBObjectID(DBObjectID id)
Set the context of a child DBObjectChooser.
|
void |
setDBObject(DBObject obj)
Convenience method to set the DBObject currently represented by the
DBObjectChooser.
|
void |
setDBObjectID(DBObjectID id)
Set the id of the DBObject currently represented by the DBObjectChooser
|
void |
setEditable(boolean editable)
Override of the Component.setEditable method.
|
void |
setEnabled(boolean enabled)
Sets whether this chooser and its children should be enabeld or not.
|
void |
setFilter(DBObjectFilter filter)
Set any additional DBObjectFilter for the chooser.
|
void |
setName(java.lang.String name)
Override of the Component.setName method.
|
void |
setNullText(java.lang.String nullText)
Set the text to show in the DBObjectChooser if the value it represents is
null . |
void |
setProvider(DBObjectProvider prov)
Set the DBObjectProvider for the DBObjectChooser.
|
void |
setShowAddButton(boolean showAddButton)
Sets whether to show an add button for creating new objects, by
providing a NewObjectProcessor instance.
|
void |
setShowDBLinkButton(boolean showDBLinkButton) |
void |
setShowEditButton(boolean showEditButton)
Sets whether to show an edit button for the selected object.
|
void |
setShowIcon(boolean showIcon)
Set whether a type icon should be shown in the DBObjectChooser.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, 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, validateTree
action, 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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public DBObjectChooser(java.lang.String... types)
types
- a list of DBObject typespublic DBObjectChooser(DBObjectChooser parent, java.lang.String... types)
parent
- Parent DBObjectChoosertypes
- a list of DBObject typespublic DBObjectChooser(DBObjectChooser parent, DBObjectLister lister, DBObjectCriteria<SystemObject> criteria, java.lang.String... types)
parent
- Parent DBObjectChooserlister
- The DBObjectLister used to list objectscriteria
- The DBObjectCriteria passed to the DBObjectListertypes
- a list of DBObject typespublic final void setShowIcon(boolean showIcon)
public final void setNullText(java.lang.String nullText)
null
.public DBObjectCriteria<SystemObject> getDBObjectCriteria()
public final void addIDToList(DBObjectID id)
If this chooser has a parent, the inclusion will be dependent on it matching the context object (e.g. if the parent chooser is a Schema chooser it will only be added if the id is for an object in the current Schema).
If the ID is a TemporaryObjectID with an original object, it will only be added to the list when the original ID for it is in the list (and will be replaced).
This extra id will be added for the lifetime of the chooser (i.e. it will persist through resets).
id
- the id to force inclusion for in the chooser.public void setShowDBLinkButton(boolean showDBLinkButton)
public void setShowAddButton(boolean showAddButton)
showAddButton
- whether to show the add button or notpublic void setAddButtonProcessor(DBObjectChooser.NewObjectProcessor processor)
processor
- the processor to use in the add operationpublic void setShowEditButton(boolean showEditButton)
showEditButton
- whether to allow edit of the current objectpublic final void setProvider(DBObjectProvider prov)
public final void enableProviderListener(boolean enable)
public final void resetCaches()
public final void setContextDBObjectID(DBObjectID id)
public final DBObjectID getDBObjectID()
public final void setDBObjectID(DBObjectID id)
public final DBObject getDBObject()
getDBObjectID()
.public final void setDBObject(DBObject obj)
setDBObjectID(oracle.javatools.db.DBObjectID)
.public final void setName(java.lang.String name)
setName
in class java.awt.Component
public java.lang.String getDelegateName()
public final void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public final boolean isEnabled()
setEnabled(boolean)
.isEnabled
in class java.awt.Component
public final void setEditable(boolean editable)
public final boolean isEditable()
setEditable(boolean)
.public DBObject getOrCreateDBObject()
public final void addChangeListener(DBObjectChooser.ChangeListener listener)
l
- public final void addChangeListener(DBObjectChooser.ChangeListener listener, boolean notifyKeyTyped)
KeyListener
).public final void removeChangeListener(DBObjectChooser.ChangeListener listener)
public final java.lang.String[] getTypes()
public void setFilter(DBObjectFilter filter)
public DBObjectFilter getFilter()
public java.awt.Component getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
getListCellRendererComponent
in interface javax.swing.ListCellRenderer
public java.awt.Component getEditorComponent()
public java.awt.Component getDefaultFocusComponent()