lib.java
Class RadioButton

java.lang.Object
  extended by types.WidgetDef
      extended by lib.java.RadioButton

@WidgetDef.Derived(value=Button.class)
public class RadioButton
extends WidgetDef

RadioButton for Definition for a Java radio button.

Author:
ritza
See Also:
for more information about the methods.

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
RadioButton(Widget widget, WidgetDef parent)
           
 
Method Summary
 String addAttributes(GUIAttributes attributes)
          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)
           
 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.
 List<String> getModifiers()
          getModifiers returns a list of methods designed to modify various attributes of the widget type in question.
 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 types.WidgetDef
addChild, commentForm, defineWidget, defineWidget, equals, getAncestry, getBaseWidgetDefClasses, getBaseWidgetDefClasses, getBaseWidgetDefClasses, getBaseWidgetDefs, getChildDefaults, getChildModifiers, getCommentName, getInnerClasses, getMultisynonymousAttributes, getSynonymousAttributes, hashCode, isAbstract, isAbstract, isContained, isContained, isContained, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, isDerivedFrom, processAttributes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadioButton

public RadioButton(Widget widget,
                   WidgetDef parent)
Method Detail

getLanguage

public String getLanguage()
Description copied from class: WidgetDef
Accessor method for the Widget language.

Specified by:
getLanguage in class WidgetDef
Returns:
language

getVariables

public List<String> getVariables()
Description copied from class: WidgetDef
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.

Specified by:
getVariables in class WidgetDef
Returns:
Variable Declaration for the widget.

preamble

public String preamble()
Description copied from class: WidgetDef
Get the chunk of initialization code to be run first. Typically this code will declare a local variable for the widget.

Note that, by its nature, a preamble should only be called once; therefore the preamble is not inherited.

Specified by:
preamble in class WidgetDef
Returns:
Instatiation code.

postamble

public String postamble()
Description copied from class: WidgetDef
Get the chunk of initialization code to be run after everything else is done. This is an empty string by default.

Note that the WidgetDef.preamble() and postamble are not inherited (much as Java constructors aren't).

Overrides:
postamble in class WidgetDef
Returns:
Final-phase initialization code.

addAttributes

public String addAttributes(GUIAttributes attributes)
                     throws BadAttributeException
Description copied from class: WidgetDef
The addAttributes code does two things; it creates the lib.java code necessary for the attributes and it type checks for all attributes. A BadAttributeException is thrown if the names or the values are erroneous. If an attribute is not found in the GUIAttributes, a BadAttributeNameException is thrown from GUIAttributes.

Specified by:
addAttributes in class WidgetDef
Parameters:
attributes - The attributes to set for the widget.
Returns:
The generated code to set the attributes.
Throws:
BadAttributeException

getDefaults

public Map<String,List<String>> getDefaults()
Description copied from class: WidgetDef
Every attribute in our language has to have a default setting. This returns all the defaults in a map of Strings to Lists of Strings.

Specified by:
getDefaults in class WidgetDef
Returns:
Map of attribute defaults

addChild

public String addChild(String childType,
                       String childName)
                throws BadChildWidgetException
Throws:
BadChildWidgetException

getModifiers

public List<String> getModifiers()
Description copied from class: WidgetDef
getModifiers returns a list of methods designed to modify various attributes of the widget type in question. When getModifiers is called, the accessors and mutators for all attributes are returned.

Specified by:
getModifiers in class WidgetDef
Returns:
List of mutators and accessors for the widget type.

getImports

public Set<String> getImports()
Description copied from class: WidgetDef
getImports keeps a Set of import lines that are pertinent to the code generated in the other methods.

Specified by:
getImports in class WidgetDef
Returns:
Set of import strings.