|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object types.WidgetDef lib.java.Menu
@WidgetDef.Derived(value=Clickable.class) public class Menu
Menu definition for a Java JMenu. A Menu is contained by a MenuBar, and contains MenuItems. A Menu's attributes include: - label - mnemonic
Nested Class Summary |
---|
Nested classes/interfaces inherited from class types.WidgetDef |
---|
WidgetDef.Abstract, WidgetDef.Contained, WidgetDef.Derived |
Field Summary |
---|
Fields inherited from class types.WidgetDef |
---|
id, parent, widget |
Constructor Summary | |
---|---|
Menu(Widget widget,
WidgetDef parent)
|
Method Summary | |
---|---|
String |
addAttributes(GUIAttributes attrs)
The addAttributes code does two things; it creates the lib.java code necessary for the attributes and it type checks for all attributes. |
String |
addChild(String childType,
String childName,
GUIAttributes childAttrs)
Check to make sure the childType is legal for the widget, then add it. |
Map<String,List<String>> |
getDefaults()
Every attribute in our language has to have a default setting. |
Set<String> |
getImports()
getImports keeps a Set of import lines that are pertinent to the code generated in the other methods. |
String |
getLanguage()
Accessor method for the Widget language. |
ArrayList<String> |
getModifiers()
getModifiers returns a list of methods designed to modify various attributes of the widget type in question. |
Map<String,String> |
getSynonymousAttributes()
Specifies synonymous attributes. |
List<String> |
getVariables()
Returns a chunk of code intended to declare variables which the backend code may need access to and therefore should be declared outside of the constructor code. |
String |
postamble()
Get the chunk of initialization code to be run after everything else is done. |
String |
preamble()
Get the chunk of initialization code to be run first. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Menu(Widget widget, WidgetDef parent)
Method Detail |
---|
public String getLanguage()
WidgetDef
getLanguage
in class WidgetDef
public String preamble()
WidgetDef
Note that, by its nature, a preamble should only be called once; therefore the preamble is not inherited.
preamble
in class WidgetDef
public String postamble()
WidgetDef
Note that the WidgetDef.preamble()
and postamble are not
inherited (much as Java constructors aren't).
postamble
in class WidgetDef
public String addAttributes(GUIAttributes attrs) throws BadAttributeException
WidgetDef
addAttributes
in class WidgetDef
attrs
- The attributes to set for the widget.
BadAttributeException
public Map<String,List<String>> getDefaults()
WidgetDef
getDefaults
in class WidgetDef
public Map<String,String> getSynonymousAttributes()
WidgetDef
WidgetDef.getDefaults()
), and the value is the name of the real attribute
with which that attribute is synonymous (i.e. equivalent).
By default, returns the empty map; WidgetDef subclasses may override to specify synonymous attributes.
getSynonymousAttributes
in class WidgetDef
public String addChild(String childType, String childName, GUIAttributes childAttrs) throws BadChildWidgetException
WidgetDef
addChild
in class WidgetDef
childType
- The widget type of the child.childName
- The identifier of the child.childAttrs
- The child's GUIAttributes map. Child attributes will be
read from this map.
BadChildWidgetException
- If the child is of an inappropriate
type. For instance, a menu can only have certain widgets (items,
submenus, etc.) as children.public ArrayList<String> getModifiers()
WidgetDef
getModifiers
in class WidgetDef
public Set<String> getImports()
WidgetDef
getImports
in class WidgetDef
public List<String> getVariables()
WidgetDef
getVariables
in class WidgetDef
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |