ch.uzh.ifi.attempto.preditor
Interface MenuCreator

All Known Implementing Classes:
AceWikiMenuCreator, DefaultMenuCreator

public interface MenuCreator

This interface represents an object that can create the menus for the predictive editor. DefaultMenuCreator is the menu creator used by default.

Author:
Tobias Kuhn

Method Summary
 MenuEntry createMenuEntry(ConcreteOption option)
          This method must create and return the menu entry object for the given concrete option.
 java.util.List<SpecialMenuItem> createSpecialMenuItems(NextTokenOptions options)
          This method should return the special menu items for the given situation (described by the next token options).
 int getColorShift(java.lang.String menuBlockName)
          This method should return the shift of the color to be used for the given menu block.
 java.util.List<java.lang.String> getMenuGroupOrdering()
          This method can be used to define the ordering of the menu groups.
 java.util.Comparator<MenuItem> getMenuItemComparator()
          This method can return a comparator to define the order of the menu items within each menu group.
 

Method Detail

createMenuEntry

MenuEntry createMenuEntry(ConcreteOption option)
This method must create and return the menu entry object for the given concrete option. described by the given next token options.

Parameters:
option - The concrete option that represents a possible next token.
Returns:
A new menu entry object for the given option.

createSpecialMenuItems

java.util.List<SpecialMenuItem> createSpecialMenuItems(NextTokenOptions options)
This method should return the special menu items for the given situation (described by the next token options).

Parameters:
options - The options for the next token.
Returns:
A list of special menu items to be shown.

getMenuGroupOrdering

java.util.List<java.lang.String> getMenuGroupOrdering()
This method can be used to define the ordering of the menu groups. Menu groups with names that are not contained in the list returned by this method appear in an undefined order. All other menu groups appear in the same order as in the list.

Returns:
A list of menu group names.

getColorShift

int getColorShift(java.lang.String menuBlockName)
This method should return the shift of the color to be used for the given menu block. A shift value of 120, for example, means a shift by 120 "degrees" towards violet. A shift of 360 is a full rotation and result in the original color.

Parameters:
menuBlockName - The name of the menu block for which the color shift should be returned.
Returns:
The color shift value.

getMenuItemComparator

java.util.Comparator<MenuItem> getMenuItemComparator()
This method can return a comparator to define the order of the menu items within each menu group.

Returns:
A comparator to compare menu items.


Copyright 2008-2012, AceWiki developers