To better describe what a property sheet is, please refer to the picture
below:
In this property sheet there exists two columns: the left column shows a
label describing the property itself, whereas the right column provides a
PropertyEditor that allows the end user the means to manipulate the
property. In the screenshot you can see CheckEditor,
ChoiceEditor, TextEditor and FontEditor, among the
many editors that are available in the Editors
package.
To create a PropertySheet is simple: you firstly instantiate an instance
of PropertySheet, and then you pass in a list of Item instances,
where each Item represents a single property that is to be editable by the
end user.
class, in particular the
BeanPropertyUtils#getProperties(Object) method that will return a
list of Item instances, one Item instance per property on the given JavaBean.
Item, Mode
| Modifier and Type | Class and Description |
|---|---|
| public static interface | PropertySheet.
A wrapper interface for a single property to be displayed in a
|
| public static enum | PropertySheet.
Specifies how the |
| Modifier and Type | Field and Description |
|---|---|
| private final SimpleObjectProperty | |
| private static final String | DEFAULT_STYLE_CLASS
* Stylesheet Handling * * |
| private final ObservableList | items
Private fields |
| private final SimpleObjectProperty | modeProperty
Properties |
| private final SimpleBooleanProperty | |
| private final SimpleObjectProperty | |
| private final SimpleBooleanProperty | |
| private final SimpleStringProperty |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PropertySheet(ObservableList<PropertySheet.
The items that should appear within the PropertySheet. itemsCreates a PropertySheet instance prepopulated with the items provided
in the items |
| Modifier and Type | Method and Description |
|---|---|
| public final SimpleObjectProperty | Returns: A SimpleObjectproperty.Used to represent how the categories should be laid out in
the PropertySheet when using the Category mode (see |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public final Comparator | |
| public ObservableList | getItems()
Returns: An ObservableList of properties that will be displayed to the user to allow for them to be edited. |
| public final PropertySheet. | |
| public final Callback | getPropertyEditorFactory()
Returns: The editor factory used by the PropertySheet to determine which
|
| public final String | |
| public String | getUserAgentStylesheet()
Overrides javafx. An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. |
| public final boolean | isModeSwitcherVisible()
Returns: whether a visual option is presented to
users to switch between the various |
| public final boolean | isSearchBoxVisible()
Returns: whether a text field should be presented to users to allow for them to filter the properties in the property sheet to only show ones matching the typed input. |
| public final SimpleObjectProperty | Returns: A SimpleObjectproperty.Used to represent how the properties should be laid out in the PropertySheet. |
| public final SimpleBooleanProperty | Returns: A SimpleBooleanproperty.This property represents whether a visual option should be presented to
users to switch between the various |
| public final SimpleObjectProperty | Returns: A SimpleObjectproperty.The property editor factory is used by the PropertySheet to determine which
|
| public final SimpleBooleanProperty | Returns: A SimpleBooleanProperty.This property represents whether a text field should be presented to users to allow for them to filter the properties in the property sheet to only show ones matching the typed input. |
| public final void | setCategoryComparator(Comparator<String> categoryComparator)
Set how the categories should be laid out in the PropertySheet. |
| public final void | |
| public final void | setModeSwitcherVisible(boolean visible)
Set whether a visual option should be presented to
users to switch between the various |
| public final void | setPropertyEditorFactory(Callback<PropertySheet.
Sets a new editor factory used by the PropertySheet to determine which
|
| public final void | setSearchBoxVisible(boolean visible)
Sets whether a text field should be presented to users to allow for them to filter the properties in the property sheet to only show ones matching the typed input. |
| public final void | |
| public final SimpleStringProperty | Returns: A SimpleStringProperty.Regardless of whether the |
| categoryComparatorProperty | back to summary |
|---|---|
| private final SimpleObjectProperty<Comparator<String>> categoryComparatorProperty | |
| DEFAULT_STYLE_CLASS | back to summary |
|---|---|
| private static final String DEFAULT_STYLE_CLASS * Stylesheet Handling * * | |
| items | back to summary |
|---|---|
| private final ObservableList<PropertySheet. Private fields | |
| modeProperty | back to summary |
|---|---|
| private final SimpleObjectProperty<PropertySheet. Properties | |
| modeSwitcherVisible | back to summary |
|---|---|
| private final SimpleBooleanProperty modeSwitcherVisible | |
| propertyEditorFactory | back to summary |
|---|---|
| private final SimpleObjectProperty<Callback<PropertySheet. | |
| searchBoxVisible | back to summary |
|---|---|
| private final SimpleBooleanProperty searchBoxVisible | |
| titleFilterProperty | back to summary |
|---|---|
| private final SimpleStringProperty titleFilterProperty | |
| PropertySheet | back to summary |
|---|---|
| public PropertySheet() Creates a default PropertySheet instance with no properties to edit. | |
| PropertySheet | back to summary |
|---|---|
| public PropertySheet(ObservableList<PropertySheet. Creates a PropertySheet instance prepopulated with the items provided
in the items
| |
| categoryComparatorProperty | back to summary |
|---|---|
| public final SimpleObjectProperty Used to represent how the categories should be laid out in
the PropertySheet when using the Category mode (see
| |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS
| |
| getCategoryComparator | back to summary |
|---|---|
public final Comparator
| |
| getItems | back to summary |
|---|---|
public ObservableList
| |
| getMode | back to summary |
|---|---|
public final PropertySheet.
| |
| getPropertyEditorFactory | back to summary |
|---|---|
public final Callback
| |
| getTitleFilter | back to summary |
|---|---|
public final String getTitleFilter()
| |
| getUserAgentStylesheet | back to summary |
|---|---|
| public String getUserAgentStylesheet() Overrides javafx. Doc from javafx. An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls. The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath. Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.
For additional information about using CSS with the scene graph,
see the CSS Reference Guide.
| |
| isModeSwitcherVisible | back to summary |
|---|---|
public final boolean isModeSwitcherVisible()
| |
| isSearchBoxVisible | back to summary |
|---|---|
public final boolean isSearchBoxVisible()
| |
| modeProperty | back to summary |
|---|---|
| public final SimpleObjectProperty Used to represent how the properties should be laid out in
the PropertySheet. Refer to the
| |
| modeSwitcherVisibleProperty | back to summary |
|---|---|
| public final SimpleBooleanProperty modeSwitcherVisibleProperty() This property represents whether a visual option should be presented to
users to switch between the various
| |
| propertyEditorFactory | back to summary |
|---|---|
| public final SimpleObjectProperty The property editor factory is used by the PropertySheet to determine which
| |
| searchBoxVisibleProperty | back to summary |
|---|---|
| public final SimpleBooleanProperty searchBoxVisibleProperty() This property represents whether a text field should be presented to users to allow for them to filter the properties in the property sheet to only show ones matching the typed input. By default this is true, so setting it to false will hide this search field.
| |
| setCategoryComparator | back to summary |
|---|---|
| public final void setCategoryComparator(Comparator<String> categoryComparator) Set how the categories should be laid out in the PropertySheet. | |
| setMode | back to summary |
|---|---|
| public final void setMode(PropertySheet. Set how the properties should be laid out in the PropertySheet. | |
| setModeSwitcherVisible | back to summary |
|---|---|
| public final void setModeSwitcherVisible(boolean visible) Set whether a visual option should be presented to
users to switch between the various | |
| setPropertyEditorFactory | back to summary |
|---|---|
| public final void setPropertyEditorFactory(Callback<PropertySheet. Sets a new editor factory used by the PropertySheet to determine which
| |
| setSearchBoxVisible | back to summary |
|---|---|
| public final void setSearchBoxVisible(boolean visible) Sets whether a text field should be presented to users to allow for them to filter the properties in the property sheet to only show ones matching the typed input. | |
| setTitleFilter | back to summary |
|---|---|
| public final void setTitleFilter(String filter) Sets the filter for filtering the options shown on screen.
| |
| titleFilter | back to summary |
|---|---|
| public final SimpleStringProperty titleFilter() Regardless of whether the
| |
PropertySheet control.
PropertySheet
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public String | |
| public String | getName()
Returns the display name of the property, which should be short (i.e. less than two words). |
| public Optional | getObservableValue()
Returns the underlying ObservableValue, where one exists, that the editor can monitor for changes. |
| public default Optional | getPropertyEditorClass()
Returns an Optional wrapping the class of the PropertyEditor that should be used for editing this item. |
| public Class | |
| public Object | |
| public default boolean | isEditable()
Indicates whether the PropertySheet should allow editing of this property, or whether it is read-only. |
| public void |
| getCategory | back to summary |
|---|---|
| public String getCategory() Returns a String representation of the category of the property. This
is relevant when the | |
| getDescription | back to summary |
|---|---|
| public String 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 | back to summary |
|---|---|
| public String 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 | |
| getObservableValue | back to summary |
|---|---|
| public Optional Returns the underlying ObservableValue, where one exists, that the editor can monitor for changes. | |
| getPropertyEditorClass | back to summary |
|---|---|
| public default Optional 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 | |
| getType | back to summary |
|---|---|
| public Class Returns the class type of the property. | |
| getValue | back to summary |
|---|---|
| public Object getValue() Returns the current value of the property. | |
| isEditable | back to summary |
|---|---|
| public default boolean isEditable() Indicates whether the PropertySheet should allow editing of this property, or whether it is read-only. The default implementation returns true. | |
| setValue | back to summary |
|---|---|
| public void setValue(Object value) Sets the current value of the property. | |
PropertySheet should be laid out. Refer to the
enumeration values to learn what each one means.
| Modifier and Type | Field and Description |
|---|---|
| public static final PropertySheet. | CATEGORY
Groups the properties in the
|
| public static final PropertySheet. | NAME
Simply displays the properties in the
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PropertySheet. | |
| public static PropertySheet. |
| CATEGORY | back to summary |
|---|---|
| public static final PropertySheet. Groups the properties in the
| |
| NAME | back to summary |
|---|---|
| public static final PropertySheet. Simply displays the properties in the
| |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static PropertySheet. | |
| values | back to summary |
|---|---|
| public static PropertySheet. | |