Top Description Fields Constructors Methods
com.dlsc.preferencesfx.model

public Class Category

extends Object
Class Inheritance
Static Imports
com.dlsc.preferencesfx.util.Constants.BREADCRUMB_DELIMITER

Represents a category, which is used to structure one to multiple groups with settings in a page.
Authors
François Martin, Marco Sanfratello

Field Summary

Modifier and TypeField and Description
private List<Category>
private StringProperty
private StringProperty
private boolean
private List<Group>
private Node
private static final Logger
private VisibilityProperty

Constructor Summary

AccessConstructor and Description
private
Category(String
Category name, for display in CategoryView
description
,
VisibilityProperty visibilityProperty)

Creates a category without groups, for top-level categories without any settings.

private
Category(String description, VisibilityProperty visibilityProperty, Group... groups)

private
Category(String description, Node itemIcon, VisibilityProperty visibilityProperty)

private
Category(String description, Node itemIcon, VisibilityProperty visibilityProperty, Group... groups)

Method Summary

Modifier and TypeMethod and Description
public void
createBreadcrumbs(List<Category>
the categories to create breadcrumbs for
categories
)

Creates and defines all of the breadcrumbs for all of the categories.

public ReadOnlyStringProperty
public Category

Returns:

this object for chaining with the fluent API
expand
()

Sets category to be expanded when added to the tree view.

public String
public List<Category>
public String
public List<Group>
public Node
public boolean

Returns:

the property showing if Category should be expanded or not
isExpand
()

Gets the property whether to auto-expand the Category or not.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
)

Creates an empty category.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
VisibilityProperty
control category visibility
visibilityProperty
)

Creates an empty category.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Group...
Group with Setting to be shown in the CategoryView
groups
)

Creates a new category from groups.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
VisibilityProperty
control category visibility
visibilityProperty
,
Group...
Group with Setting to be shown in the CategoryView
groups
)

Creates a new category from groups.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>...
Setting to be shown in the CategoryView
settings
)

Creates a new category from settings, if the settings shouldn't be individually grouped.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
VisibilityProperty
control category visibility
visibilityProperty
,
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>...
Setting to be shown in the CategoryView
settings
)

Creates a new category from settings, if the settings shouldn't be individually grouped.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
)

Creates an empty category.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
,
VisibilityProperty
control category visibility
visibilityProperty
)

Creates an empty category.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
,
Group...
Group with Setting to be shown in the CategoryView
groups
)

Creates a new category from groups.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
,
VisibilityProperty
control category visibility
visibilityProperty
,
Group...
Group with Setting to be shown in the CategoryView
groups
)

Creates a new category from groups.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
,
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>...
Setting to be shown in the CategoryView
settings
)

Creates a new category from settings, if the settings shouldn't be individually grouped.

public static Category

Returns:

initialized Category object
of
(String
Category name, for display in CategoryView
description
,
Node
Icon to be shown next to the category name
itemIcon
,
VisibilityProperty
control category visibility
visibilityProperty
,
Setting<E extends Element<E extends Element<E>>, P extends Property<T>>...
Setting to be shown in the CategoryView
settings
)

Creates a new category from settings, if the settings shouldn't be individually grouped.

public void
setBreadcrumb(String breadcrumb)

public void
public Category

Returns:

this object for chaining with the fluent API
subCategories
(Category...
the subcategories to assign to this category
children
)

Adds subcategories to this category.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
translate(TranslationService
the translation service
translationService
)

This internal method is used as a callback for when the translation service or its locale changes.

public void
unmarkAll()

Unmarks all settings and groups.

public void
unmarkGroups()

Unmarks all groups.

public void
unmarkSettings()

Unmarks all settings.

public void
updateGroupDescriptions()

Updates the group descriptions when translation changes.

public VisibilityProperty
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

childrenback to summary
private List<Category> children
descriptionback to summary
private StringProperty description
descriptionKeyback to summary
private StringProperty descriptionKey
expandback to summary
private boolean expand
groupsback to summary
private List<Group> groups
itemIconback to summary
private Node itemIcon
LOGGERback to summary
private static final Logger LOGGER
visibilityPropertyback to summary
private VisibilityProperty visibilityProperty

Constructor Detail

Categoryback to summary
private Category(String description, VisibilityProperty visibilityProperty)

Creates a category without groups, for top-level categories without any settings.

Parameters
description:String

Category name, for display in CategoryView

Categoryback to summary
private Category(String description, VisibilityProperty visibilityProperty, Group... groups)
Categoryback to summary
private Category(String description, Node itemIcon, VisibilityProperty visibilityProperty)
Categoryback to summary
private Category(String description, Node itemIcon, VisibilityProperty visibilityProperty, Group... groups)

Method Detail

createBreadcrumbsback to summary
public void createBreadcrumbs(List<Category> categories)

Creates and defines all of the breadcrumbs for all of the categories.

