public class ResourceBundleHelpProvider extends HelpProvider
HelpProvider for details):
<adf-settings xmlns="http://xmlns.oracle.com/adf/settings">
<adf-faces-config xmlns="http://xmlns.oracle.com/adf/faces/settings">
<help-provider prefix="MYAPP_">
<help-provider-class> oracle.adf.view.rich.help.ResourceBundleHelpProvider </help-provider-class>
<property>
<property-name>baseName</property-name>
<value>oracle.adfdemo.view.resource.DemoResources</value>
</property>
</help-provider>
</adf-faces-config>
</adf-settings>
Example jsp fragment:
<af:inputText label="Credit Card" helpTopicid="MYAPP_CREDIT_CARD"/>The corresponding resource file:
oracle/adfdemo/view/resource/DemoResources.properties should contain entries like:
MYAPP_CREDIT_CARD_DEFINITION = This is your MasterCard or Visa number. MYAPP_CREDIT_CARD_INSTRUCTIONS = Enter 16 digits. You may use spaces.All of the
HelpTopic objects returned by this class have implementations for HelpTopic.getInstructions() and HelpTopic.getDefinition() as described above, and at getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String). However, HelpTopic.getExternalUrl() always returns null. This may be overridden by subclassing this class and implementing getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String).| Constructor and Description |
|---|
ResourceBundleHelpProvider() |
| Modifier and Type | Method and Description |
|---|---|
String |
getBaseName()
Gets the base name of the resource bundle that this HelpProvider will pull help information from.
|
protected String |
getExternalUrl(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String topicId)
Gets the externalUrl for a HelpTopic.
|
HelpTopic |
getHelpTopic(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String topicId)
Creates a HelpTopic instance for the given topicId.
|
void |
setBaseName(String basename)
Sets the base name of the resource bundle that this HelpProvider will pull help information from.
|
public void setBaseName(String basename)
This property is required, and can only be set once.
public String getBaseName()
public HelpTopic getHelpTopic(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String topicId)
getHelpTopic in class HelpProvidertopicId - This topicId is used to form two keys to look up resources in the ResourceBundle. The two keys are formed by appending "_INSTRUCTIONS" and "_DEFINITION" to the topicId. For example, if the topicId is "foo" the two ResourceBundle keys will be "foo_INSTRUCTIONS" and "foo_DEFINITION". The resource value of the former is used as the return for HelpTopic.getInstructions() and the value of the latter is used for HelpTopic.getDefinition().
See the example in the class documentation above.
component - the component that this HelpTopic is for. This may be null. Help implementors may provide different help depending on the component state, eg: when the component is disabled.HelpTopic.getInstructions() and HelpTopic.getDefinition() return values as described above. However, HelpTopic.getExternalUrl() always returns null. A subclass may change that behaviour by overriding getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String).getExternalUrl(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)protected String getExternalUrl(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String topicId)
component - This component that this URL is for. The component may be null, if it is unknown. This is the same parameter that was passed into getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)topicId - This is the same parameter that was passed into getHelpTopic(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)HelpTopic.getExternalUrl()