com.sptci.echo2
Class ViewUpdater

java.lang.Object
  extended by com.sptci.echo2.Updater
      extended by com.sptci.echo2.ViewUpdater
All Implemented Interfaces:
java.io.Serializable

public class ViewUpdater
extends Updater
implements java.io.Serializable

An updater used to update UI containers with data from JavaBean objects.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: ViewUpdater.java,v 1.3 2006/02/15 00:48:26 rakesh Exp $
Author:
Rakesh Vidyadharan 2006-02-07
See Also:
Serialized Form

Field Summary
private static java.util.logging.Logger logger
          The logger used to log errors/warnings to.
 
Fields inherited from class com.sptci.echo2.Updater
bean, uiContainer
 
Constructor Summary
ViewUpdater(java.lang.Object uiContainer, java.lang.Object bean)
          Create a new instance with the specified UI container and java bean.
 
Method Summary
protected  void processMap(java.util.Map<java.lang.String,nextapp.echo2.app.button.ToggleButton> ui, java.util.Map<java.lang.String,java.lang.Boolean> value)
          Update ToggleButton UI components.
 void update()
          Update the fields of the Updater.uiContainer with the data in similarly named fields in Updater.bean.
protected  void updateComponent(java.lang.Object object, java.lang.Object value)
          Update the value of the specified code using the specified value.
protected  void updateListBox(nextapp.echo2.app.ListBox listBox, java.util.List<ListItem> list)
          Update a ListBox UI component.
protected  void updateSelectField(nextapp.echo2.app.SelectField selectField, java.util.List<ListItem> list)
          Update a SelectField UI component.
 
Methods inherited from class com.sptci.echo2.Updater
beanValues, getBean, getUiContainer, setBean, setUiContainer, uiValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final transient java.util.logging.Logger logger
The logger used to log errors/warnings to.

Constructor Detail

ViewUpdater

public ViewUpdater(java.lang.Object uiContainer,
                   java.lang.Object bean)
Create a new instance with the specified UI container and java bean.

Parameters:
uiContainer - The Updater.uiContainer to use.
bean - The Updater.bean to use.
Method Detail

update

public void update()
Update the fields of the Updater.uiContainer with the data in similarly named fields in Updater.bean.

Specified by:
update in class Updater
Throws:
BindingException - If errors are encountered while accessing or setting the fields.
See Also:
ReflectionUtility.fetchField(java.lang.String, java.lang.Object), updateComponent(java.lang.Object, java.lang.Object)

updateComponent

protected void updateComponent(java.lang.Object object,
                               java.lang.Object value)
                        throws java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Update the value of the specified code using the specified value.

Parameters:
object - The UI component that is to be updated.
value - The value with which to update the object.
Throws:
java.lang.IllegalAccessException - If a custom security policy restricts access to the bean fields.
java.lang.reflect.InvocationTargetException - If the accessor method for the field could not be invoked successfully.
See Also:
processMap(java.util.Map, java.util.Map), updateSelectField(nextapp.echo2.app.SelectField, java.util.List)

processMap

protected void processMap(java.util.Map<java.lang.String,nextapp.echo2.app.button.ToggleButton> ui,
                          java.util.Map<java.lang.String,java.lang.Boolean> value)
Update ToggleButton UI components.

Parameters:
ui - The map that contains the name and selected state of the toggle button.
value - The new mappings to apply to the UI component.

updateSelectField

protected void updateSelectField(nextapp.echo2.app.SelectField selectField,
                                 java.util.List<ListItem> list)
Update a SelectField UI component.

Parameters:
selectField - The UI component that is to be updated.
list - The updated list data to apply to the UI component.

updateListBox

protected void updateListBox(nextapp.echo2.app.ListBox listBox,
                             java.util.List<ListItem> list)
Update a ListBox UI component.

Parameters:
listBox - The ListBox UI component that is to be updated.
list - The updated list data to apply to the UI component.


Copyright © 2006 Sans Pareil Technologies, Inc. All Rights Reserved.