Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package com.helger.appbasics.app.menu;
 
 import java.util.List;
 
 
Contains all the menu-specific menu operations. This is not meant to be publically used. The IMenuTree should be used instead.

Author(s):
philip
 
 public interface IMenuOperations
 {
  
Append a new menu item separator at root level

Returns:
The created menu item separator object. Never null.
 
   @Nonnull
Append a new menu item separator as a child of the passed menu item

Parameters:
sParentID The parent menu item ID to append the separator to. May not be null.
Returns:
The created menu item separator object. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
 
   @Nonnull
   IMenuSeparator createSeparator (@Nonnull String sParentID);

  
Append a new menu item separator as a child of the passed menu item

Parameters:
aParent The parent menu item to append the separator to. May not be null.
Returns:
The created menu item separator object. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
 
   @Nonnull
Append a new menu item at root level.

Parameters:
sItemID The new menu item ID. May not be null.
aPage The referenced page. May not be null.
Returns:
The created menu item object. Never null.
 
   @Nonnull
   IMenuItemPage createRootItem (@Nonnull String sItemID, @Nonnull IPage aPage);

  
Append a new menu item at root level.

Parameters:
aPage The referenced page. May not be null.
Returns:
The created menu item object. The ID of the menu item is the ID of the page. Never null.
 
   @Nonnull
Append a new menu item below the specified parent.

Parameters:
sParentID 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.
Returns:
The created menu item object. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
  IMenuItemPage createItem (@Nonnull String sParentID, @Nonnull String sItemID, @Nonnull IPage aPage);

  
Append a new menu item below the specified parent.

Parameters:
sParentID The parent menu item ID to append the item to. May not be null.
aPage The referenced page. May not be null.
Returns:
The created menu item object. The ID of the menu item is the ID of the page. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
  IMenuItemPage createItem (@Nonnull String sParentID, @Nonnull IPage aPage);

  
Append a new menu item below the specified parent.

Parameters:
aParent The parent menu item to append the item to. May not be null.
aPage The referenced page. May not be null.
Returns:
The created menu item object. The ID of the menu item is the ID of the page. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
  IMenuItemPage createItem (@Nonnull IMenuItem aParent, @Nonnull IPage aPage);

  
Append a new menu item at root level.

Parameters:
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.
Returns:
The created menu item object. Never null.
Append a new menu item below the specified parent.

Parameters:
aParent 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.
Returns:
The created menu item object. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
                                @Nonnull String sItemID,
                                @Nonnull ISimpleURL aURL,
                                @Nonnull IHasDisplayText aName);

  
Append a new menu item below the specified parent.

Parameters:
sParentID 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.
Returns:
The created menu item object. Never null.
Throws:
java.lang.IllegalArgumentException If the passed parent menu item could not be resolved
                                @Nonnull String sItemID,
                                @Nonnull ISimpleURL aURL,
                                @Nonnull IHasDisplayText aName);

  
Set the default menu item. This is a shortcut for setDefaultMenuItemIDs (new ArrayList (sDefaultMenuItemID));. The passed menu item ID must resolve to an IMenuItemPage object.

Parameters:
sDefaultMenuItemID The default menu item to be set. May be null.
  void setDefaultMenuItemID (@Nullable String sDefaultMenuItemID);

  
Set the default menu items in the priority order. The passed menu item IDs must resolve to IMenuItemPage objects.

Parameters:
aDefaultMenuItemIDs The default menu items to be set. May be null. This array may not contain any null entries.
  void setDefaultMenuItemIDs (@Nullable String... aDefaultMenuItemIDs);

  
Set the default menu items in the priority order. The passed menu item IDs must resolve to IMenuItemPage objects.

Parameters:
aDefaultMenuItemIDs The default menu items to be set. May be null. This list may not contain any null entries.
  void setDefaultMenuItemIDs (@Nullable List <StringaDefaultMenuItemIDs);

  
Get the default menu item with the highest priority. Similar to getAllDefaultMenuItemIDs().get(0).

Returns:
The default menu item ID. May be null.

Returns:
The default menu item IDs. May not be null but may be empty.
Get the default menu item object. Similar to getAllDefaultMenuItems().get(0).

Returns:
null if either no default menu item is present, or the default menu item ID could not be resolved to a menu item
Get the default menu item objects in the correct order.

Returns:
The list of all default menu items, in the order as specified by setDefaultMenuItemIDs(java.util.List). Never null but may be empty.
Get the menu object with the specified ID

Parameters:
sID The ID to be resolved. May be null.
Returns:
null if the menu item could not be resolved
Iterate all menu objects and invoke the supplied callback.

Parameters:
aCallback The callback to be supplied for each menu object. May not be null.
Replace an eventually existing menu item with the new one. The ID of the passed page is used to determine the ID of the menu item to be replaced. The new menu item will be a MenuItemPage object.

Parameters:
aNewPage The page to be used instead of the existing menu item
Returns:
The create menu item or null if no such menu item exists.
New to GrepCode? Check out our FAQ X