java.lang.Object
qupath.fx.prefs.controlsfx.PropertyItemBuilder<T>
- Type Parameters:
T-
Builder class for creating
PropertySheet.Item instances, using a fluent interface and optionally supporting
localized strings.
This works as an alternative to PropertyItemParser without requiring the use of annotations.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPropertyItemBuilder(javafx.beans.property.Property<T> prop, Class<? extends T> cls) Create a new builder for a property. -
Method Summary
Modifier and TypeMethodDescriptionorg.controlsfx.control.PropertySheet.Itembuild()Build the property item.Set the resource bundle name, if required.Set the category directly, using a non-localizes string.categoryKey(String key) Set the resource bundle key for the category.choices(Collection<T> choices) Provide a collection of choices for a choice property.Provide an observable list of choices for a choice property.description(String description) Set the description directly, using a non-localized string.extensionFilters(Collection<? extends javafx.stage.FileChooser.ExtensionFilter> filters) Provide a collection of file extension filters to use with a file property.Set the resource bundle key for the category.Set the name directly, using a non-localized string.Set the type of the property to create.resourceManager(LocalizedResourceManager manager) Set the resource manager to use for localization.
-
Constructor Details
-
PropertyItemBuilder
Create a new builder for a property.- Parameters:
prop- the propertycls- the type of the property value
-
-
Method Details
-
resourceManager
Set the resource manager to use for localization. If provided, this enables the use ofkey(String)andcategoryKey(String)- and also updating these values if the locale changes.- Parameters:
manager-- Returns:
-
key
Set the resource bundle key for the category. If this is set, it will be used to look up the name for the property. Furthermore, ifkey + ".description"is found in the bundle, it will be used to set the description.- Parameters:
key-- Returns:
-
categoryKey
Set the resource bundle key for the category.- Parameters:
key-- Returns:
-
bundle
Set the resource bundle name, if required. This is used in combination with #key(String) and/or #categoryKey(String). It may not be required if #resourceManager(LocalizedResourceManager) is used with the relevant default bundle.- Parameters:
name-- Returns:
-
propertyType
Set the type of the property to create.- Parameters:
type-- Returns:
-
name
Set the name directly, using a non-localized string.- Parameters:
name-- Returns:
- See Also:
-
description
Set the description directly, using a non-localized string.- Parameters:
description-- Returns:
- See Also:
-
category
Set the category directly, using a non-localizes string.- Parameters:
category-- Returns:
- See Also:
-
choices
Provide a collection of choices for a choice property.- Parameters:
choices-- Returns:
- See Also:
-
choices
Provide an observable list of choices for a choice property. This may be used directly, and so changes can influence the property.- Parameters:
choices-- Returns:
- See Also:
-
extensionFilters
public PropertyItemBuilder<T> extensionFilters(Collection<? extends javafx.stage.FileChooser.ExtensionFilter> filters) Provide a collection of file extension filters to use with a file property. For non-file properties, this are ignored.- Parameters:
filters-- Returns:
-
build
public org.controlsfx.control.PropertySheet.Item build()Build the property item.- Returns:
-