Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.uicli.jui
Class JUTreeBinding

java.lang.Object
  extended byjava.util.AbstractMap
      extended byoracle.jbo.common.JboAbstractMap
          extended byoracle.adf.model.binding.DCControlBinding
              extended byoracle.jbo.uicli.binding.JUControlBinding
                  extended byoracle.jbo.uicli.binding.JUCtrlValueBinding
                      extended byoracle.jbo.uicli.binding.JUCtrlRangeBinding
                          extended byoracle.jbo.uicli.binding.JUCtrlHierBinding
                              extended byoracle.jbo.uicli.jui.JUTreeBinding
All Implemented Interfaces:
java.util.EventListener, JUCtrlInputValueHandler, java.util.Map, StructureDef, javax.swing.event.TreeExpansionListener, javax.swing.tree.TreeModel, javax.swing.event.TreeSelectionListener

public class JUTreeBinding
extends JUCtrlHierBinding
implements javax.swing.event.TreeExpansionListener, javax.swing.event.TreeSelectionListener, javax.swing.tree.TreeModel

A lightweight Document model that implements binding a javax.swing.JTree to a BC4J RowIterator and display a selected attribute. Each tree node may display a set of child nodes bound to another Iterator that is retrieved via an accessor on the rows of the first iterator.

This binding allows Trees that can have two types of nodes:

See Also:
RowIterator, JTree, TreeModel, TreeNode

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
 
Fields inherited from class oracle.jbo.uicli.binding.JUCtrlHierBinding
ATTR_ROOTNODE, mRootBinding, mTypeBindings
 
Fields inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
ATTR_ATTRIBUTE, ATTR_ATTRIBUTE_DEF, ATTR_ATTRIBUTE_DEFS, ATTR_ATTRIBUTE_VALUE, ATTR_ATTRIBUTE_VALUES, ATTR_ATTRIBUTES, ATTR_DISPLAY_HINT, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_PATH, ATTR_TOOLTIP, ATTR_UPDATEABLE, mHasInputVal, mInputVal, SEP_LIST_DISPLAY
 
Fields inherited from class oracle.adf.model.binding.DCControlBinding
ATTR_CURRENTROW, ATTR_DEF, ATTR_ERROR, ATTR_ERRORS, ATTR_FULLNAME, ATTR_ITER, ATTR_NAME, mInternalGet_KeyResolved, ROW_KEY_STR
 
Constructor Summary
JUTreeBinding(javax.swing.JTree tr, JUIteratorBinding iterBinding, JUCtrlHierTypeBinding[] typeBindings)
          This constructor binds a JTree with Rows from a given JUIteratorBinding and displays data as per the node-types passed in typeBindings.
JUTreeBinding(javax.swing.JTree tr, JUIteratorBinding iterBinding, java.lang.String attrName, JUCtrlHierTypeBinding[] typeBindings)
          *** For internal framework use only ***
 
Method Summary
 void addControlToPanel(java.lang.Object panel, java.lang.Object layoutObject, java.lang.Object layoutCons)
          *** For internal framework use only ***
 void addTreeModelListener(javax.swing.event.TreeModelListener l)
           
protected  JUCtrlHierNodeBinding createNodeBinding(JUCtrlHierNodeBinding parent, JUIteratorBinding iterBinding, JUCtrlHierTypeBinding typeBinding, Row row, boolean expandable)
           
protected  void createRootBinding()
           
static javax.swing.tree.DefaultTreeModel createTreeNodeTypeBinding(JUFormBinding formBinding, javax.swing.JTree control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, JUCtrlHierTypeBinding[] nodeBindings)
          This method is used by the JClient model-binding editors to bind a JTree to this binding.
 java.lang.String[] getAttributeNames()
          Returns the attribute that is displayed in the first-level nodes of this tree.
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object parent)
           
 java.lang.Object getControlModel(java.lang.Object control)
          Gets the associated View's model object.
 int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
           
static javax.swing.tree.DefaultTreeModel getInstance(JUFormBinding formBinding, javax.swing.JTree control, java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, JUCtrlHierTypeBinding[] nodeBindings)
          Deprecated. since 9.0.2
 java.lang.Object getLayoutObject()
          *** For internal framework use only ***
