SilverStream
Application Server 3.5

com.sssw.rt.event
Class AgoPropertyChangeEvent

java.lang.Object
 |
 +--java.util.EventObject
       |
       +--java.beans.PropertyChangeEvent
             |
             +--com.sssw.rt.event.AgoPropertyChangeEvent
All Implemented Interfaces:
Serializable

public class AgoPropertyChangeEvent
extends PropertyChangeEvent

Extension of the JavaBeans PropertyChangeEvent object. An AgoPropertyChangeEvent may be passed to any propertyChange method (from java.beans.PropertyChangeListener) because it extends the standard event object.

In version 3, the getChangeSource() method is deprecated. It does not return the correct value in some situations, and does not work at all for Swing-based controls. If you need to know whether the source of a property change was user action or program code, you can set a flag variable that lets you distinguish a programmatic change from a user change:

  m_modifyingControlState = true;
  myList.setValue("Boston");
  myComboBox.addItem("Boston");
  m_modifyingControlState = false;
 
  //in a valueChanged event:
  if (!modifyingControlState)
  {
     [react to user action]
  }
 

See Also:
Serialized Form

Field Summary
static int SOURCE_PROG
          Deprecated.  
static int SOURCE_USER
          Deprecated.  
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AgoPropertyChangeEvent(Object source, String propName, Object oldValue, Object newValue)
          Constructor for the SilverStream extended PropertyChangeEvent Parameters are the same as java.awt.event.PropertyChangeEvent.
AgoPropertyChangeEvent(Object source, String propName, Object oldValue, Object newValue, int changeSource)
          Deprecated.  
 
Method Summary
 int getChangeSource()
          Deprecated.  
 int getColumnIndex()
          This method is only relevant for an event whose source is a view.
 String getMessage()
          Returns the message that will be used to notify the user if the new value of this property fails validation.
 AgiRowCursor getRowCursor()
          This method is only relevant for an event whose source is a view.
 
Methods inherited from class java.beans.PropertyChangeEvent
getNewValue, getOldValue, getPropagationId, getPropertyName, setPropagationId
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOURCE_USER

public static final int SOURCE_USER
Deprecated.  

Indicates that the value was changed by an end-user action.

SOURCE_PROG

public static final int SOURCE_PROG
Deprecated.  

Indicates that the value was changed by com.sssw.rt.application programmer code.
Constructor Detail

AgoPropertyChangeEvent

public AgoPropertyChangeEvent(Object source,
                              String propName,
                              Object oldValue,
                              Object newValue)
Constructor for the SilverStream extended PropertyChangeEvent Parameters are the same as java.awt.event.PropertyChangeEvent.
Example:
 	// A control whose "Text" property has just changed would notify its
 	// listeners of the change like this:
 	AgoPropertyChangeEvent evt = new AgoPropertyChangeEvent(
 		this, "Text", formerText, newText);
 
 	// assume m_listeners is a vector
 	for (int i = 0; i < m_listeners.size(); i++)		
 	{
 		PropertyChangeListener listener = 
 			(PropertyChangeListener)m_listeners.elementAt(i);
 		listener.propertyChange(evt);
 	}
 

AgoPropertyChangeEvent

public AgoPropertyChangeEvent(Object source,
                              String propName,
                              Object oldValue,
                              Object newValue,
                              int changeSource)
Deprecated.  

Constructor.
Parameters:
changeSource - specifies whether the property change was caused by an end-user action (AgoPropertyChangeEvent.SOURCE_USER) or by program code (AgoPropertyChangeEvent.SOURCE_PROG).
Method Detail

getChangeSource

public int getChangeSource()
Deprecated.  

Indicates the source of this property change with an integer constant.
Usage:

This method is deprecated. It does not return the correct value in some situations, and does not work at all for Swing-based controls.

The constants are:

  • SOURCE_USER - the property was changed by an end-user action. The integer value is 1.
  • SOURCE_PROG - the property was changed by a SilverStream application program. The integer value is 2.
Example:
 	// Only show an alert if the new value was directly given by the user
 	if (evt.getChangeSource() == AgoPropertyChangeEvent.SOURCE_USER)
 		showUserAlert(evt);
 
 

getRowCursor

public AgiRowCursor getRowCursor()
This method is only relevant for an event whose source is a view. If the source of the property change is a view, this method returns an AgiRowCursor representing the row where the changed value is located.
Example:
 	// If the property change came from a cell in a view, extract the
 	// row and column numbers and call a helper routine
 	if (evt.getSource() instanceof AgcView)
 	{
 		AgiRowCursor rc = evt.getRowCursor();
 		int row = rc.getProperty(AgiRowCursor.ORDINAL);
 		int column = evt.getColumnIndex();
 		cellValueChanged(row, column);
 	}
 
See Also:
AgoPropertyChangeEvent.getColumnIndex(), AgiRowCursor

getColumnIndex

public int getColumnIndex()
This method is only relevant for an event whose source is a view. If the source of the property change is a view, this method returns the index of the column where the changed value is located.
Example:
 	// If the property change came from a cell in a view, extract the
 	// row and column numbers and call a helper routine
 	if (evt.getSource() instanceof AgcView)
 	{
 		AgiRowCursor rc = evt.getRowCursor();
 		int row = rc.getProperty(AgiRowCursor.ORDINAL);
 		int column = evt.getColumnIndex();
 		cellValueChanged(row, column);
 	}
 
See Also:
AgoPropertyChangeEvent.getRowCursor()

getMessage

public String getMessage()
Returns the message that will be used to notify the user if the new value of this property fails validation. Relevant in validationTest() and validationFailed event handlers.

SilverStream
Application Server 3.5