diff options
Diffstat (limited to 'NET/worlds/scape/BooleanPropertyEditor.java')
| -rw-r--r-- | NET/worlds/scape/BooleanPropertyEditor.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/NET/worlds/scape/BooleanPropertyEditor.java b/NET/worlds/scape/BooleanPropertyEditor.java new file mode 100644 index 0000000..83db263 --- /dev/null +++ b/NET/worlds/scape/BooleanPropertyEditor.java @@ -0,0 +1,26 @@ +package NET.worlds.scape; + +import NET.worlds.console.PolledDialog; + +public class BooleanPropertyEditor extends PropEditor { + private String[] choices; + private String falseName; + private String trueName; + + private BooleanPropertyEditor(Property property, String falseName, String trueName) { + super(property); + this.falseName = falseName; + this.trueName = trueName; + } + + @Override + public PolledDialog edit(EditTile parent, String title) { + String[] choices = new String[]{this.falseName, this.trueName}; + return new BooleanFieldEditorDialog(parent, title, this.property, choices); + } + + public static Property make(Property property, String falseName, String trueName) { + property.setPropertyType(0); + return property.setEditor(new BooleanPropertyEditor(property, falseName, trueName)); + } +} |