net.sf.jzeno.echo.databinding
Interface PropertyComponent

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ListBoxInterface, RebindableComponent
All Known Implementing Classes:
AbstractButton, AbstractConstantEditor, AbstractDynaPickList, AbstractLayout, AbstractListBoxDemoPanel, AbstractNumberEditor, AbstractNumberEditorDemoPanel, AbstractNumberViewer, AbstractPropertiesFileScreen, AbstractScreen, AbstractUnitTestCustomComponent, ActionBar, ActionBarDemoPanel, AskScriptNameDialog, AskVariableNameDialog, AsyncComponent, AsyncIntegerEditor, AsyncIntegerViewer, AsyncStringViewer, BigDecimalEditor, BigDecimalEditorDemoPanel, BigDecimalViewer, BlankScreen, BooleanEditor, BooleanImageViewer, BooleanImageViewerDemoPanel, BooleanViewer, BorderStyleEditor, ButtonReport, ByteEditor, ByteEditorDemoPanel, ByteViewer, CalibrationScreen, ClassEditorDemoPanel, ClassNameEditor, CloseDivComponent, ColumnAndRowUnitsEditor, ColumnSortCriterionEditor, CompactColorEditor, ComponentInspector, ComponentInspectorDialog, ComponentTypeEditor, CompoundComponent, CriteriaGrid, CriteriaGridDemoPanel, CSSButton, CSSComponent, CSSLabel, CustomComponent, CustomRenderingComponent, DateEditor, DateTimeEditor, DateTimeViewer, DateViewer, DefaultDynaTreeModel.NodeViewer, DefaultPdfLayout, DHLLayout, Dialog, DialogDemoPanel, DoubleEditor, DoubleEditorDemoPanel, DoubleViewer, DynaButton, DynaButtonDemoPanel, DynaCheckBox, DynaCheckBoxDemoPanel, DynaColorChooser, DynaColorChooserDemoPanel, DynaColorChooserDialog, DynaCompletionBox, DynaCompletionBoxDemoPanel, DynaConfirmButton, DynaConfirmButtonDemoPanel, DynaDateField, DynaDateFieldDemoPanel, DynaDateTimeField, DynaDateTimeFieldDemoPanel, DynaGrid, DynaGridDemoPanel, DynaGridReport, DynaHtmlContainer, DynaHtmlContainerDemoPanel, DynaHtmlEditor, DynaHtmlEditorDemoPanel, DynaLabel, DynaLabelDemoPanel, DynaLargeListBox, DynaLargeListBoxDemoPanel, DynaLargePickList, DynaLargePickListDemoPanel, DynaLink, DynaLinkDemoPanel, DynaListBox, DynaListBoxDemoPanel, DynaPasswordField, DynaPasswordFieldDemoPanel, DynaPickList, DynaPickListDemoPanel, DynaQuickSelectField, DynaQuickSelectFieldDemoPanel, DynaQuickSelectFieldDialog, DynaRadioButtonList, DynaRadioButtonListDemoPanel, DynaSaveButton, DynaSaveButtonDemoPanel, DynaSelectField, DynaSelectFieldDemoPanel, DynaTabbedPaneDemoPanel, DynaTable, DynaTableDemoPanel, DynaTableReport, DynaTableReport.MyCustomComp, DynaTableSortDialog, DynaTextArea, DynaTextAreaDemoPanel, DynaTextField, DynaTextFieldDemoPanel, DynaTimeField, DynaTimeFieldDemoPanel, DynaTree, DynaTreeDemoPanel, DynaTreeDemoPanel.DemoNodeViewer, ErrorMessagesComponent, ErrorMessagesComponentDemoPanel, ExternalSiteViewer, FloatEditor, FloatEditorDemoPanel, FloatViewer, FontEditor, GalleryScreen, GeneralSettingsScreen, GlobalExceptionScreen, HeapInspectorScreen, HistoryController, HorizontalAlignmentEditor, InsetsCompactEditor, InsetsEditor, InsetsEditorDialog, IntegerEditor, IntegerEditorDemoPanel, IntegerRangeSelector, IntegerViewer, JamonScreen, JavaBeanPropertyEditor, JavaBeanPropertyEditorDialog, LargeStringViewer, LargeStringViewerDemoPanel, Line, ListElementPropertyGrid, LogoffScreen, LongEditor, LongEditorDemoPanel, LongStringViewer, LongViewer, MenuBar, MenuEditorScreen, MenuEditorScreen.MenuSpecViewer, MenuSpecEditor, MockLayout, MockPropertyComponent, MockScreen, MouseCursorEditor, NavigationHistory, NewsManagerScreen, NewsTicker, NewsTickerDemoPanel, OpenDivComponent, OptimisticLockExceptionScreen, PackagesController, PageServedComponent, PdfBookmarkComponent, PdfNewPage, PdfReportComponent, PersistencySettingsScreen, PickScriptVariableDialog, PopWrapperDemoPanel, PopWrapperModeEditor, PreloadImagesComponent, PropertyEditor, PropertyGrid, PropertyGridDemoPanel, RebindableCompoundComponent, RebindablePropertyComponentSupport, RebindablePropertyComponentSupport2, ReRunButton, RescheduleSelector, SchedulerController, ScrapDialog, ScrapScreen, Screen, ScriptRecorder, ScrollBarPolicyEditor, SecondLevelCacheScreen, SecuritySettingEditor, SecuritySettingsScreen, SelectScriptDialog, ServerFileNameCompactEditor, ServerFileNameDialog, ServerFileNameEditor, SessionOverviewScreen, ShortEditor, ShortEditorDemoPanel, ShortViewer, StackTraceViewerDialog, StopButton, StringEditor, StringEditorDemoPanel, StringIconViewer, StringViewer, StringViewerDemoPanel, StyleManagerEditStyleDialog, StyleManagerScreen, SuccessStringViewer, TabPlacementEditor, TaskBar, TestDialog, TimerDemoPanel, TimeViewer, Title, ToolBarStyleEditor, TransactionModeEditor, TransactionSettingsScreen, UnitsEditor, UnitTestController, UnitTestScreen, ValidationDialog, VerticalAlignmentEditor, ViewStackTraceButton, VugenRecorder, WelcomeScreen, ZenoLayout

public interface PropertyComponent
extends java.io.Serializable

Common interface for all editors in the UI. An editor is a component that is capable of editing a single property of a single javabean in a cluster of javabeans.

All PropertyComponent implementations must also have 2 constructors.

The contract for these 2 constructors is as follows :

A good design to implement this interface is to use the PropertyComponentSupport class. Create a protected instance of this support class inside your own class. In your constructors, instantiate based on the databinding (or no databinding for default constructor) an instance of this class, and implement all operations in this interface by delegating to the support object.


Method Summary
 void addValidator(Validator validator)
           Add extra validators to this component.
 java.lang.Object getBean()
           Retrieve the root bean this editor is bound to.
 java.lang.Class getBeanClass()
           Determine the type of bean we are bound to.
 Decorator getDecorator()
           Gets the decorator, if any is configured.
 java.lang.String getProperty()
           Retrieve the property path to bind to on the domain model cluster.
 java.util.List getValidationErrors()
           Retrieves a list of currently pending validation errors on this component.
 java.util.List getValidators()
           Retrieve the list of active validators on this component.
 java.lang.Object getValue()
           Retrieve the property value from the domain model cluster.
 boolean isMarkedInvalid()
           
 boolean isReadOnly()
           
 boolean isRequired()
           Query if the editor is required to be filled in.
 boolean isValid()
           Check if this component contains valid user input.
 void markInvalid()
           Marks the component as invalid.
 void markValid()
           Marks the component as valid (remove error marking)
 void preRender()
           Make changes to the visual representation of this component before Echo starts rendering the component.
 void removeValidator(Validator validator)
           Remove an existing validator from this component.
 void setBean(java.lang.Object bean)
           sets the root bean for property-binding.
 void setBeanClass(java.lang.Class beanClass)
           Change the type of model bean this property component will be bound to.
 void setDecorator(Decorator decorator)
           Sets the decorator.
 void setProperty(java.lang.String propertyPath)
           Set the property(path) to bind to on the domain model cluster.
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRequired(boolean required)
           Determine if the editor is required to be filled in.
 void setValue(java.lang.Object value)
           Writes the supplied data into the property we are bound to.
 

Method Detail

setBean

void setBean(java.lang.Object bean)

sets the root bean for property-binding.


getBean

java.lang.Object getBean()

Retrieve the root bean this editor is bound to.


getBeanClass

java.lang.Class getBeanClass()

Determine the type of bean we are bound to.

During the lifecycle of a property component, this may NOT change ! In other words, if this component has been bound to, let's say, an Address object, this component must at all times remain bound to Address components ! (It may ofcourse change the specific instance to which it is bound, by calling setBean.)


setBeanClass

void setBeanClass(java.lang.Class beanClass)

Change the type of model bean this property component will be bound to.


setProperty

void setProperty(java.lang.String propertyPath)

Set the property(path) to bind to on the domain model cluster.


getProperty

java.lang.String getProperty()

Retrieve the property path to bind to on the domain model cluster.


setValue

void setValue(java.lang.Object value)

Writes the supplied data into the property we are bound to.


getValue

java.lang.Object getValue()

Retrieve the property value from the domain model cluster.


isRequired

boolean isRequired()

Query if the editor is required to be filled in.


setRequired

void setRequired(boolean required)

Determine if the editor is required to be filled in.


preRender

void preRender()

Make changes to the visual representation of this component before Echo starts rendering the component.

Do not modify any bound javabeans in this method, as the changes to these will not be reflected properly on the screen.


getDecorator

Decorator getDecorator()

Gets the decorator, if any is configured.


setDecorator

void setDecorator(Decorator decorator)

Sets the decorator.


setReadOnly

void setReadOnly(boolean readOnly)

Mark this component as read-only.


isReadOnly

boolean isReadOnly()

isValid

boolean isValid()

Check if this component contains valid user input. In itself this operation will not mark the component in error. In order to apply error marking on invalid components you should use EchoSupport.doValidationRecursively(Component).


markValid

void markValid()

Marks the component as valid (remove error marking)


markInvalid

void markInvalid()

Marks the component as invalid. Typically puts a colored border around it to indicate the error.


isMarkedInvalid

boolean isMarkedInvalid()

addValidator

void addValidator(Validator validator)

Add extra validators to this component.


removeValidator

void removeValidator(Validator validator)

Remove an existing validator from this component.


getValidators

java.util.List getValidators()

Retrieve the list of active validators on this component.


getValidationErrors

java.util.List getValidationErrors()

Retrieves a list of currently pending validation errors on this component.