Top Description Fields Constructors Methods
org.controlsfx.property

public Class BeanProperty

extends Object
implements Item
Class Inheritance
All Implemented Interfaces
org.controlsfx.control.PropertySheet.Item
Imports
java.beans.FeatureDescriptor, .PropertyDescriptor, .PropertyVetoException, java.lang.reflect.InvocationTargetException, .Method, java.util.Optional, org.controlsfx.control.PropertySheet, .PropertySheet.Item, org.controlsfx.property.editor.PropertyEditor, impl.org.controlsfx.i18n.Localization, javafx.beans.value.ObservableValue, javafx.scene.control.Alert

A convenience class for creating a Item for use in the PropertySheet control based on a property belonging to a JavaBean - simply provide a PropertyDescriptor and the rest will be taken care of automatically.
See Also
Item, PropertySheet, PropertyDescriptor

Field Summary

Modifier and TypeField and Description
private final Object
private final PropertyDescriptor
public static final String
CATEGORY_LABEL_KEY

Unique identifier to provide a custom category label within PropertySheet.Item#getCategory().

private boolean
private Optional<ObservableValue<? extends Object>>
private final Method

Constructor Summary

AccessConstructor and Description
public
BeanProperty(final Object bean, final PropertyDescriptor propertyDescriptor)

Method Summary

Modifier and TypeMethod and Description
private void
public Object
getBean()

Returns: The object passed in to the constructor of the BeanProperty.

public String
getCategory()

Implements org.controlsfx.control.PropertySheet.Item.getCategory.

Returns a String representation of the category of the property.

public String
getDescription()

Implements org.controlsfx.control.PropertySheet.Item.getDescription.

A String that will be shown to the user as a tooltip.

public String
getName()

Implements org.controlsfx.control.PropertySheet.Item.getName.

Returns the display name of the property, which should be short (i.e. less than two words).

public Optional<ObservableValue<? extends Object>>
getObservableValue()

Implements org.controlsfx.control.PropertySheet.Item.getObservableValue.

Returns the underlying ObservableValue, where one exists, that the editor can monitor for changes.

public PropertyDescriptor
getPropertyDescriptor()

Returns: The PropertyDescriptor passed in to the constructor of the BeanProperty.

public Optional<Class<? extends PropertyEditor<?>>>
getPropertyEditorClass()

Overrides default org.controlsfx.control.PropertySheet.Item.getPropertyEditorClass.

Returns an Optional wrapping the class of the PropertyEditor that should be used for editing this item.

public Class<?>
getType()

Implements org.controlsfx.control.PropertySheet.Item.getType.

Returns the class type of the property.

public Object
getValue()

Implements org.controlsfx.control.PropertySheet.Item.getValue.

Returns the current value of the property.

public boolean
isEditable()

Overrides default org.controlsfx.control.PropertySheet.Item.isEditable.

Indicates whether the PropertySheet should allow editing of this property, or whether it is read-only.

public void
setEditable(final boolean
Whether this property should be editable in the PropertySheet.
editable
)

public void
setValue(final Object value)

Implements org.controlsfx.control.PropertySheet.Item.setValue.

Sets the current value of the property.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanback to summary
private final Object bean
beanPropertyDescriptorback to summary
private final PropertyDescriptor beanPropertyDescriptor
CATEGORY_LABEL_KEYback to summary
public static final String CATEGORY_LABEL_KEY

Unique identifier to provide a custom category label within PropertySheet.Item#getCategory(). How to use it: with a PropertyDescriptor, provide the custom category through a a named attribute FeatureDescriptor#setValue(String, Object).

final PropertyDescriptor propertyDescriptor = new PropertyDescriptor("yourProperty", YourBean.class);
propertyDescriptor.setDisplayName("Your Display Name");
propertyDescriptor.setShortDescription("Your explanation about this property.");
// then provide a custom category
propertyDescriptor.setValue(BeanProperty.CATEGORY_LABEL_KEY, "Your custom category");
editableback to summary
private boolean editable
observableValueback to summary
private Optional<ObservableValue<? extends Object>> observableValue
readMethodback to summary
private final Method readMethod

