Extension SDK

oracle.ide.panels
Class AbstractUIContainer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byoracle.ide.panels.DefaultTraversablePanel
                      extended byoracle.ide.panels.AbstractUIContainer
All Implemented Interfaces:
javax.accessibility.Accessible, ApplyListener, ApplyNotifier, java.util.EventListener, GridBagConstants, java.awt.image.ImageObserver, java.awt.MenuContainer, NavigableUIContainer, java.io.Serializable, Traversable
Direct Known Subclasses:
MDDPanel, TabbedPanel

public abstract class AbstractUIContainer
extends DefaultTraversablePanel
implements NavigableUIContainer, ApplyListener

Common implementation for concrete NavigableUIContainer classes.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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.panels.NavigableUIContainer
NAVIGABLE_UI_CONTAINER
 
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
AbstractUIContainer()
           
 
Method Summary
 void addApplyListener(ApplyListener applyListener)
          Adds an ApplyListener that will be called when the user applies or cancels changes.
 void apply(ApplyEvent e)
          This method is called when the changes made in the NavigableUIContainer are to be committed to the original data structures.
 void cancel(ApplyEvent e)
          This method is called when the changes made in the NavigableUIContainer are to be discarded.
 boolean displayDetailNodesAsChildren()
          Returns true if the UI container is displaying detail nodes with the children rather than in a separate tree.
protected  void fireApply(ApplyEvent event)
          Fires the "apply" message to all registered ApplyListener objects.
protected  void fireCancel(ApplyEvent event)
          Fires the "cancel" message to all registered ApplyListener objects.
protected abstract  Navigable getCurrentNavigable()
          Concrete subclasses must implement this method to return the Navigable that is currently selected in the UI.
protected abstract  Traversable getCurrentTraversable()
          Concrete subclasses must implement this method to return the Traversable that is currently selected in the UI.
 java.lang.String getHelpID()
          This method allows a subclass to implement a dynamic means of determining what the help ID is.
protected  Navigable[] getRootNavigables()
           
protected  void maybeRefreshUI(TraversableContext tc)
           
protected  TraversableContext newTraversableContext()
          Returns a new TraversableContext that is initialized based on the Navigable returned by getCurrentNavigable().
 void onEntry(TraversableContext tc)
          This method is called when the Traversable is being entered.
protected  void onEntryImpl(TraversableContext tc)
           
 void onExit(TraversableContext tc)
          This method is called when the Traversable is being exited.
protected  void onExitImpl(TraversableContext tc)
           
protected abstract  void refreshUI(TraversableContext tc)
           
 void removeApplyListener(ApplyListener applyListener)
          Removes a previously added ApplyListener so that it no longer receives notification when the user applies or cancels changes.
 void setRootNavigables(Navigable[] rootNavigables)
          Sets the root-level Navigable instances for the UI.
protected  void updateHelpID(Traversable traversable)
          Updates the help ID for the AbstractUIContainer to correspond to the help ID of the Traversable's Component.
 
Methods inherited from class oracle.ide.panels.DefaultTraversablePanel
gbc, gbc, getComponent, getDefaultTitle, getExitTransition, setDefaultTitle, setHelpID
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 
Methods inherited from interface oracle.ide.panels.Traversable
getComponent, getExitTransition
 

Constructor Detail

AbstractUIContainer

public AbstractUIContainer()
Method Detail

onEntry

public void onEntry(TraversableContext tc)
Description copied from interface: Traversable
This method is called when the Traversable is being entered. The data that the Traversable should use to populate its UI components comes from the specified TraversableContext.

When the same Traversable is entered more than once in the course of interacting with the user, the Traversable needs to reload the data directly from the TraversableContext rather than caching data objects. Some reasons for this include:

Loading data directly from the TraversableContext is the best way to ensure that the Traversable will not be editing the wrong data.

The Traversable should not even cache references to data objects between invocations of onEntry and Traversable.onExit(TraversableContext) because the UI container is not required to guarantee that the references will be identical.

Specified by:
onEntry in interface Traversable
Overrides:
onEntry in class DefaultTraversablePanel
See Also:
Traversable.onEntry(TraversableContext)

onEntryImpl

protected final void onEntryImpl(TraversableContext tc)

onExit

public void onExit(TraversableContext tc)
            throws TraversalException
Description copied from interface: Traversable
This method is called when the Traversable is being exited. At this point, the Traversable should copy the data from its associated UI back into the data structures in the TraversableContext.

If the Traversable should not be exited because the user has entered either incomplete, invalid, or inconsistent data, then this method can throw a TraversalException to indicate to the property dialog or wizard that validation failed and that the user should not be allowed to exit the current Traversable. Refer to the TraversalException javadoc for details on passing the error message that should be shown to the user.

Specified by:
onExit in interface Traversable
Overrides:
onExit in class DefaultTraversablePanel
Throws:
TraversalException
See Also:
Traversable.onExit(TraversableContext)

onExitImpl

protected final void onExitImpl(TraversableContext tc)
                         throws TraversalException
Throws:
TraversalException

getHelpID

public java.lang.String getHelpID()
Description copied from class: DefaultTraversablePanel
This method allows a subclass to implement a dynamic means of determining what the help ID is.

Overrides:
getHelpID in class DefaultTraversablePanel

addApplyListener

public void addApplyListener(ApplyListener applyListener)
Description copied from interface: ApplyNotifier
Adds an ApplyListener that will be called when the user applies or cancels changes.

Specified by:
addApplyListener in interface ApplyNotifier

removeApplyListener

public void removeApplyListener(ApplyListener applyListener)
Description copied from interface: ApplyNotifier
Removes a previously added ApplyListener so that it no longer receives notification when the user applies or cancels changes.

Specified by:
removeApplyListener in interface ApplyNotifier

apply

public void apply(ApplyEvent e)
Description copied from interface: ApplyListener
This method is called when the changes made in the NavigableUIContainer are to be committed to the original data structures. This normally occurs when the user pushes the "OK", "Apply", or "Finish" button.

This method is called as soon as the user's action is recognized. Typically, if the NavigableUIContainer is editing a copy of the original data, there will be an ApplyListener registered that is responsible for flushing the changes from the edited data copy back to the original data structure. The API in the oracle.ide.panels package does not specify when such an ApplyListener is registered or whether one is registered at all.

If you are writing code that must depend on the registration order of such an ApplyListener, you will need to consult the documentation for the code that instantiates the NavigableUIContainer to determine if the registration order for ApplyListeners is specified there.

Specified by:
apply in interface ApplyListener
Parameters:
e - The ApplyEvent that provides contextual information about when the ApplyEvent was fired.

cancel

public void cancel(ApplyEvent e)
Description copied from interface: ApplyListener
This method is called when the changes made in the NavigableUIContainer are to be discarded. This normally occurs when the user pushes the "Cancel" button.

No data validation occurs when the user cancels, and the NavigableUIContainer may or may not call the onExit method of the currently showing Traversable. In general, onExit will not be called.

Specified by:
cancel in interface ApplyListener
Parameters:
e - The ApplyEvent that provides contextual information about when the ApplyEvent was fired.

setRootNavigables

public void setRootNavigables(Navigable[] rootNavigables)
Description copied from interface: NavigableUIContainer
Sets the root-level Navigable instances for the UI.

Specified by:
setRootNavigables in interface NavigableUIContainer

displayDetailNodesAsChildren

public boolean displayDetailNodesAsChildren()
Description copied from interface: NavigableUIContainer
Returns true if the UI container is displaying detail nodes with the children rather than in a separate tree. That is:

Specified by:
displayDetailNodesAsChildren in interface NavigableUIContainer

getRootNavigables

protected Navigable[] getRootNavigables()

maybeRefreshUI

protected final void maybeRefreshUI(TraversableContext tc)

refreshUI

protected abstract void refreshUI(TraversableContext tc)

getCurrentNavigable

protected abstract Navigable getCurrentNavigable()
Concrete subclasses must implement this method to return the Navigable that is currently selected in the UI.


getCurrentTraversable

protected abstract Traversable getCurrentTraversable()
Concrete subclasses must implement this method to return the Traversable that is currently selected in the UI.


newTraversableContext

protected TraversableContext newTraversableContext()
Returns a new TraversableContext that is initialized based on the Navigable returned by getCurrentNavigable().


fireApply

protected void fireApply(ApplyEvent event)
Fires the "apply" message to all registered ApplyListener objects.


fireCancel

protected void fireCancel(ApplyEvent event)
Fires the "cancel" message to all registered ApplyListener objects.


updateHelpID

protected void updateHelpID(Traversable traversable)
Updates the help ID for the AbstractUIContainer to correspond to the help ID of the Traversable's Component. This method assumes that the current Navigable as returned by getCurrentNavigable() has already been updated to match the specified Traversable.


Extension SDK

 

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