com.sptci.echo2
Class ViewPropertyChangeListener

java.lang.Object
  extended by com.sptci.PropertyChangeListener
      extended by com.sptci.echo2.PropertyChangeListener
          extended by com.sptci.echo2.ViewPropertyChangeListener
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener

public class ViewPropertyChangeListener
extends PropertyChangeListener
implements java.io.Serializable

The PropertyChangeListener for change events fired by java beans to update Echo2 UI container classes (represented by PropertyChangeListener.bean).

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: ViewPropertyChangeListener.java,v 1.2 2006/02/15 00:48:26 rakesh Exp $
Author:
Rakesh Vidyadharan 2006-01-25
See Also:
Serialized Form

Field Summary
private  java.util.HashMap<java.lang.String,java.lang.reflect.Field> fields
          A map of all the Fields in the PropertyChangeListener.bean.
private static java.util.logging.Logger logger
          The logger used to log errors/warnings to.
private  java.util.HashMap<java.lang.reflect.Field,java.lang.reflect.Method> methods
          A map of the appropriate methods to be invoked for the elements in fields.
 
Fields inherited from class com.sptci.PropertyChangeListener
bean, properties, typeMapping
 
Constructor Summary
ViewPropertyChangeListener(java.lang.Object bean)
          Create a new instance of the listener for the specified object.
 
Method Summary
private  void introspect()
          Introspect the fields of PropertyChangeListener.bean and populate the fields and methods fields.
protected  void processList(java.lang.Object object, java.beans.PropertyChangeEvent event, java.lang.reflect.Field field)
          Update AbstractList UI components.
protected  void processMap(java.util.Map map, java.beans.PropertyChangeEvent event)
          Update ToggleButton UI components.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Implementation of the event handling method.
 void setBean(java.lang.Object bean)
          Set PropertyChangeListener.bean.
protected  void updateListBox(nextapp.echo2.app.ListBox listBox, java.beans.PropertyChangeEvent event)
          Update a ListBox UI component.
protected  void updateSelectField(nextapp.echo2.app.SelectField selectField, java.beans.PropertyChangeEvent event)
          Process a SelectField UI component.
 
Methods inherited from class com.sptci.echo2.PropertyChangeListener
modifyObject, parseName, processList, processMap
 
Methods inherited from class com.sptci.PropertyChangeListener
getBean, getProperties, initProperties, modifyPrimitive, objectFromString
 
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.


fields

private transient java.util.HashMap<java.lang.String,java.lang.reflect.Field> fields
A map of all the Fields in the PropertyChangeListener.bean.


methods

private transient java.util.HashMap<java.lang.reflect.Field,java.lang.reflect.Method> methods
A map of the appropriate methods to be invoked for the elements in fields.

Constructor Detail

ViewPropertyChangeListener

public ViewPropertyChangeListener(java.lang.Object bean)
Create a new instance of the listener for the specified object.

Parameters:
bean - The object whose fields are to be updated by change events.
See Also:
setBean(java.lang.Object)
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
                    throws BindingException
Implementation of the event handling method.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class PropertyChangeListener
Parameters:
event - A PropertyChangeEvent object describing the event source and the property that has changed.
Throws:
BindingException - If errors are encountered while attempting to modify the property in PropertyChangeListener.bean.
See Also:
PropertyChangeListener.parseName(java.lang.String), processList(java.lang.Object, java.beans.PropertyChangeEvent, java.lang.reflect.Field), processMap(java.util.Map, java.beans.PropertyChangeEvent)

introspect

private void introspect()
                 throws BindingException
Introspect the fields of PropertyChangeListener.bean and populate the fields and methods fields.

Throws:
BindingException - If errors are encountered while introspecting the PropertyChangeListener.bean.

processList

protected void processList(java.lang.Object object,
                           java.beans.PropertyChangeEvent event,
                           java.lang.reflect.Field field)
                    throws BindingException
Update AbstractList UI components.

Parameters:
object - The UI component that is to be updated.
event - A PropertyChangeEvent object describing the event source and the property that has changed.
field - The field that represents the UI component that is to be updated.
Throws:
BindingException - If errors are encountered while attempting to modify the property in PropertyChangeListener.bean.

updateSelectField

protected void updateSelectField(nextapp.echo2.app.SelectField selectField,
                                 java.beans.PropertyChangeEvent event)
Process a SelectField UI component.

Parameters:
selectField - The UI component that is to be updated.
event - A PropertyChangeEvent object describing the event source and the property that has changed.

updateListBox

protected void updateListBox(nextapp.echo2.app.ListBox listBox,
                             java.beans.PropertyChangeEvent event)
Update a ListBox UI component.

Parameters:
listBox - The ListBox UI component that is to be updated.
event - A PropertyChangeEvent object describing the event source and the property that has changed.

processMap

protected void processMap(java.util.Map map,
                          java.beans.PropertyChangeEvent event)
Update ToggleButton UI components.

Parameters:
map - The map that contains the name and selected state of the toggle button.

setBean

public void setBean(java.lang.Object bean)
Set PropertyChangeListener.bean.

Overrides:
setBean in class PropertyChangeListener
Parameters:
bean - The value to set.
See Also:
introspect()


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