|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.uzh.ifi.attempto.preditor.MenuCreator
public abstract class MenuCreator
This abstract class is used for the predictive editor to create menus on the basis of categories of the grammar.
Constructor Summary | |
---|---|
MenuCreator()
Initializes a new menu creator object. |
Method Summary | |
---|---|
void |
addMenuEntry(java.lang.String menuBlockName,
TextElement textElement)
Adds a new menu entry containing the text element to the menu block. |
void |
addMenuItem(java.lang.String menuBlockName,
MenuItem menuItem)
Adds the menu item to the given menu block. |
protected abstract void |
addMenuItems(Restriction restriction)
An implementation of this abstract method should add menu items that comply with the given restriction. |
void |
addVariableEntries(java.lang.String menuBlockName,
int num,
java.lang.String categoryName)
Adds menu entries that stand for variables in the form of "X", "Y", "Z", "X1", "Y1", and so on. |
abstract void |
initMenuCreation()
This abstract method is called when the predictive editor is refreshed (before the first call of addMenuItems ). |
void |
prepareMenuBlock(java.lang.String menuBlockName)
Prepares a new menu block (if there is no such menu block already with the same name). |
void |
prepareMenuBlock(java.lang.String menuBlockName,
boolean doSort)
Prepares a new menu block (if there is no such menu block already with the same name). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MenuCreator()
Method Detail |
---|
protected abstract void addMenuItems(Restriction restriction)
addMenuItem
and/or addMenuEntry
.
restriction
- The restriction for the menu items.public abstract void initMenuCreation()
addMenuItems
). This is a good place for calling prepareMenuBlock
.
public void prepareMenuBlock(java.lang.String menuBlockName)
menuBlockName
- The name of the menu block.public void prepareMenuBlock(java.lang.String menuBlockName, boolean doSort)
menuBlockName
- The name of the menu block.doSort
- true if the items should be sorted.public void addMenuItem(java.lang.String menuBlockName, MenuItem menuItem)
menuBlockName
- The name of the menu block.menuItem
- The menu item to be added to the menu block.public void addMenuEntry(java.lang.String menuBlockName, TextElement textElement)
menuBlockName
- The name of the menu block.textElement
- The text element of the menu entry that is created and then added to the menu block.public void addVariableEntries(java.lang.String menuBlockName, int num, java.lang.String categoryName)
menuBlockName
- The name of the menu block into which the entries should be added.num
- The number upto which the variables should be enumerated.categoryName
- The category name of the entries.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |