com.ge.research.acuity.ui
Class SelectionPO

java.lang.Object
  extended bycom.ge.research.acuity.ui.PresentationObject
      extended bycom.ge.research.acuity.ui.IndependentDisplayPO
          extended bycom.ge.research.acuity.ui.InteractionObject
              extended bycom.ge.research.acuity.ui.SelectionPO

public class SelectionPO
extends InteractionObject

An interaction object that allows for selection from a list of choices.

Version:
$Revision: 1.1 $ $Date: 2006/08/11 00:17:24 $
Author:
garbiras

Field Summary
 
Fields inherited from class com.ge.research.acuity.ui.InteractionObject
CLIENT_EFFECT_LANGUAGE, CLIENT_EFFECT_LOCATION, CLIENT_EFFECT_TYPE
 
Constructor Summary
SelectionPO()
          Calls the default constructor with null argument
SelectionPO(java.lang.String statement)
          The default constructor.
 
Method Summary
 void addChoice(java.lang.Object value, java.lang.Object display)
          Adds a choice to the list of choices for this selection.
 boolean allowsMultipleSelection()
          Returns the value of the flag indicating whether or not multiple choices are allowed to be selected.
 boolean canAddSelectionToChoices()
          Returns the value of the flag indicating whether or not a selection value that does not appear in the set of choices can be added to the set of choices and displayed as a valid selection
 java.lang.Object getChoiceValue(int i)
          Returns the choice value at index i within the list of choices.
 java.util.List getChoiceValues()
          Returns the list of choice value for this selection.
 java.lang.Object[] getDefaultValues()
          Returns the array of SELECTED choice values (default values) for this selection.
 java.lang.Object getDisplayChoice(int i)
          Returns the display value to use for the choice value at index i within the list of choices.
 java.util.List getDisplayChoices()
          Returns the list of display strings to use for the choice values for this selection.
 java.lang.String getHasSortType()
          Returns the sort type of this selection list object.
 int getNumChoices()
          Returns the number of choices that exist for this selection.
 int getNumVisible()
          Returns the number of choices the client application should make visible at a time.
 void removeChoices()
          Removes all choices from this selction.
 void removeDefaultValues()
          Removes all pre-selected choices (default values) for this selection.
 void setAllowsMultipleSelection(boolean b)
          Sets the value of the flag indicating whether or not multiple choices are allowed to be selected.
 void setCanAddSelectionToChoices(boolean b)
          Sets the value of the flag indicating whether or not a selection value that does not appear in the set of choices can be added to the set of choices and displayed as a valid selection
 void setDefaultValues(java.lang.Object[] vals)
          Sets the array of SELECTED choice values (default values) for this selection.
 void setHasPresentationNature(java.lang.String string)
          Overrides setHasPresentationNature in InteractionObject.
 void setHasSortType(java.lang.String type)
          Checks that the new value for sort type is a valid presentation parameter sort type.
 void setNumVisible(int i)
          Sets the number of choices the client application should make visible at a time.
 
Methods inherited from class com.ge.research.acuity.ui.InteractionObject
alwaysRefresh, getClientEffects, getOrientation, getPrompt, getValueName, hasOwnSubmit, isDisabled, setAlwaysRefresh, setClientEffects, setHasOwnSubmit, setIsDisabled, setOrientation, setPrompt, setSubmitsOnChange, setValueName, submitsOnChange
 
Methods inherited from class com.ge.research.acuity.ui.IndependentDisplayPO
canBeRemoved, displayBanner, getHeight, getIdentifierTitle, getWidth, getXPos, getYPos, getZOrder, setCanBeRemoved, setDisplayBanner, setHeight, setIdentifier, setIdentifierTitle, setPos, setPos, setPos, setPos, setWidth, setXPos, setYPos, setZOrder
 
Methods inherited from class com.ge.research.acuity.ui.PresentationObject
addLookupInfo, getHasPresentationNature, getIdentifier, getLookupInfo, getSubject, hasSubject, isDisplayed, isEditable, setEditability, setIsDisplayed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionPO

public SelectionPO()
Calls the default constructor with null argument


SelectionPO

public SelectionPO(java.lang.String statement)
The default constructor. Calls super(statement), setting the interaction content statement. Sets the presentation nature to PresentationNatureConstants.DROPDOWN Sets the sort type to PresentationParameterConstants.SIAO_SORT_LABEL_ASC

Parameters:
statement - the statement explaining the purpose of this interaction object and content
See Also:
InteractionObject.InteractionObject(java.lang.String), setHasPresentationNature(java.lang.String), setHasSortType(java.lang.String)
Method Detail

addChoice

public void addChoice(java.lang.Object value,
                      java.lang.Object display)
Adds a choice to the list of choices for this selection.

Parameters:
value - the choice value for the selection
display - the display value to be presented for the choice value

allowsMultipleSelection

public final boolean allowsMultipleSelection()
Returns the value of the flag indicating whether or not multiple choices are allowed to be selected.

Returns:
true if the selection allows multiple choices to be selected; false if the selection allows at most a single choice to be selected.

canAddSelectionToChoices

public final boolean canAddSelectionToChoices()
Returns the value of the flag indicating whether or not a selection value that does not appear in the set of choices can be added to the set of choices and displayed as a valid selection

Returns:
true if the selection allows a selected value not present in the choice list to be added; false if the selection does not allows a selected value that does not appear in the choice list.

getChoiceValue

public java.lang.Object getChoiceValue(int i)
                                throws java.lang.IndexOutOfBoundsException
Returns the choice value at index i within the list of choices.

Returns:
The choice value for the i element within the list of choices
Throws:
java.lang.IndexOutOfBoundsException - if i is negative or greater than or equal to the number of choices for this selection

getChoiceValues

public java.util.List getChoiceValues()
Returns the list of choice value for this selection.

Returns:
The list of choice values for the selection

getDefaultValues

public java.lang.Object[] getDefaultValues()
Returns the array of SELECTED choice values (default values) for this selection. They should be rendered within the client applicationas pre-selected.

Returns:
The array of pre-selected choice values for the selection, that should be rendered as such

getDisplayChoice

public java.lang.Object getDisplayChoice(int i)
                                  throws java.lang.IndexOutOfBoundsException
Returns the display value to use for the choice value at index i within the list of choices.

Returns:
The display value for the i element within the list of choice's display strings
Throws:
java.lang.IndexOutOfBoundsException - if i is negative or greater than or equal to the number of display choices for this selection

getDisplayChoices

public java.util.List getDisplayChoices()
Returns the list of display strings to use for the choice values for this selection.

Returns:
The list of display strings to use for the choice values for the selection

getHasSortType

public final java.lang.String getHasSortType()
Returns the sort type of this selection list object.

Returns:
The sort type of this selection list object

getNumChoices

public int getNumChoices()
Returns the number of choices that exist for this selection.

Returns:
The number of choices for this selection

getNumVisible

public int getNumVisible()
Returns the number of choices the client application should make visible at a time. If the value is less than or equal to zer, returns the number of choices for this selection.

Returns:
The number of choices made visible, at one time, within the client application
See Also:
getNumChoices()

removeChoices

public void removeChoices()
Removes all choices from this selction. Removes both the choice values, as well as their display strings. Removes any default, pre-selected, choice values as well.

See Also:
removeDefaultValues()

removeDefaultValues

public void removeDefaultValues()
Removes all pre-selected choices (default values) for this selection.

See Also:
setDefaultValues(java.lang.Object[])

setAllowsMultipleSelection

public final void setAllowsMultipleSelection(boolean b)
Sets the value of the flag indicating whether or not multiple choices are allowed to be selected.

Parameters:
b - true if the selection should allow multiple choices to be selected; false if the selection should allow at most a single choice to be selected.

setCanAddSelectionToChoices

public final void setCanAddSelectionToChoices(boolean b)
Sets the value of the flag indicating whether or not a selection value that does not appear in the set of choices can be added to the set of choices and displayed as a valid selection

Parameters:
b - true if the selection should allow a selected value not present in the choice list to be added; false if the selection should not allow a selected value that does not appear in the choice list.

setDefaultValues

public void setDefaultValues(java.lang.Object[] vals)
Sets the array of SELECTED choice values (default values) for this selection. They should be rendered within the client applicationas pre-selected.

Parameters:
vals - the array of pre-selected choice values for the selection, that should be rendered as such

setHasSortType

public final void setHasSortType(java.lang.String type)
Checks that the new value for sort type is a valid presentation parameter sort type. If not, the value of sort type does not change.

Parameters:
type - the new value of sort type
See Also:
PresentationParameterConstants.isSortType(java.lang.String)

setHasPresentationNature

public void setHasPresentationNature(java.lang.String string)
Overrides setHasPresentationNature in InteractionObject. Checks that the new value for presentation nature is a valid type for a SelectionPO. If not, the value of presentation nature does not change.

Overrides:
setHasPresentationNature in class InteractionObject
Parameters:
string - the new value of presentation nature
See Also:
PresentationNatureConstants.isSelectionType(java.lang.String)

setNumVisible

public void setNumVisible(int i)
Sets the number of choices the client application should make visible at a time. If the number of choices exceeds this limit, then they should become visible via scrollbars or some other mechanism

Parameters:
i - The number of choices to be made visible, at one time, within the client application