|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--java.beans.PropertyChangeEvent | +--com.sssw.rt.event.AgoPropertyChangeEvent
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] }
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 |
public static final int SOURCE_USER
public static final int SOURCE_PROG
Constructor Detail |
public AgoPropertyChangeEvent(Object source, String propName, Object oldValue, Object newValue)
// 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); }
public AgoPropertyChangeEvent(Object source, String propName, Object oldValue, Object newValue, int changeSource)
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 |
public int getChangeSource()
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:
// Only show an alert if the new value was directly given by the user if (evt.getChangeSource() == AgoPropertyChangeEvent.SOURCE_USER) showUserAlert(evt);
public AgiRowCursor getRowCursor()
// 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); }
AgoPropertyChangeEvent.getColumnIndex()
,
AgiRowCursor
public int getColumnIndex()
// 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); }
AgoPropertyChangeEvent.getRowCursor()
public String getMessage()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |