Module qupath.fx

Class PropertyItemBuilder<T>

java.lang.Object
qupath.fx.prefs.controlsfx.PropertyItemBuilder<T>
Type Parameters:
T -

public class PropertyItemBuilder<T> extends Object
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.
  • Constructor Details

    • PropertyItemBuilder

      public PropertyItemBuilder(javafx.beans.property.Property<T> prop, Class<? extends T> cls)
      Create a new builder for a property.
      Parameters:
      prop - the property
      cls - the type of the property value
  • Method Details

    • resourceManager

      public PropertyItemBuilder<T> resourceManager(LocalizedResourceManager manager)
      Set the resource manager to use for localization. If provided, this enables the use of key(String) and categoryKey(String) - and also updating these values if the locale changes.
      Parameters:
      manager -
      Returns:
    • key

      public PropertyItemBuilder<T> key(String 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, if key + ".description" is found in the bundle, it will be used to set the description.
      Parameters:
      key -
      Returns:
    • categoryKey

      public PropertyItemBuilder<T> categoryKey(String key)
      Set the resource bundle key for the category.
      Parameters:
      key -
      Returns:
    • bundle

      public PropertyItemBuilder<T> bundle(String name)
      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

      public PropertyItemBuilder<T> name(String name)
      Set the name directly, using a non-localized string.
      Parameters:
      name -
      Returns:
      See Also:
    • description

      public PropertyItemBuilder<T> description(String description)
      Set the description directly, using a non-localized string.
      Parameters:
      description -
      Returns:
      See Also:
    • category

      public PropertyItemBuilder<T> category(String category)
      Set the category directly, using a non-localizes string.
      Parameters:
      category -
      Returns:
      See Also:
    • choices

      public PropertyItemBuilder<T> choices(Collection<T> choices)
      Provide a collection of choices for a choice property.
      Parameters:
      choices -
      Returns:
      See Also:
    • choices

      public PropertyItemBuilder<T> choices(javafx.collections.ObservableList<T> 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: