|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.dacf.util.InfoBusMemberHelper
oracle.dacf.control.ConsumerSupport
oracle.dacf.control.ControlSupport
This class provides default implementations for most of the methods in the Control interface.
Data aware controls must implement the Control interface in order to plug into the runtime framework.
Data aware controls should delegate the methods in the Control interface to this class, which provides a standard implementation.
This class also implements the InfoBusMember and InfoBusDataConsumer interfaces, and manages the connection to the InfoBus as well as the DataItem rendezvous.
The control will automatically be registered for DataItemChange events with the bound data item if the data item supports the DataItemChangeManager interface.
Field Summary | |
protected Control |
_control
|
protected java.lang.String |
_dataItemName
|
protected java.util.Vector |
_enabledListeners
|
protected java.lang.String |
_infoBusName
|
protected java.util.Vector |
_navigatedListeners
|
protected java.util.Vector |
_navigatingListeners
|
Fields inherited from class oracle.dacf.util.InfoBusMemberHelper |
m_infoBus, m_propListeners, m_sourceRef, m_syncLock, m_vetoListeners |
Constructor Summary | |
ControlSupport(Control control)
Constructs the support object for a given data aware control. |
Method Summary | |
protected void |
_setDataItem(java.lang.Object dataItem)
Binds the control to a data item. |
protected void |
_updateEnabled()
|
void |
addControlEnabledListener(ControlEnabledListener l)
Adds a ControlEnabledListener. |
void |
addNavigatedListener(NavigatedListener listener)
Adds a navigated listener to this control. |
void |
addNavigatingListener(NavigatingListener listener)
Adds a navigating listener to this control. |
void |
dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
This method is called by the InfoBus class on behalf of a data producer that is announcing the availability of a new data item by name. |
void |
dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
This method is called by the InfoBus class on behalf of a data producer that is revoking the availability of a previously announced data item. |
protected void |
finalize()
Disconnects from the InfoBus. |
java.lang.Object |
getDataItem()
Returns the InfoBus DataItem this control is bound to. |
java.lang.String |
getDataItemName()
Returns the name of the InfoBus DataItem this control is bound to. |
java.lang.String |
getInfoBusName()
Returns the name of the InfoBus this control is connected to. |
void |
handleRequestFocus()
Delegates focus changes to the NavigationManager. |
boolean |
isEnabled()
|
boolean |
isFocusValidated()
Determines whether setting focus to this control causes validation. |
void |
processNavigatedEvent(NavigatedEvent event)
Processes a navigated event for this control. |
void |
processNavigatingEvent(NavigatingEvent event)
Processes a navigating event for this control. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when the object's InfoBus property is changed. |
void |
releaseResources(InfoBusManagerReleaseEvent e)
A signalling method used to indicate the the control should free all resources and unregister any listeners that it has registered. |
void |
removeControlEnabledListener(ControlEnabledListener l)
Removes a ControlEnabledListener. |
void |
removeNavigatedListener(NavigatedListener listener)
Removes a navigated listener from this control. |
void |
removeNavigatingListener(NavigatingListener listener)
Removes a navigating listener from this control. |
void |
setDataItemName(java.lang.String dataItemName)
Sets the name of the InfoBus DataItem this control is bound to. |
void |
setEnabled(boolean b)
An override of java.awt.Component.setEnabled. |
void |
setFocusValidated(boolean focusValidated)
Sets whether focus into this control causes validation to occur. |
void |
setInfoBusName(java.lang.String infoBusName)
Sets the name of the InfoBus this control is connected to. |
Methods inherited from class oracle.dacf.control.ConsumerSupport |
available, revoked |
Methods inherited from class oracle.dacf.util.InfoBusMemberHelper |
addInfoBusPropertyListener, addInfoBusVetoableListener, clearRef, getInfoBus, joinInfoBus, joinInfoBus, leaveInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.dacf.rp.Consumer |
available, revoked |
Field Detail |
protected Control _control
protected java.lang.String _infoBusName
protected java.util.Vector _navigatedListeners
protected java.util.Vector _navigatingListeners
protected java.util.Vector _enabledListeners
protected java.lang.String _dataItemName
Constructor Detail |
public ControlSupport(Control control)
control
- The data aware control.Method Detail |
public final void addControlEnabledListener(ControlEnabledListener l)
The listener will be notified when the enabled state of the control changes.
public final void removeControlEnabledListener(ControlEnabledListener l)
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
- If fatal error.public void releaseResources(InfoBusManagerReleaseEvent e)
InfoBusManagerListener
releaseResources
in interface InfoBusManagerListener
public void setEnabled(boolean b)
This method is used to track the intentions of the programmer. With it we can insure that when the DataItem is available, the control reflects his wishes.
b
- boolean flag indicating whether the control is enabledpublic boolean isEnabled()
public final java.lang.String getInfoBusName()
Control.getInfoBusName()
public void setInfoBusName(java.lang.String infoBusName)
By default, the control is connected to the default InfoBus, named Control.DEFAULT_INFOBUS_NAME.
If the named InfoBus does not exist, it is created automatically.
If the control is already connected to an InfoBus, it is disconnected first.
infoBusName
- The name of the InfoBus to connect to.Control.DEFAULT_INFOBUS_NAME
,
Control.setInfoBusName(java.lang.String)
public java.lang.String getDataItemName()
getDataItem()
,
Control.getDataItemName()
public void setDataItemName(java.lang.String dataItemName)
The DataItem with the given name is searched for on the InfoBus, and if found, is bound to this control.
If the control is already bound to a DataItem, it is unbound first.
dataItemName
- The name of the DataItem to bind to.getDataItem()
,
Control.setDataItemName(java.lang.String)
public java.lang.Object getDataItem()
getDataItem
in class ConsumerSupport
Control.getDataItem()
public final boolean isFocusValidated()
Control.isFocusValidated()
public final void setFocusValidated(boolean focusValidated)
focusValidated
- If true, focus into this control will
cause validation to occur.Control.setFocusValidated(boolean)
public final void addNavigatedListener(NavigatedListener listener)
The listener will be notified of NavigateIn and NavigateOut events.
listener
- The listener to add.Control.addNavigatedListener(oracle.dacf.control.NavigatedListener)
public final void removeNavigatedListener(NavigatedListener listener)
listener
- The listener to remove.Control.removeNavigatedListener(oracle.dacf.control.NavigatedListener)
public void processNavigatedEvent(NavigatedEvent event)
This method is for use by the NavigationManager only.
event
- The navigated event.Control.processNavigatedEvent(oracle.dacf.control.NavigatedEvent)
public final void addNavigatingListener(NavigatingListener listener)
The listener will be notified of NavigateIn and NavigateOut events.
listener
- The listener to add.Control.addNavigatingListener(oracle.dacf.control.NavigatingListener)
public final void removeNavigatingListener(NavigatingListener listener)
listener
- The listener to remove.Control.removeNavigatingListener(oracle.dacf.control.NavigatingListener)
public void processNavigatingEvent(NavigatingEvent event) throws NavigatingException
This method is for use by the NavigationManager only.
event
- The navigating event.
NavigatingException
- If the navigation is redirected to a
different control.Control.processNavigatingEvent(oracle.dacf.control.NavigatingEvent)
public void dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
If the control is not currently bound to a data item, and the name of the new data item matches the control's data item name, then the control is bound to the new data item.
If the control is not currently bound to a data item, and the name of the new data item is a prefix for the control's data item name, then the InfoBus is searched for a matching data item, and the control is bound to it if one is found. For example, if the item A.B.C is announced as available, and the control's data item name is set to A.B.C.D.E, the control will ask the InfoBus to find the data item A.B.C.D.E in response to the announcement of A.B.C -- this means that producers only need to publish their root prefix, and allows them to create child producers on demand.
dataItemAvailable
in interface javax.infobus.InfoBusDataConsumer
event
- The event.public void dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
If the name of the data item in the event matches the control's data item name, the control is unbound from its data item.
dataItemRevoked
in interface javax.infobus.InfoBusDataConsumer
event
- The event.public void propertyChange(java.beans.PropertyChangeEvent event)
The object is removed as a data consumer from its previous InfoBus, and is added as a consumer to its new InfoBus.
propertyChange
in interface java.beans.PropertyChangeListener
event
- The event.public void handleRequestFocus()
UI controls should override the requestFocus() method of Component and invoke this method after invoking super.requestFocus().
protected void _setDataItem(java.lang.Object dataItem)
If the new data item implements the DataItemChangeManager interface, the control is added as a DataItemChangeListener for the data item.
The control's dataItemChanged and dataItemValueChanged methods are invoked after the control has been bound to the new data item.
_setDataItem
in class ConsumerSupport
dataItem
- The new data item to bind to.protected void _updateEnabled()
|
Oracle Data-aware Controls Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.