Distributed objects go in the data package, not client. While I was in
here, I went ahead and cleaned up the custom field editor handling per Ray's earlier suggestion. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2981 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ObjectEditorPanel.java,v 1.3 2004/03/04 02:43:48 eric Exp $
|
||||
// $Id: ObjectEditorPanel.java,v 1.4 2004/03/06 12:00:39 mdb Exp $
|
||||
|
||||
package com.threerings.admin.client;
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.threerings.presents.dobj.Subscriber;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.Log;
|
||||
import com.threerings.admin.data.ConfigObject;
|
||||
|
||||
/**
|
||||
* Used to edit the distributed object fields of a particular
|
||||
@@ -96,12 +97,7 @@ public class ObjectEditorPanel extends ScrollablePanel
|
||||
// if the field is anything but a plain old public field,
|
||||
// we don't want to edit it
|
||||
if (fields[ii].getModifiers() == Modifier.PUBLIC) {
|
||||
JPanel panel = _object.getCustomEditor(_ctx,
|
||||
fields[ii].getName());
|
||||
if (panel == null) {
|
||||
panel = new FieldEditor(_ctx, fields[ii], _object);
|
||||
}
|
||||
add(panel);
|
||||
add(_object.getEditor(_ctx, fields[ii]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
//
|
||||
// $Id: ConfigObject.dobj,v 1.1 2004/03/04 02:42:31 eric Exp $
|
||||
// $Id: ConfigObject.dobj,v 1.2 2004/03/06 12:00:39 mdb Exp $
|
||||
|
||||
package com.threerings.admin.client;
|
||||
package com.threerings.admin.data;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.client.FieldEditor;
|
||||
|
||||
/**
|
||||
* Base class for runtime config distributed objects. Used to allow
|
||||
* config objects to supply custom object editing UI.
|
||||
@@ -15,10 +18,10 @@ import com.threerings.presents.util.PresentsContext;
|
||||
public class ConfigObject extends DObject
|
||||
{
|
||||
/**
|
||||
* Returns a custom editor panel for the specified field.
|
||||
* Returns the editor panel for the specified field.
|
||||
*/
|
||||
public JPanel getCustomEditor (PresentsContext ctx, String fieldName)
|
||||
public JPanel getEditor (PresentsContext ctx, Field field)
|
||||
{
|
||||
return null;
|
||||
return new FieldEditor(ctx, field, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
//
|
||||
// $Id: ConfigObject.java,v 1.1 2004/03/04 02:42:31 eric Exp $
|
||||
// $Id: ConfigObject.java,v 1.2 2004/03/06 12:00:39 mdb Exp $
|
||||
|
||||
package com.threerings.admin.client;
|
||||
package com.threerings.admin.data;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.client.FieldEditor;
|
||||
|
||||
/**
|
||||
* Base class for runtime config distributed objects. Used to allow
|
||||
* config objects to supply custom object editing UI.
|
||||
@@ -15,10 +18,10 @@ import com.threerings.presents.util.PresentsContext;
|
||||
public class ConfigObject extends DObject
|
||||
{
|
||||
/**
|
||||
* Returns a custom editor panel for the specified field.
|
||||
* Returns the editor panel for the specified field.
|
||||
*/
|
||||
public JPanel getCustomEditor (PresentsContext ctx, String fieldName)
|
||||
public JPanel getEditor (PresentsContext ctx, Field field)
|
||||
{
|
||||
return null;
|
||||
return new FieldEditor(ctx, field, this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user