uic.output
Class VariableManager

java.lang.Object
  extended byuic.output.VariableManager

public class VariableManager
extends Object

While compiling this class makes sure we keep names unique and we have a full list of all the widgets to 'define' as class variables.


Field Summary
static int METHOD
           
static int VARIABLE
           
 
Constructor Summary
VariableManager()
           
 
Method Summary
 void add(String type, String name)
          Convenience method to add a variable.
 void add(String type, String name, String initValue)
          Add a variable to the global list of variables.
static String correctName(String in)
           
 String getUnique(int type, String base)
          Create a variable name that has not been used before starting with the base name.
 String getUnique(String name)
          Convenience method to get a variable name.
 String getVariableLine(String key)
          Retrieve the contents of one line from the list of variables.
 Enumeration getVariableLineKeys()
          return an emumeraion for all java widget names defined as class members.
 boolean isUnique(int type, String name)
          Checks if a name has allready been taken.
 boolean isUnique(String name)
          Convenience method to check a variable.
 void registerName(int type, String name)
          Registers the name to be in use
 void registerName(String name)
          Convenience method to register a variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD

public static final int METHOD
See Also:
Constant Field Values

VARIABLE

public static final int VARIABLE
See Also:
Constant Field Values
Constructor Detail

VariableManager

public VariableManager()
Method Detail

add

public void add(String type,
                String name,
                String initValue)
Add a variable to the global list of variables.

Parameters:
type - The type in the form of the classname. JLabel, Checkbox etc .
name - the name of the variable. myBytton for example. (does auto registering!)
initValue - is the initialising stuff for the variable.

add

public void add(String type,
                String name)
Convenience method to add a variable.


registerName

public void registerName(int type,
                         String name)
Registers the name to be in use


registerName

public void registerName(String name)
Convenience method to register a variable.


isUnique

public boolean isUnique(int type,
                        String name)
Checks if a name has allready been taken.


isUnique

public boolean isUnique(String name)
Convenience method to check a variable.


getUnique

public String getUnique(int type,
                        String base)
Create a variable name that has not been used before starting with the base name. (does auto registering!)

Parameters:
type - The type of a variable, a method or variable.
base - The starting part of the name. A number will be appended to this.
Returns:
the unique name.

getUnique

public String getUnique(String name)
Convenience method to get a variable name.


getVariableLine

public String getVariableLine(String key)
Retrieve the contents of one line from the list of variables. The list is build by adding variables via the add() method with the type==VARIABLE option.

Parameters:
key - is the type of java widget to get the line from.
Returns:
comma seperated list of instances used for type key.

getVariableLineKeys

public Enumeration getVariableLineKeys()
return an emumeraion for all java widget names defined as class members.


correctName

public static String correctName(String in)


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence