com.ibm.mashups.enabler.widget
Interface Preferences


public Preferences

An interface representing preferences. It can be obtained through an PreferencesProvider .

Since:
2.4

Method Summary
 String getValue(String name)
           Returns the preference value for the given preference name.
 String[] getValues(String name)
           Returns the preference values for the given preference name.
 boolean isReadOnly(String name)
           Return true if the preference is set and marked as read-only in the widget definition, false otherwise.
 String[] getNames()
           Returns a list of the names of preference entries.
 Map getMap()
           Returns a map of all the preferences, with the name as key and the first value only as child.
 

Method Detail

getValue

String getValue(String name)
Returns the preference value for the given preference name. If there are multiple values for the given preference, the first value will be returned.

Parameters:
name - the preference name. Must not be null
Returns:
the preference value or null, if the preference is not set.

getValues

String[] getValues(String name)
Returns the preference values for the given preference name.

Parameters:
name - the preference name. Must not be null
Returns:
the preference values or null, if the preference is not set.

isReadOnly

boolean isReadOnly(String name)
Return true if the preference is set and marked as read-only in the widget definition, false otherwise.

Parameters:
name - the preference key. Must not be null
Returns:
true if the preference is set and marked as read-only

getNames

String[] getNames()
Returns a list of the names of preference entries.

Returns:
the list of names.

getMap

Map getMap()
Returns a map of all the preferences, with the name as key and the first value only as child.

Returns:
a JSON object representing a map, never null


Copyright IBM Corp. 2010 All Rights Reserved.