public class PropertySetter extends java.lang.Object implements PropertyTypes
Modifier and Type | Class and Description |
---|---|
static class |
PropertySetter.Property
A property definition.
|
TYPE_BOOLEAN, TYPE_ENUM, TYPE_FLOAT, TYPE_INT, TYPE_STRING
Constructor and Description |
---|
PropertySetter(java.lang.String dialogTitle,
ScriptContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addProperty(java.lang.String key,
java.lang.String desc,
short type)
Add a property to Edit.
|
void |
addProperty(java.lang.String key,
java.lang.String desc,
short type,
java.util.List<java.lang.String> params)
Add a property to Edit, with an additional String parameter list.
|
void |
addProperty(java.lang.String key,
java.lang.String desc,
short type,
java.lang.Number minValue,
java.lang.Number maxValue,
java.lang.Number step)
Add a property to Edit, with an additional String parameter list.
|
void |
addProperty(java.lang.String key,
java.lang.String desc,
short type,
java.lang.String... params)
Add a property to Edit, with an additional String parameter array.
|
void |
addProperty(java.lang.String key,
java.lang.String desc,
short type,
java.lang.String param)
Add a property to Edit, with an additional String parameter.
|
void |
askForProperties()
Show the dialog with the values editors.
|
boolean |
getBooleanProperty(java.lang.String name)
Return the boolean property with a specified name.
|
float |
getFloatProperty(java.lang.String name,
float defaultValue)
Return the float property with a specified name.
|
int |
getIntProperty(java.lang.String name,
int defaultValue)
Return the int property with a specified name.
|
java.lang.String |
getNotNullStringProperty(java.lang.String name)
Return the String property with a specified name.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Return the map of all property values after the edition.
|
java.lang.String |
getStringProperty(java.lang.String name)
Return the String property with a specified name.
|
public PropertySetter(java.lang.String dialogTitle, ScriptContext context)
dialogTitle
- the dialog titlecontext
- the ScriptContextpublic void askForProperties()
public void addProperty(java.lang.String key, java.lang.String desc, short type)
key
- the property keydesc
- the field descriptiontype
- the property typepublic void addProperty(java.lang.String key, java.lang.String desc, short type, java.lang.String param)
key
- the property keydesc
- the field descriptiontype
- the property typeparam
- the property additional parameterpublic void addProperty(java.lang.String key, java.lang.String desc, short type, java.util.List<java.lang.String> params)
key
- the property keydesc
- the field descriptiontype
- the property typeparams
- the property additional parameterspublic void addProperty(java.lang.String key, java.lang.String desc, short type, java.lang.String... params)
key
- the property keydesc
- the field descriptiontype
- the property typeparams
- the property additional parameterspublic void addProperty(java.lang.String key, java.lang.String desc, short type, java.lang.Number minValue, java.lang.Number maxValue, java.lang.Number step)
key
- the property keydesc
- the field descriptiontype
- the property typeminValue
- the property minimum valuemaxValue
- the property maximum valuestep
- the property steppublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
public boolean getBooleanProperty(java.lang.String name)
name
- the name of the propertypublic java.lang.String getNotNullStringProperty(java.lang.String name)
name
- the name of the propertypublic java.lang.String getStringProperty(java.lang.String name)
name
- the name of the propertypublic int getIntProperty(java.lang.String name, int defaultValue)
name
- the name of the propertydefaultValue
- the default valuepublic float getFloatProperty(java.lang.String name, float defaultValue)
name
- the name of the propertydefaultValue
- the default valueCopyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence