|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
public interface ComponentInterface
ComponentInterface is the base interface for webAF components.
A webAF component (unrelated to java.awt.Component) is an object
used for assembling other objects and/or applications in a
component based development environment. This interface defines
the basic set of methods (and other interfaces) which components
must implement. There are support classes to provide a
default implementation; see com.sas.ComponentInterfaceSupport.
This is defined as an interface rather than as an (abstract) base class
so that objects in existing class hierarchies can be "componentized"
by simply implementing this interface, rather than reengineering the
objects to extend from a component base class. For example,
the com.sas.awt package defines several classes
derived from java.awt classes which have had this
ComponentInterface added to them to make them into webAF components.
It is not a requirement that JavaBeans used in the webAF development environment implement ComponentInterface. Components which implement ComponentInterface can take full advantage of webAF's ability to easily interconnect components using model/view and property linking.
Within webAF, the Bean Extension Wizard can assist in making components out of other objects. It does this by creating a subclass of the object and providing an implementation of the ComponentInterface in that subclass.
The initialization sequence for a component implementing the ComponentInterface is :
{constructor}
initializeComponent()
setDefaultValue()
{initialize designTime property}
initialize()
ComponentInterfaceSupport,
Component| Method Summary | |
|---|---|
abstract void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the component. |
abstract void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener to the component. |
abstract boolean |
anyPropertyChangeListeners()
Return true if there are any PropertyChangeEvent listeners. |
abstract void |
dumpComponent()
This method prints debugging information about the component. |
abstract void |
firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Report a bound property update to any registered listeners. |
abstract void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a bound property update to any registered listeners. |
abstract void |
fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Report a constrained property update to any registered listeners. |
abstract java.lang.String |
getComponentDescription()
This method returns the description of the component. |
abstract ComponentInterfaceSupportInfo |
getComponentSupportInfo(boolean createIfNecessary)
This method is not intended to be called by webAF users. |
abstract void |
initialize()
The initialize() method was designed to be a synchronization point after the constructor for the object has completed and a number of methods have been called on the component. |
abstract void |
initializeComponent()
Called by the default constructor. |
abstract boolean |
isDesignTime()
This method returns whether the component is in design mode or in run mode. |
abstract void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the component. |
abstract void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener from the component. |
abstract void |
setComponentDescription(java.lang.String description)
This method sets the description of the component. |
abstract void |
setComponentSupportInfo(ComponentInterfaceSupportInfo info)
This method is not intended to be called by webAF users. |
abstract void |
setDefaultValues()
This method sets the initial property values to their default values. |
| Methods inherited from interface com.sas.ViewInterface |
|---|
attachModel, detachModel, getModelInterface, getRequiredInterfaces, getViewInterfaceSupportInfo, refresh, removeInterfaceTraps, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsRequiredInterfaces, trapInterfaceEvents |
| Methods inherited from interface com.sas.ModelInterface |
|---|
attachView, detachView |
| Methods inherited from interface com.sas.LinkPropertiesInterface |
|---|
addLink, getLinkInfo, isLinked, queryLinks, queryLinks, removeAllLinks, removeLink, setLinkInfo |
| Method Detail |
|---|
java.lang.String getComponentDescription()
setComponentDescription(java.lang.String)void setComponentDescription(java.lang.String description)
Application writers may want to set unique componentDescriptions on components so that they can be distinquished properly in a testing environment.
description - The new description for the component.getComponentDescription()boolean isDesignTime()
ComponentInterface.isDesignTime should be used instead of java.beans.Beans.isDesignTime since java.beans.Beans.isDesignTime is not thread safe and changes the status of all JavaBeans at the same time.
Component.beansSetDesignTime(boolean)void dumpComponent()
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface com.sas.beans.PropertyChangeSourcelistener - The PropertyChangeListener to receive PropertyChangeEvents.removePropertyChangeListener(java.beans.PropertyChangeListener)void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface com.sas.beans.PropertyChangeSourcelistener - The PropertyChangeListener to stop receiving PropertyChangeEvents.addPropertyChangeListener(java.beans.PropertyChangeListener)void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
addVetoableChangeListener in interface com.sas.beans.VetoableChangeSourcelistener - The VetoableChangeListener to receive PropertyChangeEvents.removeVetoableChangeListener(java.beans.VetoableChangeListener)void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
removeVetoableChangeListener in interface com.sas.beans.VetoableChangeSourcelistener - The VetoableChangeListener to stop receiving PropertyChangeEvents.addVetoableChangeListener(java.beans.VetoableChangeListener)
void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
propertyName - The name of the property that was changed. null may be passed in to
indicate that a generic change to the component (and not a specific property) was made.oldValue - The old value of the property. null may be passed in to indicate that the
old value is unknown.newValue - The new value of the property. null may be passed in to indicate that the
new value is unknown.void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
propertyChangeEvent - A previously constructed property change eventanyPropertyChangeListeners()boolean anyPropertyChangeListeners()
void fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
throws java.beans.PropertyVetoException
propertyName - The name of the property that was changed.oldValue - The old value of the property. null may be passed in to indicate that the
new value is unknown.newValue - The new value of the property. null may be passed in to indicate that the
new value is unknown.
java.beans.PropertyVetoException - The listener vetoed the set of this constrained propertyvoid initialize()
initialize() should be called on a component after is it constructed :
ListBox listBox = new ListBox();
listBox.initialize();
container.add( listBox );
Overriding initialize is now discouraged since it is generally better to override setDefaultValues and readObject to perform initialization.
By default (in the ComponentInterface implementation), initialize() does nothing. However, various components override initialize() to perform operations, and it should be called.
Although use of initialize() is now discouraged, initialize() is also called by the validateObject method after a component is deserialized. This allows components which need processing during creation and deserialization to have a common place to perform operations. Adding event handlers to subcomponents is a typical use of the initialize method.
initializeComponent(),
setDefaultValues()void initializeComponent()
setDefaultValues(),
isDesignTime(),
Component.beansIsDesignTime()void setDefaultValues()
Note that the designTime property is not initialized when setDefaultValues is called, so initialization which depends on the value of designTime should take place in initializeComponent.
initializeComponent()ComponentInterfaceSupportInfo getComponentSupportInfo(boolean createIfNecessary)
createIfNecessary - Whether to create the ComponentInterfaceSupportInfo object if
it does not already exist.
void setComponentSupportInfo(ComponentInterfaceSupportInfo info)
info - An instance of ComponentInterfaceSupportInfo holding the information used
by the ComponentSupport class to implement the ComponentInterface.
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||