public class MenuTree extends com.helger.commons.tree.withid.unique.DefaultTreeWithGlobalUniqueID<String,IMenuObject> implements IMenuTree
| Constructor and Description |
|---|
MenuTree() |
| Modifier and Type | Method and Description |
|---|---|
IMenuItemPage |
createItem(IMenuItem aParent,
IPage aPage)
Append a new menu item below the specified parent.
|
IMenuItemExternal |
createItem(IMenuItem aParent,
String sItemID,
com.helger.commons.url.ISimpleURL aURL,
com.helger.commons.name.IHasDisplayText aName)
Append a new menu item below the specified parent.
|
IMenuItemPage |
createItem(String sParentID,
IPage aPage)
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 |
createItem(String sParentID,
String sItemID,
com.helger.commons.url.ISimpleURL aURL,
com.helger.commons.name.IHasDisplayText aName)
Append a new menu item below the specified parent.
|
IMenuItemPage |
createRootItem(IPage aPage)
Append a new menu item at root level.
|
IMenuItemPage |
createRootItem(String sItemID,
IPage aPage)
Append a new menu item at root level.
|
IMenuItemExternal |
createRootItem(String sItemID,
com.helger.commons.url.ISimpleURL aURL,
com.helger.commons.name.IHasDisplayText aName)
Append a new menu item at root level.
|
IMenuSeparator |
createRootSeparator()
Append a new menu item separator at root level
|
IMenuSeparator |
createSeparator(IMenuItem aParent)
Append a new menu item separator as a child of the passed menu item
|
IMenuSeparator |
createSeparator(String sParentID)
Append a new menu item separator as a child of the passed menu item
|
boolean |
equals(Object o) |
List<String> |
getAllDefaultMenuItemIDs() |
List<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.commons.tree.withid.DefaultTreeItemWithID<String,IMenuObject> |
getRootItemOfItemWithID(String sMenuItemID) |
int |
hashCode() |
void |
iterateAllMenuObjects(com.helger.commons.callback.INonThrowingRunnableWithParameter<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(List<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, removeItemWithIDclone, finalize, getClass, notify, notifyAll, wait, wait, wait@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 IMenuSeparator createSeparator(@Nonnull IMenuItem aParent)
IMenuOperationscreateSeparator in interface IMenuOperationsaParent - The parent menu item 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 createRootItem(@Nonnull IPage aPage)
IMenuOperationscreateRootItem in interface IMenuOperationsaPage - 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 IMenuItemPage createItem(@Nonnull String sParentID, @Nonnull IPage aPage)
IMenuOperationscreateItem in interface IMenuOperationssParentID - The parent menu item ID to append the item to. May not be
null.aPage - The referenced page. May not be null.null.@Nonnull public IMenuItemPage createItem(@Nonnull IMenuItem aParent, @Nonnull IPage aPage)
IMenuOperationscreateItem in interface IMenuOperationsaParent - The parent menu item to append the item to. 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.ISimpleURL aURL, @Nonnull com.helger.commons.name.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 IMenuItem aParent, @Nonnull String sItemID, @Nonnull com.helger.commons.url.ISimpleURL aURL, @Nonnull com.helger.commons.name.IHasDisplayText aName)
IMenuOperationscreateItem in interface IMenuOperationsaParent - The parent menu item 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.@Nonnull public IMenuItemExternal createItem(@Nonnull String sParentID, @Nonnull String sItemID, @Nonnull com.helger.commons.url.ISimpleURL aURL, @Nonnull com.helger.commons.name.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 ArrayList (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 List<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 List<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 List<IMenuItemPage> getAllDefaultMenuItems()
IMenuOperationsgetAllDefaultMenuItems in interface IMenuOperationsIMenuOperations.setDefaultMenuItemIDs(List). 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 com.helger.commons.callback.INonThrowingRunnableWithParameter<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.commons.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.commons.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.commons.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>public int hashCode()
hashCode in class com.helger.commons.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.commons.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>public String toString()
toString in class com.helger.commons.tree.withid.unique.BasicTreeWithGlobalUniqueID<String,IMenuObject,com.helger.commons.tree.withid.DefaultTreeItemWithID<String,IMenuObject>>Copyright © 2014–2015 Philip Helger. All rights reserved.