Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.ide.db.panels
Class SelectDBObjectsPanel

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 oracle.ide.panels.DefaultTraversablePanel
                      extended by oracle.ide.db.panels.SkippingTraversable
                          extended by oracle.ide.db.panels.SelectDBObjectsPanel

All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.DocumentListener, oracle.bali.ewt.shuttle.ShuttleListener, CheckBoxListItemStateListener, GridBagConstants, Traversable
Direct Known Subclasses:
BaseSQLQueryPickerPanel

public class SelectDBObjectsPanel
extends SkippingTraversable
implements java.awt.event.ActionListener, java.awt.event.ItemListener, javax.swing.event.DocumentListener, oracle.bali.ewt.shuttle.ShuttleListener, java.awt.event.KeyListener, CheckBoxListItemStateListener

Base panel for picking DBObjects from a DBObjectProvider. This panel is designed to be used as part of a Traversable in a wizard to select objects for some process (e.g. import from a database to some target in JDev).

See Also:
Serialized Form

Nested Class Summary

 

Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel

 

Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent

 

Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer

 

Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy

 

Field Summary
protected  WizardCallbacks m_callBacks
           
protected  SchemaObjectTargetPicker m_chosen
           
protected  oracle.bali.ewt.shuttle.Shuttle m_shuttle
           
static java.lang.String SELECTED_OBJECTS
           
static java.lang.String SETTINGS_KEY
           

 

Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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 oracle.ide.controls.GridBagConstants
ANCHOR_C, ANCHOR_E, ANCHOR_N, ANCHOR_NE, ANCHOR_NW, ANCHOR_S, ANCHOR_SE, ANCHOR_SW, ANCHOR_W, FILL_NONE, FILL_X, FILL_XY, FILL_Y

 

Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH

 

Constructor Summary
SelectDBObjectsPanel()
           

 

Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  boolean canAlwaysNext()
          When used in a wizard this sets whether the wizard can always next regardless of the state of this step.
protected  boolean canFinish()
          When used in a wizard this sets whether the wizard can finish after this step.
protected  boolean canRenameObjects()
          Deprecated. - rename is no longer supported. getNameProvider() returns an intention to include an extra name field that can be used for entity naming.
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
protected  void checkWizardButtons()
          Checks that the wizard's buttons are appropriately enabled.
protected  void commit(TraversableContext dataContext)
          Default implementation of the commit calls getSelectedObjects() and places what is returned into the context using the SELECTED_OBJECTS key.
protected  void fireQuery()
          Fires the query on the DBObjectPicker (LHS of shuttle) given the appropriate selections for filter, schema and object types.
protected  java.lang.String[] getAvailableTypes()
          Returns the types available for querying in the from picker - override in subclasses as appropriate.
protected  DBObjectSourcePicker getFromPicker()
          Returns the picker for the left (from) side of the shuttle.
protected  NameController getNameController()
          Returns the name provider that will produce support for including another name in addition to the object's name itself.
protected  java.lang.String getPanelName()
          Returns the name that will be prepended to all component names for ui testability.
protected  PropertyStorage getPropertyStorage()
          Returns the PropertyStorage for this panel to save its query setting in.
protected  DBObjectProvider getProvider()
          Returns the provider we're selecting objects from.
protected  DBObjectProvider getProvider(TraversableContext dataContext)
          Get the DBObjectProvider.
protected  java.lang.String getProviderKey()
          Returns the key for the provider to use in the data context.
protected  java.lang.Object getSelectedObjects()
          Returns the selection of objects chosen.
protected  java.lang.String getSettingsKey()
          Returns the key for this panel's settings.
protected  oracle.bali.ewt.shuttle.ItemPicker getToPicker()
          Returns the picker for the right (to) side of the shuttle.
protected  java.lang.String getTraversableName()
          Override this to provide a name for sub-classes which may be skipped.
protected  void init(boolean providerChanged, TraversableContext dataContext)
          Initialises the panel.
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
protected  void layoutComponents()
           
protected  void loadSettings()
          Load the IDE settings from a (dialog/wizard)-specific key.
 void onEntry(TraversableContext dataContext)
          Called on entry to the panel in the wizard.
 void onExit(TraversableContext dataContext)
          Called on panel exit.
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
protected  void saveSettings()
          Save the IDE settings from a (dialog/wizard)-specific key.
protected  void setDefaultSettings()
          If there are no settings saved in the J2EE preferences set with the key returned by getSettingsKey() then this method is called to default any appropriate controls.
protected  void setIncludePublicSchema(boolean inc)
           
