UIX 2.2.16

oracle.cabo.ui.data.tree
Class DynamicHGridDataProxy

java.lang.Object
  |
  +--oracle.cabo.ui.data.tree.BaseTreeDataProxy
        |
        +--oracle.cabo.ui.data.tree.DynamicHGridDataProxy
All Implemented Interfaces:
HGridDataProxy, TreeDataProxy

public class DynamicHGridDataProxy
extends BaseTreeDataProxy
implements HGridDataProxy

This DataProxy sits between an HGrid renderer and its data. It is used to produce dynamic views of the static tree that is rendered by HGrid. A DataProxy object must be created for each view of the data.

See the ClientStateHGridDataProxy for a detailed discussion of how an hGrid proxy works.

This proxy differs from the ClientStateHGridDataProxy in that unique IDs are used to identify tree nodes rather than indices. This allows dynamic rather than static data. This also means that wherever a numeric index was used before, an ID string is now required. Every expandable node MUST have an ID! A node ID may consist of any alphanumeric character, a dash (-) and underbar (_) other characters may work, but are not supported. The colon (:) and slash (/) characters are explicitly disallowed.

The focusRoot path is a string of node IDs delimited by the path separator character, or an array of nodeIDs.

!!! Important Note: The state string for this proxy has to name all the nodes that are currently expanded! Your nodeIDs must be unique (for the hGrid, not necessarily for the page), but you are advised to use node IDs that are as short as possible! Furthermore, you are advised not to allow expandAll or collapseAll for any but small hGrids. Only expandable nodes need to have IDs (leaf nodes do not).


Field Summary
static java.lang.String EXPAND_ALL_KEY
          the key to examine when deciding the feasibility of performing an expand-all.
static java.lang.String PATH_SEPARATOR
          The string used to delimit elements on the focus root path string.
 
Constructor Summary
DynamicHGridDataProxy()
           
DynamicHGridDataProxy(java.lang.String focusRootPath)
          Constructs a proxy that produces an HGrid that is initially focused on a given tree node.
DynamicHGridDataProxy(java.lang.String[] focusRootPath)
          Constructs a proxy that produces an HGrid that is initially focused on a given tree node.
DynamicHGridDataProxy(java.lang.String state, java.lang.String root)
          Create a proxy in response to a focus event
DynamicHGridDataProxy(java.lang.String state, java.lang.String root, boolean expandAll)
          Create a proxy in response to an expandAll (or collapseAll) event
DynamicHGridDataProxy(java.lang.String state, java.lang.String root, java.lang.String node)
          Create a proxy in response to an expand event
DynamicHGridDataProxy(java.lang.String state, java.lang.String root, java.lang.String node, boolean isPrevious)
          Create a proxy in response to an next or previous event
 
Method Summary
 void doPostRender(RenderingContext context, UINode node)
          renders the javascript needed by this proxy
 DataObjectList getBreadCrumbs(RenderingContext context, DataObject root)
           
 java.lang.String getCollapseAllDestination(RenderingContext context, DataObject focusRoot)
          Gets the destination of the collapse-all link in an HGrid.
 java.lang.String getCollapseDestination(RenderingContext context, DataObject node, int ignored)
          Returns a destination that would collapse the tree at the indicated node.
 java.lang.String getEventDestination(RenderingContext context, java.lang.String event, DataObject node, int ignored)
          Returns a destination that would fire the event at the indicated node.
 java.lang.String getExpandable(RenderingContext context, DataObject node, int ignored)
          Is the given node expandable?
 java.lang.String getExpandAllDestination(RenderingContext context, DataObject focusRoot)
          Gets the destination of the expand-all link in an HGrid.
 java.lang.String getExpandDestination(RenderingContext context, DataObject node, int ignored)
          Returns a destination that would expand the tree at the indicated node.
 java.lang.String getFocusDestination(RenderingContext context, DataObject node, int ignoredIndex)
          Returns a destination that would focus the HGrid at the indicated node.
 DataObject getFocusRoot(RenderingContext context, DataObject root)
          Gets the tree node that has the focus.
 int getViewNumber(RenderingContext context, int ignoredIndex)
          For large record sets it's expensive to display every row.
 boolean isExpandAllEnabled(RenderingContext context, DataObject focusRoot)
          checks to see if the expand/collapse-all links on this HGrid are enabled.
 void setBreadCrumbsEnabled(boolean isEnabled)
          Use this method to hide the breadcrumbs.
 
