public class MenuTree extends com.helger.tree.withid.unique.DefaultTreeWithGlobalUniqueID<String,IMenuObject> implements IMenuTree
| Constructor and Description |
|---|
MenuTree() |
| Modifier and Type | Method and Description |
|---|---|
IMenuItemExternal |
createItem(String sParentID,
String sItemID,
com.helger.commons.url.IHasSimpleURL aURL,
com.helger.commons.text.display.IHasDisplayText aName)
Append a new menu item below the specified parent.
|
IMenuItemPage |
createItem(String sParentID,
String sItemID,
IPage aPage)
Append a new menu item below the specified parent.
|
IMenuItemExternal |
createRootItem(String sItemID,
com.helger.commons.url.IHasSimpleURL aURL,
com.helger.commons.text.display.IHasDisplayText aName)
Append a new menu item at root level.
|
IMenuItemPage |
createRootItem(String sItemID,
IPage aPage)
Append a new menu item at root level.
|
IMenuSeparator |
createRootSeparator()
Append a new menu item separator at root level
|
IMenuSeparator |
createSeparator(String sParentID)
Append a new menu item separator as a child of the passed menu item
|
boolean |
equals(Object o) |
com.helger.commons.collection.ext.ICommonsList<String> |
getAllDefaultMenuItemIDs() |
com.helger.commons.collection.ext.ICommonsList<IMenuItemPage> |
getAllDefaultMenuItems()
Get the default menu item objects in the correct order.
|
IMenuItemPage |
getDefaultMenuItem()
Get the default menu item object.
|
String |
getDefaultMenuItemID()
Get the default menu item with the highest priority.
|
IMenuObject |
getMenuObjectOfID(String sID)
Get the menu object with the specified ID
|
IMenuObject |
getRootItemDataOfItemWithID(String sMenuItemID) |
com.helger.tree.withid.DefaultTreeItemWithID<String,IMenuObject> |
getRootItemOfItemWithID(String sMenuItemID) |
int |
hashCode() |
void |
iterateAllMenuObjects(Consumer<IMenuObject> aCallback)
Iterate all menu objects and invoke the supplied callback.
|
IMenuItemPage |
replaceMenuItem(IPage aNewPage)
Replace an eventually existing menu item with the new one.
|
void |
setDefaultMenuItemID(String sDefaultMenuItemID)
Set the default menu item.
|
void |
setDefaultMenuItemIDs(Iterable<String> aDefaultMenuItemIDs)
Set the default menu items in the priority order.
|
void |
setDefaultMenuItemIDs(String... aDefaultMenuItemIDs)
Set the default menu items in the priority order.
|
String |
toString() |
containsItemWithID, getAllChildren, getAllItemDatas, getAllItems, getChildCount, getChildWithID, getFactory, getItemCount, getItemDataWithID, getItemWithID, hasChildren, isItemSameOrDescendant, removeItemWithIDforAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildCount, getRootItem, hasChildrenclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontainsItemWithID, getAllItemDatas, getAllItems, getItemCount, getItemDataWithID, getItemWithID, isItemSameOrDescendant, removeItemWithIDforAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildCount, hasChildren, hasNoChildrengetChildWithIDgetAllChildren, getChildCount, hasChildren, hasNoChildrencreateItem, createItem, createItem, createItem, createItem, createRootItem, createRootItem, createSeparator@Nonnull public IMenuSeparator createRootSeparator()
IMenuOperationscreateRootSeparator in interface IMenuOperationsnull.@Nonnull public IMenuSeparator createSeparator(@Nonnull String sParentID)
IMenuOperationscreateSeparator in interface IMenuOperationssParentID - The parent menu item ID to append the separator to. May not be
null.null.@Nonnull public IMenuItemPage createRootItem(@Nonnull String sItemID, @Nonnull IPage aPage)
IMenuOperationscreateRootItem in interface IMenuOperationssItemID - The new menu item ID. May not be null.aPage - The referenced page. May not be null.null.@Nonnull public IMenuItemPage createItem(@Nonnull String sParentID, @Nonnull String sItemID, @Nonnull IPage aPage)
IMenuOperationscreateItem in interface IMenuOperationssParentID - The parent menu item ID to append the item to. May not be
null.sItemID - The new menu item ID. May not be null.aPage - The referenced page. May not be null.null.@Nonnull public IMenuItemExternal createRootItem(@Nonnull String sItemID, @Nonnull com.helger.commons.url.IHasSimpleURL aURL, @Nonnull com.helger.commons.text.display.IHasDisplayText aName)
IMenuOperationscreateRootItem in interface IMenuOperationssItemID - The new menu item ID. May not be null.aURL - The referenced URL. May not be null.aName - The name of the menu item. May not be null.null.@Nonnull public IMenuItemExternal createItem(@Nonnull String sParentID, @Nonnull String sItemID, @Nonnull com.helger.commons.url.IHasSimpleURL aURL, @Nonnull com.helger.commons.text.display.IHasDisplayText aName)
IMenuOperationscreateItem in interface IMenuOperationssParentID - The parent menu item ID to append the item to. May not be
null.sItemID - The new menu item ID. May not be null.aURL - The referenced URL. May not be null.aName - The name of the menu item. May not be null.null.public void setDefaultMenuItemID(@Nullable String sDefaultMenuItemID)
IMenuOperationssetDefaultMenuItemIDs (new String[]{sDefaultMenuItemID}); .
The passed menu item ID must resolve to an IMenuItemPage object.setDefaultMenuItemID in interface IMenuOperationssDefaultMenuItemID - The default menu item to be set. May be null.public void setDefaultMenuItemIDs(@Nullable String... aDefaultMenuItemIDs)
IMenuOperationsIMenuItemPage objects.setDefaultMenuItemIDs in interface IMenuOperationsaDefaultMenuItemIDs - The default menu items to be set. May be null. This
array may not contain any null entries.public void setDefaultMenuItemIDs(@Nullable Iterable<String> aDefaultMenuItemIDs)
IMenuOperationsIMenuItemPage objects.setDefaultMenuItemIDs in interface IMenuOperationsaDefaultMenuItemIDs - The default menu items to be set. May be null. This
list may not contain any null entries.@Nullable public String getDefaultMenuItemID()
IMenuOperationsgetAllDefaultMenuItemIDs().get(0).getDefaultMenuItemID in interface IMenuOperationsnull.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<String> getAllDefaultMenuItemIDs()
getAllDefaultMenuItemIDs in interface IMenuOperationsnull but may be
empty.@Nullable public IMenuItemPage getDefaultMenuItem()
IMenuOperationsgetAllDefaultMenuItems().get(0).getDefaultMenuItem in interface IMenuOperationsnull if either no default menu item is present, or the
default menu item ID could not be resolved to a menu item@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<IMenuItemPage> getAllDefaultMenuItems()
IMenuOperationsgetAllDefaultMenuItems in interface IMenuOperationsIMenuOperations.setDefaultMenuItemIDs(Iterable). Never null
but may be empty.@Nullable public IMenuObject getMenuObjectOfID(@Nullable String sID)
IMenuOperationsgetMenuObjectOfID in interface IMenuOperationssID - The ID to be resolved. May be null.null if the menu item could not be resolvedpublic void iterateAllMenuObjects(@Nonnull Consumer<IMenuObject> aCallback)
IMenuOperationsiterateAllMenuObjects in interface IMenuOperationsaCallback - The callback to be supplied for each menu object. May not be
null.@Nullable public IMenuItemPage replaceMenuItem(@Nonnull IPage aNewPage)
IMenuOperationsMenuItemPage object.replaceMenuItem in interface IMenuOperationsaNewPage - The page to be used instead of the existing menu itemnull if no such menu item
exists.@Nullable public com.helger.tree.withid.DefaultTreeItemWithID<String,IMenuObject> getRootItemOfItemWithID(@Nullable String sMenuItemID)
getRootItemOfItemWithID in interface IMenuTree@Nullable public IMenuObject getRootItemDataOfItemWithID(@Nullable String sMenuItemID)
getRootItemDataOfItemWithID in interface IMenuTreepublic boolean equals(Object o)
equals in class com.helger.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>public int hashCode()
hashCode in class com.helger.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>public String toString()
toString in class com.helger.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>Copyright © 2014–2017 Philip Helger. All rights reserved.