JBoss Rich Faces SVN: r16600 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:40:34 -0400 (Thu, 18 Mar 2010)
New Revision: 16600
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java 2010-03-18 14:39:55 UTC (rev 16599)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualFileManager.java 2010-03-18 14:40:34 UTC (rev 16600)
@@ -23,6 +23,18 @@
package org.richfaces.cdk.apt;
+import com.google.common.collect.BiMap;
+import com.google.common.collect.HashBiMap;
+import com.google.common.collect.Lists;
+import com.google.inject.Inject;
+import org.richfaces.cdk.Logger;
+
+import javax.tools.FileObject;
+import javax.tools.ForwardingJavaFileManager;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.JavaFileObject.Kind;
+import javax.tools.StandardLocation;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
@@ -32,20 +44,6 @@
import java.util.List;
import java.util.Set;
-import javax.tools.FileObject;
-import javax.tools.ForwardingJavaFileManager;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardLocation;
-import javax.tools.JavaFileObject.Kind;
-
-import org.richfaces.cdk.Logger;
-
-import com.google.common.collect.BiMap;
-import com.google.common.collect.HashBiMap;
-import com.google.common.collect.Lists;
-import com.google.inject.Inject;
-
/**
* <p class="changed_added_4_0">
* That class wraps {@link javax.tools.StandardJavaFileManager}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java 2010-03-18 14:39:55 UTC (rev 16599)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/VirtualJavaFileObject.java 2010-03-18 14:40:34 UTC (rev 16600)
@@ -23,6 +23,7 @@
package org.richfaces.cdk.apt;
+import javax.tools.SimpleJavaFileObject;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
@@ -31,8 +32,6 @@
import java.nio.channels.ReadableByteChannel;
import java.nio.charset.Charset;
-import javax.tools.SimpleJavaFileObject;
-
/**
* <p class="changed_added_4_0">This class represents read-only {@link javax.tools.JavaFileObject} created
* from {@link java.io.File} or {@link java.net.URL}</p>
14 years, 7 months
JBoss Rich Faces SVN: r16599 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:39:55 -0400 (Thu, 18 Mar 2010)
New Revision: 16599
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-03-18 14:39:12 UTC (rev 16598)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/TaskFactoryImpl.java 2010-03-18 14:39:55 UTC (rev 16599)
@@ -26,12 +26,25 @@
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import com.google.inject.Inject;
-import org.richfaces.cdk.*;
+import org.richfaces.cdk.CdkClassLoader;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.FileManager;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.Output;
+import org.richfaces.cdk.Outputs;
+import org.richfaces.cdk.Source;
+import org.richfaces.cdk.Sources;
import javax.annotation.processing.Processor;
-import javax.tools.*;
+import javax.tools.Diagnostic;
import javax.tools.Diagnostic.Kind;
+import javax.tools.DiagnosticListener;
+import javax.tools.JavaCompiler;
import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java 2010-03-18 14:39:12 UTC (rev 16598)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java 2010-03-18 14:39:55 UTC (rev 16599)
@@ -28,7 +28,6 @@
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.TypeElement;
-import javax.faces.view.facelets.ValidatorHandler;
import java.lang.annotation.Annotation;
/**
@@ -42,7 +41,7 @@
public void process(TypeElement element) throws CdkProcessingException {
JsfValidator validator = element.getAnnotation(JsfValidator.class);
- ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId((validator.id())));
+ ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId(validator.id()));
setClassNames(element, validatorModel, validator);
setDescription(validatorModel, validator.icon(), getDocComment(element), validator.displayName());
14 years, 7 months
JBoss Rich Faces SVN: r16598 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:39:12 -0400 (Thu, 18 Mar 2010)
New Revision: 16598
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-18 14:38:25 UTC (rev 16597)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-18 14:39:12 UTC (rev 16598)
@@ -24,13 +24,11 @@
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.Family;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.RendererModel;
import org.richfaces.cdk.templatecompiler.RendererTemplateParser;
import org.richfaces.cdk.util.Strings;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2010-03-18 14:38:25 UTC (rev 16597)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/SourceUtils.java 2010-03-18 14:39:12 UTC (rev 16598)
@@ -23,13 +23,12 @@
package org.richfaces.cdk.apt;
+import com.google.inject.ProvidedBy;
+import org.richfaces.cdk.model.ClassName;
+
import java.lang.annotation.Annotation;
import java.util.Set;
-import org.richfaces.cdk.model.ClassName;
-
-import com.google.inject.ProvidedBy;
-
/**
* <p class="changed_added_4_0">This class provides utility methods to analayze java classes. This implementation uses APT API to get
* information about Java code.</p>
@@ -99,6 +98,8 @@
public Set<BeanProperty> getBeanPropertiesAnnotatedWith(Class<? extends Annotation> annotation,
ClassName type);
+ public Set<BeanProperty> getAbstractBeanProperties(ClassName type);
+
public String getDocComment(ClassName componentElement);
public Object getConstant(ClassName componentElement, String name);
14 years, 7 months
JBoss Rich Faces SVN: r16597 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:38:25 -0400 (Thu, 18 Mar 2010)
New Revision: 16597
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java 2010-03-18 14:29:31 UTC (rev 16596)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java 2010-03-18 14:38:25 UTC (rev 16597)
@@ -3,18 +3,22 @@
import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Provider;
-
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.NamingConventions;
import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.DisplayName;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.Icon;
import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
import org.richfaces.cdk.apt.SourceUtils.SuperTypeVisitor;
-import org.richfaces.cdk.model.*;
+import org.richfaces.cdk.model.BeanModelBase;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.DescriptionGroup;
+import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.TagModel;
import org.richfaces.cdk.util.Strings;
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FragmentParser;
@@ -24,7 +28,6 @@
import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.MirroredTypesException;
import javax.lang.model.type.TypeMirror;
-
import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -32,7 +35,9 @@
public abstract class ProcessorBase {
private static final String TAG_HANDLER_DEFULT_CLASS = Tag.DEFAULT.class.getName().replace('$', '.');
-
+
+ private static final String SIGNATURE_NONE_CLASS_NAME = Signature.NONE.class.getName().replace('$', '.');
+
@Inject
private ComponentLibrary library;
@@ -114,7 +119,7 @@
// JavaDoc comments
component.setDescription(description);
- if (null != icon ) {
+ if (null != icon) {
setIcon(component, icon);
}
@@ -154,11 +159,6 @@
// Process XML files with standard attributes definitions.
- for (String attributesConfig : getAnnotationAttributes(componentElement)) {
- // process additional properties.
- component.getAttributes().addAll(parseProperties(attributesConfig));
- }
-
SourceUtils sourceUtils = getSourceUtils();
sourceUtils.visitSupertypes(asClassDesctiption(componentElement), new SuperTypeVisitor() {
@@ -172,9 +172,11 @@
}
}
});
-
- Set<BeanProperty> properties = sourceUtils.getBeanPropertiesAnnotatedWith(Attribute.class, asClassDesctiption(componentElement));
-
+
+ ClassName componentClassName = asClassDesctiption(componentElement);
+ Set<BeanProperty> properties = sourceUtils.getBeanPropertiesAnnotatedWith(Attribute.class, componentClassName);
+ properties.addAll(sourceUtils.getAbstractBeanProperties(componentClassName));
+
// TODO - encapsulate attribute builder into utility class.
for (BeanProperty beanProperty : properties) {
@@ -185,40 +187,59 @@
}
private void processAttribute(BeanProperty beanProperty, Property attribute) {
- // Flags
+ attribute.setType(beanProperty.getType());
+
Attribute attributeAnnotarion = beanProperty.getAnnotation(Attribute.class);
if (attributeAnnotarion == null) {
- return;
+ attribute.setGenerate(!beanProperty.isExists());
+ setDescription(attribute, null, beanProperty.getDocComment(), null);
+
+ } else {
+ attribute.setHidden(attributeAnnotarion.hidden());
+ attribute.setLiteral(attributeAnnotarion.literal());
+ attribute.setPassThrough(attributeAnnotarion.passThrough());
+ attribute.setRequired(attributeAnnotarion.required());
+ attribute.setReadOnly(attributeAnnotarion.readOnly());
+ attribute.setGenerate(attributeAnnotarion.generate() || !beanProperty.isExists());
+
+ setDescription(attribute, attributeAnnotarion.icon(), beanProperty.getDocComment(), attributeAnnotarion.displayName());
+
+ // DefaultValues
+ String defaultValue = attributeAnnotarion.defaultValue();
+ if (!Strings.isEmpty(defaultValue)) {
+ attribute.setDefaultValue(defaultValue);
+ }
+
+ String suggestedValue = attributeAnnotarion.suggestedValue();
+ if (!Strings.isEmpty(suggestedValue)) {
+ attribute.setSuggestedValue(suggestedValue);
+ }
+
+ // MethodExpression call signature.
+ attribute.setSignature(getSignature(attributeAnnotarion.signature()));
+
+ for (EventName event : attributeAnnotarion.events()) {
+ setBehaviorEvent(attribute, event);
+ }
}
-
- attribute.setHidden(attributeAnnotarion.hidden());
- attribute.setLiteral(attributeAnnotarion.literal());
- attribute.setPassThrough(attributeAnnotarion.passThrough());
- attribute.setRequired(attributeAnnotarion.required());
- attribute.setReadOnly(attributeAnnotarion.readOnly());
- attribute.setGenerate(attributeAnnotarion.generate()|| !beanProperty.isExists());
-
- setDescription(attribute, attributeAnnotarion.icon(), beanProperty.getDocComment(), attributeAnnotarion.displayName());
-
- // type.
- attribute.setType(beanProperty.getType());
-
- // DefaultValues
- String defaultValue = attributeAnnotarion.defaultValue();
- if (!Strings.isEmpty(defaultValue)) {
- attribute.setDefaultValue(defaultValue);
+ }
+
+ private List<ClassName> getSignature(Signature signature) {
+ if (signature == null) {
+ return null;
}
-
- String suggestedValue = attributeAnnotarion.suggestedValue();
- if (!Strings.isEmpty(suggestedValue)) {
- attribute.setSuggestedValue(suggestedValue);
+
+ String returnType;
+ try {
+ returnType = signature.returnType().getName();
+ } catch (MirroredTypeException e) {
+ TypeMirror returnTypeMirror = e.getTypeMirror();
+ returnType = returnTypeMirror.toString();
}
-
- // MethodExpression call signature.
- Signature signature = attributeAnnotarion.signature();
- if (null != signature && signature.returnType() != Signature.NONE.class) {
+
+ if (signature != null && SIGNATURE_NONE_CLASS_NAME.equals(returnType)) {
List<ClassName> parameters = Lists.newArrayList();
-
+
try {
for (Class<?> parameterType : signature.parameters()) {
parameters.add(new ClassName(parameterType.getName()));
@@ -231,14 +252,13 @@
parameters.add(new ClassName(parameterType.toString()));
}
}
-
+
+ return parameters;
// signature parameters always should be replaced.
- attribute.setSignature(parameters);
// TODO - set method return type.
}
- for(EventName event : attributeAnnotarion.events()){
- setBehaviorEvent(attribute, event);
- }
+
+ return null;
}
private void setBehaviorEvent(Property attribute, EventName eventName) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java 2010-03-18 14:29:31 UTC (rev 16596)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ReflectionUtils.java 2010-03-18 14:38:25 UTC (rev 16597)
@@ -23,11 +23,11 @@
package org.richfaces.cdk.apt;
+import org.richfaces.cdk.model.ClassName;
+
import java.lang.annotation.Annotation;
import java.util.Set;
-import org.richfaces.cdk.model.ClassName;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -45,6 +45,12 @@
return null;
}
+ @Override
+ public Set<BeanProperty> getAbstractBeanProperties(ClassName type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.cdk.apt.SourceUtils#getConstant(org.richfaces.cdk.model.ClassName, java.lang.String)
*/
14 years, 7 months
JBoss Rich Faces SVN: r16596 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:29:31 -0400 (Thu, 18 Mar 2010)
New Revision: 16596
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkAnnotationProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptSourceUtils.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -1,8 +1,9 @@
package org.richfaces.cdk.apt;
-import java.lang.annotation.Annotation;
-import java.util.List;
-import java.util.Set;
+import com.google.common.collect.Sets;
+import org.richfaces.cdk.model.ClassName;
+import org.richfaces.cdk.model.InvalidNameException;
+import org.richfaces.cdk.util.PropertyUtils;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.Element;
@@ -14,13 +15,10 @@
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
+import java.lang.annotation.Annotation;
+import java.util.List;
+import java.util.Set;
-import org.richfaces.cdk.model.ClassName;
-import org.richfaces.cdk.model.InvalidNameException;
-import org.richfaces.cdk.util.PropertyUtils;
-
-import com.google.common.collect.Sets;
-
public class AptSourceUtils implements SourceUtils {
@@ -53,15 +51,16 @@
// Get all methods and fields annotated by annotation.
for (Element childElement : members) {
boolean annotated = (null != childElement.getAnnotation(annotation));
+ if (!annotated) {
+ continue;
+ }
// Have an annotation, infer property name.
if (ElementKind.METHOD.equals(childElement.getKind())) {
processMethod(properties, childElement, annotated);
} else if (ElementKind.FIELD.equals(childElement.getKind())) {
- if (annotated) {
- processFiled(properties, childElement);
- }
- }
+ processFiled(properties, childElement);
+ }
// TODO - merge properties with same name ?
}
@@ -69,6 +68,21 @@
return properties;
}
+ public Set<BeanProperty> getAbstractBeanProperties(ClassName type) {
+ Set<BeanProperty> properties = Sets.newHashSet();
+ List<? extends Element> members = this.processingEnv.getElementUtils().getAllMembers(asTypeElement(type));
+
+ for (Element childElement : members) {
+ if (ElementKind.METHOD.equals(childElement.getKind())) {
+ processMethod(properties, childElement, false);
+ }
+
+ // TODO - merge properties with same name ?
+ }
+
+ return properties;
+ }
+
private void processFiled(Set<BeanProperty> properties, Element childElement) {
AptBeanProperty property = new AptBeanProperty(childElement.getSimpleName().toString());
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -25,12 +25,10 @@
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfBehavior;
-import org.richfaces.cdk.annotations.JsfConverter;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.FacesId;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.faces.view.facelets.BehaviorHandler;
import javax.lang.model.element.TypeElement;
import java.lang.annotation.Annotation;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkAnnotationProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkAnnotationProcessor.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkAnnotationProcessor.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -23,12 +23,11 @@
package org.richfaces.cdk.apt;
-import java.lang.annotation.Annotation;
+import org.richfaces.cdk.CdkProcessingException;
import javax.lang.model.element.TypeElement;
+import java.lang.annotation.Annotation;
-import org.richfaces.cdk.CdkProcessingException;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -23,8 +23,12 @@
package org.richfaces.cdk.apt;
-import java.util.Collections;
-import java.util.Set;
+import com.google.inject.Inject;
+import org.richfaces.cdk.CdkProcessingException;
+import org.richfaces.cdk.LibraryBuilder;
+import org.richfaces.cdk.Logger;
+import org.richfaces.cdk.ModelBuilder;
+import org.richfaces.cdk.ModelValidator;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.ProcessingEnvironment;
@@ -33,15 +37,9 @@
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
+import java.util.Collections;
+import java.util.Set;
-import org.richfaces.cdk.CdkProcessingException;
-import org.richfaces.cdk.LibraryBuilder;
-import org.richfaces.cdk.Logger;
-import org.richfaces.cdk.ModelBuilder;
-import org.richfaces.cdk.ModelValidator;
-
-import com.google.inject.Inject;
-
/**
* <p class="changed_added_4_0">
* Base class for all CDK Annotation processors. That class provides access to current CDK context and utility methods
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -25,21 +25,22 @@
package org.richfaces.cdk.apt;
-import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.annotations.*;
-import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.Event;
+import org.richfaces.cdk.annotations.Facet;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
-import org.richfaces.cdk.apt.SourceUtils.SuperTypeVisitor;
-import org.richfaces.cdk.model.*;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ComponentModel;
+import org.richfaces.cdk.model.FacesId;
+import org.richfaces.cdk.model.FacetModel;
import org.richfaces.cdk.util.Strings;
-import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.faces.event.FacesEvent;
-import javax.faces.view.facelets.ComponentHandler;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.MirroredTypeException;
import javax.lang.model.type.MirroredTypesException;
@@ -113,22 +114,22 @@
facetModel.setDescription(beanProperty.getDocComment());
processFacet(facet, facetModel);
- if(!beanProperty.isExists()){
+ if (!beanProperty.isExists()) {
facetModel.setGenerate(true);
}
}
// @Facets annotation.
JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
- for (Facet facet : annotation.facets()) {
- if (!Strings.isEmpty(facet.name())) {
- FacetModel facetModel = component.getOrCreateFacet(facet.name());
- processFacet(facet, facetModel);
- } else {
- // TODO - record error.
- throw new CdkException("Facet name should be set");
- }
+ for (Facet facet : annotation.facets()) {
+ if (!Strings.isEmpty(facet.name())) {
+ FacetModel facetModel = component.getOrCreateFacet(facet.name());
+ processFacet(facet, facetModel);
+ } else {
+ // TODO - record error.
+ throw new CdkException("Facet name should be set");
}
+ }
}
private void processFacet(Facet facet, FacetModel facetModel) {
@@ -157,19 +158,19 @@
private void setEvents(TypeElement componentElement, ComponentModel component) {
Event[] fires = componentElement.getAnnotation(JsfComponent.class).fires();
- for (Event event : fires) {
- try {
- component.addEvent(event.value().getName());
- } catch (MirroredTypesException mirror) {
- for (TypeMirror eventType : mirror.getTypeMirrors()) {
- component.addEvent(eventType.toString());
- // TODO - check does component already implement eventSource interface
- }
- } catch (MirroredTypeException mirror) {
- component.addEvent(mirror.getTypeMirror().toString());
- }
+ for (Event event : fires) {
+ try {
+ component.addEvent(event.value().getName());
+ } catch (MirroredTypesException mirror) {
+ for (TypeMirror eventType : mirror.getTypeMirrors()) {
+ component.addEvent(eventType.toString());
+ // TODO - check does component already implement eventSource interface
+ }
+ } catch (MirroredTypeException mirror) {
+ component.addEvent(mirror.getTypeMirror().toString());
+ }
- }
+ }
}
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-03-18 14:27:54 UTC (rev 16595)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-03-18 14:29:31 UTC (rev 16596)
@@ -30,7 +30,6 @@
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.MirroredTypeException;
-import javax.faces.view.facelets.ConverterHandler;
import java.lang.annotation.Annotation;
/**
14 years, 7 months
JBoss Rich Faces SVN: r16595 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-03-18 10:27:54 -0400 (Thu, 18 Mar 2010)
New Revision: 16595
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
Log:
RF-8232 Tags support
remove visitor
fix checkstyle errors
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-03-18 02:02:07 UTC (rev 16594)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-03-18 14:27:54 UTC (rev 16595)
@@ -23,14 +23,13 @@
package org.richfaces.cdk.apt;
-import javax.annotation.processing.Processor;
-
-import org.richfaces.cdk.LibraryBuilder;
-
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
import com.google.inject.multibindings.Multibinder;
+import org.richfaces.cdk.LibraryBuilder;
+import javax.annotation.processing.Processor;
+
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
14 years, 7 months
JBoss Rich Faces SVN: r16594 - branches/community/3.3.X/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-03-17 22:02:07 -0400 (Wed, 17 Mar 2010)
New Revision: 16594
Modified:
branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_column.xml
Log:
Added var restriction to sortBy and filterBy descriptions (RF-8494)
Modified: branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_column.xml
===================================================================
--- branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_column.xml 2010-03-18 01:20:53 UTC (rev 16593)
+++ branches/community/3.3.X/docs/userguide/en/src/main/docbook/included/rich_column.xml 2010-03-18 02:02:07 UTC (rev 16594)
@@ -209,14 +209,7 @@
<title>Sorting and Filtering</title>
<section id="sort">
<title>Sorting</title>
- <para> In order to sort the columns you should use the <emphasis>
- <property>"sortBy"</property>
- </emphasis> attribute that indicates what values to be
- sorted. This attribute can be used only with the <emphasis role="bold">
- <property><rich:dataTable></property>
- </emphasis> component.
- In order to sort the column you should click on its
- header. See the following example. </para>
+ <para> In order to sort the columns you should use the <emphasis><property>"sortBy"</property></emphasis> attribute that indicates what values to be sorted. This attribute can be used only with the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component. Expressions in the <emphasis><property>"sortBy"</property></emphasis> attribute can refer only to the variable declared with the <emphasis><property>"var"</property></emphasis> attribute, not to those declared with other attributes such as the <emphasis><property>"rowKeyVar"</property></emphasis> attribute. In order to sort the column you should click on its header. See the following example. </para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
@@ -454,7 +447,7 @@
</emphasis> attribute at a column you want
to be filterable. This attribute defines
iterable object property which is used
- when filtering performed. </para>
+ when filtering performed. Expressions in the <emphasis><property>"filterBy"</property></emphasis> attribute can refer only to the variable declared with the <emphasis><property>"var"</property></emphasis> attribute, not to those declared with other attributes such as the <emphasis><property>"rowKeyVar"</property></emphasis> attribute.</para>
<para> The <emphasis>
<property>"filterValue"</property>
</emphasis> attribute is used to get or
14 years, 8 months
JBoss Rich Faces SVN: r16593 - in root/framework/trunk: api/src/main/java/org/richfaces/component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-03-17 21:20:53 -0400 (Wed, 17 Mar 2010)
New Revision: 16593
Added:
root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java
root/framework/trunk/api/src/main/java/org/richfaces/renderkit/
root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialRenderingVisitContext.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/SubcomponentIdsProxiedCollection.java
root/framework/trunk/impl/src/test/java/org/richfaces/component/visit/
root/framework/trunk/impl/src/test/java/org/richfaces/context/
root/framework/trunk/impl/src/test/java/org/richfaces/context/SubcomponentIdsProxiedCollectionTest.java
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java
root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
Log:
Partial updates for sub-component parts implemented in draft
Added: root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java (rev 0)
+++ root/framework/trunk/api/src/main/java/org/richfaces/component/PartiallyEncodedComponent.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface PartiallyEncodedComponent {
+
+ // TODO document this method
+ public void encodePartially(VisitContext context, VisitCallback callback,
+ Collection<String> subComponentIdentifiers) throws IOException;
+
+}
Added: root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java (rev 0)
+++ root/framework/trunk/api/src/main/java/org/richfaces/renderkit/PartialEncodingRenderer.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface PartialEncodingRenderer {
+
+ // TODO document this method
+ public void encodePartially(UIComponent component, VisitContext context, VisitCallback callback,
+ Collection<String> subComponentIdentifiers) throws IOException;
+}
Added: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialRenderingVisitContext.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialRenderingVisitContext.java (rev 0)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialRenderingVisitContext.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.context;
+
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitContextWrapper;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PartialRenderingVisitContext extends VisitContextWrapper {
+
+ private VisitContext wrappedVisitContext;
+
+ private SubcomponentIdsProxiedCollection proxiedIdsCollection;
+
+ public PartialRenderingVisitContext(VisitContext wrappedVisitContext) {
+ super();
+ this.wrappedVisitContext = wrappedVisitContext;
+ }
+
+ @Override
+ public SubcomponentIdsProxiedCollection getIdsToVisit() {
+ if (proxiedIdsCollection == null) {
+ proxiedIdsCollection = new SubcomponentIdsProxiedCollection(getWrapped().getIdsToVisit());
+ }
+
+ return proxiedIdsCollection;
+ }
+
+ @Override
+ public VisitContext getWrapped() {
+ return wrappedVisitContext;
+ }
+}
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java 2010-03-18 00:53:35 UTC (rev 16592)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextFactoryImpl.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -21,13 +21,14 @@
package org.richfaces.context;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialViewContext;
import javax.faces.context.PartialViewContextFactory;
-import java.util.Map;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+
/**
* @author Nick Belaevski
* @since 4.0
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-03-18 00:53:35 UTC (rev 16592)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/PartialViewContextImpl.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -21,13 +21,18 @@
*/
package org.richfaces.context;
-import org.ajax4jsf.component.AjaxOutput;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
import static org.ajax4jsf.renderkit.AjaxRendererUtils.ALL;
-import org.richfaces.log.RichfacesLogger;
-import org.slf4j.Logger;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.component.visit.VisitCallback;
@@ -40,16 +45,14 @@
import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.PhaseId;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
+import org.ajax4jsf.component.AjaxOutput;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.richfaces.component.PartiallyEncodedComponent;
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
/**
* @author Nick Belaevski
* @since 4.0
@@ -310,8 +313,20 @@
// is visited. Note that we use the SKIP_UNRENDERED hint as we
// only want to visit the rendered subtree.
EnumSet<VisitHint> hints = EnumSet.of(VisitHint.SKIP_UNRENDERED);
- VisitContext visitContext = VisitContext.createVisitContext(facesContext, phaseClientIds, hints);
- PhaseAwareVisitCallback visitCallback = new PhaseAwareVisitCallback(facesContext, phaseId);
+
+ VisitCallback visitCallback;
+ VisitContext visitContext = VisitContext.createVisitContext(facesContext, Collections.<String>emptySet(),
+ hints);
+
+ if (PhaseId.RENDER_RESPONSE.equals(phaseId)) {
+ PartialRenderingVisitContext partialRenderingVisitContext = new PartialRenderingVisitContext(visitContext);
+ visitCallback = new RenderVisitCallback(facesContext, partialRenderingVisitContext.getIdsToVisit());
+ visitContext = partialRenderingVisitContext;
+ } else {
+ visitCallback = new PhaseAwareExecuteVisitCallback(facesContext, phaseId);
+ }
+
+ visitContext.getIdsToVisit().addAll(phaseClientIds);
component.visitTree(visitContext, visitCallback);
}
@@ -334,19 +349,19 @@
}
private void renderState(FacesContext context) throws IOException {
-
- // Get the view state and write it to the response..
- PartialResponseWriter writer = getPartialResponseWriter();
- writer.startUpdate(PartialResponseWriter.VIEW_STATE_MARKER);
- String state = context.getApplication().getStateManager().getViewState(context);
- writer.write(state);
- writer.endUpdate();
-
+ if (!context.getViewRoot().isTransient()) {
+ // Get the view state and write it to the response..
+ PartialResponseWriter writer = getPartialResponseWriter();
+ writer.startUpdate(PartialResponseWriter.VIEW_STATE_MARKER);
+ String state = context.getApplication().getStateManager().getViewState(context);
+ writer.write(state);
+ writer.endUpdate();
+ }
}
/*
* (non-Javadoc)
- *
+ *
* @see javax.faces.context.PartialViewContext#release()
*/
@Override
@@ -422,52 +437,94 @@
facesContext.setResponseWriter(orig);
}
- private static final class PhaseAwareVisitCallback implements VisitCallback {
+ private static final class PhaseAwareExecuteVisitCallback implements VisitCallback {
private PhaseId curPhase;
private FacesContext ctx;
- private PhaseAwareVisitCallback(FacesContext ctx, PhaseId curPhase) {
+ private PhaseAwareExecuteVisitCallback(FacesContext ctx, PhaseId curPhase) {
this.ctx = ctx;
this.curPhase = curPhase;
}
public VisitResult visit(VisitContext context, UIComponent comp) {
- try {
- if (curPhase == PhaseId.APPLY_REQUEST_VALUES) {
+ if (curPhase == PhaseId.APPLY_REQUEST_VALUES) {
- // RELEASE_PENDING handle immediate request(s)
- // If the user requested an immediate request
- // Make sure to set the immediate flag here.
+ // RELEASE_PENDING handle immediate request(s)
+ // If the user requested an immediate request
+ // Make sure to set the immediate flag here.
- comp.processDecodes(ctx);
- } else if (curPhase == PhaseId.PROCESS_VALIDATIONS) {
- comp.processValidators(ctx);
- } else if (curPhase == PhaseId.UPDATE_MODEL_VALUES) {
- comp.processUpdates(ctx);
- } else if (curPhase == PhaseId.RENDER_RESPONSE) {
+ comp.processDecodes(ctx);
+ } else if (curPhase == PhaseId.PROCESS_VALIDATIONS) {
+ comp.processValidators(ctx);
+ } else if (curPhase == PhaseId.UPDATE_MODEL_VALUES) {
+ comp.processUpdates(ctx);
+ } else {
+ throw new IllegalStateException("I18N: Unexpected "
+ + "PhaseId passed to PhaseAwareContextCallback: " + curPhase.toString());
+ }
- PartialResponseWriter writer = ctx.getPartialViewContext().getPartialResponseWriter();
+ // Once we visit a component, there is no need to visit
+ // its children, since processDecodes/Validators/Updates and
+ // encodeAll() already traverse the subtree. We return
+ // VisitResult.REJECT to supress the subtree visit.
+ return VisitResult.REJECT;
+ }
- writer.startUpdate(comp.getClientId(ctx));
- try {
- // do the default behavior...
- comp.encodeAll(ctx);
- } catch (Exception ce) {
- if (LOG.isErrorEnabled()) {
- LOG.error(ce.getMessage());
+ }
+
+ private static final class RenderVisitCallback implements VisitCallback {
+
+ private FacesContext ctx;
+
+ private SubcomponentIdsProxiedCollection proxiedIdsCollection;
+
+ private RenderVisitCallback(FacesContext ctx, SubcomponentIdsProxiedCollection proxiedIdsCollection) {
+ this.ctx = ctx;
+ this.proxiedIdsCollection = proxiedIdsCollection;
+ }
+
+ private void logException(Exception e) {
+ if (LOG.isErrorEnabled()) {
+ LOG.error(e.getMessage());
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(e.getMessage(), e);
+ }
+ }
+
+ private void encodeUpdateForWholeComponent(UIComponent comp) throws IOException {
+ PartialResponseWriter writer = ctx.getPartialViewContext().getPartialResponseWriter();
+
+ writer.startUpdate(comp.getClientId(ctx));
+ try {
+ // do the default behavior...
+ comp.encodeAll(ctx);
+ } catch (Exception ce) {
+ logException(ce);
+ }
+ writer.endUpdate();
+ }
+
+ public VisitResult visit(VisitContext context, UIComponent comp) {
+ try {
+ Collection<String> subComponentIds = proxiedIdsCollection.getSubComponentIds(comp.getClientId(ctx));
+ if (subComponentIds != null && !subComponentIds.isEmpty()) {
+ if (comp instanceof PartiallyEncodedComponent) {
+ PartiallyEncodedComponent partiallyEncodedComponent = (PartiallyEncodedComponent) comp;
+ try {
+ partiallyEncodedComponent.encodePartially(context, this, subComponentIds);
+ } catch (Exception e) {
+ logException(e);
}
- if (LOG.isDebugEnabled()) {
- LOG.debug(ce.getMessage(), ce);
- }
+ } else {
+ encodeUpdateForWholeComponent(comp);
}
- writer.endUpdate();
} else {
- throw new IllegalStateException("I18N: Unexpected "
- + "PhaseId passed to PhaseAwareContextCallback: " + curPhase.toString());
+ encodeUpdateForWholeComponent(comp);
}
} catch (IOException ex) {
- ex.printStackTrace();
+ LOG.error(ex.getMessage(), ex);
}
// Once we visit a component, there is no need to visit
Added: root/framework/trunk/impl/src/main/java/org/richfaces/context/SubcomponentIdsProxiedCollection.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/context/SubcomponentIdsProxiedCollection.java (rev 0)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/context/SubcomponentIdsProxiedCollection.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.context;
+
+import java.util.AbstractCollection;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+class SubcomponentIdsProxiedCollection extends AbstractCollection<String> {
+
+ private static final char METADATA_CHAR = '@';
+
+ private static final Collection<String> WHOLE_COMPONENT = Collections
+ .unmodifiableCollection(new HashSet<String>(0));
+
+ private Collection<String> clientdIdsCollection;
+
+ private Map<String, Collection<String>> subIdsMap = new HashMap<String, Collection<String>>();
+
+ public SubcomponentIdsProxiedCollection(Collection<String> idsCollection) {
+ super();
+ this.clientdIdsCollection = idsCollection;
+ }
+
+ private int getMetadataCharPosition(String s) {
+ int idx = s.indexOf(METADATA_CHAR);
+
+ // check for (idx == 0): if "s" starts with metadata char, then we consider it's JSF-predefined id like "@all"
+ if (idx <= 0) {
+ idx = s.length();
+ }
+
+ return idx;
+ }
+
+ private String getClientId(String s, int metadataCharPosition) {
+ return s.substring(0, metadataCharPosition);
+ }
+
+ private String getSubComponentId(String s, int metadataCharPosition) {
+ if (s.length() != metadataCharPosition) {
+ return s.substring(metadataCharPosition + 1);
+ } else {
+ return null;
+ }
+ }
+
+ private boolean addSubComponentId(String clientId, String subComponentId) {
+ boolean result = clientdIdsCollection.add(clientId);
+
+ if (subComponentId != null) {
+ Collection<String> subIdsSet = subIdsMap.get(clientId);
+ if (subIdsSet == null) {
+ subIdsSet = new HashSet<String>();
+ subIdsMap.put(clientId, subIdsSet);
+ }
+
+ if (subIdsSet != WHOLE_COMPONENT) {
+ result = subIdsSet.add(subComponentId);
+ }
+ } else {
+ result = (subIdsMap.put(clientId, WHOLE_COMPONENT) != WHOLE_COMPONENT);
+ }
+
+ return result;
+ }
+
+ private boolean removeSubComponentId(String clientId, String subComponentId) {
+ boolean result = false;
+
+ if (subComponentId != null) {
+ Collection<String> subIdsSet = subIdsMap.get(clientId);
+ if (subIdsSet != null) {
+ result = subIdsSet.remove(subComponentId);
+ if (subIdsSet.isEmpty()) {
+ subIdsMap.remove(clientId);
+ clientdIdsCollection.remove(clientId);
+ }
+ }
+ } else {
+ subIdsMap.remove(clientId);
+ result = clientdIdsCollection.remove(clientId);
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean add(String e) {
+ int charPosition = getMetadataCharPosition(e);
+ String clientId = getClientId(e, charPosition);
+ String subComponentId = getSubComponentId(e, charPosition);
+
+ return addSubComponentId(clientId, subComponentId);
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ if (!(o instanceof String)) {
+ return false;
+ }
+
+ String e = (String) o;
+ int charPosition = getMetadataCharPosition(e);
+ String clientId = getClientId(e, charPosition);
+ String subComponentId = getSubComponentId(e, charPosition);
+
+ return removeSubComponentId(clientId, subComponentId);
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ if (!(o instanceof String)) {
+ return false;
+ }
+
+ String e = (String) o;
+ int charPosition = getMetadataCharPosition(e);
+ String clientId = getClientId(e, charPosition);
+ String subComponentId = getSubComponentId(e, charPosition);
+
+ if (subComponentId != null) {
+ Collection<String> subIdsSet = subIdsMap.get(clientId);
+ return (subIdsSet != null && subIdsSet != WHOLE_COMPONENT && subIdsSet.contains(subComponentId));
+ } else {
+ return clientdIdsCollection.contains(clientId);
+ }
+ }
+
+ @Override
+ public Iterator<String> iterator() {
+ return new Iterator<String>() {
+
+ private Iterator<String> delegateIterator = clientdIdsCollection.iterator();
+
+ private String nextElement = null;
+
+ public boolean hasNext() {
+ return delegateIterator.hasNext();
+ }
+
+ public String next() {
+ nextElement = delegateIterator.next();
+ return nextElement;
+ }
+
+ public void remove() {
+ delegateIterator.remove();
+ subIdsMap.remove(nextElement);
+ nextElement = null;
+ }
+ };
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return clientdIdsCollection.isEmpty();
+ }
+
+ @Override
+ public int size() {
+ return clientdIdsCollection.size();
+ }
+
+ @Override
+ public void clear() {
+ clientdIdsCollection.clear();
+ subIdsMap.clear();
+ }
+
+ public Collection<String> getSubComponentIds(String clientId) {
+ Collection<String> subIds = subIdsMap.get(clientId);
+ if (subIds != WHOLE_COMPONENT) {
+ return subIds;
+ }
+
+ return null;
+ }
+
+}
Added: root/framework/trunk/impl/src/test/java/org/richfaces/context/SubcomponentIdsProxiedCollectionTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/richfaces/context/SubcomponentIdsProxiedCollectionTest.java (rev 0)
+++ root/framework/trunk/impl/src/test/java/org/richfaces/context/SubcomponentIdsProxiedCollectionTest.java 2010-03-18 01:20:53 UTC (rev 16593)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.context;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class SubcomponentIdsProxiedCollectionTest {
+
+ private Collection<String> delegateCollection;
+
+ private SubcomponentIdsProxiedCollection proxiedIdsCollection;
+
+ @Before
+ public void setUp() throws Exception {
+ delegateCollection = new LinkedHashSet<String>();
+ proxiedIdsCollection = new SubcomponentIdsProxiedCollection(delegateCollection);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ delegateCollection = null;
+ proxiedIdsCollection = null;
+ }
+
+ @Test
+ public void testAddClientId() throws Exception {
+ assertTrue(proxiedIdsCollection.add("form"));
+ assertFalse(proxiedIdsCollection.add("form"));
+
+ assertTrue(delegateCollection.contains("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+
+ assertTrue(proxiedIdsCollection.add("form:table"));
+ assertFalse(proxiedIdsCollection.add("form:table"));
+
+ assertTrue(delegateCollection.contains("form"));
+ assertTrue(delegateCollection.contains("form:table"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+
+ assertTrue(proxiedIdsCollection.add("form:grid@body"));
+ assertFalse(proxiedIdsCollection.add("form:grid@body"));
+
+ assertTrue(delegateCollection.contains("form"));
+ assertTrue(delegateCollection.contains("form:table"));
+ assertTrue(delegateCollection.contains("form:grid"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+ assertNotNull(proxiedIdsCollection.getSubComponentIds("form:grid"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:grid").contains("body"));
+
+ assertTrue(proxiedIdsCollection.add("form:grid@header"));
+ assertFalse(proxiedIdsCollection.add("form:grid@header"));
+
+ assertTrue(delegateCollection.contains("form"));
+ assertTrue(delegateCollection.contains("form:table"));
+ assertTrue(delegateCollection.contains("form:grid"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+ assertNotNull(proxiedIdsCollection.getSubComponentIds("form:grid"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:grid").contains("body"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:grid").contains("header"));
+
+ assertTrue(proxiedIdsCollection.add("form:grid"));
+ assertFalse(proxiedIdsCollection.add("form:grid"));
+ assertTrue(delegateCollection.contains("form"));
+ assertTrue(delegateCollection.contains("form:table"));
+ assertTrue(delegateCollection.contains("form:grid"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:grid"));
+ }
+
+ @Test
+ public void testRemove() throws Exception {
+ proxiedIdsCollection.add("form");
+ proxiedIdsCollection.add("form:table");
+ proxiedIdsCollection.add("form:grid@body");
+ proxiedIdsCollection.add("form:tab@label");
+ proxiedIdsCollection.add("form:tab@content");
+
+ assertTrue(delegateCollection.contains("form"));
+ assertTrue(delegateCollection.contains("form:table"));
+ assertTrue(delegateCollection.contains("form:grid"));
+ assertTrue(delegateCollection.contains("form:tab"));
+ assertNotNull(proxiedIdsCollection.getSubComponentIds("form:grid"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:grid").contains("body"));
+ assertNotNull(proxiedIdsCollection.getSubComponentIds("form:tab"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:tab").contains("label"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:tab").contains("content"));
+
+ assertTrue(proxiedIdsCollection.remove("form"));
+ assertFalse(delegateCollection.contains("form"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form"));
+ assertFalse(proxiedIdsCollection.remove("form"));
+
+ assertTrue(proxiedIdsCollection.remove("form:table"));
+ assertFalse(delegateCollection.contains("form:table"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+ assertFalse(proxiedIdsCollection.remove("form:table"));
+
+ assertTrue(proxiedIdsCollection.remove("form:grid"));
+ assertFalse(delegateCollection.contains("form:grid"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:grid"));
+ assertFalse(proxiedIdsCollection.remove("form:grid"));
+
+ assertTrue(proxiedIdsCollection.remove("form:tab@label"));
+ assertTrue(delegateCollection.contains("form:tab"));
+ assertNotNull(proxiedIdsCollection.getSubComponentIds("form:tab"));
+ assertTrue(proxiedIdsCollection.getSubComponentIds("form:tab").contains("content"));
+ assertFalse(proxiedIdsCollection.remove("form:tab@label"));
+
+ assertTrue(proxiedIdsCollection.remove("form:tab@content"));
+ assertFalse(delegateCollection.contains("form:tab"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:tab"));
+ assertFalse(proxiedIdsCollection.remove("form:tab@content"));
+ }
+
+ @Test
+ public void testIterator() throws Exception {
+ proxiedIdsCollection.add("form");
+ proxiedIdsCollection.add("form:table@footer");
+ proxiedIdsCollection.add("form:table@header");
+
+ Iterator<String> iterator = proxiedIdsCollection.iterator();
+ assertTrue(iterator.hasNext());
+ assertEquals("form", iterator.next());
+
+ assertTrue(iterator.hasNext());
+ assertEquals("form:table", iterator.next());
+ iterator.remove();
+
+ assertTrue(delegateCollection.contains("form"));
+ assertFalse(delegateCollection.contains("form:table"));
+ assertNull(proxiedIdsCollection.getSubComponentIds("form:table"));
+ }
+}
14 years, 8 months
JBoss Rich Faces SVN: r16592 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk/apt and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-03-17 20:53:35 -0400 (Wed, 17 Mar 2010)
New Revision: 16592
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/FacesComponentProcessor.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Signature.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
Log:
CODING IN PROGRESS - issue RF-8523: Refactor CDK annotations
https://jira.jboss.org/jira/browse/RF-8523
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -78,6 +78,16 @@
boolean required() default false;
boolean generate() default true;
+
+ String displayName() default "";
+
+ String defaultValue() default "";
+
+ String suggestedValue() default "";
+
+ Icon icon() default @Icon();
Signature signature() default @Signature();
+
+ EventName[] events() default {};
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Event.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -29,6 +29,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import javax.faces.event.FacesEvent;
+
/**
* <p class="changed_added_4_0">
* This annotation tells CDK to generate event-related classes:
@@ -49,6 +51,11 @@
public static final String NAME = "org.richfaces.cdk.annotations.Event";
/**
+ * <p class="changed_added_4_0"></p>
+ * @return
+ */
+ public Class<? extends FacesEvent> value();
+ /**
* <p class="changed_added_4_0">
* Name of the listener interface class.
* </p>
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Facet.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -49,6 +49,12 @@
*
* @return
*/
- String value() default "";
+ String name() default "";
+
+ boolean generate() default true;
+
+ Icon icon() default @Icon;
+
+ String displayName() default "";
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfBehavior.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -50,7 +50,40 @@
*/
public String id() default "";
- public String behaviorClass() default "";
+ public String generate() default "";
public Tag tag() default @Tag;
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Icon used by IDE.
+ * </p>
+ *
+ * @return
+ */
+ public Icon icon() default @Icon();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Display name for development tools.
+ * </p>
+ *
+ * @return
+ */
+ public String displayName() default "";
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * defines fragments of faces-config.xml that contain standard attribute definitions. CDK also tries to read
+ * META-INF/cdk/attributes/[classname].xml file for all component superclasses and interfaces, therefore it is not
+ * necessary to explicit include definitions for UIComponent and any other standard JSF classes. CDK defines couple
+ * of its own "urn" namespaces: "urn:resource:" for classpath resources, "urn:config:" for for project configuration
+ * folder and "urn:attributes:" for META-INF/cdk/attributes/ in the annotations library.
+ * </p>
+ *
+ * @return
+ */
+ public String[] attributes() default {};
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfComponent.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -51,6 +51,10 @@
public static final String NAME = "org.richfaces.cdk.annotations.JsfComponent";
/**
+ * <p class="changed_added_4_0">Excplicitly disable component generation</p>
+ */
+ public static final String DISABLED = "##DISABLED";
+ /**
* <p class="changed_added_4_0">
* Type of the component. This is mandatory parameter because CDK uses <em>component-type</em> as primary key for
* components library model.
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -42,9 +42,44 @@
public String id() default "";
- public Class<?> forClass() default Object.class;
+ public Class<?> forClass() default NONE.class;
- public String converterClass() default "";
+ public String generate() default "";
+
+ /**
+ * <p class="changed_added_4_0">
+ * Icon used by IDE.
+ * </p>
+ *
+ * @return
+ */
+ public Icon icon() default @Icon();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Display name for development tools.
+ * </p>
+ *
+ * @return
+ */
+ public String displayName() default "";
+
public Tag tag() default @Tag;
+
+ public static final class NONE {}
+
+ /**
+ * <p class="changed_added_4_0">
+ * defines fragments of faces-config.xml that contain standard attribute definitions. CDK also tries to read
+ * META-INF/cdk/attributes/[classname].xml file for all component superclasses and interfaces, therefore it is not
+ * necessary to explicit include definitions for UIComponent and any other standard JSF classes. CDK defines couple
+ * of its own "urn" namespaces: "urn:resource:" for classpath resources, "urn:config:" for for project configuration
+ * folder and "urn:attributes:" for META-INF/cdk/attributes/ in the annotations library.
+ * </p>
+ *
+ * @return
+ */
+ public String[] attributes() default {};
+
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfValidator.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -15,9 +15,40 @@
public static final String NAME = "org.richfaces.cdk.annotations.JsfValidator";
- public String id() default "";
+ public String id();
- public String validatorClass() default "";
+ public String generate() default "";
public Tag tag() default @Tag;
+ /**
+ * <p class="changed_added_4_0">
+ * Icon used by IDE.
+ * </p>
+ *
+ * @return
+ */
+ public Icon icon() default @Icon();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Display name for development tools.
+ * </p>
+ *
+ * @return
+ */
+ public String displayName() default "";
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * defines fragments of faces-config.xml that contain standard attribute definitions. CDK also tries to read
+ * META-INF/cdk/attributes/[classname].xml file for all component superclasses and interfaces, therefore it is not
+ * necessary to explicit include definitions for UIComponent and any other standard JSF classes. CDK defines couple
+ * of its own "urn" namespaces: "urn:resource:" for classpath resources, "urn:config:" for for project configuration
+ * folder and "urn:attributes:" for META-INF/cdk/attributes/ in the annotations library.
+ * </p>
+ *
+ * @return
+ */
+ public String[] attributes() default {};
}
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Signature.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Signature.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Signature.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -40,7 +40,7 @@
*
* @return
*/
- public Class<?> returnType() default Object.class;
+ public Class<?> returnType() default NONE.class;
/**
* <p class="changed_added_4_0">
@@ -50,4 +50,6 @@
* @return
*/
public Class<?>[] parameters() default {};
+
+ public static final class NONE {}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptModule.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -45,7 +45,6 @@
protected void configure() {
Multibinder<CdkAnnotationProcessor> setBinder = Multibinder.newSetBinder(binder(),CdkAnnotationProcessor.class);
setBinder.addBinding().to(ComponentProcessor.class);
- setBinder.addBinding().to(FacesComponentProcessor.class);
setBinder.addBinding().to(BehaviorProcessor.class);
setBinder.addBinding().to(RendererProcessor.class);
setBinder.addBinding().to(ConverterProcessor.class);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/BehaviorProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -25,6 +25,7 @@
import org.richfaces.cdk.CdkProcessingException;
import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.JsfConverter;
import org.richfaces.cdk.model.BehaviorModel;
import org.richfaces.cdk.model.FacesId;
@@ -49,9 +50,9 @@
setClassNames(element, behaviorModel, behavior);
setTagInfo(behavior.tag(), behaviorModel);
+ processAttributes(element, behaviorModel);
+ setDescription(behaviorModel, behavior.icon(), getDocComment(element), behavior.displayName());
- setDescription(element, behaviorModel);
-
getLibrary().getBehaviors().add(behaviorModel);
}
@@ -62,11 +63,14 @@
public void setClassNames(TypeElement element, BehaviorModel behaviorModel, JsfBehavior behavior) {
String baseClass = element.getQualifiedName().toString();
- setClassNames(element, behaviorModel, behavior.behaviorClass(), baseClass);
+ setClassNames(element, behaviorModel, behavior.generate(), baseClass);
}
+
@Override
- protected String getDafaultParentTagHandlerClass() {
- return BehaviorHandler.class.getName();
+ protected String[] getAnnotationAttributes(TypeElement element) {
+ JsfBehavior behavior = element.getAnnotation(JsfBehavior.class);
+ return behavior.attributes();
}
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -45,7 +45,6 @@
import javax.lang.model.type.MirroredTypesException;
import javax.lang.model.type.TypeMirror;
import java.lang.annotation.Annotation;
-import java.util.List;
import java.util.Set;
/**
@@ -63,44 +62,29 @@
private Injector injector;
public void process(TypeElement componentElement) {
- ComponentLibrary library = getLibrary();
- // Process class-level annotations.
- ComponentModel component = new ComponentModel();
- component.setType(new FacesId(getComponentType(componentElement)));
- // Should that component be generated ?
- setClassNames(componentElement, component);
- setComponentProperties(componentElement, component);
-
JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
if (null != annotation) {
- component.setGenerate(!"".equals(annotation.generate()));
+ ComponentLibrary library = getLibrary();
+ // Process class-level annotations.
+ ComponentModel component = new ComponentModel();
+ component.setType(FacesId.parseId(annotation.type()));
+ // Should that component be generated ?
+ String baseClass = componentElement.getQualifiedName().toString();
+ setClassNames(componentElement, component, annotation.generate(), baseClass);
+ setComponentProperties(componentElement, component, annotation);
for (Tag tag : annotation.tag()) {
setTagInfo(tag, component);
}
+ library.getComponents().add(component);
}
- library.getComponents().add(component);
}
- protected String getComponentType(TypeElement componentElement) {
- // Calculate type for base UI component class.
- JsfComponent componentAnnotation = componentElement.getAnnotation(JsfComponent.class);
- String explicitType = componentAnnotation.type();
-// if (!Strings.isEmpty(explicitType)) {
- return explicitType;
-// }
-
- // Because component type is a primary key for components collection,
- // we have to infer explicit value here.
-// String className = componentElement.getQualifiedName().toString();
-// return getNamingConventions().inferComponentType(new ClassName(className));
- }
-
- private void setComponentProperties(TypeElement componentElement, ComponentModel component)
+ private void setComponentProperties(TypeElement componentElement, ComponentModel component, JsfComponent annotation)
throws CdkException {
// JsfComponent family
setComponeneFamily(componentElement, component);
- setDescription(componentElement, component);
+ setDescription(component, annotation.icon(), getDocComment(componentElement), annotation.displayName());
processFacets(componentElement, component);
// process Events.
@@ -122,51 +106,44 @@
// TODO - encapsulate attribute builder into utility class.
for (BeanProperty beanProperty : properties) {
- FacetModel facet = component.getOrCreateFacet(beanProperty.getName());
+ Facet facet = beanProperty.getAnnotation(Facet.class);
+ FacetModel facetModel = component.getOrCreateFacet(beanProperty.getName());
// Documentation
- facet.setDescription(beanProperty.getDocComment());
+ facetModel.setDescription(beanProperty.getDocComment());
- Icon icon = beanProperty.getAnnotation(Icon.class);
-
- if (null != icon) {
- setIcon(facet, icon);
+ processFacet(facet, facetModel);
+ if(!beanProperty.isExists()){
+ facetModel.setGenerate(true);
}
-
- DisplayName displayName = beanProperty.getAnnotation(DisplayName.class);
-
- if (null != displayName) {
- facet.setDisplayname(displayName.value());
- }
-
- // Flags.
- facet.setGenerate(beanProperty.isExists());
}
// @Facets annotation.
- Facets facetsAnnotation = componentElement.getAnnotation(Facets.class);
-
- if (null != facetsAnnotation) {
- Facet[] facets = facetsAnnotation.value();
-
- for (Facet facet : facets) {
- if (!Strings.isEmpty(facet.value())) {
- component.getOrCreateFacet(facet.value());
+ JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
+ for (Facet facet : annotation.facets()) {
+ if (!Strings.isEmpty(facet.name())) {
+ FacetModel facetModel = component.getOrCreateFacet(facet.name());
+ processFacet(facet, facetModel);
} else {
-
// TODO - record error.
+ throw new CdkException("Facet name should be set");
}
}
- }
}
+ private void processFacet(Facet facet, FacetModel facetModel) {
+ setIcon(facetModel, facet.icon());
+ facetModel.setDisplayname(facet.displayName());
+ // Flags.
+ facetModel.setGenerate(facet.generate());
+ }
+
private void setComponeneFamily(TypeElement componentElement, ComponentModel component) {
- Family family = componentElement.getAnnotation(Family.class);
+ JsfComponent annotation = componentElement.getAnnotation(JsfComponent.class);
- if (null != family) {
-
+ if (!Strings.isEmpty(annotation.family())) {
// @Family annotation
- component.setFamily(family.value());
+ component.setFamily(annotation.family());
} else {
// static final COMPONENT_FAMILY string constant.
Object value = getSourceUtils().getConstant(asClassDesctiption(componentElement), "COMPONENT_FAMILY");
@@ -178,167 +155,30 @@
private void setEvents(TypeElement componentElement, ComponentModel component) {
- Fires fires = componentElement.getAnnotation(Fires.class);
+ Event[] fires = componentElement.getAnnotation(JsfComponent.class).fires();
- if (null != fires) {
- try {
- for (Class<? extends FacesEvent> eventClass : fires.value()) {
- component.addEvent(eventClass.getName());
- }
- } catch (MirroredTypesException mirror) {
- for (TypeMirror eventType : mirror.getTypeMirrors()) {
- component.addEvent(eventType.toString());
- // TODO - check does component already implement eventSource interface
- }
- } catch (MirroredTypeException mirror) {
- component.addEvent(mirror.getTypeMirror().toString());
- }
- }
- }
+ for (Event event : fires) {
+ try {
+ component.addEvent(event.value().getName());
+ } catch (MirroredTypesException mirror) {
+ for (TypeMirror eventType : mirror.getTypeMirrors()) {
+ component.addEvent(eventType.toString());
+ // TODO - check does component already implement eventSource interface
+ }
+ } catch (MirroredTypeException mirror) {
+ component.addEvent(mirror.getTypeMirror().toString());
+ }
- private void setClassNames(TypeElement componentElement, ComponentModel component) {
- Generate generate = componentElement.getAnnotation(Generate.class);
- String name = generate == null ? null : generate.value();
-
- String baseClass = componentElement.getQualifiedName().toString();
-
- setClassNames(componentElement, component, name, baseClass);
- }
-
- protected void processAttributes(TypeElement componentElement, final ComponentModel component)
- throws CdkException {
-
- // Process XML files with standard attributes definitions.
- Attributes attributes = componentElement.getAnnotation(Attributes.class);
-
- if (null != attributes) {
- for (String attributesConfig : attributes.value()) {
-
- // process additional properties.
- component.getAttributes().addAll(parseProperties(attributesConfig));
- }
- }
-
- SourceUtils sourceUtils = getSourceUtils();
- sourceUtils.visitSupertypes(asClassDesctiption(componentElement), new SuperTypeVisitor() {
-
- @Override
- public void visit(ClassName type) {
- try {
- component.getAttributes().addAll(
- parseProperties(CdkEntityResolver.URN_ATTRIBUTES + type.toString() + ".xml"));
- } catch (CdkException e) {
- // TODO - log errors ?
}
- }
- });
-
- Set<BeanProperty> properties = sourceUtils.getBeanPropertiesAnnotatedWith(Attribute.class, asClassDesctiption(componentElement));
-
- // TODO - encapsulate attribute builder into utility class.
- for (BeanProperty beanProperty : properties) {
- if (component.getAttribute(beanProperty.getName()) != null) {
- continue;
- }
-
- Property attribute = component.getOrCreateAttribute(beanProperty.getName());
-
- // Documentation
- attribute.setDescription(beanProperty.getDocComment());
-
- setDescription(componentElement, component);
-
- // type.
- attribute.setType(beanProperty.getType());
-
-
- setAttributePrams(beanProperty, attribute);
-
- // BehaviorModel events.
- EventName eventName = beanProperty.getAnnotation(EventName.class);
- setBehaviorEvent(attribute, eventName);
-
- EventNames eventNames = beanProperty.getAnnotation(EventNames.class);
- if (null != eventNames) {
- for (EventName eventNameInstance : eventNames.value()) {
- setBehaviorEvent(attribute, eventNameInstance);
- }
- }
-
- // DefaultValues
- DefaultValue defaultValue = beanProperty.getAnnotation(DefaultValue.class);
- if (null != defaultValue) {
- attribute.setDefaultValue(defaultValue.value());
- }
-
- SuggestedValue suggestedValue = beanProperty.getAnnotation(SuggestedValue.class);
- if (null != suggestedValue) {
- attribute.setSuggestedValue(suggestedValue.value());
- }
-
- // Flags.
- attribute.setGenerate(attribute.isGenerate()
- || !beanProperty.isExists()
- || null != beanProperty.getAnnotation(Generate.class));
- }
}
- private void setAttributePrams(BeanProperty beanProperty, Property attribute) {
- // Flags
- Attribute attributeAnnotarion = beanProperty.getAnnotation(Attribute.class);
- if (attributeAnnotarion == null) {
- return;
- }
-
- attribute.setHidden(attributeAnnotarion.hidden());
- attribute.setLiteral(attributeAnnotarion.literal());
- attribute.setPassThrough(attributeAnnotarion.passThrough());
- attribute.setRequired(attributeAnnotarion.required());
- attribute.setReadOnly(attributeAnnotarion.readOnly());
- attribute.setGenerate(attributeAnnotarion.generate());
-
- // MethodExpression call signature.
- Signature signature = attributeAnnotarion.signature();
- if (null != signature) {
- List<ClassName> parameters = Lists.newArrayList();
-
- try {
- for (Class<?> parameterType : signature.parameters()) {
- parameters.add(new ClassName(parameterType.getName()));
- }
- } catch (MirroredTypeException e) {
- TypeMirror parameterType = e.getTypeMirror();
- parameters.add(new ClassName(parameterType.toString()));
- } catch (MirroredTypesException e) {
- for (TypeMirror parameterType : e.getTypeMirrors()) {
- parameters.add(new ClassName(parameterType.toString()));
- }
- }
-
- // signature parameters always should be replaced.
- attribute.setSignature(parameters);
-
- // TODO - set method return type.
- }
+ @Override
+ protected String[] getAnnotationAttributes(TypeElement componentElement) {
+ return componentElement.getAnnotation(JsfComponent.class).attributes();
}
- private void setBehaviorEvent(Property attribute, EventName eventName) {
- if (null != eventName) {
- org.richfaces.cdk.model.EventName event = new org.richfaces.cdk.model.EventName();
-
- event.setName(eventName.value());
- event.setDefaultEvent(eventName.defaultEvent());
- attribute.getEventNames().add(event);
- }
- }
-
@Override
public Class<? extends Annotation> getProcessedAnnotation() {
return JsfComponent.class;
}
-
- @Override
- protected String getDafaultParentTagHandlerClass() {
- return ComponentHandler.class.getName();
- }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -48,12 +48,20 @@
converterModel.setId(FacesId.parseId(converter.id()));
try {
- converterModel.setConverterForClass(new ClassName(converter.forClass().getName()));
+ Class<?> forClass = converter.forClass();
+ if (!JsfConverter.NONE.class.equals(forClass)) {
+ converterModel.setConverterForClass(new ClassName(forClass.getName()));
+ }
} catch (MirroredTypeException e) {
- converterModel.setConverterForClass(new ClassName(e.getTypeMirror().toString()));
+ String name = e.getTypeMirror().toString();
+ if (!JsfConverter.NONE.class.getName().equals(name)) {
+ converterModel.setConverterForClass(new ClassName(name));
+ }
}
- setDescription(element, converterModel);
+ setDescription(converterModel, converter.icon(), getDocComment(element), converter.displayName());
+
+ processAttributes(element, converterModel);
setClassNames(element, converterModel, converter);
setTagInfo(converter.tag(), converterModel);
@@ -70,11 +78,12 @@
public void setClassNames(TypeElement componentElement, ConverterModel converterModel, JsfConverter converter) {
String baseClass = componentElement.getQualifiedName().toString();
- setClassNames(componentElement, converterModel, converter.converterClass(), baseClass);
+ setClassNames(componentElement, converterModel, converter.generate(), baseClass);
}
- @Override
- protected String getDafaultParentTagHandlerClass() {
- return ConverterHandler.class.getName();
+ protected String[] getAnnotationAttributes(TypeElement element) {
+ JsfConverter converter = element.getAnnotation(JsfConverter.class);
+
+ return converter.attributes();
}
}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/FacesComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/FacesComponentProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/FacesComponentProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.cdk.apt;
-
-import java.lang.annotation.Annotation;
-
-import javax.faces.component.FacesComponent;
-import javax.lang.model.element.TypeElement;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-public class FacesComponentProcessor extends ComponentProcessor {
-
- @Override
- protected String getComponentType(TypeElement componentElement) {
- FacesComponent facesComponent = componentElement.getAnnotation(FacesComponent.class);
- return facesComponent.value();
- }
- @Override
- public Class<? extends Annotation> getProcessedAnnotation() {
- return FacesComponent.class;
- }
-
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ProcessorBase.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -1,18 +1,33 @@
package org.richfaces.cdk.apt;
+import com.google.common.collect.Lists;
import com.google.inject.Inject;
import com.google.inject.Provider;
+
+import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.DisplayName;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.Icon;
+import org.richfaces.cdk.annotations.Signature;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
+import org.richfaces.cdk.apt.SourceUtils.SuperTypeVisitor;
import org.richfaces.cdk.model.*;
+import org.richfaces.cdk.util.Strings;
import org.richfaces.cdk.xmlconfig.CdkEntityResolver;
import org.richfaces.cdk.xmlconfig.FragmentParser;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.MirroredTypeException;
+import javax.lang.model.type.MirroredTypesException;
+import javax.lang.model.type.TypeMirror;
+
import java.util.Collection;
+import java.util.List;
+import java.util.Set;
public abstract class ProcessorBase {
@@ -57,9 +72,6 @@
protected void setTagInfo(Tag tag, ModelElementBase model) {
String name = tag.name();
-// if (Strings.isEmpty(name)) {
-// name = namingConventions.inferTagName(model.getGeneratedClass());
-// }
TagModel tagModel = new TagModel();
tagModel.setName(name);
@@ -71,9 +83,6 @@
model.setTag(tagModel);
}
- protected String getDafaultParentTagHandlerClass() {
- return null;
- }
/**
* <p class="changed_added_4_0"></p>
@@ -81,17 +90,19 @@
* @param icon
*/
protected void setIcon(DescriptionGroup component, Icon icon) {
- DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
-
- if (icon.small().length() > 0) {
- iconValue.setSmallIcon(icon.small());
+ if (!Strings.isEmpty(icon.small()) || !Strings.isEmpty(icon.large())) {
+ DescriptionGroup.Icon iconValue = new DescriptionGroup.Icon();
+
+ if (!Strings.isEmpty(icon.small())) {
+ iconValue.setSmallIcon(icon.small());
+ }
+
+ if (!Strings.isEmpty(icon.large())) {
+ iconValue.setLargeIcon(icon.large());
+ }
+ component.setIcon(iconValue);
+
}
-
- if (icon.large().length() > 0) {
- iconValue.setLargeIcon(icon.large());
- }
-
- component.setIcon(iconValue);
}
public ComponentLibrary getLibrary() {
@@ -99,33 +110,29 @@
}
-
- protected void setDescription(TypeElement element, DescriptionGroup component) {
+ protected void setDescription(DescriptionGroup component, Icon icon, String description, String displayName) {
// JavaDoc comments
- component.setDescription(getSourceUtils().getDocComment(asClassDesctiption(element)));
-
- Icon icon = element.getAnnotation(Icon.class);
-
- if (null != icon) {
+ component.setDescription(description);
+ if (null != icon ) {
setIcon(component, icon);
}
-
- DisplayName displayName = element.getAnnotation(DisplayName.class);
-
- if (null != displayName) {
- component.setDisplayname(displayName.value());
+
+ if (!Strings.isEmpty(displayName)) {
+ component.setDisplayname(displayName);
}
}
protected void setClassNames(TypeElement componentElement, ModelElementBase modelElement,
String generatedClass, String baseClass) {
- if (componentElement.getModifiers().contains(Modifier.ABSTRACT)) {
+ if (componentElement.getModifiers().contains(Modifier.ABSTRACT) || !Strings.isEmpty(generatedClass)) {
modelElement.setGenerate(true);
+ modelElement.setTargetClass(ClassName.parseName(generatedClass));
+ } else {
+ modelElement.setGenerate(false);
}
modelElement.setBaseClass(ClassName.parseName(baseClass));
- modelElement.setTargetClass(ClassName.parseName(generatedClass));
}
protected Collection<Property> parseProperties(String attributesConfig) {
@@ -135,4 +142,112 @@
protected ClassName asClassDesctiption(TypeElement componentElement) {
return new ClassName(componentElement.getQualifiedName().toString());
}
+
+ protected String getDocComment(TypeElement componentElement) {
+ return getSourceUtils().getDocComment(asClassDesctiption(componentElement));
+ }
+
+ protected abstract String[] getAnnotationAttributes(TypeElement componentElement);
+
+
+ protected void processAttributes(TypeElement componentElement, final BeanModelBase component) throws CdkException {
+
+ // Process XML files with standard attributes definitions.
+
+ for (String attributesConfig : getAnnotationAttributes(componentElement)) {
+ // process additional properties.
+ component.getAttributes().addAll(parseProperties(attributesConfig));
+ }
+
+ SourceUtils sourceUtils = getSourceUtils();
+ sourceUtils.visitSupertypes(asClassDesctiption(componentElement), new SuperTypeVisitor() {
+
+ @Override
+ public void visit(ClassName type) {
+ try {
+ component.getAttributes().addAll(
+ parseProperties(CdkEntityResolver.URN_ATTRIBUTES + type.toString() + ".xml"));
+ } catch (CdkException e) {
+ // TODO - log errors ?
+ }
+ }
+ });
+
+ Set<BeanProperty> properties = sourceUtils.getBeanPropertiesAnnotatedWith(Attribute.class, asClassDesctiption(componentElement));
+
+ // TODO - encapsulate attribute builder into utility class.
+ for (BeanProperty beanProperty : properties) {
+
+ Property attribute = component.getOrCreateAttribute(beanProperty.getName());
+
+ processAttribute(beanProperty, attribute);
+ }
+ }
+
+ private void processAttribute(BeanProperty beanProperty, Property attribute) {
+ // Flags
+ Attribute attributeAnnotarion = beanProperty.getAnnotation(Attribute.class);
+ if (attributeAnnotarion == null) {
+ return;
+ }
+
+ attribute.setHidden(attributeAnnotarion.hidden());
+ attribute.setLiteral(attributeAnnotarion.literal());
+ attribute.setPassThrough(attributeAnnotarion.passThrough());
+ attribute.setRequired(attributeAnnotarion.required());
+ attribute.setReadOnly(attributeAnnotarion.readOnly());
+ attribute.setGenerate(attributeAnnotarion.generate()|| !beanProperty.isExists());
+
+ setDescription(attribute, attributeAnnotarion.icon(), beanProperty.getDocComment(), attributeAnnotarion.displayName());
+
+ // type.
+ attribute.setType(beanProperty.getType());
+
+ // DefaultValues
+ String defaultValue = attributeAnnotarion.defaultValue();
+ if (!Strings.isEmpty(defaultValue)) {
+ attribute.setDefaultValue(defaultValue);
+ }
+
+ String suggestedValue = attributeAnnotarion.suggestedValue();
+ if (!Strings.isEmpty(suggestedValue)) {
+ attribute.setSuggestedValue(suggestedValue);
+ }
+
+ // MethodExpression call signature.
+ Signature signature = attributeAnnotarion.signature();
+ if (null != signature && signature.returnType() != Signature.NONE.class) {
+ List<ClassName> parameters = Lists.newArrayList();
+
+ try {
+ for (Class<?> parameterType : signature.parameters()) {
+ parameters.add(new ClassName(parameterType.getName()));
+ }
+ } catch (MirroredTypeException e) {
+ TypeMirror parameterType = e.getTypeMirror();
+ parameters.add(new ClassName(parameterType.toString()));
+ } catch (MirroredTypesException e) {
+ for (TypeMirror parameterType : e.getTypeMirrors()) {
+ parameters.add(new ClassName(parameterType.toString()));
+ }
+ }
+
+ // signature parameters always should be replaced.
+ attribute.setSignature(parameters);
+ // TODO - set method return type.
+ }
+ for(EventName event : attributeAnnotarion.events()){
+ setBehaviorEvent(attribute, event);
+ }
+ }
+
+ private void setBehaviorEvent(Property attribute, EventName eventName) {
+ if (null != eventName) {
+ org.richfaces.cdk.model.EventName event = new org.richfaces.cdk.model.EventName();
+
+ event.setName(eventName.value());
+ event.setDefaultEvent(eventName.defaultEvent());
+ attribute.getEventNames().add(event);
+ }
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/RendererProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -71,7 +71,7 @@
setRendererType(rendererModel, annotation);
setComponentFamily(rendererModel, annotation);
setTemplate(rendererModel, annotation);
- setDescription(rendererElement, rendererModel);
+ setDescription(rendererModel, annotation.icon(), getDocComment(rendererElement), annotation.displayName());
String renderKitId = annotation.renderKitId();
if (Strings.isEmpty(renderKitId)) {
@@ -152,37 +152,14 @@
}
-// private void setEvents(TypeElement componentElement, org.richfaces.cdk.model.Renderer component) {
-// Fires fires = componentElement.getAnnotation(Fires.class);
-//
-// if (null != fires) {
-// try {
-// for (Class<? extends FacesEvent> eventClass : fires.value()) {
-// component.addEvent(eventClass.getName());
-// }
-// } catch (MirroredTypesException mirror) {
-// for (TypeMirror eventType : mirror.getTypeMirrors()) {
-// component.addEvent(eventType.toString());
-// // TODO - check does component already implement eventSource interface
-// }
-// } catch (MirroredTypeException mirror) {
-// component.addEvent(mirror.getTypeMirror().toString());
-// }
-// }
-// }
- private void setBehaviorEvent(Property attribute, EventName eventName) {
- if (null != eventName) {
- org.richfaces.cdk.model.EventName event = new org.richfaces.cdk.model.EventName();
-
- event.setName(eventName.value());
- event.setDefaultEvent(eventName.defaultEvent());
- attribute.getEventNames().add(event);
- }
- }
-
@Override
public Class<? extends Annotation> getProcessedAnnotation() {
return JsfRenderer.class;
}
+
+ protected String[] getAnnotationAttributes(TypeElement componentElement) {
+ return null;
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ValidatorProcessor.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -44,7 +44,7 @@
ValidatorModel validatorModel = new ValidatorModel(FacesId.parseId((validator.id())));
setClassNames(element, validatorModel, validator);
- setDescription(element, validatorModel);
+ setDescription(validatorModel, validator.icon(), getDocComment(element), validator.displayName());
setTagInfo(validator.tag(), validatorModel);
@@ -59,11 +59,11 @@
public void setClassNames(TypeElement componentElement, ValidatorModel validatorModel,
JsfValidator validator) {
String baseClass = componentElement.getQualifiedName().toString();
- setClassNames(componentElement, validatorModel, validator.validatorClass(), baseClass);
+ setClassNames(componentElement, validatorModel, validator.generate(), baseClass);
}
- @Override
- protected String getDafaultParentTagHandlerClass() {
- return ValidatorHandler.class.getName();
+ protected String[] getAnnotationAttributes(TypeElement element) {
+ JsfValidator validator = element.getAnnotation(JsfValidator.class);
+ return validator.attributes();
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/FreeMarkerRenderer.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -25,18 +25,22 @@
package org.richfaces.cdk.freemarker;
-import com.google.inject.Inject;
-import freemarker.template.Configuration;
-import freemarker.template.Template;
-import freemarker.template.TemplateException;
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkWriter;
import org.richfaces.cdk.FileManager;
-import org.richfaces.cdk.model.*;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.LibraryVisitor;
+import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.Trackable;
+import org.richfaces.cdk.model.Visitable;
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
+import freemarker.template.Configuration;
+import freemarker.template.Template;
+import freemarker.template.TemplateException;
/**
* <p class="changed_added_4_0">Base class for all output file buildes that use FreeMarker as template engine.</p>
@@ -53,7 +57,6 @@
private final FileManager output;
- @Inject
public FreeMarkerRenderer(Configuration configuration, ComponentLibrary library, FileManager output) {
this.configuration = configuration;
this.library = library;
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/BehaviorProcessorTest.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -25,22 +25,26 @@
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
-import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.Collections;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.Name;
import javax.lang.model.element.TypeElement;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.cdk.CdkTestRunner;
import org.richfaces.cdk.Mock;
import org.richfaces.cdk.NamingConventions;
+import org.richfaces.cdk.Stub;
+import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfBehavior;
-import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.apt.SourceUtils.BeanProperty;
+import org.richfaces.cdk.apt.SourceUtils.SuperTypeVisitor;
import org.richfaces.cdk.model.BehaviorModel;
+import org.richfaces.cdk.model.ClassName;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.FacesId;
import org.richfaces.cdk.xmlconfig.JAXB;
@@ -68,8 +72,17 @@
@Mock
private TypeElement componentElement;
+
+ @Stub
+ private Name name;
+ @Stub
+ private Tag tag;
+
@Mock
+ private JsfBehavior behaviorAnnotation;
+
+ @Mock
private JAXB jaxb;
@Mock
@@ -77,34 +90,26 @@
@Test
- @Ignore
+
public void testProcess() throws Exception {
- expect(componentElement.getAnnotation(JsfBehavior.class)).andReturn(new JsfBehavior() {
-
- @Override
- public Class<? extends Annotation> annotationType() {
- return JsfBehavior.class;
- }
-
- @Override
- public Tag tag() {
- return null;
- }
-
- @Override
- public String id() {
- return MY_BEHAVIOR;
- }
-
- @Override
- public String behaviorClass() {
- return "foo.bar.Behavior";
- }
- });
- replay(log, utils, componentElement, jaxb, conventions);
+ expect(componentElement.getAnnotation(JsfBehavior.class)).andStubReturn(behaviorAnnotation);
+ expect(behaviorAnnotation.id()).andReturn(MY_BEHAVIOR);
+ expect(componentElement.getQualifiedName()).andReturn(name);
+ expect(componentElement.getModifiers()).andReturn(Collections.singleton(Modifier.ABSTRACT));
+ expect(componentElement.getQualifiedName()).andReturn(name).atLeastOnce();
+ expect(behaviorAnnotation.generate()).andReturn("foo.Bar");
+ expect(behaviorAnnotation.tag()).andReturn(tag);
+ expect(behaviorAnnotation.attributes()).andReturn(new String[]{});
+ expect(behaviorAnnotation.icon()).andReturn(null);
+ expect(behaviorAnnotation.displayName()).andReturn(null);
+ expect(tag.handlerName()).andStubReturn("");
+ utils.visitSupertypes((ClassName)anyObject(), (SuperTypeVisitor)anyObject());expectLastCall();
+ expect(utils.getBeanPropertiesAnnotatedWith(eq(Attribute.class), (ClassName)anyObject())).andReturn(Collections.<BeanProperty>emptySet());
+ expect(utils.getDocComment((ClassName) anyObject())).andStubReturn(null);
+ replay(log, utils, componentElement, jaxb, conventions,behaviorAnnotation,tag,name);
processor.process(componentElement);
- verify(log, utils, componentElement, jaxb, conventions);
+ verify(log, utils, componentElement, jaxb, conventions,behaviorAnnotation,tag,name);
Collection<BehaviorModel> behaviors = library.getBehaviors();
assertEquals(1, behaviors.size());
Deleted: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/freemarker/FreeMarkerRendererTest.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -1,28 +0,0 @@
-package org.richfaces.cdk.freemarker;
-
-import static org.junit.Assert.*;
-
-import java.io.StringWriter;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.richfaces.cdk.CdkTestBase;
-import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.FacesId;
-
-public class FreeMarkerRendererTest extends CdkTestBase {
- @Test
- public void testRender() {
-
- // fail("Not yet implemented");
- }
-
- @Test
- @Ignore
- public void testProcessComponent() throws Exception {
- final StringWriter output = new StringWriter();
- ComponentModel component = new ComponentModel(FacesId.parseId("foo.Bar"));
-
- assertEquals("foo.Bar", output.toString());
- }
-}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-03-18 00:30:57 UTC (rev 16591)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-03-18 00:53:35 UTC (rev 16592)
@@ -56,6 +56,7 @@
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.xmlconfig.JAXB;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import org.xml.sax.InputSource;
import org.xml.sax.ext.EntityResolver2;
import javax.faces.event.ActionEvent;
@@ -288,11 +289,15 @@
}
@Test
- @Ignore
+
// TODO - fix import-attributes.
public void dummyComponentTest() throws Exception {
- expect(resolver.getExternalSubset(eq("cdk:root"), EasyMock.<String> anyObject())).andReturn(null).atLeastOnce();
- expect(resolver.resolveEntity((String)isNull(), (String)anyObject())).andReturn(null).atLeastOnce();
+ expect(resolver.getExternalSubset(EasyMock.<String> eq("cdk:root"), (String)anyObject())).andReturn(null);
+ expect(resolver.resolveEntity((String)isNull(), (String)eq("urn:resource:org/richfaces/cdk/templatecompiler/dummy-attributes.xml"))).andReturn(new InputSource(this.getClass().getResourceAsStream("/org/richfaces/cdk/templatecompiler/dummy-attributes.xml")));
+ expect(resolver.getExternalSubset(EasyMock.<String> eq("cdk:properties"), (String)isNull())).andReturn(null);
+ expect(resolver.resolveEntity((String)isNull(), (String)eq("urn:attributes:dummy-template-props.xml"))).andReturn(new InputSource(this.getClass().getResourceAsStream("/META-INF/cdk/attributes/dummy-template-props.xml")));
+ expect(resolver.getExternalSubset(EasyMock.<String>eq("cdk:properties"), (String)isNull())).andReturn(null);
+
replay(resolver, templatesSource);
Template template = parser.parseTemplate(getJavaFile("org/richfaces/cdk/templatecompiler/dummy.template.xml"));
assertNotNull(template);
14 years, 8 months
JBoss Rich Faces SVN: r16591 - in branches/community/3.3.X/docs/cdkguide/en/src/main/docbook: modules and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-03-17 20:30:57 -0400 (Wed, 17 Mar 2010)
New Revision: 16591
Modified:
branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/includes/pcreate.xml
branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/devsample.xml
branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/setup.xml
Log:
Changed GA to Final
Modified: branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/includes/pcreate.xml
===================================================================
--- branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/includes/pcreate.xml 2010-03-17 20:40:27 UTC (rev 16590)
+++ branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/includes/pcreate.xml 2010-03-18 00:30:57 UTC (rev 16591)
@@ -14,7 +14,7 @@
At first we need to create a project for the component itself. In the library directory
<property>Sandbox</property> you just created, launch the following command (all in one line):
</para>
- <programlisting role="XML"><![CDATA[mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-jsf-component -DarchetypeVersion=3.3.3.GA -DartifactId=inputDate]]>
+ <programlisting role="XML"><![CDATA[mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-jsf-component -DarchetypeVersion=3.3.3.Final -DartifactId=inputDate]]>
</programlisting>
<para>
As is easy to see a new directory with the name <property>inputDate</property> will be created.
@@ -164,7 +164,7 @@
<plugin>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
- <version>3.3.3.GA</version>
+ <version>3.3.3.Final</version>
<executions>
<execution>
<phase>generate-sources</phase>
@@ -202,7 +202,7 @@
<dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
- <version>3.3.3.GA</version>
+ <version>3.3.3.Final</version>
</dependency>
</dependencies>
</project>]]>
Modified: branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/devsample.xml
===================================================================
--- branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/devsample.xml 2010-03-17 20:40:27 UTC (rev 16590)
+++ branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/devsample.xml 2010-03-18 00:30:57 UTC (rev 16591)
@@ -21,7 +21,7 @@
where you have created the <emphasis role="bold"><property><inputDate></property></emphasis> component
and launch the following command (all in one line):
</para>
- <programlisting role="XML"><![CDATA[mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-jsfwebapp -DarchetypeVersion=3.3.3.GA -DgroupId=org.mycompany -DartifactId=inputDate-sample]]></programlisting>
+ <programlisting role="XML"><![CDATA[mvn archetype:create -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-jsfwebapp -DarchetypeVersion=3.3.3.Final -DgroupId=org.mycompany -DartifactId=inputDate-sample]]></programlisting>
<para>
As easy to see a new directory <property>inputDate-sample</property> is created with the predefined JSF project structure:
</para>
Modified: branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/setup.xml
===================================================================
--- branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/setup.xml 2010-03-17 20:40:27 UTC (rev 16590)
+++ branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/modules/setup.xml 2010-03-18 00:30:57 UTC (rev 16591)
@@ -180,7 +180,7 @@
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
- <version>3.3.3.GA</version>
+ <version>3.3.3.Final</version>
</dependency>
</dependencies>
</project>]]>
14 years, 8 months