Novell exteNd
Director 5.2 API

com.novell.afw.portlet.api
Interface EbiPortletPreferenceSelect

All Superinterfaces:
Cloneable, EbiPortletPreference

public interface EbiPortletPreferenceSelect
extends EbiPortletPreference

Interface representing a Select type of EbiPortletPreference. It provides methods that are useful for working with single valued preferences bound to a set of valid values. All values set for this preference must be one in the list of Allowable Values. If not, the validate() method will throw a EboPortletPreferenceValidationException indicating that the value is not acceptable.

Since:
v5.0

Inner Class Summary
static interface EbiPortletPreferenceSelect.AllowableValue
          Interface for a value object for sets of value/displayValue pairs for an option.
 
Fields inherited from interface com.novell.afw.portlet.api.EbiPortletPreference
TYPE_BOOLEAN, TYPE_COMPLEX, TYPE_INTEGER, TYPE_PASSWORD, TYPE_SELECT, TYPE_STRING
 
Method Summary
 void addAllowableValue(String value, String displayValue)
          Adds an AllowableValue to the list.
 void addAllowableValue(String value, String displayValue, int insertIndex)
          Inserts an AllowableValue to the list at the index specified.
 List getAllowableValues()
          Returns an unmodifiable List of EbiPortletPreferenceSelect.AllowableValue objects sorted in the order that they should be displayed in UI.
 void removeAllowableValue(int index)
          Removes an AllowableValue from the list of values allowed.
 void replaceAllowableValue(String value, String displayValue, int index)
          Replaces the allowable value at the index specified with the value and display value provided.
 
Methods implemented from interface com.novell.afw.portlet.api.EbiPortletPreference
getDataType, getDescription, getDisplayableXML, getDisplayName, getLocale, getName, getValue, getValue, getValues, getValues, isEncrypted, isHiddenFromUser, isMultiValued, isReadOnly, isRequired, setDescription, setDisplayName, setHiddenFromUser, setMultiValued, setReadOnly, setRequired, setValue, setValues, validate
 

Method Detail

getAllowableValues

public List getAllowableValues()
Returns an unmodifiable List of EbiPortletPreferenceSelect.AllowableValue objects sorted in the order that they should be displayed in UI. The List is unmodifiable, and any attempts to modify the contents of the returned List directly will result in a runtime exception.
Since:
v5.0

addAllowableValue

public void addAllowableValue(String value,
                              String displayValue)
Adds an AllowableValue to the list. This method adds it at the end of the list. Duplicates are allowed, though in general , having more than one value with same or different displaynames is not very useful.
Parameters:
value - The acutal value to which the entered value should be constrained.
displayValue - The value that the UI should use to display the value.
Since:
v5.0

addAllowableValue

public void addAllowableValue(String value,
                              String displayValue,
                              int insertIndex)
                       throws IndexOutOfBoundsException
Inserts an AllowableValue to the list at the index specified. If index is invalid (out of bounds) an IndexOutOufBoundsException will be thrown.
Parameters:
value - The acutal value to which the entered value should be constrained.
displayValue - The value that the UI should use to display the value.
insertIndex - The position at which to insert this allowable value.
Throws:
IndexOutOfBoundsException - thrown if the index indicated is less than 0 or greater than the number of allowable elements.
Since:
v5.0

removeAllowableValue

public void removeAllowableValue(int index)
                          throws IndexOutOfBoundsException
Removes an AllowableValue from the list of values allowed. This method can throw an IndexOutOfBoundsException if the index provided is invalid.
Parameters:
index - the position at which the removal should be done.
Throws:
IndexOutOfBoundsException - if the index is less than 0 or greater than the number of allowable values.
Since:
v5.0

replaceAllowableValue

public void replaceAllowableValue(String value,
                                  String displayValue,
                                  int index)
Replaces the allowable value at the index specified with the value and display value provided.
Parameters:
value - String new value to insert.
displayValue - String the new displayValue to insert.
index - int index of the value to replace.
Since:
v5.0

Novell exteNd
Director 5.2 API