public class RasterLayerHierarchyListItem extends java.lang.Object implements HierarchyListItem, Visibility
HierarchyListItem.ComparatorSort, HierarchyListItem.Sort, HierarchyListItem.SortAlphabet, HierarchyListItem.SortAlphabetDesc, HierarchyListItem.SortDistanceFrom
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
iconUri |
protected RasterLayer2 |
subject |
protected java.util.Set<java.lang.Class<? extends Action>> |
supportedActions |
protected java.lang.String |
uid |
Constructor and Description |
---|
RasterLayerHierarchyListItem(RasterLayer2 subject) |
RasterLayerHierarchyListItem(RasterLayer2 subject,
java.lang.String iconUri) |
Modifier and Type | Method and Description |
---|---|
<T extends Action> |
getAction(java.lang.Class<T> clazz)
Returns an instance of the specified action that can be used to interact with the node's
underlying content.
|
HierarchyListItem |
getChildAt(int index)
Returns the child node at the specified index.
|
int |
getChildCount()
Returns the number of children that this node has.
|
int |
getDescendantCount()
Returns the total number of descendant nodes that this node has.
|
android.view.View |
getExtraView()
Returns the extra view, if any, associated with the node.
|
int |
getIconColor()
Returns the color to be applied to the icon.
|
java.lang.String |
getIconUri()
Returns the URI for the icon for the node.
|
java.lang.Object |
getLocalData(java.lang.String s)
Returns the local data associated with the node for the specified key.
|
<T> T |
getLocalData(java.lang.String s,
java.lang.Class<T> clazz)
Returns the local data associated with the node for the specified key.
|
int |
getPreferredListIndex()
Returns the preferred index in the list for the item to be displayed at.
|
java.lang.String |
getTitle()
Returns the title to be displayed for the item.
|
java.lang.String |
getUID()
Returns the unique ID of the list item
|
java.lang.Object |
getUserObject()
Returns the user object associated with the node.
|
boolean |
isChildSupported()
Check if list item can contain children
|
boolean |
isVisible()
Gets the current visibility state.
|
HierarchyListItem.Sort |
refresh(HierarchyListItem.Sort sortHint)
Refreshes this node's descendants on the specified sort.
|
java.lang.Object |
setLocalData(java.lang.String s,
java.lang.Object o)
Sets the specified local data on the object.
|
boolean |
setVisible(boolean visible)
Encapsulation of the visibility toggle implementation as an action.
|
protected final RasterLayer2 subject
protected final java.lang.String iconUri
protected final java.util.Set<java.lang.Class<? extends Action>> supportedActions
protected final java.lang.String uid
public RasterLayerHierarchyListItem(RasterLayer2 subject)
public RasterLayerHierarchyListItem(RasterLayer2 subject, java.lang.String iconUri)
public java.lang.String getUID()
HierarchyListItem
getUID
in interface HierarchyListItem
public java.lang.String getTitle()
HierarchyListItem
getTitle
in interface HierarchyListItem
public int getPreferredListIndex()
HierarchyListItem
getPreferredListIndex
in interface HierarchyListItem
-1
to indicate no preference
(FIFO).public int getChildCount()
HierarchyListItem
getChildCount
in interface HierarchyListItem
public int getDescendantCount()
HierarchyListItem
getDescendantCount
in interface HierarchyListItem
public HierarchyListItem getChildAt(int index)
HierarchyListItem
getChildAt
in interface HierarchyListItem
index
- The indexpublic boolean isChildSupported()
HierarchyListItem
isChildSupported
in interface HierarchyListItem
public java.lang.String getIconUri()
HierarchyListItem
getIconUri
in interface HierarchyListItem
null
if the node
has no icon, or "gone" to remove the icon space entirely.public int getIconColor()
HierarchyListItem
getIconColor
in interface HierarchyListItem
0xFFFFFFFF
(-1
)
to use the original color.public java.lang.Object setLocalData(java.lang.String s, java.lang.Object o)
HierarchyListItem
setLocalData
in interface HierarchyListItem
s
- The key for the datao
- The value for the datapublic java.lang.Object getLocalData(java.lang.String s)
HierarchyListItem
getLocalData
in interface HierarchyListItem
s
- The key for the local datapublic <T> T getLocalData(java.lang.String s, java.lang.Class<T> clazz)
HierarchyListItem
getLocalData
in interface HierarchyListItem
s
- The key for the local dataclazz
- The return type for the dataT
.public <T extends Action> T getAction(java.lang.Class<T> clazz)
HierarchyListItem
getAction
in interface HierarchyListItem
clazz
- The action classnull
if the specified
action is not supported for the node.public java.lang.Object getUserObject()
HierarchyListItem
getUserObject
in interface HierarchyListItem
null
.public android.view.View getExtraView()
HierarchyListItem
getExtraView
in interface HierarchyListItem
null
if there is no view.public HierarchyListItem.Sort refresh(HierarchyListItem.Sort sortHint)
HierarchyListItem
refresh
in interface HierarchyListItem
sortHint
- The new sortpublic boolean setVisible(boolean visible)
Visibility
setVisible
in interface Visibility
visible
- boolean true is visible, false invisible.public boolean isVisible()
Visibility
isVisible
in interface Visibility