Business Components

oracle.jbo.uicli.binding
Class JUCtrlValueBinding

java.lang.Object
  |
  +--oracle.jbo.uicli.binding.JUControlBinding
        |
        +--oracle.jbo.uicli.binding.JUCtrlValueBinding
All Implemented Interfaces:
AttributeList
Direct Known Subclasses:
JUCtrlAttrsBinding, JUCtrlRangeBinding

public abstract class JUCtrlValueBinding
extends JUControlBinding
implements AttributeList

A JUControlBinding class responsible for maintaining which attribute(s) of a row this binding can display/update. This class accepts a list of attribute names and gets the AttributeDef objects for those attributes from the associated ViewObject. This class also provides APIs to update values in a control given a new row or a set of rows. JUIteratorBinding uses APIs in this class to notify the controls of:

This class also has accessor methods that return attribute values for Attributes with which this control binding is working. The indices of these attributes are ordered based on the names provided to this control binding in the constructor.


Constructor Summary
TypeConstructor
protected JUCtrlValueBinding()
           
  JUCtrlValueBinding(java.lang.Object control, JUIteratorBinding iterBinding, java.lang.String[] attrNames)
           
 
Method Summary
TypeMethod
 AttributeDef findAttributeDef(java.lang.String name)
           
 java.lang.Object getAttribute(int index)
          Selects the attribute at the given index.
 java.lang.Object getAttribute(java.lang.String name)
          Selects the attribute with the given name.
 int getAttributeCount()
          Counts the number of attributes.
 AttributeDef getAttributeDef(int index)
           
 AttributeDef[] getAttributeDefs()
           
 java.lang.Object getAttributeFromRow(int rowIndexInRange, int attrIndex)
           
 java.lang.Object getAttributeFromRow(int rowIndexInRange, java.lang.String name)
           
 java.lang.Object getAttributeFromRow(Row row, AttributeDef def)
           
 java.lang.Object getAttributeFromRow(Row row, int attrIndex)
           
 java.lang.Object getAttributeFromRow(Row row, java.lang.String name)
           
 int getAttributeIndexOf(java.lang.String name)
          Find the index of the named attribute.
 java.lang.String[] getAttributeNames()
           
 boolean isAttributeUpdateable(int index)
          Determines whether this attribute is updateable for that row instance.
 void setAttribute(int index, java.lang.Object value)
          Sets the value of an attribute.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set the value for the named attribute.
 void setAttributeInRow(int rowIndexInRange, int attrIndex, java.lang.Object value, boolean handleException)
           
 void setAttributeInRow(int rowIndexInRange, java.lang.String name, java.lang.Object value, boolean handleException)
           
 void setAttributeInRow(Row row, AttributeDef def, java.lang.Object value)
           
 void setAttributeInRow(Row row, AttributeDef def, java.lang.Object value, boolean handleException)
           
 void setAttributeInRow(Row row, int attrIndex, java.lang.Object value, boolean handleException)
           
 void setAttributeInRow(Row row, java.lang.String name, java.lang.Object value, boolean handleException)
           
 void stopEditing()
          Notified by NavigationBar to stop any edits on the current control.
abstract  void updateNavigated(NavigationEvent event)
          Update the current row display as the currency has navigated in the iterator with which this control binding is working.
abstract  void updateRangeScrolled(ScrollEvent event)
          Update the control display based on whether the rows of data has scrolled.
 void updateRowDeleted(DeleteEvent event)
          Notification that a row was deleted in the associated iterator.
 void updateRowInserted(InsertEvent event)
          Notification that a new row was inserted in the associated iterator.
abstract  void updateValuesFromRow(Row row)
          Given a row, update the control with new attribute values from this row based on the attributes with which this binding is associated.
abstract  void updateValuesFromRows(Row[] rows, boolean clear)
          Given a set of rows, update the control with new attribute values from the rows based on the attributes with which this binding is associated.
 
Methods inherited from class oracle.jbo.uicli.binding.JUControlBinding
addControlToPanel, executeQuery, executeQueryIfNeeded, getAllRowsInRange, getApplicationModule, getControl, getCurrentRow, getDef, getFormBinding, getIteratorBinding, getLayoutObject, getName, getRowAtRangeIndex, getRowIterator, getTransaction, getViewObject, isControlQueriable, reportException, setFormBinding, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUCtrlValueBinding

protected JUCtrlValueBinding()

JUCtrlValueBinding

public JUCtrlValueBinding(java.lang.Object control,
                          JUIteratorBinding iterBinding,
                          java.lang.String[] attrNames)
Method Detail

updateValuesFromRow

