Revamped the config object editor system to make it easier to create
custom editors for simple data types. Added a checkbox editor for boolean fields. Also switched the layout to the side as one is likely to accumulate many objects and allowed an object to be specified as the default. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3452 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -27,7 +27,8 @@ import javax.swing.JPanel;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.util.PresentsContext;
|
||||
|
||||
import com.threerings.admin.client.FieldEditor;
|
||||
import com.threerings.admin.client.AsStringFieldEditor;
|
||||
import com.threerings.admin.client.BooleanFieldEditor;
|
||||
|
||||
/**
|
||||
* Base class for runtime config distributed objects. Used to allow
|
||||
@@ -40,6 +41,10 @@ public class ConfigObject extends DObject
|
||||
*/
|
||||
public JPanel getEditor (PresentsContext ctx, Field field)
|
||||
{
|
||||
return new FieldEditor(ctx, field, this);
|
||||
if (field.getType().equals(Boolean.TYPE)) {
|
||||
return new BooleanFieldEditor(ctx, field, this);
|
||||
} else {
|
||||
return new AsStringFieldEditor(ctx, field, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user