org.rhq.enterprise.communications.command.param
Class OptionListRenderingInformation

java.lang.Object
  extended by org.rhq.enterprise.communications.command.param.ParameterRenderingInformation
      extended by org.rhq.enterprise.communications.command.param.OptionListRenderingInformation
All Implemented Interfaces:
Serializable

public class OptionListRenderingInformation
extends ParameterRenderingInformation
implements Serializable

Class used to encapsulate information specific to lists of options.

Author:
Charles Crouch
See Also:
Serialized Form

Constructor Summary
OptionListRenderingInformation()
          Defines all keys as null.
OptionListRenderingInformation(String labelKey, String descriptionKey, List optionLabelKeys)
          Create a new OptionListRenderingInformation.
 
Method Summary
 void applyResourceBundle(ResourceBundle resourceBundle)
          Applies the given resource bundle to this object so this object can obtain the actual string values for its keys.
 List getOptionLabelKeys()
          Returns the keys that will be used to look up each option item's label in a resource bundle.
 List getOptionLabels()
          Gets the option label strings as found in the resource bundle.
 void setOptionLabels(List<String> optionLabels)
          Explicitly sets the option labels strings.
 
Methods inherited from class org.rhq.enterprise.communications.command.param.ParameterRenderingInformation
getDescription, getDescriptionKey, getLabel, getLabelKey, isHidden, isObfuscated, isReadOnly, setDescription, setHidden, setLabel, setObfuscated, setReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionListRenderingInformation

public OptionListRenderingInformation()
Defines all keys as null. See OptionListRenderingInformation(String, String, List) for more information.


OptionListRenderingInformation

public OptionListRenderingInformation(String labelKey,
                                      String descriptionKey,
                                      List optionLabelKeys)
Create a new OptionListRenderingInformation. This constructor takes keys to labels and descriptions, and also keys to labels for displaying the rows of a dropdown.

Parameters:
labelKey -
descriptionKey -
optionLabelKeys - list of keys that represent each option - the items in the list must be of type String
See Also:
ParameterRenderingInformation.ParameterRenderingInformation(String, String)
Method Detail

getOptionLabelKeys

public List getOptionLabelKeys()
Returns the keys that will be used to look up each option item's label in a resource bundle.

Returns:
the option label keys (the list contains Strings)

getOptionLabels

public List getOptionLabels()
Gets the option label strings as found in the resource bundle.

This will return null until a resource bundle has been applied to this object. The returned list may also be explicitly set via setOptionLabels(List).

Returns:
the description string or null

setOptionLabels

public void setOptionLabels(List<String> optionLabels)
Explicitly sets the option labels strings. This can be used if you want to supply a default list of option labels without having to apply a resource bundle.

Parameters:
optionLabels -

applyResourceBundle

public void applyResourceBundle(ResourceBundle resourceBundle)
                         throws MissingResourceException
Applies the given resource bundle to this object so this object can obtain the actual string values for its keys. See ParameterRenderingInformation.applyResourceBundle(ResourceBundle) for more information on how this method works.

Overrides:
applyResourceBundle in class ParameterRenderingInformation
Parameters:
resourceBundle - the resource bundle where the key values are found (may be null)
Throws:
MissingResourceException - if a key was not found in the resource bundle
See Also:
ParameterRenderingInformation.applyResourceBundle(ResourceBundle)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.