public abstract class Property
extends java.lang.Object
PropertiesList
.PropertiesListModel
,
TextProperty
,
NumericProperty
,
BooleanProperty
,
ListProperty
,
ColorProperty
Modifier and Type | Field and Description |
---|---|
protected javax.swing.table.TableCellEditor |
editor
the property's editor
|
protected javax.swing.table.TableCellRenderer |
renderer
the property's renderer
|
protected java.lang.Object |
value
the value of the property
|
Constructor and Description |
---|
Property(java.lang.String name,
java.lang.String description,
java.lang.Object initialValue,
java.lang.Object[] arguments)
Creates a new property.
|
Modifier and Type | Method and Description |
---|---|
protected abstract javax.swing.table.TableCellEditor |
createEditor(java.lang.Object[] arguments)
Creates the editor of the property.
|
protected abstract javax.swing.table.TableCellRenderer |
createRenderer(java.lang.Object[] arguments)
Creates the renderer of the property.
|
java.lang.String |
getDescription()
Gets the description of the property.
|
java.lang.String |
getName()
Gets the name of the property.
|
java.lang.Object |
getValue()
Gets the value of the property.
|
protected abstract java.lang.Class<?> |
getValueClass()
Gets the class of the value.
|
protected abstract java.lang.Object |
onEditStop(java.lang.Object value)
Checks if the committed value is valid.
|
void |
setValue(java.lang.Object value)
Sets the value of the property.
|
java.lang.String |
toString() |
protected java.lang.Object value
protected final javax.swing.table.TableCellEditor editor
protected final javax.swing.table.TableCellRenderer renderer
public Property(java.lang.String name, java.lang.String description, java.lang.Object initialValue, java.lang.Object[] arguments) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
name
- the name of the propertydescription
- the description of the property (the description can contain html tags to format the text)initialValue
- the initial value of the propertyarguments
- arguments for the creation of the editor in createEditor(Object[])
and the renderer in createRenderer(Object[])
or null
java.lang.IllegalArgumentException
- java.lang.IllegalStateException
- public final java.lang.String getName()
public final java.lang.String getDescription()
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value
- the valuepublic java.lang.String toString()
toString
in class java.lang.Object
protected abstract javax.swing.table.TableCellEditor createEditor(java.lang.Object[] arguments)
IllegalStateException
is thrown.arguments
- the arguments list which is committed by the constructor or null
DefaultCellEditor
,
ColorCellEditor
,
SliderCellEditor
protected abstract javax.swing.table.TableCellRenderer createRenderer(java.lang.Object[] arguments)
null
) the value class
(getValueClass()
) is used to find a default cell renderer for this property (see DefaultTableCellRenderer
) .arguments
- the arguments list which is committed by the constructor or null
null
if the default renderer should be usedprotected abstract java.lang.Class<?> getValueClass()
String.class
or if you have
a numeric property the return value should be Number.class
and so on.
createRenderer(Object[])
returns null
) the value class is used to set the default cell renderer for this property.protected abstract java.lang.Object onEditStop(java.lang.Object value)
value
- the edit valuesetValue(Object)