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.jdeveloper.db.controls
Class ConnectionPickerButton

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JToggleButton
                      extended by oracle.ide.controls.MenuToolButton
                          extended by oracle.jdeveloper.db.controls.ConnectionPickerButton

All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants, ToolbarGroup, ToolbarItem

public class ConnectionPickerButton
extends MenuToolButton
implements java.awt.event.ActionListener

Provides a button that, when pushed, will show a popup menu of available connections and on selection of a connection fire an action.

Since:
11
See Also:
Serialized Form

Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.ide.controls.MenuToolButton
MenuToolButton.ButtonItemListener, MenuToolButton.ButtonKeyListener, MenuToolButton.ButtonPopupMenuListener, MenuToolButton.MenuToolButtonModel

 

Nested classes/interfaces inherited from class javax.swing.JToggleButton
javax.swing.JToggleButton.AccessibleJToggleButton, javax.swing.JToggleButton.ToggleButtonModel

 

Nested classes/interfaces inherited from class javax.swing.AbstractButton
javax.swing.AbstractButton.AccessibleAbstractButton, javax.swing.AbstractButton.ButtonChangeListener

 

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

 

Fields inherited from class oracle.ide.controls.MenuToolButton
_actions, _hiddenItems, _popup, _visibleActions, POPUP_ICON, POPUP_MENU_LISTENER, POPUP_WIDTH

 

Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY

 

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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST

 

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

 

Constructor Summary
ConnectionPickerButton(ConnectionInfo info)
          Creates a picker button with no action.
ConnectionPickerButton(ConnectionInfo info, ToggleAction action)
          Creates a new picker button when a connection is selected, fires the given action.

 

Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addConnectionListener(java.awt.event.ItemListener il)
          Adds an ItemListener that will be notified when the selected item in the popup menu is changed.
protected  void configurePropertiesFromAction(javax.swing.Action a)
           
protected  void connectionSelected(ConnectionInfo info)
          Called whenever the selection is changed.
protected  java.beans.PropertyChangeListener createActionPropertyChangeListener(javax.swing.Action a)
           
protected  javax.swing.JPopupMenu createPopupMenu()
           
 ConnectionInfo getConnectionInfo()
          Gets the object encapsulating the selected connection information.
protected  DatabaseConnections getDefaultStore()
          By default returns null unless there is only one store in the product, then that is the deafult.
 java.awt.Dimension getMaximumSize()
           
 java.awt.Dimension getMinimumSize()
           
protected  java.util.Collection<java.lang.String> listConnections(DatabaseConnections dc)
          By default returns all the connections in the connection store.
protected  java.util.Collection<java.lang.String> listStores()
          Returns the list of store names to include in the picker component.
 void removeConnectionListener(java.awt.event.ItemListener il)
           
protected  void resetConnections()
           
 void setBounds(int x, int y, int width, int height)
           
 void setConnectionInfo(ConnectionInfo info)
          Sets the selected connection using the given info.
 void setContext(Context ideContext)
          Sets the IDE context to use for determining which connection stores should be in the list.

 

Methods inherited from class oracle.ide.controls.MenuToolButton
add, add, add, add, add, addPopupItem, addPopupMenuListener, createButtonItemListener, createButtonKeyListener, createMenuItemActionPropertyChangeListener, createModel, findPopupItem, getActions, getPopupMenu, getPreferredSize, paintComponent, removeAllPopupItems, removePopupItem, removePopupMenuListener, setAction, setPaintPopUpIndicator

 

Methods inherited from class javax.swing.JToggleButton
getAccessibleContext, getUIClassID, paramString, updateUI

 

Methods inherited from class javax.swing.AbstractButton
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition

 

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, getNextFocusableComponent, getPopupLocation, 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, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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

 

Methods inherited from class java.awt.Container
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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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

 

Methods inherited from interface oracle.ide.controls.ToolbarItem
getAction

 

Constructor Detail

ConnectionPickerButton

public ConnectionPickerButton(ConnectionInfo info)
Creates a picker button with no action. By default the text for the button will therefore be the chosen connection name. This "mode" is used when the picker button is being used as a replacement for a combo box in a picker component, rather than for executing an action.
Parameters:
info - the given ConnectionInfo object will be used to store the choice of selected connection when a selection has been made.

ConnectionPickerButton

public ConnectionPickerButton(ConnectionInfo info,
                              ToggleAction action)
Creates a new picker button when a connection is selected, fires the given action. The button will use the action's Icon.
Parameters:
info - the given ConnectionInfo object will be used to store the choice of selected connection when a selection has been made.
action - the action to fire when a selection has been made

Method Detail

addConnectionListener

public final void addConnectionListener(java.awt.event.ItemListener il)
Adds an ItemListener that will be notified when the selected item in the popup menu is changed. Note in the course of constructing the button and populating (or repopulating if the context is changed) the selection can change many times. To fire an action on selection it is better to give a ToggleAction on construction.

The ItemEvent item will be the ConnectionInfo for the curently chosen connection.

Parameters:
il - the listener to add

removeConnectionListener

public final void removeConnectionListener(java.awt.event.ItemListener il)

setContext

public final void setContext(Context ideContext)
Sets the IDE context to use for determining which connection stores should be in the list. If this isn't provided, all stores will be shown.

resetConnections

protected final void resetConnections()

listStores

protected java.util.Collection<java.lang.String> listStores()
Returns the list of store names to include in the picker component. By default this will list the stores available to the given context, or list all the stores if no context has been provided.
See Also:
setContext(Context)

listConnections

protected java.util.Collection<java.lang.String> listConnections(DatabaseConnections dc)
By default returns all the connections in the connection store. Never return null.

getDefaultStore

protected DatabaseConnections getDefaultStore()
By default returns null unless there is only one store in the product, then that is the deafult. This means that all connection stores will appear with their connections in a submenu. If this returns a store to be used as the default, the connections in that store will appear in the main menu, with all other stores appearing as submenus.

createPopupMenu

protected final javax.swing.JPopupMenu createPopupMenu()
Overrides:
createPopupMenu in class MenuToolButton

setBounds

public final void setBounds(int x,
                            int y,
                            int width,
                            int height)
Overrides:
setBounds in class java.awt.Component

actionPerformed

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

getConnectionInfo

public final ConnectionInfo getConnectionInfo()
Gets the object encapsulating the selected connection information.

setConnectionInfo

public final void setConnectionInfo(ConnectionInfo info)
Sets the selected connection using the given info. This also switches the info that underlies this picker to be the given info (i.e. changes to the selection will be propogated to the given ConnectionInfo instance.
Parameters:
info - the connection information to use to change the selection, and store subsequent connection changes.

connectionSelected

protected void connectionSelected(ConnectionInfo info)
Called whenever the selection is changed. A warning - on initialisation the select changes a few times. Override in a subclass that is a picker (not an action button).

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getMaximumSize

public java.awt.Dimension getMaximumSize()
Overrides:
getMaximumSize in class javax.swing.JComponent

configurePropertiesFromAction

protected void configurePropertiesFromAction(javax.swing.Action a)
Overrides:
configurePropertiesFromAction in class javax.swing.AbstractButton

createActionPropertyChangeListener

protected java.beans.PropertyChangeListener createActionPropertyChangeListener(javax.swing.Action a)
Overrides:
createActionPropertyChangeListener in class javax.swing.AbstractButton

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.