Package com.explodingpixels.macwidgets
Class SourceListCategory
java.lang.Object
com.explodingpixels.macwidgets.SourceListCategory
- All Implemented Interfaces:
TextProvider
A category in a
SourceList
. SourceListCategory
s are top level containers for
SourceListItem
s. SourceListCategory
s are text only, and rendered in full caps
(regardless of supplied text capitalization).-
Constructor Summary
ConstructorsConstructorDescriptionSourceListCategory
(String text) Creates aSourceListCategory
with the given text.SourceListCategory
(String text, boolean collapsable) Creates aSourceListCategory
with the given text. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsItem
(SourceListItem item) Returnstrue
if the givenSourceListItem
is contained by this category, to include being a sub-element of anotherSourceListItem
contained by this category.int
Gets the number of childSourceListItem
s that are part of this category.getItems()
Gets a list of thisSourceListCategory
'sSourceListItem
s.getText()
Gets the category text.boolean
true
if thisSourceListCategory
is collapsable.void
Sets the text to use for thisSourceListCategory
.toString()
Returns aString
representation of thisSourceListCategory
.
-
Constructor Details
-
SourceListCategory
Creates aSourceListCategory
with the given text. The capitalization of the text will be ignored, as categories are rendered in full caps.- Parameters:
text
- the category text. Cannot be null.
-
SourceListCategory
Creates aSourceListCategory
with the given text. The capitalization of the text will be ignored, as categories are rendered in full caps. If thisSourceListCategory
is marked as not collapsable, then no disclosure icon will be shown, making theSourceListCategory
always expanded.- Parameters:
text
- theSourceListCategory
text. Cannot be null.collapsable
-true
if thisSourceListCategory
should be collapsable.
-
-
Method Details
-
getText
Gets the category text. The returned will be the text that was set on the category - that is, this method does not return an all caps version of the text.- Specified by:
getText
in interfaceTextProvider
- Returns:
- the category text.
-
setText
Sets the text to use for thisSourceListCategory
. The capitalization of the text will be ignored, as categories are rendered in full caps.- Parameters:
text
- the category text.
-
isCollapsable
public boolean isCollapsable()true
if thisSourceListCategory
is collapsable.- Returns:
true
if thisSourceListCategory
is collapsable.
-
getItemCount
public int getItemCount()Gets the number of childSourceListItem
s that are part of this category.- Returns:
- the number of
SourceListItem
s that are part of this category.
-
containsItem
Returnstrue
if the givenSourceListItem
is contained by this category, to include being a sub-element of anotherSourceListItem
contained by this category.- Parameters:
item
- theSourceListItem
to determine whether or not is contained by this category.- Returns:
true
if the givenSourceListItem
is contained within this category or within on of this categoriesSourceListItem
s.
-
toString
Returns aString
representation of thisSourceListCategory
. -
getItems
Gets a list of thisSourceListCategory
'sSourceListItem
s.- Returns:
- a list of this
SourceListCategory
'sSourceListItem
s.
-