Constructor Detail

BeanPropertyback to summary
public BeanProperty(final Object bean, final PropertyDescriptor propertyDescriptor)

Method Detail

findObservableValueback to summary
private void findObservableValue()
getBeanback to summary
public Object getBean()
Returns:Object

The object passed in to the constructor of the BeanProperty.

getCategoryback to summary
public String getCategory()

Implements org.controlsfx.control.PropertySheet.Item.getCategory.

Doc from org.controlsfx.control.PropertySheet.Item.getCategory.

Returns a String representation of the category of the property. This is relevant when the PropertySheet mode property is set to Mode#CATEGORY - as then all properties with the same category will be grouped together visually.

Annotations
@Override
getDescriptionback to summary
public String getDescription()

Implements org.controlsfx.control.PropertySheet.Item.getDescription.

Doc from org.controlsfx.control.PropertySheet.Item.getDescription.

A String that will be shown to the user as a tooltip. This allows for a longer form of detail than what is possible with the getName() method.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.controlsfx.control.PropertySheet.Item.getName.

Doc from org.controlsfx.control.PropertySheet.Item.getName.

Returns the display name of the property, which should be short (i.e. less than two words). This is used to explain to the end user what the property represents and is displayed beside the PropertyEditor. If you need to explain more detail to the user, consider placing it in the getDescription().

Annotations
@Override
getObservableValueback to summary
public Optional<ObservableValue<? extends Object>> getObservableValue()

Implements org.controlsfx.control.PropertySheet.Item.getObservableValue.

Doc from org.controlsfx.control.PropertySheet.Item.getObservableValue.

Returns the underlying ObservableValue, where one exists, that the editor can monitor for changes.

Annotations
@Override
getPropertyDescriptorback to summary
public PropertyDescriptor getPropertyDescriptor()
Returns:PropertyDescriptor

The PropertyDescriptor passed in to the constructor of the BeanProperty.

getPropertyEditorClassback to summary
public Optional<Class<? extends PropertyEditor<?>>> getPropertyEditorClass()

Overrides default org.controlsfx.control.PropertySheet.Item.getPropertyEditorClass.

Doc from org.controlsfx.control.PropertySheet.Item.getPropertyEditorClass.

Returns an Optional wrapping the class of the PropertyEditor that should be used for editing this item. The default implementation returns Optional.empty() The class must have a constructor that can accept a single argument of type PropertySheet.Item

Annotations
@SuppressWarnings:unchecked
@Override
getTypeback to summary
public Class<?> getType()

Implements org.controlsfx.control.PropertySheet.Item.getType.

Doc from org.controlsfx.control.PropertySheet.Item.getType.

Returns the class type of the property.

Annotations
@Override
getValueback to summary
public Object getValue()

Implements org.controlsfx.control.PropertySheet.Item.getValue.

Doc from org.controlsfx.control.PropertySheet.Item.getValue.

Returns the current value of the property.

Annotations
@Override
isEditableback to summary
public boolean isEditable()

Overrides default org.controlsfx.control.PropertySheet.Item.isEditable.

Doc from org.controlsfx.control.PropertySheet.Item.isEditable.

Indicates whether the PropertySheet should allow editing of this property, or whether it is read-only. The default implementation returns true.

Annotations
@Override
setEditableback to summary
public void setEditable(final boolean editable)
Parameters
editable:boolean

Whether this property should be editable in the PropertySheet.

setValueback to summary
public void setValue(final Object value)

Implements org.controlsfx.control.PropertySheet.Item.setValue.

Doc from org.controlsfx.control.PropertySheet.Item.setValue.

Sets the current value of the property.

Annotations
@Override