Business Components

oracle.jbo.uicli.binding
Class JUFormBinding

java.lang.Object
  |
  +--oracle.jbo.uicli.binding.JUFormBinding
Direct Known Subclasses:
JUPanelBinding

public abstract class JUFormBinding
extends java.lang.Object

Corresponds to a Swing JFrame instance and manages bindings used in a frame. The JUFormBinding class provides:

In the JClient Framework, JUPanelBinding extends this class and provides a home to various iterator bindings and control bindings.

See Also:
JUPanelBinding

Field Summary
TypeField
protected  ApplicationModule mAM
           
protected  JUApplication mApplication
           
 
Constructor Summary
TypeConstructor
protected JUFormBinding()
          Default constrcutor.
protected JUFormBinding(java.lang.Object panel)
          Constructor used by JUPanelBinding, which passes in a reference to the JPanel object.
 
Method Summary
TypeMethod
 void addControlBinding(JUControlBinding control)
          *** For internal framework use only ***
 void addControlBinding(java.lang.String name, JUControlBinding control)
          *** For internal framework use only ***
 void addIterBinding(JUIteratorBinding iterBinding)
          Adds the given iterator binding name with a framework generated name.
 void addIterBinding(java.lang.String name, JUIteratorBinding iterBinding)
          Adds this iterator binding with this form with the given name.
 void addStatusBarInterface(JUStatusBarInterface statusBar)
          Helper method to add the given object to the JUApplication's StatusBars.
protected abstract  void callBeforeRowNavigated(JUIteratorBinding iter)
          Invoked before any iterator binding performs a navigation call on a BC4J iterator.
protected abstract  void callBeforeSaveTransaction(Transaction txn)
          Invoked before the ensuing transaction's commit method is invoked by the framework.
