public class Property extends Object
Usage:
PropertySheetOperator pso = new PropertySheetOperator("Properties of MyClass"); Property p = new Property(pso, "Name"); System.out.println("\nProperty name="+p.getName()); System.out.println("\nProperty value="+p.getValue()); p.setValue("ANewValue"); // set a new value by index where it is applicable //p.setValue(2); // open custom editor where it is applicable //p.openEditor();
PropertySheetOperator
Modifier and Type | Field and Description |
---|---|
static String |
CHECKBOX_RENDERER
Class name of check box renderer.
|
static String |
COMBOBOX_RENDERER
Class name of combo box renderer.
|
protected Node.Property |
property
Instance of Node.Property.
|
protected PropertySheetOperator |
propertySheetOper
Property sheet where this property resides.
|
static String |
RADIOBUTTON_RENDERER
Class name of radio button renderer.
|
static String |
SET_RENDERER
Class name of set renderer.
|
static String |
STRING_RENDERER
Class name of string renderer.
|
Constructor and Description |
---|
Property(PropertySheetOperator propertySheetOper,
int index)
Waits for index-th property in specified property sheet.
|
Property(PropertySheetOperator propertySheetOper,
String name)
Waits for property with given name in specified property sheet.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canEditAsText()
Returns true if this property can be edited as text by inplace text field.
|
String |
getName()
Gets display name of this property.
|
String |
getRendererName()
Returns class name of renderer used to render this property.
|
int |
getRow() |
String |
getShortDescription()
Gets short description for this property.
|
String |
getValue()
Gets string representation of property value.
|
boolean |
isEnabled()
Returns true if this property is enabled in property sheet, that means
it is possible to change its value by inplace editor.
|
void |
openEditor()
Opens custom property editor for the property by click on "..." button.
|
void |
setDefaultValue()
Sets default value for this property.
|
void |
setValue(int index)
Sets value of this property by given index.
|
void |
setValue(String textValue)
Sets value of this property to specified text.
|
boolean |
supportsCustomEditor()
Checks whether this property supports custom editor.
|
public static final String STRING_RENDERER
public static final String CHECKBOX_RENDERER
public static final String COMBOBOX_RENDERER
public static final String RADIOBUTTON_RENDERER
public static final String SET_RENDERER
protected Node.Property property
protected PropertySheetOperator propertySheetOper
public Property(PropertySheetOperator propertySheetOper, String name)
propertySheetOper
- PropertySheetOperator where to find property.name
- property display namepublic Property(PropertySheetOperator propertySheetOper, int index)
propertySheetOper
- PropertySheetOperator where to find property.index
- index (row number) of property inside property sheet
(starts at 0). If there categories shown in property sheet,
rows occupied by their names must by added to index.public String getName()
public String getValue()
public void setValue(String textValue)
textValue
- text to be set in property (e.g. "a new value",
"a new item from list", "false", "TRUE")public void setValue(int index)
index
- index of item to be selected from possible optionspublic void openEditor()
Property.supportsCustomEditor()
.public boolean supportsCustomEditor()
public void setDefaultValue()
public boolean isEnabled()
public boolean canEditAsText()
public String getRendererName()
Property.STRING_RENDERER
, Property.CHECKBOX_RENDERER
,
Property.COMBOBOX_RENDERER
, Property.RADIOBUTTON_RENDERER
, Property.SET_RENDERER
.Property.STRING_RENDERER
,
Property.CHECKBOX_RENDERER
,
Property.COMBOBOX_RENDERER
,
Property.RADIOBUTTON_RENDERER
,
Property.SET_RENDERER
public String getShortDescription()
public int getRow()