Methods inherited from class oracle.cabo.ui.data.tree.BaseTreeDataProxy
getChildren, isSelected, selectionEnabled, setFormName, sharedInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.cabo.ui.data.tree.TreeDataProxy
getChildren, isSelected, selectionEnabled, setFormName
 

Field Detail

EXPAND_ALL_KEY

public static final java.lang.String EXPAND_ALL_KEY
the key to examine when deciding the feasibility of performing an expand-all. The uiXML value is "expandAll"
See Also:
isExpandAllEnabled(RenderingContext, DataObject)

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
The string used to delimit elements on the focus root path string.
Constructor Detail

DynamicHGridDataProxy

public DynamicHGridDataProxy()

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String focusRootPath)
Constructs a proxy that produces an HGrid that is initially focused on a given tree node.
Parameters:
focusRootPath - This describes the path from the root of the tree to the subnode that must be the current focus root. This is a slash (/) delimited string of nodeIDs.

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String[] focusRootPath)
Constructs a proxy that produces an HGrid that is initially focused on a given tree node.
Parameters:
focusRootPath - This describes the path from the root of the tree to the subnode that must be the current focus root. Each element in this array indicates the ID of the next child (folder) node.

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String state,
                             java.lang.String root)
Create a proxy in response to a focus event
Parameters:
state - the encoded string with the current state of the tree.
root - this identifies the current focus root of the HGrid
Throws:
java.lang.IllegalArgumentException - if the above strings are not well formed.

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String state,
                             java.lang.String root,
                             boolean expandAll)
Create a proxy in response to an expandAll (or collapseAll) event
Parameters:
state - the encoded string with the current state of the tree.
root - this identifies the current focus root of the HGrid. The expand/collapse all takes place starting at this node.
expandAll - if true does an expand-all. Otherwise do a collapse-all.
Throws:
java.lang.IllegalArgumentException - if the above strings are not well formed.

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String state,
                             java.lang.String root,
                             java.lang.String node)
Create a proxy in response to an expand event
Parameters:
state - the encoded string with the current state of the tree.
root - this identifies the current focus root of the HGrid
node - this identifies the node that must be expanded/collapsed

DynamicHGridDataProxy

public DynamicHGridDataProxy(java.lang.String state,
                             java.lang.String root,
                             java.lang.String node,
                             boolean isPrevious)
Create a proxy in response to an next or previous event
Parameters:
state - the encoded string with the current state of the tree.
root - this identifies the current focus root of the HGrid
node - this identifies the node that parent node whose view will be scrolled.
isPrevious - this flag identifies the precipitating event as a previous if true, or a next event if false.
Method Detail

setBreadCrumbsEnabled

public void setBreadCrumbsEnabled(boolean isEnabled)
Use this method to hide the breadcrumbs. The breadcrumbs cannot be hidden if the HGrid has been focused into a subtree. If the breadcrumbs are hidden, then the focus column will also be hidden.
Parameters:
isEnabled - The breadcrumbs are enabled by default. Setting this to false will hide the breadcrumbs.
Throws:
java.lang.IllegalArgumentException - if the breadcrumbs cannot be disabled.

doPostRender

public void doPostRender(RenderingContext context,
                         UINode node)
                  throws java.io.IOException
renders the javascript needed by this proxy
Specified by:
doPostRender in interface TreeDataProxy
Overrides:
doPostRender in class BaseTreeDataProxy
Parameters:
node - the HGrid UINode

getFocusDestination

public java.lang.String getFocusDestination(RenderingContext context,
                                            DataObject node,
                                            int ignoredIndex)
Returns a destination that would focus the HGrid at the indicated node.
Specified by:
getFocusDestination in interface HGridDataProxy
Parameters:
node - the tree node.
ignoredIndex - ignored in this Dynamic implementation.

isExpandAllEnabled

public boolean isExpandAllEnabled(RenderingContext context,
                                  DataObject focusRoot)
