|
|||||||||
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. |
void |
addReferenceEntries(java.lang.String menuBlockName,
java.lang.String category)
This method looks for referenceable text elements earlier in the token list, given the category of the next token. |
void |
addVariableEntries(java.lang.String menuBlockName,
int num,
java.lang.String category)
This method adds text elements that contain variables (in the form of "X", "Y", "Z", "X1", "Y1", "Z1", "X2", and so on) to the menu block. |
java.util.List<TextElement> |
getAccessibleTextElements(java.lang.String nextToken)
This method returns all text elements that are accessible for the given next token. |
abstract void |
initMenuCreation()
This abstract method is called when the predictive editor is refreshed (before the first call of processCategory ). |
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). |
abstract void |
processCategory(Terminal category)
An implementation of this abstract method should process the category by calling addMenuItem
and/or addMenuEntry . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MenuCreator()
Method Detail |
---|
public abstract void processCategory(Terminal category)
addMenuItem
and/or addMenuEntry
.
category
- The category of the grammar to be processed.public abstract void initMenuCreation()
processCategory
). 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 addReferenceEntries(java.lang.String menuBlockName, java.lang.String category)
menuBlockName
- The name of the menu block.category
- The category name for which the previous tokens should be checked for referenceability.getAccessibleTextElements(String)
,
RefableTextElement
,
RefTextElement
public void addVariableEntries(java.lang.String menuBlockName, int num, java.lang.String category)
menuBlockName
- The name of the menu block.num
- Variables are created up to this number.category
- The category name of the variable tokens.VarTextElement
public java.util.List<TextElement> getAccessibleTextElements(java.lang.String nextToken)
nextToken
- The next token.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |