edu.neu.ccs.gui
Class InputProperties

java.lang.Object
  extended byedu.neu.ccs.gui.InputProperties
All Implemented Interfaces:
Cloneable, JPTConstants, Serializable, SwingConstants

public class InputProperties
extends Object
implements JPTConstants, Cloneable, Serializable

A property list used to store properties pertaining to input components.

There are four bound properties for an input properties object that represent the standard properties for an input component and the parameters it contributes to a standard error strategy:

This class implements a data structure that can be used to store any number of input properties of any type, keyed using String property names. An input properties object can be created so that it shadows the properties stored in a preexisting input properties object or the base input properties object that contains default property values. Properties with the same name that are stored in the top level input properties object are returned in favor of lower level properties stored in the shadowed input properties object(s). Properties stored in the lower level input properties object(s) are returned by the top level input properties object if those properties are not shadowed by higher level properties with the same names.

Since:
1.0
Version:
2.2
See Also:
Serialized Form

Field Summary
static InputProperties BASE_PROPERTIES
          Shared base property list for input property objects.
static String DIALOG_TITLE
          Bound property name for the dialog box title to be used as a parameter for a standard error strategy if the view state of this input component is malformed.
static String INPUT_MODEL
          Bound property name for the input model for this view.
static String INPUT_PROMPT
          Bound property name for the prompt to be used as a parameter for a standard error strategy if the view state of this input component is malformed.
protected  InputProperties next
          Property list that this property list shadows.
static String SUGGESTION
          Bound property name for a suggested view state for this view.
protected  Hashtable table
          Hashtable used to map property names to property values.
 
Fields inherited from interface edu.neu.ccs.util.JPTConstants
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
InputProperties()
          Constructor for an empty property list that shadows the shared base property object.
InputProperties(InputProperties properties)
          Constructor for an empty property list that shadows the given property list.
 
Method Summary
 boolean equals(Object other)
          Returns true if this property list is equivalent to the given object, or false if it is not.
 String getDialogTitle()
          Returns the dialog title text stored in this property list.
 int getInputModel()
          Returns the input model value stored in this property list.
 String getInputPrompt()
          Returns the input prompt text stored in this property list.
 Object getProperty(String propertyName)
          Returns the value of the property with the provided name, or null if the property has not been set.
 String getSuggestion()
          Returns the suggested view state stored in this property list.
 void setDialogTitle(String dialogTitle)
          Sets the dialog title to the given title text.
 void setInputModel(int inputModel)
          Sets the input model value to the given value.
 void setInputPrompt(String inputPrompt)
          Sets the input prompt text to the given prompt text.
 void setProperty(String propertyName, Object property)
          Stores the given property under the provided name.
 void setSuggestion(String suggestion)
          Sets the suggested view state to the given String data.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_PROMPT

public static final String INPUT_PROMPT
Bound property name for the prompt to be used as a parameter for a standard error strategy if the view state of this input component is malformed.

See Also:
Constant Field Values

DIALOG_TITLE

public static final String DIALOG_TITLE
Bound property name for the dialog box title to be used as a parameter for a standard error strategy if the view state of this input component is malformed.

See Also:
Constant Field Values

INPUT_MODEL

public static final String INPUT_MODEL
Bound property name for the input model for this view.

See Also:
JPTConstants.MANDATORY, JPTConstants.OPTIONAL, Constant Field Values

SUGGESTION

public static final String SUGGESTION
Bound property name for a suggested view state for this view.

See Also:
Constant Field Values

BASE_PROPERTIES

public static final InputProperties BASE_PROPERTIES
Shared base property list for input property objects.


table

protected Hashtable table
Hashtable used to map property names to property values.


next

protected InputProperties next
Property list that this property list shadows.

Constructor Detail

InputProperties

public InputProperties()
Constructor for an empty property list that shadows the shared base property object.


InputProperties

public InputProperties(InputProperties properties)
Constructor for an empty property list that shadows the given property list. If the given property list is null, the property list will not shadow another property list.

Parameters:
properties - the desired property list to shadow
Method Detail

equals

public boolean equals(Object other)
Returns true if this property list is equivalent to the given object, or false if it is not.

Parameters:
other - the object to compare with

setProperty

public void setProperty(String propertyName,
                        Object property)
Stores the given property under the provided name.

Parameters:
propertyName - the String name of the property
property - the value of the property to be stored in the list

getProperty

public Object getProperty(String propertyName)
Returns the value of the property with the provided name, or null if the property has not been set.

Parameters:
propertyName - the String name of the desired property value

setInputPrompt

public void setInputPrompt(String inputPrompt)
Sets the input prompt text to the given prompt text.

Parameters:
inputPrompt - the new prompt text

getInputPrompt

public String getInputPrompt()
Returns the input prompt text stored in this property list.


setDialogTitle

public void setDialogTitle(String dialogTitle)
Sets the dialog title to the given title text.

Parameters:
dialogTitle - the new title text

getDialogTitle

public String getDialogTitle()
Returns the dialog title text stored in this property list.


setInputModel

public void setInputModel(int inputModel)
Sets the input model value to the given value.

Parameters:
inputModel - the new input model value
See Also:
JPTConstants.MANDATORY, JPTConstants.OPTIONAL

getInputModel

public int getInputModel()
Returns the input model value stored in this property list.

See Also:
JPTConstants.MANDATORY, JPTConstants.OPTIONAL

setSuggestion

public void setSuggestion(String suggestion)
Sets the suggested view state to the given String data.

Parameters:
suggestion - the new suggestion text

getSuggestion

public String getSuggestion()
Returns the suggested view state stored in this property list.