protected  javax.swing.tree.DefaultTreeModel getModelImpl(javax.swing.JTree control)
          Returns the TreeModel to which the associated JTree is bound.
 java.lang.Object getRoot()
           
 JUTreeNodeBinding getRootBinding()
          Returns the root node binding that contains the iterator that the root node is displaying.
 java.lang.Object getValueAt(int rowIndex, int attrIndex)
          Returns null, as tree is not implemented to return attribute values for a given Row.
 boolean isLeaf(java.lang.Object node)
           
 void removeTreeModelListener(javax.swing.event.TreeModelListener l)
           
protected  JUCtrlHierNodeBinding restoreTreeAndExpand(java.util.ArrayList al)
          Advanced method: Applications should not use this method
 void setControl(java.lang.Object ctrl)
          Sets the associated Swing control.
 void setLayoutObject(javax.swing.JScrollPane scrollPane)
          *** For internal framework use only ***
 void setValueAt(java.lang.Object value, int rowIndex, int attrIndex)
          This method is a noop.
 void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
           
 void treeExpanded(javax.swing.event.TreeExpansionEvent e)
           
 void updateRangeScrolled(ScrollEvent event)
          Method to handle scroll events from the BC4J iterator.
 void updateValuesFromRow(Row row)
          This method is called in the framework when values of a single row need to be updated in a control (typically on a navigation event).
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
           
 void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
           
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlHierBinding
findNodeByKeyPath, getRootNodeBinding, getTypeBindings, internalGet, updateValuesFromRows
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlRangeBinding
createValueBindingRef, getEstimatedRowCount, getRangeSet, getRangeSize, getRangeStart, needsEstimatedRowCount, refreshControl, release, resetInputState, updateNavigated
 
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding
compareAndSetAttribute, displayInShortForm, findAttributeDef, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeDef, getAttributeDef, getAttributeDefs, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeFromRow, getAttributeIndexOf, getAttributes, getAttributes, getAttributeUIHelper, getAttributeValidators, getAttributeValidators, getAttributeValue, getAttributeValue, getAttributeValueFromRow, getAttributeValues, getAttributeValues, getControlType, getDisplayHeight, getDisplayHint, getDisplayWidth, getError, getErrors, getHint, getHint, getInputValue, getLabel, getLabel, getLabels, getLabelSet, getLocaleContext, getMergedAttributeValues, getPath, getTooltip, getTooltip, hasFormatInformation, internalGetRow, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isMandatory, isNewInputValue, isUpdateable, lookupAttributeDef, processInputException, processNewInputValue, put, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeValue, setError, setInputValue, setInputValue, setInputValueHandler, stopEditing, updateRowDeleted, updateRowInserted
 
Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
getFormBinding, getIteratorBinding, reportException, setFormBinding
 
Methods inherited from class oracle.adf.model.binding.DCControlBinding
addToDCExceptions, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getBindingContainer, getControl, getCurrentRow, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, hashCode, internalSetName, isControlQueriable, removeFromDCExceptions, reportException, resetAttributeExceptionInRow, setBindingContainer, setName, toString
 
Methods inherited from class oracle.jbo.common.JboAbstractMap
entrySet, equals
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.jbo.StructureDef
getDefFullName, getDefName, getFullName, getName
 

Constructor Detail

JUTreeBinding

public JUTreeBinding(javax.swing.JTree tr,
                     JUIteratorBinding iterBinding,
                     JUCtrlHierTypeBinding[] typeBindings)
This constructor binds a JTree with Rows from a given JUIteratorBinding and displays data as per the node-types passed in typeBindings.


JUTreeBinding

public JUTreeBinding(javax.swing.JTree tr,
                     JUIteratorBinding iterBinding,
                     java.lang.String attrName,
                     JUCtrlHierTypeBinding[] typeBindings)
*** For internal framework use only ***

Method Detail

getControlModel

public java.lang.Object getControlModel(java.lang.Object control)
Gets the associated View's model object.

Overrides:
getControlModel in class DCControlBinding

createTreeNodeTypeBinding

public static javax.swing.tree.DefaultTreeModel createTreeNodeTypeBinding(JUFormBinding formBinding,
                                                                          javax.swing.JTree control,
                                                                          java.lang.String voInstanceName,
                                                                          java.lang.String voIterName,
                                                                          java.lang.String voIterBindingName,
                                                                          JUCtrlHierTypeBinding[] nodeBindings)
This method is used by the JClient model-binding editors to bind a JTree to this binding. The rules for ViewObjects that will be displayed in this binding are passed in the nodeBindings array.

The rules the govern the node bindings are:


getInstance

public static javax.swing.tree.DefaultTreeModel getInstance(JUFormBinding formBinding,
                                                            javax.swing.JTree control,
                                                            java.lang.String voInstanceName,
                                                            java.lang.String voIterName,
                                                            java.lang.String voIterBindingName,
                                                            JUCtrlHierTypeBinding[] nodeBindings)
Deprecated. since 9.0.2


setControl

public void setControl(java.lang.Object ctrl)
Description copied from class: DCControlBinding
Sets the associated Swing control.

Overrides:
setControl in class DCControlBinding

getModelImpl

protected javax.swing.tree.DefaultTreeModel getModelImpl(javax.swing.JTree control)
Returns the TreeModel to which the associated JTree is bound. Unlike JUTableBinding, tree binding does not implement a custom TreeModel, but rather reuses the existing TreeModel in JTree and simply attaches itself as an associate to the TreeModel and passes BC4J data to it.


addControlToPanel

public void addControlToPanel(java.lang.Object panel,
                              java.lang.Object layoutObject,
                              java.lang.Object layoutCons)
*** For internal framework use only ***

Overrides:
addControlToPanel in class JUCtrlRangeBinding

getLayoutObject

public java.lang.Object getLayoutObject()
*** For internal framework use only ***

Overrides:
getLayoutObject in class DCControlBinding

setLayoutObject

public void setLayoutObject(javax.swing.JScrollPane scrollPane)
*** For internal framework use only ***


getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int attrIndex)
Returns null, as tree is not implemented to return attribute values for a given Row. The displayed value is accessible via the TreeModel.

Overrides:
getValueAt in class JUCtrlRangeBinding

setValueAt

public void setValueAt(java.lang.Object value,
                       int rowIndex,
                       int attrIndex)
This method is a noop. JUTreeBinding is currently only a readonly binding

Overrides:
setValueAt in class JUCtrlRangeBinding

getAttributeNames

public java.lang.String[] getAttributeNames()
Returns the attribute that is displayed in the first-level nodes of this tree.

Overrides:
getAttributeNames in class JUCtrlValueBinding

getRootBinding

public JUTreeNodeBinding getRootBinding()
Returns the root node binding that contains the iterator that the root node is displaying.


createNodeBinding

protected JUCtrlHierNodeBinding createNodeBinding(JUCtrlHierNodeBinding parent,
                                                  JUIteratorBinding iterBinding,
                                                  JUCtrlHierTypeBinding typeBinding,
                                                  Row row,
                                                  boolean expandable)
Overrides:
createNodeBinding in class JUCtrlHierBinding

createRootBinding

protected void createRootBinding()
Overrides:
createRootBinding in class JUCtrlHierBinding

restoreTreeAndExpand

protected JUCtrlHierNodeBinding restoreTreeAndExpand(java.util.ArrayList al)
Advanced method: Applications should not use this method

Overrides:
restoreTreeAndExpand in class JUCtrlHierBinding

updateValuesFromRow

public void updateValuesFromRow(Row row)
This method is called in the framework when values of a single row need to be updated in a control (typically on a navigation event).

Overrides:
updateValuesFromRow in class JUCtrlHierBinding

updateRangeScrolled

public void updateRangeScrolled(ScrollEvent event)
Description copied from class: JUCtrlRangeBinding
Method to handle scroll events from the BC4J iterator. Subclasses need to implement this method to update the currently displayed rowset (if desired).

Overrides:
updateRangeScrolled in class JUCtrlRangeBinding

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent e)
Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent e)
Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

getRoot

public java.lang.Object getRoot()
Specified by:
getRoot in interface javax.swing.tree.TreeModel

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)
Specified by:
getChild in interface javax.swing.tree.TreeModel

getChildCount

public int getChildCount(java.lang.Object parent)
Specified by:
getChildCount in interface javax.swing.tree.TreeModel

isLeaf

public boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel

valueForPathChanged

public void valueForPathChanged(javax.swing.tree.TreePath path,
                                java.lang.Object newValue)
Specified by:
valueForPathChanged in interface javax.swing.tree.TreeModel

getIndexOfChild

public int getIndexOfChild(java.lang.Object parent,
                           java.lang.Object child)
Specified by:
getIndexOfChild in interface javax.swing.tree.TreeModel

addTreeModelListener

public void addTreeModelListener(javax.swing.event.TreeModelListener l)
Specified by:
addTreeModelListener in interface javax.swing.tree.TreeModel

removeTreeModelListener

public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
Specified by:
removeTreeModelListener in interface javax.swing.tree.TreeModel

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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