Description copied from interface: HGridDataProxy
checks to see if the expand/collapse-all links on this HGrid are enabled. If an expand-all operation on the focus root (the tree node that has the focus) would result in too many rows, then this method must return false.
Specified by:
isExpandAllEnabled in interface HGridDataProxy
Parameters:
focusRoot - checks to see if it is feasible to completely expand this focus root.
Returns:
true if focusRoot has a property EXPAND_ALL_KEY and its value is not Boolean.FALSE
See Also:
EXPAND_ALL_KEY, Boolean.FALSE

getExpandAllDestination

public java.lang.String getExpandAllDestination(RenderingContext context,
                                                DataObject focusRoot)
Description copied from interface: HGridDataProxy
Gets the destination of the expand-all link in an HGrid. This method is called only if the expand-all operation is permitted.
Specified by:
getExpandAllDestination in interface HGridDataProxy
Parameters:
focusRoot - The current focus of the HGrid

getCollapseAllDestination

public java.lang.String getCollapseAllDestination(RenderingContext context,
                                                  DataObject focusRoot)
Description copied from interface: HGridDataProxy
Gets the destination of the collapse-all link in an HGrid. This method is called only if the expand-all operation is permitted.
Specified by:
getCollapseAllDestination in interface HGridDataProxy
Parameters:
focusRoot - The current focus of the HGrid

getEventDestination

public java.lang.String getEventDestination(RenderingContext context,
                                            java.lang.String event,
                                            DataObject node,
                                            int ignored)
Returns a destination that would fire the event at the indicated node.
Specified by:
getEventDestination in interface HGridDataProxy
Parameters:
event - the desired event.
node - the tree node.
ignored - Ignored for this implementation

getExpandDestination

public java.lang.String getExpandDestination(RenderingContext context,
                                             DataObject node,
                                             int ignored)
Returns a destination that would expand the tree at the indicated node.
Specified by:
getExpandDestination in interface TreeDataProxy
Overrides:
getExpandDestination in class BaseTreeDataProxy
Parameters:
node - the tree node
ignored - Ignored for this implementation

getCollapseDestination

public java.lang.String getCollapseDestination(RenderingContext context,
                                               DataObject node,
                                               int ignored)
Returns a destination that would collapse the tree at the indicated node.
Specified by:
getCollapseDestination in interface TreeDataProxy
Overrides:
getCollapseDestination in class BaseTreeDataProxy
Parameters:
node - the tree node
ignored - Ignored for this implementation

getExpandable

public java.lang.String getExpandable(RenderingContext context,
                                      DataObject node,
                                      int ignored)
Is the given node expandable?
Specified by:
getExpandable in interface TreeDataProxy
Overrides:
getExpandable in class BaseTreeDataProxy
Parameters:
node - the tree node
ignored - Ignored for this implementation
Returns:
one of UIConstants.EXPANDABLE_NO, UIConstants.EXPANDABLE_ALWAYS, UIConstants.EXPANDABLE_EXPANDED or UIConstants.EXPANDABLE_COLLAPSED

getFocusRoot

public DataObject getFocusRoot(RenderingContext context,
                               DataObject root)
Description copied from interface: HGridDataProxy
Gets the tree node that has the focus.
Specified by:
getFocusRoot in interface HGridDataProxy
Parameters:
root - the root of the HGrid tree.
Returns:
the tree node that currently has the HGrid focus.

getBreadCrumbs

public DataObjectList getBreadCrumbs(RenderingContext context,
                                     DataObject root)
Specified by:
getBreadCrumbs in interface HGridDataProxy
Parameters:
root - the root of the tree
Returns:
each DataObject is a bread crumb.

getViewNumber

public int getViewNumber(RenderingContext context,
                         int ignoredIndex)
Description copied from interface: HGridDataProxy
For large record sets it's expensive to display every row. Instead we implement a view on the child rows. The views are of a fixed size known to the renderer. This method returns the number of the view that should be displayed (so row getViewNum(...) * viewSize is the row number).
Specified by:
getViewNumber in interface HGridDataProxy
Parameters:
ignoredIndex - Ignored in this Dynamic implementation.

UIX 2.2.16