com.sas
Interface ComponentInterface

All Superinterfaces:
java.util.EventListener, LinkPropertiesInterface, ModelInterface, java.io.ObjectInputValidation, java.beans.PropertyChangeListener, com.sas.beans.PropertyChangeSource, java.io.Serializable, com.sas.beans.VetoableChangeSource, ViewInterface
All Known Subinterfaces:
BookmarkManagerInterface, BookmarkManagerV2Interface, CommandProcessorViewInterface, LevelTreeInterface, LevelTreeV2Interface, LevelTreeV3Interface, ServerNodeInterface, com.sas.servlet.beans.TransformationInterface
All Known Implementing Classes:
_rprxIOMBookmarkManager, _rprxIOMBookmarkManagerV2, _rprxIOMLevelTree, _rprxIOMLevelTreeV2, _rprxIOMLevelTreeV3, _rprxJ2BookmarkManager, _rprxJ2BookmarkManagerV2, _rprxJ2LevelTree, _rprxJ2LevelTreeV2, _rprxJ2LevelTreeV3, _rprxJ2ServerNode, _rprxRemoteBookmarkManagerClient, _rprxRemoteBookmarkManagerV2Client, _rprxRemoteDesignTimeBookmarkManager, _rprxRemoteDesignTimeBookmarkManagerV2, _rprxRemoteDesignTimeLevelTree, _rprxRemoteDesignTimeLevelTreeV2, _rprxRemoteDesignTimeLevelTreeV3, _rprxRemoteDesignTimeServerNode, _rprxRemoteLevelTreeClient, _rprxRemoteLevelTreeV2Client, _rprxRemoteLevelTreeV3Client, _rprxRemoteServerNodeClient, Alarm, AlarmButtonModel, AnimationIconView, Applet, AppletVisualComponent, ArrowButton, AssociationList, BaseBorder, BaseButton, BaseCollection, BaseDataBean, BasicColorsCanvas, BasicColorsPanel, BookmarkManagerDelegate, BooleanData, BooleanOperator, Border, BorderedContainer, BorderedPanel, BoundedDouble, BoundedLong, BufferedPanel, Button, ButtonDialog, ButtonPanel, ButtonVisualComponent, ByteData, Canvas, CanvasVisualComponent, CatalogSelectorDialog, CharacterData, CheckBox, CheckBoxCell, CheckBoxVisualComponent, Choice, ChoiceVisualComponent, ClassPathClasses, ClassSelectorPanel, CloseCancelCustomizerDialog, Collection, CollectionMirror, Color, ColorComponent, ColorDialog, ColorList, ColorNameList, ColorPanel, ComboBox, CommandProcessor, Component, Component, ComponentVisualComponent, CompositeBorder, CompositeContainer, CompositePanel, Container, ContainerContainerComponent, ContainerVisualComponent, CurrentDate, CurrentTime, CustomColorsPanel, CustomizerDialog, CustomizerPanel, DataSetSelectorDialog, DataTableSortController, DateTimeMonitor, DefaultButtonListener, DefaultButtonModel, DefaultColorList, DefaultFontFamilyList, DefaultFontList, Dialog, DialogContainerComponent, DialogVisualComponent, Dictionary, DirectoryDialog, DoubleData, DualSelector, DynamicPropertyBag, EISSelectorDialog, File, FileComponent, FileList, FileListFiltersPanel, FileSystem, FileSystemList, Fireworks, FloatData, Font, FontComponent, FontDialog, FontList, FontPanel, Frame, FrameContainerComponent, FrameVisualComponent, GraphicalCheckBox, IconView, ImageAnimation, ImageLinkModel, ImageModel, ImageSequence, ImageView, IMDBTable, IndexedPropertyEditorHost, IntegerData, IntegerRange, com.sas.rmi.IOMBaseClient, com.sas.rmi.J2BaseClient, KeyCollection, Label, LabelView, LabelVisualComponent, LevelTreeDelegate, LibrarySelectorDialog, ListBox, ListBoxVisualComponent, LongData, Marquee, MessageBox, MetabaseSelectorDialog, NavigationBar, NodeDelegate, NumericTextField, ObjectData, OkCancelHelpDialog, OrderedCollection, OrderedListCollection, OrientationSelector, Panel, PanelContainerComponent, PanelVisualComponent, ParameterBag, Printer, PrinterList, ProgressDialog, PropertyEditorHost, PropertySheet, PushButton, RadioBox, RadioButton, RangeCollection, com.sas.rmi.RemoteBaseClient, com.sas.rmi.RemoteDesignTimeBaseClient, RemoteObjectCustomizerPanel, RemoteObjectSelectorDialog, RGBList, com.sas.rmi.RMIBaseClient, SASListDelegate, SASListNodeDelegate, SASProcedureTemplate, Scrollbar, Scrollbar, ScrollbarVisualComponent, ScrollPane, ScrollPaneContainerComponent, ScrollPaneVisualComponent, ScrollSlider, SelectionGroup, ServerNodeDelegate, Set, ShortData, SimpleJSTreeNode, SimpleTable, SliderListener, SortedCollection, SpinBox, SpinButton, StaticCollection, StaticDictionary, StaticOrderedCollection, StaticStringList, StaticTextModel, StatusStringData, StringCollection, StringComparator, StringData, StyledLabelView, TabBar, TabbedView, TabBorder, TabButton, TabButtonModel, TabFolder, TableView, Template, TextArea, TextAreaVisualComponent, TextBorder, TextEditComposite, TextField, TextFieldVisualComponent, TextLinkModel, TextValueModel, Timer, ToggleButton, ToggleButtonModel, Toolbar, ToolbarBorder, ToolbarButton, TransformingComparator, Tree, TreeView, UnitsBox, UpDownListBox, UpDownTextArea, URL, Windows95Border, WordWrapTextArea

public interface ComponentInterface
extends ViewInterface, ModelInterface, LinkPropertiesInterface, java.beans.PropertyChangeListener, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, java.io.Serializable, java.io.ObjectInputValidation

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()
 

See Also:
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

getComponentDescription

java.lang.String getComponentDescription()
This method returns the description of the component.

Returns:
The description of the component.
See Also:
setComponentDescription(java.lang.String)

setComponentDescription

void setComponentDescription(java.lang.String description)
This method sets the description of the component.

Application writers may want to set unique componentDescriptions on components so that they can be distinquished properly in a testing environment.

Parameters:
description - The new description for the component.
See Also:
getComponentDescription()

isDesignTime

boolean isDesignTime()
This method returns whether the component is in design mode or in run mode. Typically, a development environment for JavaBeans will set the designTime property to true while the component is being manipulated inside the development environment.

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.

Returns:
true for the component is in design mode, false for the component is in run mode.
See Also:
Component.beansSetDesignTime(boolean)

dumpComponent

void dumpComponent()
This method prints debugging information about the component. The value of all of the component's properties is printed. dumpComponent may be overridden by subclasses to provide additional information about component.


addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the component.

Specified by:
addPropertyChangeListener in interface com.sas.beans.PropertyChangeSource
Parameters:
listener - The PropertyChangeListener to receive PropertyChangeEvents.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the component.

Specified by:
removePropertyChangeListener in interface com.sas.beans.PropertyChangeSource
Parameters:
listener - The PropertyChangeListener to stop receiving PropertyChangeEvents.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener to the component.

Specified by:
addVetoableChangeListener in interface com.sas.beans.VetoableChangeSource
Parameters:
listener - The VetoableChangeListener to receive PropertyChangeEvents.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

removeVetoableChangeListener

void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener from the component.

Specified by:
removeVetoableChangeListener in interface com.sas.beans.VetoableChangeSource
Parameters:
listener - The VetoableChangeListener to stop receiving PropertyChangeEvents.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

firePropertyChange

void firePropertyChange(java.lang.String propertyName,
                        java.lang.Object oldValue,
                        java.lang.Object newValue)
Report a bound property update to any registered listeners. This method returns immediately without any action if there are no registered PropertyChangeEvent listeners. No event is fired if old and new are equal and non-null. This method corresponds to the java.beans.PropertyChangeSupport firePropertyChange method, which we cannot call directly since we have our own com.sas.beans.PropertyChangeEvent.

Parameters:
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.

firePropertyChange

void firePropertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
Report a bound property update to any registered listeners. This method is provided to allow the user to pass in their existing property change event; usually the other firePropertyChange method will be used which constructs a property change event. Before constructing a PropertyChangeEvent, you should test if there are any PropertyChangeEvent listeners and skip allocating and firing the event if there are no listeners.

Parameters:
propertyChangeEvent - A previously constructed property change event
See Also:
anyPropertyChangeListeners()

anyPropertyChangeListeners

boolean anyPropertyChangeListeners()
Return true if there are any PropertyChangeEvent listeners. If false, your property set methods can skip any additional logic for sending PropertyChangeEvents.

Returns:
true if there are any property change listeners.

fireVetoableChange

void fireVetoableChange(java.lang.String propertyName,
                        java.lang.Object oldValue,
                        java.lang.Object newValue)
                        throws java.beans.PropertyVetoException
Report a constrained property update to any registered listeners. No event is fired if old and new are equal and non-null. This method calls the java.beans.VetoableChangeSupport fireVetoableChange method. Throws a java.beans.PropertyVetoException.

Parameters:
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.
Throws:
java.beans.PropertyVetoException - The listener vetoed the set of this constrained property

initialize

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. This allows components with "expensive" set method calls to delay processing until all the sets have occurred.

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.

See Also:
initializeComponent(), setDefaultValues()

initializeComponent

void initializeComponent()
Called by the default constructor. initializeComponent calls setDefaultValues and then sets the designTime property on the component based on com.sas.Component.beansIsDesignTime().

See Also:
setDefaultValues(), isDesignTime(), Component.beansIsDesignTime()

setDefaultValues

void setDefaultValues()
This method sets the initial property values to their default values. It is called by initializeComponent. Subclasses of the Component class or classes that implement the ComponentInterface should override setDefaultValues to perform their initialization.

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.

See Also:
initializeComponent()

getComponentSupportInfo

ComponentInterfaceSupportInfo getComponentSupportInfo(boolean createIfNecessary)
This method is not intended to be called by webAF users. It is used internally by the ComponentInterfaceSupport class.

Parameters:
createIfNecessary - Whether to create the ComponentInterfaceSupportInfo object if it does not already exist.
Returns:
An instance of ComponentInterfaceSupportInfo holding the information used by the ComponentSupport class to implement the ComponentInterface.

setComponentSupportInfo

void setComponentSupportInfo(ComponentInterfaceSupportInfo info)
This method is not intended to be called by webAF users. It is used internally by the ComponentInterfaceSupport class.

Parameters:
info - An instance of ComponentInterfaceSupportInfo holding the information used by the ComponentSupport class to implement the ComponentInterface.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.