protected abstract  void callBeforeSetAttribute(JUControlBinding ctrl, Row row, AttributeDef ad, java.lang.Object value)
          Invoked before any control binding performs a setAttribute call on a BC4J row.
 void clearIterBindings()
          Clean all iterator bindings registered with this form.
 boolean displayInShortForm(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Returns true if the attribute is to displayed in the short(summary) form.
 void displayStatus(JUIteratorBinding iterBinding, java.lang.String msgId, java.lang.Object[] params)
          Helper method to display the given message and params via the JUApplication's displayStatus method.
 void displayStatus(java.lang.String msg)
          Helper method to display the given message string via the JUApplication's displayStatus method.
 void execute()
          Execute the query behind each iterator binding that is contained in this form binding.
 void executeIfNeeded()
          Excecute the query for each iterator binding, if not already executed.
 JUControlBinding findControlBinding(java.lang.String name)
          *** For internal framework use only ***
 JUIteratorBinding findIterBinding(java.lang.String name)
          Returns the iterator binding object of the given name.
protected abstract  void focusGained(JUIteratorBinding iterBinding, JUControlBinding binding, int attrIndex)
          Invoked by the framework to notify various status bars of which control has gained the focus.
 JUApplication getApplication()
          Returns the JUApplciation object to which this form binding belongs.
 ApplicationModule getApplicationModule()
          Return oracle.jbo.ApplicationModule instance which provides the BC4J context to this form binding object.
 JUControlBinding getControlBinding(int index)
          *** For internal framework use only ***
 int getControlType(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Returns the preferred control type for this attribute.
 JUFormDef getDef()
          *** For internal framework use only ***
 int getDisplayHeight(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Returns the display width for this attribute.
 java.lang.String getDisplayHint(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Retrieves the display hint that dictates whether this attribute should be visible or not.
 int getDisplayWidth(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Returns the display width for this attribute.
 java.lang.String getHint(java.lang.String voName, java.lang.String attrName, LocaleContext locale, java.lang.String sHintName)
          Returns the hint value based on the hint name.
 java.util.ArrayList getIterBindingList()
          Return an ordered set of iterator bindings.
 java.util.HashMap getIterBindings()
          Return the hashmap containing iterator bindings.
 java.lang.String getLabel(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Retrieves the label to be used in any attribute prompts
 java.lang.String getName()
          Returns the instance name of this JUFormBinding object.
 java.lang.Object getPanel()
          Returns the associated JPanel object.
 JUIteratorBinding getRangeIterBinding(java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName, int rangeSize)
          Return an Iterator Binding of the given "voIterBindingName", if one already exists by that name, after setting up the iterator binding's range Size to the greater of existing range size and the given range size.
 JUIteratorBinding getRowIterBinding(java.lang.String voInstanceName, java.lang.String voIterName, java.lang.String voIterBindingName)
          Return an Iterator Binding of the given "voIterBindingName" if one already exists by that name.
 java.lang.String getTooltip(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Retrives the tooltip text to be used for this attribute.
 boolean hasFormatInformation(java.lang.String voName, java.lang.String attrName, LocaleContext locale)
          Returns true if any format hints have been defined for this attribute.
protected abstract  void initializeApplicationModule()
          *** For internal framework use only *** Used to setup reference to JUApplication and oracle.jbo.Application objects.
 void initializeFromDef(ApplicationModule am)
          *** For internal framework use only ***
 void initializeFromDef(RowSetIterator[] rsis)
          *** For internal framework use only ***
abstract  void initializePanel(java.util.ArrayList controls)
          *** For internal framework use only ***
 boolean isFindMode()
          Returns true if this form is in find mode.
protected abstract  void notifyIteratorChanged(JUIteratorBinding iterBnd, boolean refresh)
          Notify each listener of the iteratorChanged event when an iterator changes its data due to execute, re-execute, or change in display mode (find mode or data mode).
 boolean removeControlBinding(JUControlBinding control)
          *** For internal framework use only ***
 boolean removeControlBinding(java.lang.String name)
          *** For internal framework use only ***
 boolean removeIterBinding(java.lang.String name)
          If an iterator binding exists with the given name, remove it from the internal members.
 void removeStatusBarInterface(JUStatusBarInterface statusBar)
          Helper method to remove the given object to the JUApplication's StatusBars.
 void reportException(java.lang.Exception ex)
          If JUApplication is setup, then invoke JUApplication.reportException to report any exceptions.
 void setApplication(JUApplication app)
          Sets the JUApplication instance in this form binding and adds it to the JUApplication.
 void setApplicationModule(ApplicationModule am)
          *** For internal framework use only *** Sets the ApplicationModule reference
 void setFindMode(boolean mode)
          Sets this form into findMode.
 void setName(java.lang.String name)
          *** For internal framework use only ***
abstract  void setPanel(java.lang.Object panel)
          Associates this form binding object with a JPanel object.
protected  void setPanelInternal(java.lang.Object panel)
          Sets internal member variable with the given panel instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mAM

protected ApplicationModule mAM

mApplication

protected JUApplication mApplication
Constructor Detail

JUFormBinding

protected JUFormBinding()
Default constrcutor.

JUFormBinding

protected JUFormBinding(java.lang.Object panel)
Constructor used by JUPanelBinding, which passes in a reference to the JPanel object.
Method Detail

initializePanel

public abstract void initializePanel(java.util.ArrayList controls)
*** For internal framework use only ***

initializeApplicationModule

protected abstract void initializeApplicationModule()
*** For internal framework use only *** Used to setup reference to JUApplication and oracle.jbo.Application objects.

reportException

public void reportException(java.lang.Exception ex)
If JUApplication is setup, then invoke JUApplication.reportException to report any exceptions. Otherwise, throw a JboException (wrapping non-JboExceptions if required)

getApplication

public JUApplication getApplication()
Returns the JUApplciation object to which this form binding belongs.

setApplication

public void setApplication(JUApplication app)
Sets the JUApplication instance in this form binding and adds it to the JUApplication. If this form binding is already registered with a JUApplication, then it throws an InvalidOperException.
Throws:
InvalidOperException -  

getName

public final java.lang.String getName()
Returns the instance name of this JUFormBinding object.

setName

public final void setName(java.lang.String name)
*** For internal framework use only ***

Sets the instance name of this JUFormBinding object.


getDef

public final JUFormDef getDef()
*** For internal framework use only ***

initializeFromDef

public void initializeFromDef(ApplicationModule am)
*** For internal framework use only ***

initializeFromDef

public void initializeFromDef(RowSetIterator[] rsis)
*** For internal framework use only ***

getPanel

public final java.lang.Object getPanel()
Returns the associated JPanel object.

setPanel

public abstract void setPanel(java.lang.Object panel)
Associates this form binding object with a JPanel object.

setPanelInternal

protected void setPanelInternal(java.lang.Object panel)
Sets internal member variable with the given panel instance.

getApplicationModule

public final ApplicationModule getApplicationModule()
Return oracle.jbo.ApplicationModule instance which provides the BC4J context to this form binding object.

setApplicationModule

public void setApplicationModule(ApplicationModule am)
*** For internal framework use only *** Sets the ApplicationModule reference

getIterBindings

public final java.util.HashMap getIterBindings()
Return the hashmap containing iterator bindings.

getIterBindingList

public final java.util.ArrayList getIterBindingList()
Return an ordered set of iterator bindings.

findIterBinding

public final JUIteratorBinding findIterBinding(java.lang.String name)
Returns the iterator binding object of the given name.

addIterBinding

public final void addIterBinding(JUIteratorBinding iterBinding)
Adds the given iterator binding name with a framework generated name.

addIterBinding

public final void addIterBinding(java.lang.String name,
                                 JUIteratorBinding iterBinding)
Adds this iterator binding with this form with the given name.
Throws:
InvalidObjNameException - if an invalid name is passed in.
NameClashException - if given a duplicate name.

removeIterBinding

public final boolean removeIterBinding(java.lang.String name)
If an iterator binding exists with the given name, remove it from the internal members.

clearIterBindings

public final void clearIterBindings()
Clean all iterator bindings registered with this form.

addControlBinding

public final void addControlBinding(JUControlBinding control)
*** For internal framework use only ***

addControlBinding

public final void addControlBinding(java.lang.String name,
                                    JUControlBinding control)
*** For internal framework use only ***

getControlBinding

public final JUControlBinding getControlBinding(int index)
*** For internal framework use only ***

findControlBinding

public final JUControlBinding findControlBinding(java.lang.String name)
*** For internal framework use only ***

removeControlBinding

public final boolean removeControlBinding(JUControlBinding control)
*** For internal framework use only ***

removeControlBinding

public final boolean removeControlBinding(java.lang.String name)
*** For internal framework use only ***

execute

public void execute()
Execute the query behind each iterator binding that is contained in this form binding. Applications could invoke this method to re-execute all the ViewObjects associated with this form.

executeIfNeeded

public void executeIfNeeded()
Excecute the query for each iterator binding, if not already executed. Applications should invoke this method to verify and execute all the ViewObjects associated with this form. This method is used by the generated applications by default.

getRowIterBinding

public JUIteratorBinding getRowIterBinding(java.lang.String voInstanceName,
                                           java.lang.String voIterName,
                                           java.lang.String voIterBindingName)
Return an Iterator Binding of the given "voIterBindingName" if one already exists by that name. If not, create an IteratorBinding object that references a default iterator of the ViewObject instance named voInstanceName (and optionally the iterator named voIterName). Return this created iterator binding after adding it to internal lists.

Various control bindings that display just one row's attribute invoke this method to find or create the iterator binding for which they display an attribute data.


getRangeIterBinding

public JUIteratorBinding getRangeIterBinding(java.lang.String voInstanceName,
                                             java.lang.String voIterName,
                                             java.lang.String voIterBindingName,
                                             int rangeSize)
Return an Iterator Binding of the given "voIterBindingName", if one already exists by that name, after setting up the iterator binding's range Size to the greater of existing range size and the given range size. If range size is -1, that indicates all rows in the range and hence takes precedence in the above comparison.

If not, create an IteratorBinding object that references a default iterator of the ViewObject instance named voInstanceName (and optionally the iterator named voIterName). Return this created iterator binding after adding it to internal lists.

Various control bindings that are capable of displaying more than one row of data invoke this method to create their iterator binding with a preferred range size.


setFindMode

public void setFindMode(boolean mode)
Sets this form into findMode. All iterator bindings with this form are set to find mode. Also, notify each iteratorChanged listener registered with this form of the change in the iterator (due to change in mode so that they update the displays with the find or data mode's data).

isFindMode

public boolean isFindMode()
Returns true if this form is in find mode.

focusGained

protected abstract void focusGained(JUIteratorBinding iterBinding,
                                    JUControlBinding binding,
                                    int attrIndex)
Invoked by the framework to notify various status bars of which control has gained the focus.

notifyIteratorChanged

protected abstract void notifyIteratorChanged(JUIteratorBinding iterBnd,
                                              boolean refresh)
Notify each listener of the iteratorChanged event when an iterator changes its data due to execute, re-execute, or change in display mode (find mode or data mode).

addStatusBarInterface

public void addStatusBarInterface(JUStatusBarInterface statusBar)
Helper method to add the given object to the JUApplication's StatusBars.

removeStatusBarInterface

public void removeStatusBarInterface(JUStatusBarInterface statusBar)
Helper method to remove the given object to the JUApplication's StatusBars.

displayStatus

public void displayStatus(JUIteratorBinding iterBinding,
                          java.lang.String msgId,
                          java.lang.Object[] params)
Helper method to display the given message and params via the JUApplication's displayStatus method. This method becomes a no-op if this form is not registered with a JUApplication

displayStatus

public void displayStatus(java.lang.String msg)
Helper method to display the given message string via the JUApplication's displayStatus method. This method becomes a no-op if this form is not registered with a JUApplication

callBeforeSetAttribute

protected abstract void callBeforeSetAttribute(JUControlBinding ctrl,
                                               Row row,
                                               AttributeDef ad,
                                               java.lang.Object value)
Invoked before any control binding performs a setAttribute call on a BC4J row. This is used by JUPanelBinding to generate validation events to validate attribute values before they are set.

callBeforeRowNavigated

protected abstract void callBeforeRowNavigated(JUIteratorBinding iter)
Invoked before any iterator binding performs a navigation call on a BC4J iterator. This is used by JUPanelBinding to generate validation events to validate the current row of data before allowing navigation.

callBeforeSaveTransaction

protected abstract void callBeforeSaveTransaction(Transaction txn)
Invoked before the ensuing transaction's commit method is invoked by the framework. This is used by JUPanelBinding to generate validation events to validate all changes before they are finally committed to the database.

getLabel

public java.lang.String getLabel(java.lang.String voName,
                                 java.lang.String attrName,
                                 LocaleContext locale)
Retrieves the label to be used in any attribute prompts

getTooltip

public java.lang.String getTooltip(java.lang.String voName,
                                   java.lang.String attrName,
                                   LocaleContext locale)
Retrives the tooltip text to be used for this attribute.

getDisplayHint

public java.lang.String getDisplayHint(java.lang.String voName,
                                       java.lang.String attrName,
                                       LocaleContext locale)
Retrieves the display hint that dictates whether this attribute should be visible or not. The two possible values are:

getControlType

public int getControlType(java.lang.String voName,
                          java.lang.String attrName,
                          LocaleContext locale)
Returns the preferred control type for this attribute.

getDisplayWidth

public int getDisplayWidth(java.lang.String voName,
                           java.lang.String attrName,
                           LocaleContext locale)
Returns the display width for this attribute.

getDisplayHeight

public int getDisplayHeight(java.lang.String voName,
                            java.lang.String attrName,
                            LocaleContext locale)
Returns the display width for this attribute.

getHint

public java.lang.String getHint(java.lang.String voName,
                                java.lang.String attrName,
                                LocaleContext locale,
                                java.lang.String sHintName)
Returns the hint value based on the hint name.

hasFormatInformation

public boolean hasFormatInformation(java.lang.String voName,
                                    java.lang.String attrName,
                                    LocaleContext locale)
Returns true if any format hints have been defined for this attribute. This function should be used to bracket any calls to the formatting API.

displayInShortForm

public boolean displayInShortForm(java.lang.String voName,
                                  java.lang.String attrName,
                                  LocaleContext locale)
Returns true if the attribute is to displayed in the short(summary) form.

Business Components