How to Create a Class for a Resource Bundle

Creating Custom ADF Faces Components 30-33 – At the bottom, select Constructors from Superclass and Implement Abstract Methods . 5. In the source editor, add all the attributes to the file. Example 30–19 shows the code for the attributes for the TagPaneTag class. Example 30–19 Attributes in the TagPaneTag Class public class TagPaneTag extends UIXComponentELTag { private ValueExpression _partialTriggers = null; private ValueExpression _visible = null; private ValueExpression _inlineStyle = null; private ValueExpression _styleClass = null; private ValueExpression _tags = null; private ValueExpression _orderBy = null; private MethodExpression _tagSelectListener = null; 6. To declaratively generate the accessor methods for the attributes, right-click the file in the source editor and choose Generate Accessors.

7. In the Generate Accessors dialog, click Select All, set the Scope to public and

click OK. 8. Add the render type and component type to the class. The component type will be used by the superclass to instantiate the component using the applications factory method, createComponentcomponentType. Example 30–20 shows the code for the TagPaneTag class, where both the component type and render type are oracle.adfdemo.acme.TagPane. Example 30–20 Component Type and Render Type for the TagPaneTag Class public String getComponentType { return COMPONENT_TYPE; } public String getRendererType { return RENDERER_TYPE; } pThis components type, codeoracle.adfdemo.acme.TagPanecodep static public final String COMPONENT_TYPE = oracle.adfdemo.acme.TagPane; pLogical name given to the registered renderer for this component.p static public final String RENDERER_TYPE = oracle.adfdemo.acme.TagPane; 9. Override the setProperties method from the superclass that has a single formal parameter of type FacesBean. This is a MyFaces Trinidad version on the base UIComponentELTag, but it is passed the components state holder instead of the component reference. The job of the setProperties method is to push the JSP tag attribute values to the component. Example 30–21 shows the overridden method for the tagPaneTag class. 30-34 Web User Interface Developers Guide for Oracle Application Development Framework Example 30–21 Overridden setProperties Method in the TagPaneTag Class Override protected void setPropertiesFacesBean facesBean { super.setPropertiesfacesBean; setStringArrayPropertyfacesBean, TagPane.PARTIAL_TRIGGERS_KEY, _partialTriggers; setPropertyfacesBean, TagPane.VISIBLE_KEY, _visible; setPropertyfacesBean, TagPane.INLINE_STYLE_KEY, _inlineStyle; setPropertyfacesBean, TagPane.STYLE_CLASS_KEY, _styleClass; setPropertyfacesBean, TagPane.TAGS_KEY, _tags; setPropertyfacesBean, TagPane.ORDER_BY_KEY, _orderBy; facesBean.setPropertyTagPane.TAG_SELECT_LISTENER_KEY, _tagSelectListener; }

30.4.10 How to Configure the Tag Library Descriptor

A tag library descriptor TLD provides more information on the Java Class to the JSP compilation engine and IDE tools TLDs are not used in applications that use Facelets. Before you begin: Associate the tag library with a URI, assign a version, and give it a name. You should have already performed this step when you created the tag library stub file in Section 30.2.6, How to Add a JavaServer Pages Tag Library Descriptor File. To configure the TLD: 1. Open the skeleton TLD file.

2. In the Component Palette, drag and drop a tag element.

3. In the Insert tag dialog, do the following:

■ name : Enter the name of the component. For example, for the tagPane component, you might enter tagPane. ■ body-content : Enter JSP. ■ tag-class : Click the ellipses button and navigate to the components tag class file. 4. Define each of the attributes as follows. For each attribute:

a. In the Structure window, right-click the tag element and choose Insert inside

tag attribute . b. In the Insert Attribute dialog, enter a value for the name. This should be the same as the name given in the tag class. c. In the Structure window, select the attribute and in the Property Inspector, set any attribute values. There are three types of elements to define for each attribute. The id element is a simple string. Additionally attributes can be either deferred-value or deferred-method attributes. These allow late deferred evaluation of the expression. Now that JSP and JSF share the same EL engine, the compiled EL can be passed directly to the component. Example 30–22 shows the TLD for the tagPane component.