Class Category
java.lang.Object
org.ametys.plugins.workspaces.categories.Category
- All Implemented Interfaces:
ColorableTag
,Tag
Class representing a category.
-
Field Summary
Fields inherited from interface org.ametys.cms.tag.Tag
NAME_PATTERN
-
Constructor Summary
ConstructorDescriptionConstructorCategory
(String id, String name, String color, AbstractColorsComponent colorsComponent, Category parent, I18nizableText title, I18nizableText description) ConstructorCategory
(String id, String name, Category parent, I18nizableText title, I18nizableText description) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new child tag.getColor
(boolean withDefaultValue) Get the color index in the component paleteGet the color componentRetrieves the description.getId()
Get the tag unique id.getName()
Get the tag name.Get the parent tagGet the parent name.Try to get a child tag by its idgetTags()
Retrieves the Set of child tagsgetTitle()
Retrieves the title.boolean
Determines if a tag existsvoid
Set the child tagsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.cms.tag.ColorableTag
getColorCSSClassPrefix
-
Constructor Details
-
Category
Constructor- Parameters:
id
- The id of the tag. The id must be unique.
-
Category
public Category(String id, String name, Category parent, I18nizableText title, I18nizableText description) Constructor- Parameters:
id
- The id of the tag. The id must be unique.name
- The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.parent
- The parent tag (can be null if the tag has no parent)title
- the tag titledescription
- the tag description
-
Category
public Category(String id, String name, String color, AbstractColorsComponent colorsComponent, Category parent, I18nizableText title, I18nizableText description) Constructor- Parameters:
id
- The id of the tag. The id must be unique.name
- The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.color
- the colorcolorsComponent
- the colors componentparent
- The parent tag (can be null if the tag has no parent)title
- the tag titledescription
- the tag description
-
-
Method Details
-
getId
Description copied from interface:Tag
Get the tag unique id. -
getName
Description copied from interface:Tag
Get the tag name. -
getTitle
Description copied from interface:Tag
Retrieves the title. -
getDescription
Description copied from interface:Tag
Retrieves the description.- Specified by:
getDescription
in interfaceTag
- Returns:
- the description.
-
getColor
Description copied from interface:ColorableTag
Get the color index in the component palete- Specified by:
getColor
in interfaceColorableTag
- Parameters:
withDefaultValue
-true
if we want to get first the color of the parent then the default value- Returns:
- the color. Can be null if withDefaultValue is
false
-
getColorComponent
Description copied from interface:ColorableTag
Get the color component- Specified by:
getColorComponent
in interfaceColorableTag
- Returns:
- the color component
-
getParentName
Description copied from interface:Tag
Get the parent name.- Specified by:
getParentName
in interfaceTag
- Returns:
- The parent name.
-
getParent
Description copied from interface:Tag
Get the parent tag -
addTag
Description copied from interface:Tag
Add a new child tag. -
getTags
Description copied from interface:Tag
Retrieves the Set of child tags -
getTag
Description copied from interface:Tag
Try to get a child tag by its id -
hasTag
Description copied from interface:Tag
Determines if a tag exists -
setTags
Description copied from interface:Tag
Set the child tags
-