Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: ACE-Components
-
Labels:None
-
Environment:generator
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial
Description
Integrate annotation based generator to the sparkle component branch
Issue Links
- depends on
-
ICE-5040 Sparkle: Add Field annotation for non-Property fields in Meta class
- Closed
-
ICE-5077 JSF2: find out how to save/restore state of the fields that are not public properties
- Closed
-
ICE-5078 Generator: Find out what MethodExpression takes to define in component and integrate it in the Generator
- Closed
Activity
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #19288 | Wed Sep 23 12:10:21 MDT 2009 | adnan.durrani | Fix towards Removed setters/getters, and tag classes and all icefaces-comps.jar dependency. |
Files Changed | ||||
MODIFY
/icefaces/scratchpads/sparkle/component/build.xml
MODIFY /icefaces/scratchpads/sparkle/component/src/org/icefaces/component/tab/Tabs.java MODIFY /icefaces/scratchpads/sparkle/component/src/org/icefaces/component/tab/TabSetRenderer.java |
Adnan Durrani
created issue -
Adnan Durrani
made changes -
Field | Original Value | New Value |
---|---|---|
Summary | Integrate annotation based generator to the sparkle component branch | Create annotation based generator for sparkle components |
Salesforce Case | [] | |
Fix Version/s | 2.0 [ 10032 ] |
Adnan Durrani
made changes -
Adnan Durrani
made changes -
Adnan Durrani
made changes -
Ken Fyten
made changes -
Salesforce Case | [] | |
Component/s | Components [ 10012 ] | |
Affects | [Documentation (User Guide, Ref. Guide, etc.), Sample App./Tutorial] |
Ken Fyten
made changes -
Fix Version/s | 2.0-Beta [ 10231 ] | |
Fix Version/s | 2.0-Alpha3 [ 10032 ] |
Ken Fyten
made changes -
Fix Version/s | 2.0-Beta2 [ 10242 ] | |
Fix Version/s | 2.0-Beta1 [ 10231 ] |
Ken Fyten
made changes -
Security | Private [ 10001 ] |
Ken Fyten
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Summary | Create annotation based generator for sparkle components | Create annotation based generator for ACE components |
Issue Type | Task [ 3 ] | New Feature [ 2 ] |
Salesforce Case | [] | |
Component/s | ACE-Components [ 10050 ] | |
Component/s | Components [ 10012 ] |
Ken Fyten
made changes -
Fix Version/s | 2.0.0 [ 10230 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Annotation
POJO
You will have to create a POJO class (Meta class), with following two annotations:
1- @Component
2- @property
For example:
@Component(..)
{ @Property private String label; }public class SliderMeta
No, meta class can be placed anywhere in the sparkle\src.
No, meta class will be excluded from the jar and stays in your workplan.
Yes, meta class name should be suffixed with Meta (e.g.) TabSetMeta
The generator looks for the class level "Component" annotation.
@Component (
componentClass="org.icefaces.component.Slider", //this class has to be created by the developer and must extending SliderBase (SliderBase will be generated by the generator)
generatedClass="org.icefaces.component.SliderBase"
extendsClass = "javax.faces.component.UIPanel"
)
So the hierarchy of "Slider.java" would look something like this "Slider->SliderBase->UIPanel->UIComponentBase->UIComponent"
package org.icefaces.component.slider;
@Component(
tagName = "slider",
componentClass = "org.icefaces.component.slider.Slider",
componentType = "com.icesoft.faces.Slider",
extendsClass = "javax.faces.component.UIPanel",
rendererClass = "com.icesoft.component.slider.SliderRenderer"
rendererType = "com.icesoft.faces.SliderRenderer"
)
public class SliderMeta
{ @Property private String label; }<component>
<component-type>com.icesoft.faces.Slider</component-type>
<component-class>org.icefaces.component.slider.Slider</component-class>
</component>
@Component(
.....
componentClass = "org.icefaces.component.slider.Slider",
//just add the following line to the above example
generatedClass = "org.icefaces.component.slider.SliderBase"
)
<component>
<component-type>com.icesoft.faces.Slider</component-type>
<component-class>org.icefaces.component.slider.Slider</component-class>
</component>
Now you create a hand coded class named Slider extending SliderBase. You'll get all generated accessor in your hand coded class and override any behavior. The hierarchy of Slider class will look like this:
UIComponent->UIComponentBase->UIPanel->SliderBase->Slider
@Property
private String label;
@Property
private Boolean partialSubmit;
@Property
private Date currentDate;
The generated property will look something like this:
/**
*/
public void setLabel(java.lang.String label) { getStateHelper().put(PropertyKeys.label, label); }
/**
*/
public java.lang.String getLabel() { return (java.lang.String) getStateHelper().eval(PropertyKeys.label); }
For example:
@Property (
javadocGet="custom comment for get",
javadocSet="custom comment for set",
tlddoc="comments for TLDDOC"
)
private String label;
So the generated property will look something like this:
/**
*/
public void setLabel(java.lang.String label) { getStateHelper().put(PropertyKeys.label, label); }
/**
*/
public java.lang.String getLabel() { return (java.lang.String) getStateHelper().eval(PropertyKeys.label); }
The Tld doc will look something like this:
<attribute>
<name>label</name>
<description><![CDATA[comments for TLDDOC]]></description>
@Property(
isMethodExpression=true,
methodExpressionArgument="javax.faces.event.ValueChangeEvent"
)
private MethodExpression tabChangeListener;
public class SliderMeta {
@Property
private String label;
@Facets
{ @Facet UIComponent header; @Facet UIComponent body; @Facet UIComponent footer; }class FacetsMeta
}