public abstract void updateValuesFromRow(Row row)
Given a row, update the control with new attribute values from this row based on the attributes with which this binding is associated.

updateValuesFromRows

public abstract void updateValuesFromRows(Row[] rows,
                                          boolean clear)
Given a set of rows, update the control with new attribute values from the rows based on the attributes with which this binding is associated. If clear is true, the control is expected to remove the current displayed value and associated children values (like in a tree, remove all subnodes) and then set the new values.

updateRangeScrolled

public abstract void updateRangeScrolled(ScrollEvent event)
Update the control display based on whether the rows of data has scrolled.
See Also:
ScrollEvent

updateNavigated

public abstract void updateNavigated(NavigationEvent event)
Update the current row display as the currency has navigated in the iterator with which this control binding is working.

updateRowInserted

public void updateRowInserted(InsertEvent event)
Notification that a new row was inserted in the associated iterator. Control-bindings like JTable refresh their display to show the new row on this event.

updateRowDeleted

public void updateRowDeleted(DeleteEvent event)
Notification that a row was deleted in the associated iterator. Moves the currency on the associated row iterator to the next row (or previous row if there is no next row) when the currency on the iterator was on the deleted row.

getAttributeNames

public java.lang.String[] getAttributeNames()

getAttributeDefs

public AttributeDef[] getAttributeDefs()

getAttributeDef

public AttributeDef getAttributeDef(int index)

findAttributeDef

public AttributeDef findAttributeDef(java.lang.String name)

getAttributeFromRow

public java.lang.Object getAttributeFromRow(int rowIndexInRange,
                                            int attrIndex)

getAttributeFromRow

public java.lang.Object getAttributeFromRow(int rowIndexInRange,
                                            java.lang.String name)

getAttributeFromRow

public java.lang.Object getAttributeFromRow(Row row,
                                            AttributeDef def)

getAttributeFromRow

public java.lang.Object getAttributeFromRow(Row row,
                                            int attrIndex)

getAttributeFromRow

public java.lang.Object getAttributeFromRow(Row row,
                                            java.lang.String name)

setAttributeInRow

public void setAttributeInRow(int rowIndexInRange,
                              int attrIndex,
                              java.lang.Object value,
                              boolean handleException)

setAttributeInRow

public void setAttributeInRow(int rowIndexInRange,
                              java.lang.String name,
                              java.lang.Object value,
                              boolean handleException)

setAttributeInRow

public void setAttributeInRow(Row row,
                              AttributeDef def,
                              java.lang.Object value)

setAttributeInRow

public void setAttributeInRow(Row row,
                              AttributeDef def,
                              java.lang.Object value,
                              boolean handleException)

setAttributeInRow

public void setAttributeInRow(Row row,
                              int attrIndex,
                              java.lang.Object value,
                              boolean handleException)

setAttributeInRow

public void setAttributeInRow(Row row,
                              java.lang.String name,
                              java.lang.Object value,
                              boolean handleException)

getAttribute

public java.lang.Object getAttribute(int index)
Description copied from interface: AttributeList
Selects the attribute at the given index.
Specified by:
getAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
index - an integer in the range 0 to getAttributeCount() - 1.
Returns:
the attribute associated with index.

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: AttributeList
Selects the attribute with the given name.
Specified by:
getAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - an attribute name.
Returns:
the attribute associated with name.
Throws:
JboException, - a runtime exception, if name is unknown.

setAttribute

public void setAttribute(int index,
                         java.lang.Object value)
Description copied from interface: AttributeList
Sets the value of an attribute.
Specified by:
setAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
index - the attribute's index.
value - the value to be assigned to the attribute.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: AttributeList
Set the value for the named attribute.
Specified by:
setAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - the attribute's name.
value - the value to be assigned to the attribute.
Throws:
JboException, - a runtime exception, i if name is unknown.

getAttributeCount

public int getAttributeCount()
Description copied from interface: AttributeList
Counts the number of attributes.
Specified by:
getAttributeCount in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Returns:
the number of attributes.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String name)
Description copied from interface: AttributeList
Find the index of the named attribute.
Specified by:
getAttributeIndexOf in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - the attribute's name.
Returns:
an integer in the range 0 to getAttributeCount() - 1.
Throws:
JboException, - a runtime exception, if name is unknown.

isAttributeUpdateable

public boolean isAttributeUpdateable(int index)
Determines whether this attribute is updateable for that row instance. Returns true if iterator is in data mode and is the corresponding row. If iterator is in find mode, then does an additional check to determine whether the associated control is queriable.

stopEditing

public void stopEditing()
Notified by NavigationBar to stop any edits on the current control. Primarily for grid and tree to notify their cell editors to stop editing.

Business Components