public class PropertiesListModel
extends java.lang.Object
PropertiesList
.
add(Property)
to add a property to the list and getPropertyCount()
/getProperty(int)
to iterate over
the existing properties. With getProperty(String)
you can get a property by its name or you can use a more specific one like
getTextProperty(String)
/getListProperty(String)
/getBooleanProperty(String)
/...Constructor and Description |
---|
PropertiesListModel()
Creates a new model.
|
PropertiesListModel(LanguageFile langFile,
java.lang.String langID)
Creates a new model.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Property p)
Adds a new property to the model.
|
BooleanProperty |
getBooleanProperty(java.lang.String name)
Gets the boolean property with the specified name.
|
ColorProperty |
getColorProperty(java.lang.String name)
Gets the color property with the specified name.
|
ListProperty |
getListProperty(java.lang.String name)
Gets the list property with the specified name.
|
java.lang.String |
getNameColumnCaption()
Gets the caption of the property name column.
|
NumericProperty |
getNumericProperty(java.lang.String name)
Gets the numeric property with the specified name.
|
Property |
getProperty(int index)
Gets a property at a given index.
|
Property |
getProperty(java.lang.String name)
Gets the property with the specified name.
|
<T extends Property> |
getProperty(java.lang.String name,
java.lang.Class<T> c)
Gets the property with the specified name and class.
|
int |
getPropertyCount()
Gets the number of properties.
|
int |
getRowHeight()
Gets the row height of the properties list.
|
TextProperty |
getTextProperty(java.lang.String name)
Gets the text property with the specified name.
|
java.lang.String |
getValueColumnCaption()
Gets the caption of the property value column.
|
boolean |
hasAutoRowSorter()
Indicates if the properties list should use the default row sorter.
|
boolean |
isHeaderVisible()
Indicates whether the header of the properties list should be visible.
|
boolean |
remove(java.lang.String name)
Removes a property from the list.
|
void |
removeAll()
Removes all properties from the list.
|
public PropertiesListModel()
public PropertiesListModel(LanguageFile langFile, java.lang.String langID)
LanguageFile
and a language id to display language dependent
captions in the properties list. The following language labels are available:
langFile
- the language file or null
if the properties list should not use language dependent column captionslangID
- the language idpublic final boolean add(Property p) throws java.lang.IllegalArgumentException
p
- the propertytrue
if the property could be added otherwise false
(this could be if there is already a property with that name)java.lang.IllegalArgumentException
- TextProperty
,
NumericProperty
,
BooleanProperty
,
ListProperty
,
ColorProperty
public final boolean remove(java.lang.String name)
name
- the name of the property that should be removedtrue
if the property could be removed otherwise false
(this could be if there is no property with that name)public final void removeAll()
public int getPropertyCount()
public Property getProperty(int index) throws java.lang.IndexOutOfBoundsException
index
- the indexjava.lang.IndexOutOfBoundsException
- index < 0 || index >= getPropertyCount()
)public Property getProperty(java.lang.String name)
name
- the name of the propertynull
if there is no property with the given namepublic <T extends Property> T getProperty(java.lang.String name, java.lang.Class<T> c)
name
- the name of the propertyc
- the class of the property (like TextProperty.class
, ...)null
if there is either no property with the given name or the property of the name is not assignable from the specified classTextProperty
,
NumericProperty
,
BooleanProperty
,
ListProperty
,
ColorProperty
public TextProperty getTextProperty(java.lang.String name)
name
- the name of the text propertynull
if there is no text property with the given namepublic NumericProperty getNumericProperty(java.lang.String name)
name
- the name of the numeric propertynull
if there is no numeric property with the given namepublic BooleanProperty getBooleanProperty(java.lang.String name)
name
- the name of the boolean propertynull
if there is no boolean property with the given namepublic ListProperty getListProperty(java.lang.String name)
name
- the name of the list propertynull
if there is no list property with the given namepublic ColorProperty getColorProperty(java.lang.String name)
name
- the name of the color propertynull
if there is no color property with the given namepublic java.lang.String getNameColumnCaption()
public java.lang.String getValueColumnCaption()
public boolean isHeaderVisible()
true
if the header with the column captions should be visible otherwise false
public int getRowHeight()
public boolean hasAutoRowSorter()
true
if the properties list should auto create a row sorter otherwise false