net.sf.jzeno.echo
Class AbstractLayout

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by nextapp.echo.AbstractPane
          extended by nextapp.echo.ContentPane
              extended by net.sf.jzeno.echo.AbstractLayout
All Implemented Interfaces:
java.io.Serializable, PropertyComponent, RebindableComponent, EventSink, Layout, Component
Direct Known Subclasses:
DHLLayout, MockLayout, ZenoLayout

public abstract class AbstractLayout
extends ContentPane
implements Layout, EventSink, java.io.Serializable, RebindableComponent

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Fields inherited from class nextapp.echo.ContentPane
BACKGROUND_IMAGE_PROPERTIES_CHANGED_PROPERTY, DEFAULT_INSETS, HEIGHT_CHANGED_PROPERTY, HEIGHT_EXTENT_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, SCROLL_BAR_ALWAYS, SCROLL_BAR_AUTO, SCROLL_BAR_NEVER, SCROLL_BAR_POLICY_CHANGED_PROPERTY, SCROLL_BAR_X_CHANGED_PROPERTY, SCROLL_BAR_Y_CHANGED_PROPERTY, STYLE_BACKGROUND_IMAGE, STYLE_BACKGROUND_IMAGE_PROPERTIES, STYLE_HEIGHT, STYLE_HEIGHT_EXTENT, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_SCROLL_BAR_POLICY, STYLE_VERTICAL_ALIGNMENT, STYLE_WIDTH, STYLE_WIDTH_EXTENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, WIDTH_CHANGED_PROPERTY, WIDTH_EXTENT_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.AbstractPane
PROPORTIONAL, RESIZABLE_CHANGED_PROPERTY, STYLE_RESIZABLE
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
AbstractLayout()
           
 
Method Summary
 void addValidator(Validator validator)
           Add extra validators to this component.
 void clearScrollPosition()
           Reset the scroll position of the current screen.
 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.Object getNullObject()
           
 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 isBound()
           
 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 loadPersistentState(java.lang.Object[] state)
           Gives you an oportunity to load some state such as the scroll position.
 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 rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void removeValidator(Validator validator)
           Remove an existing validator from this component.
 void resetScheduledDowntime()
          Remove any downtime messages set previously by Layout.setScheduledDowntime(String, Date, Integer).
 java.lang.Object[] savePersistentState()
           Gives you an oportunity to save some state such as the scroll position.
 void setBean(java.lang.Object newBean)
           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 setNullObject(java.lang.Object nullObject)
           This object should be returned by the implementor in getValue, when the property path ends in a null value.
 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 setScheduledDowntime(java.lang.String msg, java.util.Date date, java.lang.Integer minutes)
           One of the duties of a Layout component is to visualize downtime messages.
 void setValue(java.lang.Object value)
           Writes the supplied data into the property we are bound to.
 java.util.List traceValue()
           Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.
 
Methods inherited from class nextapp.echo.ContentPane
addCssFile, applyStyle, getBackgroundImage, getBackgroundImageProperties, getCssFiles, getHeightExtent, getHorizontalAlignment, getInsets, getScrollBarPolicy, getScrollBarX, getScrollBarY, getVerticalAlignment, getWidthExtent, isCssStyled, isScrollBarPositionModified, setBackgroundImage, setBackgroundImageProperties, setCssStyled, setHeight, setHeightExtent, setHorizontalAlignment, setInsets, setScrollBarPolicy, setScrollBarPositionModified, setScrollBarX, setScrollBarY, setVerticalAlignment, setWidth, setWidthExtent
 
Methods inherited from class nextapp.echo.AbstractPane
getHeight, getWidth, isResizable, setResizable
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setFont, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jzeno.echo.Layout
addCssFile, addOnLoadScriptOnce, getContent, getCssFiles, setContent, setErrors, setMessages, setWarnings
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

AbstractLayout

public AbstractLayout()
Method Detail

clearScrollPosition

public void clearScrollPosition()
Description copied from interface: Layout

Reset the scroll position of the current screen. Typically called when navigating from one screen to another. We don't want to have the scroll position of the first screen on the second.

Specified by:
clearScrollPosition in interface Layout

loadPersistentState

public void loadPersistentState(java.lang.Object[] state)
Description copied from interface: Layout

Gives you an oportunity to load some state such as the scroll position. State passed in is what you returned from the previous call to savePersistentSate.

Specified by:
loadPersistentState in interface Layout

savePersistentState

public java.lang.Object[] savePersistentState()
Description copied from interface: Layout

Gives you an oportunity to save some state such as the scroll position. If you're deriving from AbstractLayout, this operation is allready implemented. (see AbstractLayout).

Specified by:
savePersistentState in interface Layout

resetScheduledDowntime

public void resetScheduledDowntime()
Description copied from interface: Layout
Remove any downtime messages set previously by Layout.setScheduledDowntime(String, Date, Integer).

Specified by:
resetScheduledDowntime in interface Layout

setScheduledDowntime

public void setScheduledDowntime(java.lang.String msg,
                                 java.util.Date date,
                                 java.lang.Integer minutes)
Description copied from interface: Layout

One of the duties of a Layout component is to visualize downtime messages. Typically this is a messages that is put up on the screen some time before the system (e.g. the application server we're running on,..) is taken down for maintenance/upgrading etc...

The application code can trigger a new downtime messages by calling EchoSupport.setScheduledDowntime(String, Date, Integer).

A convenient way to satisfy this requirement is to include an instance of the ErrorMessagesComponentin your layout class.

Specified by:
setScheduledDowntime in interface Layout

addValidator

public void addValidator(Validator validator)
Description copied from interface: PropertyComponent

Add extra validators to this component.

Specified by:
addValidator in interface PropertyComponent

preRender

public void preRender()
Description copied from interface: PropertyComponent

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.

Specified by:
preRender in interface PropertyComponent

getBean

public java.lang.Object getBean()
Description copied from interface: PropertyComponent

Retrieve the root bean this editor is bound to.

Specified by:
getBean in interface PropertyComponent

getBeanClass

public java.lang.Class getBeanClass()
Description copied from interface: PropertyComponent

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

Specified by:
getBeanClass in interface PropertyComponent

getDecorator

public Decorator getDecorator()
Description copied from interface: PropertyComponent

Gets the decorator, if any is configured.

Specified by:
getDecorator in interface PropertyComponent

getNullObject

public java.lang.Object getNullObject()
Specified by:
getNullObject in interface RebindableComponent

getProperty

public java.lang.String getProperty()
Description copied from interface: PropertyComponent

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

Specified by:
getProperty in interface PropertyComponent

getValidationErrors

public java.util.List getValidationErrors()
Description copied from interface: PropertyComponent

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

Specified by:
getValidationErrors in interface PropertyComponent

getValidators

public java.util.List getValidators()
Description copied from interface: PropertyComponent

Retrieve the list of active validators on this component.

Specified by:
getValidators in interface PropertyComponent

getValue

public java.lang.Object getValue()
Description copied from interface: PropertyComponent

Retrieve the property value from the domain model cluster.

Specified by:
getValue in interface PropertyComponent

isBound

public boolean isBound()

isMarkedInvalid

public boolean isMarkedInvalid()
Specified by:
isMarkedInvalid in interface PropertyComponent

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent

isRequired

public boolean isRequired()
Description copied from interface: PropertyComponent

Query if the editor is required to be filled in.

Specified by:
isRequired in interface PropertyComponent

isValid

public boolean isValid()
Description copied from interface: PropertyComponent

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

Specified by:
isValid in interface PropertyComponent

markInvalid

public void markInvalid()
Description copied from interface: PropertyComponent

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

Specified by:
markInvalid in interface PropertyComponent

markValid

public void markValid()
Description copied from interface: PropertyComponent

Marks the component as valid (remove error marking)

Specified by:
markValid in interface PropertyComponent

removeValidator

public void removeValidator(Validator validator)
Description copied from interface: PropertyComponent

Remove an existing validator from this component.

Specified by:
removeValidator in interface PropertyComponent

setBean

public void setBean(java.lang.Object newBean)
Description copied from interface: PropertyComponent

sets the root bean for property-binding.

Specified by:
setBean in interface PropertyComponent

setBeanClass

public void setBeanClass(java.lang.Class beanClass)
Description copied from interface: PropertyComponent

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

Specified by:
setBeanClass in interface PropertyComponent

setDecorator

public void setDecorator(Decorator decorator)
Description copied from interface: PropertyComponent

Sets the decorator.

Specified by:
setDecorator in interface PropertyComponent

setNullObject

public void setNullObject(java.lang.Object nullObject)
Description copied from interface: RebindableComponent

This object should be returned by the implementor in getValue, when the property path ends in a null value.

Specified by:
setNullObject in interface RebindableComponent

setProperty

public void setProperty(java.lang.String propertyPath)
Description copied from interface: PropertyComponent

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

Specified by:
setProperty in interface PropertyComponent

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

Specified by:
setRequired in interface PropertyComponent

setValue

public void setValue(java.lang.Object value)
Description copied from interface: PropertyComponent

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

Specified by:
setValue in interface PropertyComponent

traceValue

public java.util.List traceValue()
Description copied from interface: RebindableComponent

Reads the properties in this components property path, and traces all read properties, returning the actual property values in a List.

Specified by:
traceValue in interface RebindableComponent

rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent