public class PropertyPanel
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PropertyPanel.Prop
Simple data carrier for a property, composed of a key/label/value trio.
|
Constructor and Description |
---|
PropertyPanel(java.lang.String title,
java.lang.String glyphId)
Constructs a property panel model with the given title and
glyph identifier (icon to display).
|
Modifier and Type | Method and Description |
---|---|
PropertyPanel |
addButton(ButtonId button)
Adds the given button descriptor to the panel data.
|
PropertyPanel |
addProp(java.lang.String key,
int value)
Deprecated.
as of Loon (1.11) in deference to the localized version
|
PropertyPanel |
addProp(java.lang.String key,
long value)
Deprecated.
as of Loon (1.11) in deference to the localized version
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.Object value)
Deprecated.
as of Loon (1.11) in deference to the localized version
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.Object value,
java.lang.String reStrip)
Deprecated.
as of Loon (1.11) in deference to the localized version
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String value)
Deprecated.
as of Loon (1.11) in deference to the localized version
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String label,
int value)
Adds a property to the panel data, using a decimal formatter.
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String label,
long value)
Adds a property to the panel data, using a decimal formatter.
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String label,
java.lang.Object value)
Adds a property to the panel data.
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String label,
java.lang.Object value,
java.lang.String reStrip)
Adds a property to the panel data.
|
PropertyPanel |
addProp(java.lang.String key,
java.lang.String label,
java.lang.String value)
Adds a property to the panel data.
|
PropertyPanel |
addSeparator()
Adds a separator to the panel data.
|
java.util.List<ButtonId> |
buttons()
Returns the list of button descriptors.
|
protected java.text.NumberFormat |
formatter()
Returns a number formatter to use for formatting integer and long
property values.
|
java.lang.String |
glyphId()
Returns the glyph identifier.
|
PropertyPanel |
glyphId(java.lang.String glyphId)
Sets the glyph identifier.
|
java.lang.String |
id()
Returns the internal ID.
|
PropertyPanel |
id(java.lang.String id)
Adds an ID field to the panel data, to be included in
the returned JSON data to the client.
|
java.lang.String |
navPath()
Returns the navigation path.
|
PropertyPanel |
navPath(java.lang.String navPath)
Adds a navigation path field to the panel data, to be included in
the returned JSON data to the client.
|
java.util.List<PropertyPanel.Prop> |
properties()
Returns the list of properties to be displayed.
|
PropertyPanel |
removeAllButtons()
Removes all currently defined buttons.
|
PropertyPanel |
removeAllProps()
Removes all currently defined properties.
|
PropertyPanel |
removeButtons(ButtonId... descriptors)
Removes buttons with the given descriptors from the list.
|
PropertyPanel |
removeProps(java.lang.String... keys)
Removes properties with the given keys from the list.
|
java.lang.String |
title()
Returns the title text.
|
PropertyPanel |
title(java.lang.String title)
Sets the title text.
|
public PropertyPanel(java.lang.String title, java.lang.String glyphId)
title
- title textglyphId
- glyph IDprotected java.text.NumberFormat formatter()
This default implementation uses a formatter for the default locale. For example:
Locale.ENGLISH : 1000 -> "1,000" Locale.FRENCH : 1000 -> "1 000" Locale.GERMAN : 1000 -> "1.000"
public PropertyPanel navPath(java.lang.String navPath)
navPath
- the navigation pathpublic PropertyPanel id(java.lang.String id)
id
- the identifierpublic PropertyPanel addProp(java.lang.String key, java.lang.String label, java.lang.String value)
key
- property keylabel
- property label (localized)value
- property valuepublic PropertyPanel addProp(java.lang.String key, java.lang.String label, int value)
key
- property keylabel
- property label (localized)value
- property valuepublic PropertyPanel addProp(java.lang.String key, java.lang.String label, long value)
key
- property keylabel
- property label (localized)value
- property valuepublic PropertyPanel addProp(java.lang.String key, java.lang.String label, java.lang.Object value)
toString()
method is used to convert the
value to a string.key
- property keylabel
- property label (localized)value
- property valuepublic PropertyPanel addProp(java.lang.String key, java.lang.String label, java.lang.Object value, java.lang.String reStrip)
toString()
method is used to convert the
value to a string, from which the characters defined in the given
regular expression string are stripped.key
- property keylabel
- property label (localized)value
- property valuereStrip
- regexp characters to strip from value string@Deprecated public PropertyPanel addProp(java.lang.String key, java.lang.String value)
key
- property key (also used as display label)value
- property value@Deprecated public PropertyPanel addProp(java.lang.String key, int value)
key
- property key (also used as display label)value
- property value@Deprecated public PropertyPanel addProp(java.lang.String key, long value)
key
- property key (also used as display label)value
- property value@Deprecated public PropertyPanel addProp(java.lang.String key, java.lang.Object value)
toString()
method is used to convert the
value to a string.
Note also that the key is used as the label.key
- property key (also used as display label)value
- property value@Deprecated public PropertyPanel addProp(java.lang.String key, java.lang.Object value, java.lang.String reStrip)
toString()
method is used to convert the
value to a string, from which the characters defined in the given
regular expression string are stripped.
Note also that the key is used as the label.key
- property key (also used as display label)value
- property valuereStrip
- regexp characters to strip from value stringpublic PropertyPanel addSeparator()
public java.lang.String title()
public java.lang.String glyphId()
public java.lang.String navPath()
public java.lang.String id()
public java.util.List<PropertyPanel.Prop> properties()
public java.util.List<ButtonId> buttons()
public PropertyPanel title(java.lang.String title)
title
- title textpublic PropertyPanel glyphId(java.lang.String glyphId)
glyphId
- glyph identifierpublic PropertyPanel removeProps(java.lang.String... keys)
keys
- keys of properties to removepublic PropertyPanel removeAllProps()
public PropertyPanel addButton(ButtonId button)
button
- button descriptorpublic PropertyPanel removeButtons(ButtonId... descriptors)
descriptors
- descriptors to removepublic PropertyPanel removeAllButtons()