protected  void setupQuery(DBObjectSourcePicker from, Schema schema, java.lang.String filter, java.lang.String[] types)
          By default this sets the schema, types and filter on the given from picker.
 void shuttleItemsMoved(oracle.bali.ewt.shuttle.ShuttleEvent p0)
           
 void shuttleItemsRemoved(oracle.bali.ewt.shuttle.ShuttleEvent p0)
           
 void shuttleItemsReordered(oracle.bali.ewt.shuttle.ShuttleEvent p0)
           
 void stateChanged(java.lang.Object source)
          Occurs when the checked state of a list item changes.

 

Methods inherited from class oracle.ide.db.panels.SkippingTraversable
isSkipping

 

Methods inherited from class oracle.ide.panels.DefaultTraversablePanel
gbc, gbc, getComponent, getDefaultTitle, getExitTransition, getHelpID, getText, setDefaultTitle, setHelpID

 

Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI

 

Methods inherited from class javax.swing.JComponent
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, update

 

Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree

 

Methods inherited from class java.awt.Component
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, 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, 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, transferFocusUpCycle

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

SELECTED_OBJECTS

public static final java.lang.String SELECTED_OBJECTS
See Also:
Constant Field Values

SETTINGS_KEY

public static final java.lang.String SETTINGS_KEY

m_callBacks

protected WizardCallbacks m_callBacks

m_chosen

protected SchemaObjectTargetPicker m_chosen

m_shuttle

protected oracle.bali.ewt.shuttle.Shuttle m_shuttle

Constructor Detail

SelectDBObjectsPanel

public SelectDBObjectsPanel()

Method Detail

getPanelName

protected java.lang.String getPanelName()
Returns the name that will be prepended to all component names for ui testability. Override where appropriate.

layoutComponents

protected void layoutComponents()

getProvider

protected final DBObjectProvider getProvider()
Returns the provider we're selecting objects from.

getNameController

protected NameController getNameController()
Returns the name provider that will produce support for including another name in addition to the object's name itself. Useful for providing entity names in addition to the object. Returns null by default which means no name field appears at all.

getFromPicker

protected DBObjectSourcePicker getFromPicker()
Returns the picker for the left (from) side of the shuttle. By default this returns a DBObjectSourcePicker for the provider in the traversable context, which doesn't show child objects, and does remove from the tree on shuttle. Override in subclasses as appropriate.

getToPicker

protected oracle.bali.ewt.shuttle.ItemPicker getToPicker()
Returns the picker for the right (to) side of the shuttle. By default this is a simple picker around a JList that contains the DBObjects. Override in subclasses as appropriate.
If the returned picker is Traversable its onEntry() and onExit() methods will be called with the panel's entry and exit.

canFinish

protected boolean canFinish()
When used in a wizard this sets whether the wizard can finish after this step.

canAlwaysNext

protected boolean canAlwaysNext()
When used in a wizard this sets whether the wizard can always next regardless of the state of this step.

canRenameObjects

@Deprecated
protected boolean canRenameObjects()
Deprecated. - rename is no longer supported. getNameProvider() returns an intention to include an extra name field that can be used for entity naming.
Sets whether the user can rename the objects they are importing. This is false by default - override in subclasses to include a rename field at the bottom of the panel.

getAvailableTypes

protected java.lang.String[] getAvailableTypes()
Returns the types available for querying in the from picker - override in subclasses as appropriate. The String should be the offical oracle.javatools.db types - for example to select just Tables and Views (the default) the following is returned: new String[]{Table.TYPE, View.TYPE};

getProviderKey

protected java.lang.String getProviderKey()
Returns the key for the provider to use in the data context.

onEntry

public final void onEntry(TraversableContext dataContext)
Called on entry to the panel in the wizard. Final so that the listeners are always correctly set up. Override init(boolean,TraversableContext) for custom behaviour.
Specified by:
onEntry in interface Traversable
Overrides:
onEntry in class SkippingTraversable
Parameters:
dataContext - The data wrapper where the Traversable locates the data that it needs to populate the UI.
See Also:
Traversable.onEntry(TraversableContext)

onExit

public final void onExit(TraversableContext dataContext)
                  throws TraversalException
Called on panel exit. Final so that the listeners are always finished properly. Override commit(TraversableContext) for custom behaviour.
Specified by:
onExit in interface Traversable
Overrides:
onExit in class DefaultTraversablePanel
Parameters:
dataContext - The data object where changes made in the UI should be copied so that the changes can be accessed by other Traversables.
Throws:
TraversalException - if the user has entered either incomplete, invalid, or inconsistent data. This exception prevents the property dialog or wizard from continuing and forces the user to stay on the current Traversable until the data entered is valid or the user cancels. The exception class itself is capable of carrying an error message that will be shown to the user. Refer to its javadoc for details.
See Also:
Traversable.onExit(TraversableContext)

getProvider

protected DBObjectProvider getProvider(TraversableContext dataContext)
Get the DBObjectProvider. The default implementation returns a provider from the Traversable context. (Using @link getProviderKey() as the key.

commit

protected void commit(TraversableContext dataContext)
               throws TraversalException
Default implementation of the commit calls getSelectedObjects() and places what is returned into the context using the SELECTED_OBJECTS key.
Throws:
TraversalException

getSelectedObjects

protected java.lang.Object getSelectedObjects()
Returns the selection of objects chosen. By default this will return a SchemaObjectDescriptor[] if the "to picker" is a SchemaObjectTargetPicker. Otherwise it will return a Transferable[] of the "to picker"'s available objects. Override for custom behaviour.

setIncludePublicSchema

protected void setIncludePublicSchema(boolean inc)

init

protected void init(boolean providerChanged,
                    TraversableContext dataContext)
Initialises the panel. Call from the onEntry(TraversableContext) to the parent Traversable. The default implementation deals with auto-querying, spotting that the provider has changed, loading the settings and checking the wizard buttons if working in a wizard). It is recommended that subclasses still call this behaviour.
Parameters:
providerChanged - whether on entering the state has changed the provider.
dataContext - the traversable context containing all state data

fireQuery

protected void fireQuery()
Fires the query on the DBObjectPicker (LHS of shuttle) given the appropriate selections for filter, schema and object types.

setupQuery

protected void setupQuery(DBObjectSourcePicker from,
                          Schema schema,
                          java.lang.String filter,
                          java.lang.String[] types)
By default this sets the schema, types and filter on the given from picker. The filter is processed to remove single quotes, add a % to the remaining string and then the externalised version of the final string used in the query is set as the text in the filter field so the user can see what's happened.

getSettingsKey

protected java.lang.String getSettingsKey()
Returns the key for this panel's settings. Override in subclasses to have a separate set of saved settings for the specific panel subclass. The key will be used in the PropertyStorage for the panel returned by getPropertyStorage().
See Also:
getPropertyStorage()

getPropertyStorage

protected PropertyStorage getPropertyStorage()
Returns the PropertyStorage for this panel to save its query setting in. The settings are stored using the key returned by getSettingsKey().
See Also:
getSettingsKey()

loadSettings

protected void loadSettings()
Load the IDE settings from a (dialog/wizard)-specific key. The key used is retrieved from the getSettingsKey() method. If no settings have yet been associated with this key, the default settings are loaded instead.

setDefaultSettings

protected void setDefaultSettings()
If there are no settings saved in the J2EE preferences set with the key returned by getSettingsKey() then this method is called to default any appropriate controls. By default this sets autoQuery to be FALSE if the provider is a Database, and all types will be selected with no filter. Subclasses can override.

saveSettings

protected void saveSettings()
Save the IDE settings from a (dialog/wizard)-specific key. The key used is retrieved from the getSettingsKey() method.

checkWizardButtons

protected void checkWizardButtons()
Checks that the wizard's buttons are appropriately enabled. Call if the state of selection has changed. Uses canFinish() and canAlwaysNext().

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

shuttleItemsMoved

public void shuttleItemsMoved(oracle.bali.ewt.shuttle.ShuttleEvent p0)
Specified by:
shuttleItemsMoved in interface oracle.bali.ewt.shuttle.ShuttleListener

shuttleItemsRemoved

public void shuttleItemsRemoved(oracle.bali.ewt.shuttle.ShuttleEvent p0)
Specified by:
shuttleItemsRemoved in interface oracle.bali.ewt.shuttle.ShuttleListener

shuttleItemsReordered

public void shuttleItemsReordered(oracle.bali.ewt.shuttle.ShuttleEvent p0)
Specified by:
shuttleItemsReordered in interface oracle.bali.ewt.shuttle.ShuttleListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

stateChanged

public void stateChanged(java.lang.Object source)
Description copied from interface: CheckBoxListItemStateListener
Occurs when the checked state of a list item changes.
Specified by:
stateChanged in interface CheckBoxListItemStateListener
Parameters:
source - The item whose state has changed.

getTraversableName

protected java.lang.String getTraversableName()
Override this to provide a name for sub-classes which may be skipped.
Specified by:
getTraversableName in class SkippingTraversable

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.