Have to supply the old value now when constructing an
AttributeChangedEvent by hand. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2511 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: FieldEditor.java,v 1.5 2002/10/02 20:10:20 mdb Exp $
|
// $Id: FieldEditor.java,v 1.6 2003/04/30 22:32:20 mdb Exp $
|
||||||
|
|
||||||
package com.threerings.admin.client;
|
package com.threerings.admin.client;
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ import com.samskivert.swing.event.AncestorAdapter;
|
|||||||
import com.threerings.presents.dobj.AttributeChangeListener;
|
import com.threerings.presents.dobj.AttributeChangeListener;
|
||||||
import com.threerings.presents.dobj.AttributeChangedEvent;
|
import com.threerings.presents.dobj.AttributeChangedEvent;
|
||||||
import com.threerings.presents.dobj.DObject;
|
import com.threerings.presents.dobj.DObject;
|
||||||
|
import com.threerings.presents.dobj.ObjectAccessException;
|
||||||
import com.threerings.presents.util.PresentsContext;
|
import com.threerings.presents.util.PresentsContext;
|
||||||
|
|
||||||
import com.threerings.admin.Log;
|
import com.threerings.admin.Log;
|
||||||
@@ -129,9 +130,15 @@ public class FieldEditor extends JPanel
|
|||||||
|
|
||||||
// submit an attribute changed event with the new value
|
// submit an attribute changed event with the new value
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
AttributeChangedEvent ace = new AttributeChangedEvent(
|
try {
|
||||||
_object.getOid(), _field.getName(), value);
|
AttributeChangedEvent ace = new AttributeChangedEvent(
|
||||||
_ctx.getDObjectManager().postEvent(ace);
|
_object.getOid(), _field.getName(), value,
|
||||||
|
_object.getAttribute(_field.getName()));
|
||||||
|
_ctx.getDObjectManager().postEvent(ace);
|
||||||
|
} catch (ObjectAccessException oae) {
|
||||||
|
Log.warning("Failed to update field " + _field.getName() +
|
||||||
|
": "+ oae);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user