/** * Append a new menu item separator as a child of the passed menu item * * @param aParent * The parent menu item to append the separator to. May not be * <code>null</code>. * @return The created menu item separator object. Never <code>null</code>. * @throws IllegalArgumentException * If the passed parent menu item could not be resolved */ @Nonnull default IMenuSeparator createSeparator (@Nonnull final IMenuItem aParent) { ValueEnforcer.notNull (aParent, "Parent"); return createSeparator (aParent.getID ()); }
/** * @return <code>true</code> if an explicit target is defined, * <code>false</code> otherwise. */ default boolean hasTarget () { return StringHelper.hasText (getTarget ()); }
final DefaultTreeItemWithID <String, IMenuObject> aTreeItem = aMenuTree.getItemWithID (aCurrent.getID ()); aCurrent = aTreeItem.isRootItem () ? null : (IMenuItem) aTreeItem.getParent ().getData (); aBreadcrumb.addLink (aLEC.getLinkToMenuItem (aItem.getID ()), aItem.getDisplayText (aDisplayLocale)); else aBreadcrumb.addActive (aItem.getDisplayText (aDisplayLocale));
final DefaultTreeItemWithID <String, IMenuObject> aTreeItem = aMenuTree.getItemWithID (aCurrent.getID ()); aCurrent = aTreeItem.isRootItem () ? null : (IMenuItem) aTreeItem.getParent ().getData (); aBreadcrumb.getList ().addLink (aLEC.getLinkToMenuItem (aItem.getID ()), aItem.getDisplayText (aDisplayLocale)); else aBreadcrumb.getList ().addActive (aItem.getDisplayText (aDisplayLocale));
/** * Append a new menu item below the specified parent. * * @param aParent * The parent menu item to append the item to. May not be * <code>null</code>. * @param aPage * The referenced page. May not be <code>null</code>. * @return The created menu item object. The ID of the menu item is the ID of * the page. Never <code>null</code>. * @throws IllegalArgumentException * If the passed parent menu item could not be resolved */ @Nonnull default IMenuItemPage createItem (@Nonnull final IMenuItem aParent, @Nonnull final IPage aPage) { ValueEnforcer.notNull (aParent, "Parent"); return createItem (aParent.getID (), aPage); }
/** * Append a new menu item below the specified parent. * * @param aParent * The parent menu item to append the item to. May not be * <code>null</code>. * @param sItemID * The new menu item ID. May not be <code>null</code>. * @param aURL * The referenced URL. May not be <code>null</code>. * @param aName * The name of the menu item. May not be <code>null</code>. * @return The created menu item object. Never <code>null</code>. * @throws IllegalArgumentException * If the passed parent menu item could not be resolved */ @Nonnull default IMenuItemExternal createItem (@Nonnull final IMenuItem aParent, @Nonnull final String sItemID, @Nonnull final IHasSimpleURL aURL, @Nonnull final IHasDisplayText aName) { ValueEnforcer.notNull (aParent, "Parent"); return createItem (aParent.getID (), sItemID, aURL, aName); }
/** * Append a new menu item separator as a child of the passed menu item * * @param aParent * The parent menu item to append the separator to. May not be * <code>null</code>. * @param sID * Separator ID to be used. Must be unique. May neither be * <code>null</code> nor empty! * @return The created menu item separator object. Never <code>null</code>. * @throws IllegalArgumentException * If the passed parent menu item could not be resolved * @since 8.0.1 */ @Nonnull default IMenuSeparator createSeparator (@Nonnull final IMenuItem aParent, @Nonnull @Nonempty final String sID) { ValueEnforcer.notNull (aParent, "Parent"); return createSeparator (aParent.getID (), sID); }