oracle.jbo.uicli.jui
Class JUTreeBinding
java.lang.Object
java.util.AbstractMap
oracle.jbo.common.JboAbstractMap
oracle.adf.model.binding.DCControlBinding
oracle.jbo.uicli.binding.JUControlBinding
oracle.jbo.uicli.binding.JUCtrlValueBinding
oracle.jbo.uicli.binding.JUCtrlRangeBinding
oracle.jbo.uicli.binding.JUCtrlHierBinding
oracle.jbo.uicli.jui.JUTreeBinding
- All Implemented Interfaces:
- ControlBinding, oracle.adf.model.ControlBinding, java.util.EventListener, JUCtrlInputValueHandler, JUCtrlValueHandler, java.util.Map, RangeBinding, oracle.adf.model.RangeBinding, 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:
- JUTreeAccessorTypeBinding - that display a selected attribute for all rows of a ViewObject/Iterator and upon expansion, expand the same accessor for all rows.
- JUTreeDiscrAttrTypeBinding - that allow displaying different attributes for each row of a ViewObject/Iterator determined by a unique value of the same or different attribute in the same row, and upon expansion, potentially expands to display rows from a different accessor for each row based on the discriminator attribute value. This type of node binding can be used to display polymorphic Rows in a ViewObject or display different attributes/accessors for each row based on the discriminator attribute value on that row: For example, assuming an EmpView, display EmployeeSal for all Employees of deptid=10 while displaying EmployeeRate for all Employees of deptid=20 and so on.
- See Also:
RowIterator
, JTree
, TreeModel
, TreeNode
Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
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_HEIGHT, ATTR_DISPLAY_HINT, ATTR_DISPLAY_WIDTH, ATTR_FORMAT, ATTR_FORMATS, ATTR_INPUT_VALUE, ATTR_LABEL, ATTR_LABELS, ATTR_LABELSET, ATTR_MANDATORY, ATTR_PATH, ATTR_TOOLTIP, ATTR_UPDATEABLE, ATTR_VIEWABLE, mHasInputVal, mInputVal, SEP_LIST_DISPLAY |
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.JUCtrlRangeBinding |
createValueBindingRef, getCurrentRowIndex, getEstimatedRowCount, getInputErrorsForRowKey, getInputValueInRow, getRangeSet, getRangeSize, getRangeStart, needsEstimatedRowCount, refreshControl, release, setCurrentRowAtIndex, setInputValueInRow, setRangeStart, updateNavigated |
Methods inherited from class oracle.jbo.uicli.binding.JUCtrlValueBinding |
compareAndSetAttribute, displayInShortForm, ensureVariableManager, 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, getFormat, getFormats, getHint, getHint, getInputValue, getInputValue, getInputValueHandler, getLabel, getLabel, getLabels, getLabelSet, getLocaleContext, getMergedAttributeValues, getNullValueString, getPath, getTooltip, getTooltip, hasFormatInformation, hasVariables, initResources, internalGetRow, internalHasPermission, isArrayIteratorType, isAttributeMandatory, isAttributeUpdateable, isAttributeUpdateable, isMandatory, isNewInputValue, isUpdateable, lookupAttributeDef, processInputException, processNewInputValue, put, resetInputState, resolvePath, setArrayIteratorType, setAttribute, setAttribute, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeInRow, setAttributeValue, setError, setInputValue, setInputValue, setInputValueHandler, setNullValueString, stopEditing, updateRowDeleted, updateRowInserted, validateInputValue |
Methods inherited from class oracle.adf.model.binding.DCControlBinding |
addToDCExceptions, executeQuery, executeQueryIfNeeded, get, getAllRowsInRange, getApplicationModule, getBindingContainer, getControl, getDCIteratorBinding, getDef, getDefFullName, getDefName, getFullName, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, hashCode, internalHasPermission, internalSetName, isControlQueriable, removeFromDCExceptions, reportException, resetAttributeExceptionInRow, setBindingContainer, setListener, setListener, setName, toString |
Methods inherited from class oracle.jbo.common.JboAbstractMap |
entrySet, equals, internalPut |
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.adf.model.RangeBinding |
getLabelSet |
Methods inherited from interface oracle.adf.model.ControlBinding |
setListener |
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 ***
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:
- Each ViewObject in the tree can either be displayed using a JUTreeAccessorTypeBinding or a JUTreeDiscrAttrTypeBinding.
- JUTreeAccessorTypeBinding takes precedence
- Only one attribute is displayed for each node based on the attribute setting in the corresponding JUCtrlHierTypeBinding object.
- Only one accessor is expanded for each node based on the accessor setting in the corresponding JUCtrlHierTypeBinding object.
- The order of nodes determine the search order for discriminator values in case of JUTreeDiscrAttrTypeBinding bindings and the first matching value determines the attribute and accessor for that node.
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
Copyright © 1997, 2006, Oracle. All rights reserved.