Parameters
categories:List<Category>

the categories to create breadcrumbs for

descriptionPropertyback to summary
public ReadOnlyStringProperty descriptionProperty()
expandback to summary
public Category expand()

Sets category to be expanded when added to the tree view.

Returns:Category

this object for chaining with the fluent API

getBreadcrumbback to summary
public String getBreadcrumb()
getChildrenback to summary
public List<Category> getChildren()
getDescriptionback to summary
public String getDescription()
getGroupsback to summary
public List<Group> getGroups()
getItemIconback to summary
public Node getItemIcon()
isExpandback to summary
public boolean isExpand()

Gets the property whether to auto-expand the Category or not.

Returns:boolean

the property showing if Category should be expanded or not

ofback to summary
public static Category of(String description)

Creates an empty category. Can be used for top-level categories without Setting.

Parameters
description:String

Category name, for display in CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, VisibilityProperty visibilityProperty)

Creates an empty category. Can be used for top-level categories without Setting.

Parameters
description:String

Category name, for display in CategoryView

visibilityProperty:VisibilityProperty

control category visibility

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Group... groups)

Creates a new category from groups.

Parameters
description:String

Category name, for display in CategoryView

groups:Group[]

Group with Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, VisibilityProperty visibilityProperty, Group... groups)

Creates a new category from groups.

Parameters
description:String

Category name, for display in CategoryView

visibilityProperty:VisibilityProperty

control category visibility

groups:Group[]

Group with Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Setting<E extends Element<E extends Element<E>>, P extends Property<T>>... settings)

Creates a new category from settings, if the settings shouldn't be individually grouped.

Parameters
description:String

Category name, for display in CategoryView

settings:Setting<E extends Element<E extends Element<E>>, P extends Property<T>>[]

Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, VisibilityProperty visibilityProperty, Setting<E extends Element<E extends Element<E>>, P extends Property<T>>... settings)

Creates a new category from settings, if the settings shouldn't be individually grouped.

Parameters
description:String

Category name, for display in CategoryView

visibilityProperty:VisibilityProperty

control category visibility

settings:Setting<E extends Element<E extends Element<E>>, P extends Property<T>>[]

Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon)

Creates an empty category. Can be used for top-level categories without Setting.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon, VisibilityProperty visibilityProperty)

Creates an empty category. Can be used for top-level categories without Setting.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

visibilityProperty:VisibilityProperty

control category visibility

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon, Group... groups)

Creates a new category from groups.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

groups:Group[]

Group with Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon, VisibilityProperty visibilityProperty, Group... groups)

Creates a new category from groups.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

visibilityProperty:VisibilityProperty

control category visibility

groups:Group[]

Group with Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon, Setting<E extends Element<E extends Element<E>>, P extends Property<T>>... settings)

Creates a new category from settings, if the settings shouldn't be individually grouped.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

settings:Setting<E extends Element<E extends Element<E>>, P extends Property<T>>[]

Setting to be shown in the CategoryView

Returns:Category

initialized Category object

ofback to summary
public static Category of(String description, Node itemIcon, VisibilityProperty visibilityProperty, Setting<E extends Element<E extends Element<E>>, P extends Property<T>>... settings)

Creates a new category from settings, if the settings shouldn't be individually grouped.

Parameters
description:String

Category name, for display in CategoryView

itemIcon:Node

Icon to be shown next to the category name

visibilityProperty:VisibilityProperty

control category visibility

settings:Setting<E extends Element<E extends Element<E>>, P extends Property<T>>[]

Setting to be shown in the CategoryView

Returns:Category

initialized Category object

setBreadcrumbback to summary
public void setBreadcrumb(String breadcrumb)
setVisibilityPropertyback to summary
public void setVisibilityProperty(VisibilityProperty visibilityProperty)
subCategoriesback to summary
public Category subCategories(Category... children)

Adds subcategories to this category. Can be used to build up a hierarchical tree of Categories.

Parameters
children:Category[]

the subcategories to assign to this category

Returns:Category

this object for chaining with the fluent API

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
translateback to summary
public void translate(TranslationService translationService)

This internal method is used as a callback for when the translation service or its locale changes. Also applies the translation to all contained sections.

Parameters
translationService:TranslationService

the translation service

See Also
::translate
unmarkAllback to summary
public void unmarkAll()

Unmarks all settings and groups. Is used for the search, which marks and unmarks items depending on the match as a form of visual feedback.

unmarkGroupsback to summary
public void unmarkGroups()

Unmarks all groups. Is used for the search, which marks and unmarks items depending on the match as a form of visual feedback.

unmarkSettingsback to summary
public void unmarkSettings()

Unmarks all settings. Is used for the search, which marks and unmarks items depending on the match as a form of visual feedback.

updateGroupDescriptionsback to summary
public void updateGroupDescriptions()

Updates the group descriptions when translation changes.

visibilityPropertyback to summary
public VisibilityProperty visibilityProperty()