Package org.dashbuilder.navigation
Interface NavTree
-
- All Known Implementing Classes:
NavTreeImpl
public interface NavTreeA tree like structure containing a list of parent and children nodes where every node is aNavIteminstance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(NavItemVisitor visitor)Entry point for visitor interfacesNavDivideraddDivider(String groupId, boolean modifiable)Creates and register a brand newNavDivideritem.NavGroupaddGroup(String id, String name, String description, String groupId, boolean modifiable)Creates and register a brand newNavGroupitem.NavItemaddItem(String id, String name, String description, String groupId, boolean modifiable, String context)Creates and register a brand newNavItemitem.NavTreecloneTree()Creates a brand new copy of this treeNavItemdeleteItem(String id)Delete an existing item including all its children.NavTreegetItemAsTree(String id)Given an existing item, it creates a brand new subtree where the item (or its children in case of groups) is taken as the root node.NavItemgetItemById(String id)Get an item given its id.List<NavItem>getRootItems()The list of items belonging to the first tree levelNavItemmoveItem(String id, String newParentId)Changes the location of an item in the treevoidmoveItemDown(String id)Move an item one position down in its parent's children listvoidmoveItemFirst(String id)Move the specified item to the first position within its parent's children listvoidmoveItemLast(String id)Move the specified item to the last position within its parent's children listvoidmoveItemUp(String id)Move an item one position up in its parent's children listList<NavItem>searchItems(NavItemContext ctx)Get the items that match the given contextNavItemsetItemContext(String id, String context)Updates the perspective attached to an existing perspective linkNavItemsetItemDescription(String id, String description)Updates the description attribute of an existing itemNavItemsetItemModifiable(String id, boolean modifiable)Updates the modifiable flag attribute of an existing itemNavItemsetItemName(String id, String name)Updates the name attribute of an existing item
-
-
-
Method Detail
-
getRootItems
List<NavItem> getRootItems()
The list of items belonging to the first tree level- Returns:
- A list of
NavIteminstances
-
getItemById
NavItem getItemById(String id)
Get an item given its id. All the tree nodes are compared, no matter its level.- Parameters:
id- The unique identifier of the item- Returns:
- The first instance found
-
getItemAsTree
NavTree getItemAsTree(String id)
Given an existing item, it creates a brand new subtree where the item (or its children in case of groups) is taken as the root node.- Parameters:
id- The unique identifier of the item- Returns:
- The first instance found
-
searchItems
List<NavItem> searchItems(NavItemContext ctx)
Get the items that match the given context- Parameters:
ctx- The context to search for- Returns:
- The list of nav items that match the target context
-
addGroup
NavGroup addGroup(String id, String name, String description, String groupId, boolean modifiable)
Creates and register a brand newNavGroupitem.- Parameters:
id- The unique id of the itemname- The item's namedescription- A brief description of the itemgroupId- The identifier of an existing node in the tree where to append the newly created item as a childmodifiable- Flag indicating if the item can be modified once added- Returns:
- The instance just created
-
addItem
NavItem addItem(String id, String name, String description, String groupId, boolean modifiable, String context)
Creates and register a brand newNavItemitem.- Parameters:
id- The unique id of the itemname- The item's namedescription- A brief description of the itemgroupId- The identifier of an existing node in the tree where to append the newly created item as a childmodifiable- Flag indicating if the item can be modified once addedcontext- An string that contains item related information, like an external reference for instance.- Returns:
- The instance just created
-
addDivider
NavDivider addDivider(String groupId, boolean modifiable)
Creates and register a brand newNavDivideritem.- Parameters:
groupId- The identifier of an existing node in the tree where to append the newly created item as a childmodifiable- Flag indicating if the item can be modified once added- Returns:
- The instance just created
-
deleteItem
NavItem deleteItem(String id)
Delete an existing item including all its children.- Parameters:
id- The unique identifier of the item- Returns:
- The instance removed or null if the instance is not found
-
setItemName
NavItem setItemName(String id, String name)
Updates the name attribute of an existing item- Parameters:
id- The unique id of the itemname- A brief description of the item- Returns:
- The instance being updated
-
setItemDescription
NavItem setItemDescription(String id, String description)
Updates the description attribute of an existing item- Parameters:
id- The unique id of the itemdescription- A brief description of the item- Returns:
- The instance being updated
-
setItemModifiable
NavItem setItemModifiable(String id, boolean modifiable)
Updates the modifiable flag attribute of an existing item- Parameters:
id- The unique id of the itemmodifiable- Flag indicating if the item can be modified- Returns:
- The instance being updated
-
setItemContext
NavItem setItemContext(String id, String context)
Updates the perspective attached to an existing perspective link- Parameters:
id- The unique id of the itemcontext- The item's context- Returns:
- The item being updated
-
moveItem
NavItem moveItem(String id, String newParentId)
Changes the location of an item in the tree- Parameters:
id- The unique id of the itemnewParentId- The identifier of an existing node in the tree where to move the item- Returns:
- The instance being updated
-
moveItemFirst
void moveItemFirst(String id)
Move the specified item to the first position within its parent's children list- Parameters:
id- The unique id of the item
-
moveItemLast
void moveItemLast(String id)
Move the specified item to the last position within its parent's children list- Parameters:
id- The unique id of the item
-
moveItemUp
void moveItemUp(String id)
Move an item one position up in its parent's children list- Parameters:
id- The unique id of the item
-
moveItemDown
void moveItemDown(String id)
Move an item one position down in its parent's children list- Parameters:
id- The unique id of the item
-
accept
void accept(NavItemVisitor visitor)
Entry point for visitor interfaces
-
cloneTree
NavTree cloneTree()
Creates a brand new copy of this tree
-
-