Extension SDK 10.1.2

oracle.ide.panels
Class TraversableContext

java.lang.Object
  extended byoracle.ide.util.Namespace
      extended byoracle.ide.panels.TraversableContext

public final class TraversableContext
extends Namespace

The TraversableContext class provides the means for a Traversable to find the data objects that it is responsible for editing whenever it is entered or exited.

The important characteristic of TraversableContext is that Traversable implementations be able to search for their data objects by a fixed name, even when multiple data objects of the same type are being edited by the same Traversable implementation. This capability requires the participation of the MetaTraversable class through the name link mechanism provided by its MetaTraversable.setNameLink(String, String) method.

See the javadoc for Traversable for more details on its interactions with the TraversableContext.

See the javadoc for Namespace for details on how data is stored and retrieved in a context-sensitive manner. Note: The TraversableContext class is currently declared final. This may be relaxed in the future after the API is considered stable for both property dialogs and wizards, and subclassing issues have been thoroughly considered.


Field Summary
static int BACKWARD_TRAVERSAL
          Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods.
static int FOCUS_TRAVERSAL
          Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods.
static int FORWARD_TRAVERSAL
          Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods.
static int RANDOM_ACCESS_TRAVERSAL
          Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods.
 
Constructor Summary
TraversableContext(Namespace namespace, int direction)
          This constructor creates a new instance using the specified Namespace as the data context.
TraversableContext(Navigable navigable, int direction)
          This constructor creates a new instance using the specified Navigable to determine the data context.
 
Method Summary
 java.lang.Object getDesignTimeObject(java.lang.String key)
          Experimental.
 DialogCallbacks getDialogCallbacks()
           
 int getDirection()
          Returns the direction that the traversal is occurring in.
 WizardCallbacks getWizardCallbacks()
           
 NavigableContext newNavigableContext()
           
 void putDesignTimeObject(java.lang.String key, java.lang.Object dtObject)
          Experimental.
 void setDialogCallbacks(DialogCallbacks callbacks)
           
 void setWizardCallbacks(WizardCallbacks callbacks)
           
protected  java.lang.String translateKey(java.lang.String key)
          This method is used to remap a key that is used when invoking either the Namespace.find(String) or #findAndReplace(String, Object method.
 
Methods inherited from class oracle.ide.util.Namespace
contains, find, findAndReplace, get, get, getData, getParent, getRoot, isRoot, put, put, put, put, remove, setParent, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANDOM_ACCESS_TRAVERSAL

public static final int RANDOM_ACCESS_TRAVERSAL
Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods. This constant means that the Traversable is being entered or exited in a random-access manner. Random-access traversal typically occurs in a properties dialog.

See Also:
Constant Field Values

FORWARD_TRAVERSAL

public static final int FORWARD_TRAVERSAL
Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods. This constant means that the Traversable is being entered or exited in a sequentially forward direction. Forward traversal typically occurs in a wizard.

See Also:
Constant Field Values

BACKWARD_TRAVERSAL

public static final int BACKWARD_TRAVERSAL
Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods. This constant means that the Traversable is being entered or exited in a sequentially backward direction. Backward traversal typically occurs in a wizard.

See Also:
Constant Field Values

FOCUS_TRAVERSAL

public static final int FOCUS_TRAVERSAL
Constant that indicates that the direction of traversal for the Traversable.onEntry(TraversableContext) and Traversable.onExit(TraversableContext) methods. This constant means that the Traversable is being entered by gaining input focus or is being exited by losing input focus. Focus traversal typically occurs in dialogs, wizards, or editors that are are modeless.

See Also:
Constant Field Values
Constructor Detail

TraversableContext

public TraversableContext(Navigable navigable,
                          int direction)
This constructor creates a new instance using the specified Navigable to determine the data context. The traversal direction is set according to the specified int.

Parameters:
navigable - the Navigable whose data context will be associated with the TraversableContext. This must not be null or else a NullPointerException will be thrown.
direction - the traversal direction associated with the creation of the TraversableContext. The value must be one of RANDOM_ACCESS_TRAVERSAL, FORWARD_TRAVERSAL, BACKWARD_TRAVERSAL, or FOCUS_TRAVERSAL, or else an IllegalArgumentException will be thrown.
Throws:
java.lang.NullPointerException - if the specified Navigable is null.
java.lang.IllegalArgumentException - if the specified direction is not a legally accepted value.

TraversableContext

public TraversableContext(Namespace namespace,
                          int direction)
This constructor creates a new instance using the specified Namespace as the data context. The traversal direction is set according to the specified int. Because no MetaTraversable is set through this method, the new TraversableContext does not remap any data keys. (Remapping data keys is typically only needed in cases where the same Traversable implementation reappears more than once in a particular MDDPanel but edits different objects at the same level in the TraversableContext. Since the Traversable accesses its data by a fixed key, that fixed key needs to be remapped to a real name when the key could possibly be resolved to more than one object.)

Method Detail

getDirection

public int getDirection()
Returns the direction that the traversal is occurring in. The return value will be one of:


getWizardCallbacks

public WizardCallbacks getWizardCallbacks()

setWizardCallbacks

public void setWizardCallbacks(WizardCallbacks callbacks)

getDialogCallbacks

public DialogCallbacks getDialogCallbacks()

setDialogCallbacks

public void setDialogCallbacks(DialogCallbacks callbacks)

getDesignTimeObject

public java.lang.Object getDesignTimeObject(java.lang.String key)
Experimental.


putDesignTimeObject

public void putDesignTimeObject(java.lang.String key,
                                java.lang.Object dtObject)
Experimental.


newNavigableContext

public NavigableContext newNavigableContext()

translateKey

protected java.lang.String translateKey(java.lang.String key)
Description copied from class: Namespace
This method is used to remap a key that is used when invoking either the Namespace.find(String) or #findAndReplace(String, Object method. In general, translation will not be necessary, so this method by default returns the specified key itself. A subclass that requires key mappings should override this method to provide the proper key mapping behavior.

Overrides:
translateKey in class Namespace

Extension SDK

 

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