JBoss Rich Faces SVN: r16243 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/user-extensions and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-01-06 12:21:54 -0500 (Wed, 06 Jan 2010)
New Revision: 16243
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/user-extensions/rfqa-extensions.js
Log:
- TooltipTestCase - tried to rewrite isTextPresent and isElementPresent to jQuery implementation (RFPL-316)
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java 2010-01-05 22:51:50 UTC (rev 16242)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipDataTableTestCase.java 2010-01-06 17:21:54 UTC (rev 16243)
@@ -79,18 +79,22 @@
private void waitForElementAppears(final String locator) {
waitModelUpdate.until(new Condition() {
public boolean isTrue() {
- return selenium.isElementPresent(locator);
+ return isElementPresent(locator);
}
});
}
-
+
private void waitForElementDisappears(final String locator) {
waitModelUpdate.until(new Condition() {
public boolean isTrue() {
- return !selenium.isElementPresent(locator);
+ return !isElementPresent(locator);
}
});
}
+
+ private boolean isElementPresent(String locator) {
+ return !"0".equals(selenium.getEval(format("jqFind('{0}:visible').size()", locator.replaceFirst("^jquery=", "").trim())));
+ }
@SuppressWarnings("unused")
@BeforeMethod
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java 2010-01-05 22:51:50 UTC (rev 16242)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/tooltip/TooltipTestCase.java 2010-01-06 17:21:54 UTC (rev 16243)
@@ -50,6 +50,17 @@
private final String MSG_OUTPUT_TOOLTIP_3_4_TEXT = getMsg("OUTPUT_TOOLTIP_3_4_TEXT");
private final Pattern MSG_REGEXP_TOOLTIPS_REQUESTED = Pattern.compile(getMsg("REGEXP_TOOLTIPS_REQUESTED"));
+ final String jqFindTooltip = "jqFind('{0}:visible:textEquals({1})')";
+ final String jqFindTooltipWait = format(jqFindTooltip, "strong", MSG_OUTPUT_TOOLTIP_3_4_WAITING);
+ final String jqFindTooltipText = format(jqFindTooltip, "span", MSG_OUTPUT_TOOLTIP_3_4_TEXT);
+
+ final String conditionTooltipWaitAppears = format("{0}.size() > 0", format(jqFindTooltip, "strong",
+ MSG_OUTPUT_TOOLTIP_3_4_WAITING));
+ final String conditionTooltipTextAppears = format("{0}.size() > 0", format(jqFindTooltip, "span",
+ MSG_OUTPUT_TOOLTIP_3_4_TEXT));
+ final String conditionTooltipTextDisappears = format("{0}.size() == 0", format(jqFindTooltip, "span",
+ MSG_OUTPUT_TOOLTIP_3_4_TEXT));
+
/**
* Hover mouse at first panel and so invokes tooltip displaying. Checks that
* the tooltip text will display and next hover mouse out of panel to close
@@ -108,17 +119,16 @@
Integer tooltipsRequested = null;
for (int i = 0; i < 3; i++) {
- assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_WAITING));
- assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_TEXT));
+ assertEquals(selenium.getEval(format("{0}.size()", jqFindTooltipWait)), "0");
+ assertEquals(selenium.getEval(format("{0}.size()", jqFindTooltipText)), "0");
if (i == 0)
selenium.mouseMoveAt(LOC_PANEL_SAMPLE_3, MSG_EVENT_COORDS_AT_PANEL);
mouseOverAt(LOC_PANEL_SAMPLE_3, MSG_EVENT_COORDS_AT_PANEL);
-
tooltipsRequested = waitForTooltipChanges(tooltipsRequested, i == 0);
selenium.mouseOut(LOC_PANEL_SAMPLE_3);
- waitForTextDisappears(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
+ selenium.waitForCondition(conditionTooltipTextDisappears, "3000");
}
}
@@ -133,14 +143,14 @@
Integer tooltipsRequested = null;
for (int i = 0; i < 3; i++) {
- assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_WAITING));
- assertFalse(selenium.isTextPresent(MSG_OUTPUT_TOOLTIP_3_4_TEXT));
+ assertEquals(selenium.getEval(format("{0}.size()", jqFindTooltipWait)), "0");
+ assertEquals(selenium.getEval(format("{0}.size()", jqFindTooltipText)), "0");
selenium.clickAt(LOC_PANEL_SAMPLE_4, MSG_EVENT_COORDS_AT_PANEL);
tooltipsRequested = waitForTooltipChanges(tooltipsRequested, i == 0);
selenium.mouseOut(LOC_PANEL_SAMPLE_4);
- waitForTextDisappears(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
+ selenium.waitForCondition(conditionTooltipTextDisappears, "3000");
}
}
@@ -148,16 +158,15 @@
Integer tooltipsRequested = null;
if (firstLoop) {
- waitForText(MSG_OUTPUT_TOOLTIP_3_4_WAITING);
- waitForText(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
+ selenium.waitForCondition(conditionTooltipWaitAppears, "3000");
+ selenium.waitForCondition(conditionTooltipTextAppears, "3000");
+
tooltipsRequested = retrieveRequestedTooltips.retrieve();
} else {
- waitForText(MSG_OUTPUT_TOOLTIP_3_4_TEXT);
+ selenium.waitForCondition(conditionTooltipTextAppears, "3000");
+
tooltipsRequested = Wait.waitForChangeAndReturn(tooltipsRequestedOld, retrieveRequestedTooltips);
-
- if (tooltipsRequestedOld != null) {
- assertEquals(tooltipsRequested, Integer.valueOf(tooltipsRequestedOld + 1));
- }
+ assertEquals(tooltipsRequested, Integer.valueOf(tooltipsRequestedOld + 1));
}
return tooltipsRequested;
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/user-extensions/rfqa-extensions.js
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/user-extensions/rfqa-extensions.js 2010-01-05 22:51:50 UTC (rev 16242)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/user-extensions/rfqa-extensions.js 2010-01-06 17:21:54 UTC (rev 16243)
@@ -87,3 +87,7 @@
return jQuery.trim(elem.textContent || elem.innerText || "").endsWith(
match[3]);
}
+
+var jqFind = function(selector) {
+ return $(selenium.browserbot.getCurrentWindow().document).find(selector);
+}
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r16242 - in branches/community/3.3.X: samples/beanValidatorSample and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-01-05 17:51:50 -0500 (Tue, 05 Jan 2010)
New Revision: 16242
Modified:
branches/community/3.3.X/framework/api/src/main/java/org/richfaces/validator/GraphValidator.java
branches/community/3.3.X/samples/beanValidatorSample/pom.xml
branches/community/3.3.X/ui/beanValidator/pom.xml
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/FacesBeanValidator.java
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/HibernateValidator.java
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/NullValidator.java
branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/ObjectValidator.java
branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/HibernateValidatorTest.java
branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/ObjectValidatorTest.java
Log:
https://jira.jboss.org/jira/browse/RF-8213
Modified: branches/community/3.3.X/framework/api/src/main/java/org/richfaces/validator/GraphValidator.java
===================================================================
--- branches/community/3.3.X/framework/api/src/main/java/org/richfaces/validator/GraphValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/framework/api/src/main/java/org/richfaces/validator/GraphValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -3,6 +3,7 @@
*/
package org.richfaces.validator;
+import java.util.Collection;
import java.util.Set;
import javax.faces.component.UIComponent;
@@ -18,7 +19,7 @@
*/
public interface GraphValidator {
- public String[] validateGraph(FacesContext context, UIComponent component, Object value,
+ public Collection<String> validateGraph(FacesContext context, UIComponent component, Object value,
Object profiles) throws ValidatorException ;
}
Modified: branches/community/3.3.X/samples/beanValidatorSample/pom.xml
===================================================================
--- branches/community/3.3.X/samples/beanValidatorSample/pom.xml 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/samples/beanValidatorSample/pom.xml 2010-01-05 22:51:50 UTC (rev 16242)
@@ -41,12 +41,23 @@
<artifactId>slf4j-jcl</artifactId>
<version>1.4.2</version>
</dependency>
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.0.b2</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui</artifactId>
<version>3.3.3-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.3.3-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>com.uwyn</groupId>
<artifactId>jhighlight</artifactId>
<version>1.0</version>
Modified: branches/community/3.3.X/ui/beanValidator/pom.xml
===================================================================
--- branches/community/3.3.X/ui/beanValidator/pom.xml 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/pom.xml 2010-01-05 22:51:50 UTC (rev 16242)
@@ -66,6 +66,7 @@
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/component/UIGraphValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -25,6 +25,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -226,7 +227,7 @@
Validator validator = context.getApplication().createValidator(getType());
if (validator instanceof GraphValidator) {
GraphValidator graphValidator = (GraphValidator) validator;
- String[] messages = graphValidator.validateGraph(context,this, value,getProfiles());
+ Collection<String> messages = graphValidator.validateGraph(context,this, value,getProfiles());
if (null != messages) {
context.renderResponse();
// send all validation messages.
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -3,6 +3,8 @@
*/
package org.richfaces.validator;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Locale;
import java.util.Set;
@@ -47,7 +49,7 @@
* java.lang.String, java.lang.Object, java.util.Locale)
*/
@Override
- protected String[] validate(FacesContext facesContext, Object base, String property,
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property,
Object value, Set<String> profiles) {
Class beanType = base.getClass();
Set<ConstraintViolation<Object>> constrains = getValidator(facesContext)
@@ -63,12 +65,20 @@
* .FacesContext, java.lang.Object, java.util.Set)
*/
@Override
- public String[] validateGraph(FacesContext context, Object value,
+ public Collection<String> validateGraph(FacesContext context, Object value,
Set<String> profiles) {
Class<?>[] groups = getGroups(profiles);
Set<ConstraintViolation<Object>> violations = getValidator(
context).validate(value, groups);
- String[] messages = extractMessages(violations);
+ Collection<String> messages = extractMessages(violations);
+ if(null != parent){
+ Collection<String> parentMessages = parent.validateGraph(context, value, profiles);
+ if(null != messages){
+ messages.addAll(parentMessages);
+ } else {
+ messages = parentMessages;
+ }
+ }
return messages;
}
@@ -98,13 +108,12 @@
return groups;
}
- private String[] extractMessages(Set<ConstraintViolation<Object>> violations) {
- String[] messages = null;
+ private Collection<String> extractMessages(Set<ConstraintViolation<Object>> violations) {
+ Collection<String> messages = null;
if (null != violations && violations.size() > 0) {
- messages = new String[violations.size()];
- int i = 0;
+ messages = new ArrayList<String>(violations.size());
for (ConstraintViolation<? extends Object> constraintViolation : violations) {
- messages[i++] = constraintViolation.getMessage();
+ messages.add(constraintViolation.getMessage());
}
}
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/FacesBeanValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/FacesBeanValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/FacesBeanValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -22,6 +22,7 @@
import java.io.Serializable;
import java.text.MessageFormat;
+import java.util.Collection;
import java.util.Locale;
import java.util.Set;
@@ -101,7 +102,7 @@
ValueExpression valueExpression = component
.getValueExpression("value");
if (null != valueExpression) {
- String[] messages = ObjectValidator.getInstance(context)
+ Collection<String> messages = ObjectValidator.getInstance(context)
.validate(context, valueExpression, convertedValue, getProfiles());
if (null != messages) {
input.setValid(false);
@@ -144,10 +145,10 @@
return label;
}
- public String[] validateGraph(FacesContext context, UIComponent component,
+ public Collection<String> validateGraph(FacesContext context, UIComponent component,
Object value, Object profiles) throws ValidatorException {
ObjectValidator beanValidator = ObjectValidator.getInstance(context);
- String[] messages = beanValidator.validateGraph(context, value,AjaxRendererUtils.asSet(profiles));
+ Collection<String> messages = beanValidator.validateGraph(context, value,AjaxRendererUtils.asSet(profiles));
return messages;
}
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/HibernateValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/HibernateValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/HibernateValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -21,6 +21,7 @@
package org.richfaces.validator;
import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EmptyStackException;
@@ -57,19 +58,27 @@
private Map<ValidatorKey, ClassValidator<? extends Object>> classValidators = new ConcurrentHashMap<ValidatorKey, ClassValidator<? extends Object>>();
HibernateValidator() {
+ super();
// This is a "singleton"-like class. Only factory methods allowed.
// Enforce class to load
ClassValidator.class.getName();
}
+ HibernateValidator(ObjectValidator parent){
+ super(parent);
+ // This is a "singleton"-like class. Only factory methods allowed.
+ // Enforce class to load
+ ClassValidator.class.getName();
+ }
+
@Override
@SuppressWarnings("unchecked")
- public String[] validateGraph(FacesContext context, Object value,
+ public Collection<String> validateGraph(FacesContext context, Object value,
Set<String> profiles) {
if (null == context) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
- String validationMessages[] = null;
+ Collection<String> validationMessages = null;
if (null != value) {
ClassValidator<Object> validator = (ClassValidator<Object>) getValidator(
context, value.getClass());
@@ -77,14 +86,21 @@
InvalidValue[] invalidValues = validator
.getInvalidValues(value);
if (null != invalidValues && invalidValues.length > 0) {
- validationMessages = new String[invalidValues.length];
+ validationMessages = new ArrayList<String>(invalidValues.length);
for (int i = 0; i < invalidValues.length; i++) {
InvalidValue invalidValue = invalidValues[i];
- validationMessages[i] = invalidValue.getMessage();
+ validationMessages.add(invalidValue.getMessage());
}
}
}
-
+ if(null != parent){
+ Collection<String> parentMessages = parent.validateGraph(context, value, profiles);
+ if(null != validationMessages){
+ validationMessages.addAll(parentMessages);
+ } else {
+ validationMessages = parentMessages;
+ }
+ }
}
return validationMessages;
}
@@ -156,17 +172,17 @@
}
@Override
- protected String[] validate(FacesContext facesContext, Object base, String property,
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property,
Object value, Set<String> profiles) {
InvalidValue[] invalidValues = validateBean(facesContext, base, property,
value);
if (null == invalidValues) {
return null;
} else {
- String[] result = new String[invalidValues.length];
+ Collection<String> result = new ArrayList<String>(invalidValues.length);
for (int i = 0; i < invalidValues.length; i++) {
InvalidValue invalidValue = invalidValues[i];
- result[i] = invalidValue.getMessage();
+ result.add(invalidValue.getMessage());
}
return result;
}
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/NullValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/NullValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/NullValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -3,6 +3,7 @@
*/
package org.richfaces.validator;
+import java.util.Collection;
import java.util.Set;
import javax.faces.context.FacesContext;
@@ -17,7 +18,7 @@
* @see org.richfaces.validator.ObjectValidator#validate(java.lang.Object, java.lang.String, java.lang.Object, java.util.Locale)
*/
@Override
- protected String[] validate(FacesContext facesContext, Object base, String property,
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property,
Object value, Set<String> profiles) {
// do nothing.
return null;
@@ -27,7 +28,7 @@
* @see org.richfaces.validator.ObjectValidator#validateGraph(javax.faces.context.FacesContext, java.lang.Object, java.util.Set)
*/
@Override
- public String[] validateGraph(FacesContext context, Object value,
+ public Collection<String> validateGraph(FacesContext context, Object value,
Set<String> profiles) {
// do nothing
return null;
Modified: branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/ObjectValidator.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -39,6 +39,8 @@
private static final Object MUTEX = new Object();
private static final Log log = LogFactory.getLog(ObjectValidator.class);
+
+ protected final ObjectValidator parent;
/**
* Create BeanValidator instance. For a Junit tests only.
@@ -52,19 +54,13 @@
ObjectValidator validator = null;
try {
validator = new BeanValidator();
- } catch (Exception e){
- try {
- validator = new HibernateValidator();
- } catch (Throwable e2) {
- //Hibernate-validators not available
- }
+ } catch (Throwable e){
+ // JSR-303 is not avalable.
}
- catch (LinkageError le){
- try {
- validator = new HibernateValidator();
- } catch (Throwable e2) {
- //Hibernate-validators not available
- }
+ try {
+ validator = new HibernateValidator(validator);
+ } catch (Throwable e2) {
+ //Hibernate-validators not available
}
if(validator == null){
log.warn("Validator implementations not found at classpath, default NullValidator will be used.");
@@ -73,6 +69,13 @@
return validator;
}
+ ObjectValidator() {
+ this.parent = null;
+ }
+
+ ObjectValidator(ObjectValidator parent){
+ this.parent = parent;
+ }
/**
* Return BeanValidator object from a ServletContext attribute. Create new
* instance if none is defined.
@@ -98,7 +101,7 @@
return instance;
}
- public abstract String[] validateGraph(FacesContext context, Object value,
+ public abstract Collection<String> validateGraph(FacesContext context, Object value,
Set<String> profiles);
/**
@@ -116,12 +119,12 @@
* @throws FacesException
* if locale or context not properly initialized
*/
- public String[] validate(FacesContext context, ValueExpression target,
+ public Collection<String> validate(FacesContext context, ValueExpression target,
Object value, Set<String> profiles) {
if (null == context) {
throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
}
- String[] validationMessages = null;
+ Collection<String> validationMessages = null;
if (null != target) {
ELContext elContext = context.getELContext();
ValidationResolver validationResolver = createValidationResolver(
@@ -135,6 +138,14 @@
}
if (!validationResolver.isValid()) {
validationMessages = validationResolver.getValidationMessages();
+ }
+ if(null != parent){
+ Collection<String> parentMessages = parent.validate(context, target, value, profiles);
+ if(null != validationMessages){
+ validationMessages.addAll(parentMessages);
+ } else {
+ validationMessages = parentMessages;
+ }
}
}
@@ -155,7 +166,7 @@
* @return null for a valid value, array of the validation messages
* othervise.
*/
- protected abstract String[] validate(FacesContext facesContext, Object base,
+ protected abstract Collection<String> validate(FacesContext facesContext, Object base,
String property, Object value, Set<String> profiles);
static Locale calculateLocale(FacesContext context) {
@@ -323,7 +334,7 @@
private boolean valid = true;
- private String[] validationMessages = null;
+ private Collection<String> validationMessages = null;
private Stack<BasePropertyPair> valuesStack;
@@ -445,7 +456,7 @@
validationMessages = validate(facesContext, base,
property.toString(), value, profiles);
valid = null == validationMessages
- || 0 == validationMessages.length;
+ || 0 == validationMessages.size();
}
}
@@ -468,7 +479,7 @@
/**
* @return the validationMessages
*/
- public String[] getValidationMessages() {
+ public Collection<String> getValidationMessages() {
return validationMessages;
}
Modified: branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -20,6 +20,7 @@
*/
package org.richfaces.validator;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -49,9 +50,9 @@
public void testValidate() throws Exception {
BeanValidator validator = new BeanValidator();
- String[] validate = validator.validate(facesContext, new Bean(), "property", null, null);
+ Collection<String> validate = validator.validate(facesContext, new Bean(), "property", null, null);
assertNotNull(validate);
- assertEquals(1, validate.length);
+ assertEquals(1, validate.size());
}
public static class Bean {
Modified: branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/HibernateValidatorTest.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/HibernateValidatorTest.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/HibernateValidatorTest.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -118,7 +118,7 @@
assertTrue(list instanceof List);
validationResolver.setValue(elContext, list, new Integer(0), "");
assertFalse(validationResolver.isValid());
- assertEquals(1, validationResolver.getValidationMessages().length);
+ assertEquals(1, validationResolver.getValidationMessages().size());
}
public void testValidationResolverMap() throws Exception {
ValidableBean bean = new ValidableBean();
@@ -129,7 +129,7 @@
assertTrue(list instanceof Map);
validationResolver.setValue(elContext, list, new Integer(0), "");
assertFalse(validationResolver.isValid());
- assertEquals(1, validationResolver.getValidationMessages().length);
+ assertEquals(1, validationResolver.getValidationMessages().size());
}
public void testHibernateMessages() throws Exception {
Modified: branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/ObjectValidatorTest.java
===================================================================
--- branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/ObjectValidatorTest.java 2010-01-05 15:57:32 UTC (rev 16241)
+++ branches/community/3.3.X/ui/beanValidator/src/test/java/org/richfaces/validator/ObjectValidatorTest.java 2010-01-05 22:51:50 UTC (rev 16242)
@@ -1,5 +1,6 @@
package org.richfaces.validator;
+import java.util.Collection;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;
@@ -26,12 +27,12 @@
public void testCreateInstance() {
ObjectValidator objectValidator = ObjectValidator.createInstance();
- assertEquals(BeanValidator.class, objectValidator.getClass());
+ assertEquals(HibernateValidator.class, objectValidator.getClass());
}
public void testGetInstance() {
ObjectValidator objectValidator = ObjectValidator.getInstance(facesContext);
- assertEquals(BeanValidator.class, objectValidator.getClass());
+ assertEquals(HibernateValidator.class, objectValidator.getClass());
ObjectValidator objectValidator2 = ObjectValidator.getInstance(facesContext);
assertSame(objectValidator, objectValidator2);
}
@@ -62,14 +63,14 @@
private static class ObjectValidatorStub extends ObjectValidator {
@Override
- protected String[] validate(FacesContext facesContext, Object base, String property,
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property,
Object value, Set<String> profiles) {
// TODO Auto-generated method stub
return null;
}
@Override
- public String[] validateGraph(FacesContext context, Object value,
+ public Collection<String> validateGraph(FacesContext context, Object value,
Set<String> profiles) {
// TODO Auto-generated method stub
return null;
15 years, 2 months
JBoss Rich Faces SVN: r16241 - branches/community/3.3.X/samples/richfaces-demo/functional-test.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-01-05 10:57:32 -0500 (Tue, 05 Jan 2010)
New Revision: 16241
Added:
branches/community/3.3.X/samples/richfaces-demo/functional-test/README.html
Removed:
branches/community/3.3.X/samples/richfaces-demo/functional-test/README.txt
Log:
- RFPL-314 Complete README for richfaces-demo/functional-test
Added: branches/community/3.3.X/samples/richfaces-demo/functional-test/README.html
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/README.html (rev 0)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/README.html 2010-01-05 15:57:32 UTC (rev 16241)
@@ -0,0 +1,133 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<style>
+body { font-family: sans-serif; }
+h1 { color: darkblue; }
+.indent { text-indent: 2em; }
+</style>
+<body>
+ <h1>RichFaces-Demo - functional-test</h1>
+
+ <h2>About</h2>
+
+ <h3>Introduction</h3>
+ <p>Functional test uses Maven and TestNG to run integration tests, which consist of automated browser testing using <a href="http://seleniumhq.org/">Selenium web application testing system</a>.</p>
+
+ <h3>Structure</h3>
+ <p>Each component from <a href="http://livedemo.exadel.com/richfaces-demo/index.jsp">RichFaces-Demo application</a> corresponds with one package of test cases (except of components which share one presentation like <i>data table, column and column group</i>).</p>
+ <p>Each package is divided to one or more test cases presenting features of one component, traditionally distinguished by own tab.</p>
+
+ <h3>Location</h3>
+ <p>All test cases are under <tt>src/test/richfaces/integrationTest</tt> package, separated to packages by component name such as</p>
+ <p class="indent"><tt>org.jboss.richfaces.integrationTest.dataTable</tt></p>
+ <p>and each test case is named by feature it corresponds like</p>
+ <p class="indent"><tt>org.jboss.richfaces.integrationTest.dataTable.ExtendedDataModelTestCase</tt></p>
+
+ <h3>TestNG descriptor</h3>
+ <p>All of the tests forms suite and they are enumerated in TestNG descriptor <tt>src/test/resources/testng.xml</tt>.</p>
+
+ <h3>Logging</h3>
+ <p>By default selenium local instance of SeleniumServer logs to file <tt>target/selenium/selenium-server.log</tt>.</p>
+
+ <h3>Resources</h3>
+ <p>The majority of locators and assert values used in test are externalized in <tt>*.properties</tt> files.</p>
+ <p>You can find all string belonging to the given package of test cases in path such as <tt>src/test/resources/${package}/locators.properties</tt> (<tt>*/messages.properties</tt> respectively).</p>
+
+ <h2>Build environment</h2>
+ <p>Recommended: Maven 2.1.0, SunJDK 1.6.0_16</p>
+ <p>Requires locally built <tt>selenium-testing-lib library</tt> (obtain it from <a href="http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/test-ap...">SVN repository</a>)</p>
+
+ <h2>Command-line usage</h2>
+
+ <h3>Basics</h3>
+ <p>Tests run in <tt>integration-test</tt> phase, but also <tt>post-integration-test</tt> contains finalization processes.</p>
+ <p>So basic operation which you may want to trigger is run all of the tests - this operation requires specification of browser to use (propagated to Selenium configuration; <a href="http://seleniumhq.org/docs/">consult documentation</a>):</p>
+ <p class="indent"><tt>$ <b>mvn post-integration-test -Dbrowser="*firefox"</b></tt></p>
+ <p>(we can use also <tt>verify</tt> phase adequately since it is more simple to type)</p>
+ <p class="indent"><tt>$ mvn <b>verify</b> -Dbrowser="*firefox"</tt></p>
+ <p>This command run the tests using externally run container. This is default behaviour, but you probably want to prepare all of the necessary stuff in container instead:</p>
+
+ <h3>Container specification</h3>
+ <p>Build are using Cargo to run richfaces-demo inside container. To use that, you must specify <tt>containerId</tt> definition:</p>
+ <p class="indent"><tt>$ mvn verify -Dbrowser="*firefox" <b>-DcontainerId=tomcat6x</b></tt></p>
+ <p>Configuration now supports:</p>
+ <ul>
+ <li>tomcat6x</li>
+ <li>jboss5x <i>(can be use to run inside JBoss AS 6.X too)</i></li>
+ </ul>
+ <p>By default, build is configured to obtain container installation archive from URL in specified version. In that way is container downloaded automatically (note: Cargo is caching the downloaded binary).</p>
+ <p>You can specify the version manually by redefining <tt>container.version</tt>:</p>
+ <p class="indent"><tt>$ mvn verify -Dbrowser="*firefox" -DcontainerId=tomcat6x <b>-Dcontainer.version=6.0.18</b></tt></p>
+ <p>You also may want avoid downloading container (note: it is highly recommended to specify the version of container to overwrite default version, because build isn't able to obtain it automatically from archive):</p>
+ <p class="indent"><tt>$ mvn verify -Dbrowser="*firefox" -DcontainerId=tomcat6x <b>-Dcontainer.version=6.0.18 -Dcontainer.installer.url=file:/home/foo/binaries/apacha-tomcat-6.0.18.zip</b></tt></p>
+ <p>(notice the <tt>file:/</tt> prefix in <tt>container.installer.url</tt> definition)</p>
+
+ <h3>Running one-off tests</h3>
+ <p>By default, complete suite specified in TestNG descriptor are run during <tt>integration-test</tt> phase.</p>
+ <p>If you want to run only selected tests, use comma-separated list of paths specifing the test cases (you can use wildcards). For example:</p>
+ <p>
+ <div class="indent"><tt>$ mvn ... <b>-Dtest=TooltipTestCase</b></tt></div>
+ <div class="indent"><tt>$ mvn ... <b>-Dtest="extendedDataTable/*"</b></tt> <i>(run all of the tests for EDT)</i></div>
+ <div class="indent"><tt>$ mvn ... <b>-Dtest="ActionParameter*,tooltip/*"</b></tt> <i>(run ActionParameterTestCase and all of the tests for Tooltip)</i></div>
+ <div class="indent"><tt>$ mvn ... <b>-Dtest="*Validator*"</b></tt> <i>(run all validator tests)</i></div>
+ </p>
+
+ <h3>Selenium configuration</h3>
+ <p>Additional settings which influence selenium configuration defaults:</p>
+
+ <h4>Maximizing selenium window with tested application</h4>
+ <p class="indent"><tt>$ mvn ... <b>-Dselenium.maximize=true</b></tt></p>
+
+ <h4>Run selenium in debugging mode</h4>
+ <p>This mode allows force to use selenium debug mode and also browser side logging (note: this combination is very verbose):</p>
+ <p class="indent"><tt>$ mvn ... <b>-Dselenium.debug=true</b></tt></p>
+
+ <h4>Changing host and port of SeleniumServer</h4>
+ <p>By default build uses local selenium (<tt>localhost:8444</tt>) started in <tt>pre-integration-test</tt> phase, but you can define other host and/or port too:</p>
+ <p class="indent"><tt>$ mvn ... <b>-Dselenium.host=remote.host -Dselenium.port=4444</b></tt></p>
+ <p>(note: despite of specifying other host for connecting remote SeleniumServer, the local instance of SeleniumServer is triggered automatically on the specified port <tt>${selenium.port}</tt> listening on <tt>0.0.0.0</tt> - so give a attention what port are you using)</p>
+ <p>(note: build automatically prepares JavaScript extensions for SeleniumServer, so it is necessary to copy that extensions from <tt>target/test-classes/custom-extensions.js</tt> and start designated SeleniumServer with switch <tt>-userExtension</tt> pointed to that file - the <tt>custom-extensions.js</tt> are built in <tt>process-test-resources</tt> phase)</p>
+
+ <h3>Which richfaces-demo artifact use?</h3>
+ <p>(You may omit following examples if you aren't using Cargo (containerId definition) to deploy richfaces-demo.)</p>
+ <p>By default, selenium obtains newest snapshot of richfaces-demo from <a href="http://snapshots.jboss.org/maven2/org/richfaces/samples/richfaces-demo/">snapshots.jboss.org</a>, but you may want to override version - in that case use one of following methods to specify artifact what you want to be tested:</p>
+
+ <h4>Specifying release version</h4>
+ <p class="indent"><tt>$ mvn ... <b>-Ddemo.version=3.3.3.BETA1</b></tt></p>
+ <p>But especially when testing release, you may want to specify suitable profile for given container, so let specify classifier of richfaces-demo artifact:</p>
+ <p class="indent"><tt>$ mvn ... -DcontainerId=tomcat6x ... -Ddemo.version=3.3.3.BETA1 <b>-Ddemo.classifier=tomcat6</b></tt></p>
+ <p class="indent"><tt>$ mvn ... -DcontainerId=jboss5x ... -Ddemo.version=3.3.3.BETA1 <b>-Ddemo.classifier=jee5</b></tt></p>
+ <p>(If you don't define <tt>demo.classifier</tt>, standard behaviour (no classifier) taken precedence and you should use only JavaEE 5 compatible containers (don't use <tt>tomcat6x</tt>))</p>
+ <p class="indent"><tt>$ mvn ... -DcontainerId=jboss5x ... -Ddemo.version=3.3.3.BETA1</tt> <i>(defaults to <tt>-Ddemo.classifier=""</tt>)</i></p>
+
+ <h4>Use local richfaces-demo artifact</h4>
+ <p>If you want use artifact on your local filesystem (specified by location), just use:</p>
+ <p class="indent"><tt>$ mvn ... <b>-Ddemo.location=../richfaces-demo.war</b></tt></p>
+ <p>or</p>
+ <p class="indent"><tt>$ mvn ... <b>-Ddemo.location=$HOME/richfaces-demo-3.3.3-20100104.212113-50.war</b></tt></p>
+ <p>This is very usable for:</p>
+ <ul>
+ <li>locally built or modified artifacts</li>
+ <li>testing snapshots other than the latest</li>
+ </ul>
+
+ <h3>Application context</h3>
+ <p>You can redefine application context, where application actually resides (defaults to <tt>http://localhost:8080/richfaces-demo/</tt>) in following way:</p>
+ <p class="indent"><tt>$ mvn ... <b>-Dcontext.root=http://some.host/ -Dcontext.path=/deployed/richfaces-demo/</b></tt></p>
+ <p>(note: this definition points Selenium where application resides, so the host must be available from host where selenium instance is running)</p>
+
+ <h3>Use prepared template of Firefox profile</h3>
+ <p>If you already have Firefox's profile prepared for testing (e.g. when you have there installed own extenssions), you may use it as template for Selenium:</p>
+ <p class="indent"><tt>$ mvn ... -Dbrowser="*firefox" <b>-DfirefoxProfileTemplate="$HOME/.mozilla/8vykwrsm.default"</b></tt></p>
+ <p>(note: don't be scared about using such profile since Selenium makes a working copy of given profile first)</p>
+
+ <h3>Testing JSF2</h3>
+ <p>It is necessary to use <b>jsf2</b> definition to run test properly configured for JSF2:</p>
+ <p class="indent"><tt>$ mvn ... <b>-Djsf2</b></tt></p>
+ <p>(note: that definition implies turning profile <tt><b>jsf2_0</b></tt> on: <tt>-Pjsf2_0</tt>)</p>
+
+ <h2>Configuration by default</h2>
+ <p>All of the definitions above are configured with respect of configuration by default paragidm, so it is possible to achieve different behaviours with varying combinations.</p>
+ <p>All default values are specified in pom.xml in properties.</p>
+</body>
+</html>
\ No newline at end of file
Deleted: branches/community/3.3.X/samples/richfaces-demo/functional-test/README.txt
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/README.txt 2010-01-05 13:31:41 UTC (rev 16240)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/README.txt 2010-01-05 15:57:32 UTC (rev 16241)
@@ -1,46 +0,0 @@
-1) Build environment
-
-Needs third-party library selenium-testing-lib library.
-
-You can obtain it from https://svn.devel.redhat.com/repos/jboss-qa/wfk/trunk/selenium-testing-lib
-(until it is available from maven repositories).
-
-Install it into your local maven repository.
-
-
-2) Running tests
-
-It's necessary to have running web/app server with richfaces-demo deployed on it.
-
-To run tests, you have to set up Maven's property called "browser" which contains browser
-type and path to its binary if needed. You can specify application's context by setting Maven properties
-named "context.root" and "context.path".
-
-To set them, either edit profiles.xml or pass runtime arguments to maven, e.g.
- mvn install -Dbrowser=*firefox
- mvn install -Dbrowser="*firefox /usr/lib/firefox-3.5.2/firefox"
- mvn install -Dbrowser=*iexplore -Dcontext.root=http://localhost:8080/ -Dcontext.path=/richfaces-demo
-
-Default values are set in pom.xml.
-
-
-3) Profiles
-
-Since some tests might not be runnable on some platforms, there are separate testng.xml files in
-src/test/profiles for each platform (unix/windows/mac).
-
-
-4) Properties files
-
-The majority of locators and assert values used in test are externalized in *.properties files. You can find
-all string belonging to the class in src/test/resources/packagename/locators.properties or
-src/test/resources/packagename/messages.properties.
-
-
-5) Generating testng.xml
-
-$ find -name "*.java" | grep -v Abstract | sort | tr '/' '.' | sed -r 's#^..(.*).java$#<test name="\1">\n\t<classes>\n\t\t<class name="\1" />\n\t</classes>\n</test>\n#'
-
-
-
-
15 years, 2 months
JBoss Rich Faces SVN: r16240 - root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-01-05 08:31:41 -0500 (Tue, 05 Jan 2010)
New Revision: 16240
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/AttributeModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacetModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ListenerModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
Log:
https://jira.jboss.org/jira/browse/RF-8232
Tags support - rename model classes
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,36 +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.model;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Attribute extends Property {
-
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/AttributeModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Attribute.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/AttributeModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/AttributeModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,36 @@
+/*
+ * $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.model;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class AttributeModel extends Property {
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/AttributeModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,86 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Behavior implements ModelElement<Behavior> {
-
- private Type type;
-
- public Behavior() {
- }
-
- public Behavior(Type type) {
- this.type = type;
- }
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the type
- */
- public Type getType() {
- return this.type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
-
- @Override
- public void merge(Behavior other) {
-
- // TODO Auto-generated method stub
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- @Override
- public boolean same(Behavior other) {
- return null != getType() && getType().equals(other.getType());
- }
-
-
- public static final class Type extends Key {
- public Type(String name) {
- super(name);
- }
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Behavior.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,85 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class BehaviorModel implements ModelElement<BehaviorModel> {
+
+ private Type type;
+
+ public BehaviorModel() {
+ }
+
+ public BehaviorModel(Type type) {
+ this.type = type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the type
+ */
+ public Type getType() {
+ return this.type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public void merge(BehaviorModel other) {
+
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public boolean same(BehaviorModel other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
+
+ public static final class Type extends Key {
+ public Type(String name) {
+ super(name);
+ }
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/BehaviorModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,290 +0,0 @@
-package org.richfaces.cdk.model;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlType;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * That class represents JSF component in the CDK.
- * That is mapped to faces-config "component" element.
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-@XmlType(name = "faces-config-componentType")
-(a)XmlAccessorType(XmlAccessType.NONE)
-public final class Component extends ModelElementBase implements ModelElement<Component> {
-
- /**
- * <p class="changed_added_4_0">Is that component c</p>
- */
- private boolean generate = false;
-
- /**
- * <p class="changed_added_4_0">
- * Facets recognised by the component
- * </p>
- */
- private final ModelMap<String,Facet> facets = ModelMap.<String,Facet>create();
-
- /**
- * <p class="changed_added_4_0">
- * Application level events fired by the component
- * </p>
- */
- private final ModelCollection<Event> events = ModelCollection.<Event>create();
-
- /**
- * <p class="changed_added_4_0">
- * Component attributes
- * </p>
- */
- private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
-
- /**
- * <p class="changed_added_4_0">
- * Renderer for the final component. This is bidirectional many to many
- * relation.
- * </p>
- */
- private final ModelCollection<Renderer> renderers = ModelCollection.<Renderer>create();
-
- /**
- * <p class="changed_added_4_0">
- * Cenerated component class
- * </p>
- */
- private ClassDescription baseClass;
-
- /**
- * <p class="changed_added_4_0">
- * Cenerated component class
- * </p>
- */
- private ClassDescription componentClass;
- private String family;
-
- /**
- * <p class="changed_added_4_0">
- * Component type
- * </p>
- */
- private Type type;
-
- public Component(Type key) {
- this.type = key;
- }
-
- public Component() {
-
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- @Override
- public void merge(Component otherComponent) {
- ComponentLibrary.merge(renderers, otherComponent.getRenderers());
-
- //merge facets, renderers, events ...
- attributes.putAll(otherComponent.getAttributes());
- facets.putAll(otherComponent.getFacets());
- ComponentLibrary.merge(events, otherComponent.getEvents());
- ComponentLibrary.merge(renderers, otherComponent.getRenderers());
- ComponentLibrary.merge(this, otherComponent);
- }
-
- @Override
- public boolean same(Component other) {
- if(null != getType() && null != other.getType()){
- // Both types not null, compare them.
- return getType().equals(other.getType());
- }
- // one or both types are null, compare classes.
- if(null != getComponentClass() && getComponentClass().equals(other.getComponentClass())){
- return true;
- }
- return false;
- }
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
-
- @XmlElement(name = "component-type", required = true)
- public Type getType() {
- return type;
- }
-
- /**
- * <p class="changed_added_4_0">
- * Reepresent a component family. In the faces-config element that property encoded as
- * <component><component-extension><cdk:component-family>....
- * </p>
- *
- * @return the family
- */
- @Merge
- public String getFamily() {
- return family;
- }
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param family
- * the family to set
- */
- public void setFamily(String family) {
- this.family = family;
- }
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @return the componentClass
- */
- @Merge
- public ClassDescription getComponentClass() {
- return componentClass;
- }
-
- /**
- * <p class="changed_added_4_0">Represents class of that component.
- * </p>
- *
- * @param componentClass
- * the componentClass to set
- */
- @XmlElement(name = "component-class")
- public void setComponentClass(ClassDescription componentClass) {
- this.componentClass = componentClass;
- }
-
- /**
- * <p class="changed_added_4_0">Base class for generated components.
- * </p>
- *
- * @return the baseClass
- */
- @Merge
- public ClassDescription getBaseClass() {
- return baseClass;
- }
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param baseClass
- * the baseClass to set
- */
- public void setBaseClass(ClassDescription baseClass) {
- this.baseClass = baseClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the generate
- */
- @Merge
- public boolean isGenerate() {
- return generate;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param generate the generate to set
- */
- public void setGenerate(boolean exists) {
- this.generate = exists;
- }
-
- /**
- * <p class="changed_added_4_0">
- * Represents JSF component attributes and properties.
- * </p>
- *
- * @return the attributes
- */
- @XmlElements({@XmlElement(name = "property", type = Property.class) ,
- @XmlElement(name = "attribute", type = Attribute.class) })
- public Map<String,Property> getAttributes() {
- return attributes;
- }
-
- public Property addAttribute(String attributeName) {
- Property attribute;
-
- attribute = attributes.get(attributeName);
- if(null == attribute){
- attribute = new Property();
- attributes.put(attributeName, attribute);
- }
-
- return attribute;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the facets
- */
- public Map<String,Facet> getFacets() {
- return facets;
- }
-
- public Facet addFacet(String name) {
- Facet facet = facets.get(name);
- if(null == facet){
- facet = new Facet();
- facets.put(name, facet);
- }
- return facet;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the events
- */
- public Collection<Event> getEvents() {
- return events;
- }
-
- public Event addEvent(String className) {
-
- // TODO - use a single events collection from library.
- Event event = new Event();
- event.setType(new ClassDescription(className));
- events.add(event);
- return event;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * TODO - synchronize renderers collection with library ?
- * @return the renderers
- */
- public Collection<Renderer> getRenderers() {
- return renderers;
- }
-
- public static class Type extends Key {
- public Type(String type) {
- super(type);
- }
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,290 @@
+package org.richfaces.cdk.model;
+
+import java.util.Collection;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlType;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * That class represents JSF component in the CDK.
+ * That is mapped to faces-config "component" element.
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+@XmlType(name = "faces-config-componentType")
+(a)XmlAccessorType(XmlAccessType.NONE)
+public final class ComponentModel extends ModelElementBase implements ModelElement<ComponentModel> {
+
+ /**
+ * <p class="changed_added_4_0">Is that component c</p>
+ */
+ private boolean generate = false;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Facets recognised by the component
+ * </p>
+ */
+ private final ModelMap<String, FacetModel> facets = ModelMap.<String, FacetModel>create();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Application level events fired by the component
+ * </p>
+ */
+ private final ModelCollection<EventModel> events = ModelCollection.<EventModel>create();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component attributes
+ * </p>
+ */
+ private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Renderer for the final component. This is bidirectional many to many
+ * relation.
+ * </p>
+ */
+ private final ModelCollection<RendererModel> renderers = ModelCollection.<RendererModel>create();
+
+ /**
+ * <p class="changed_added_4_0">
+ * Cenerated component class
+ * </p>
+ */
+ private ClassDescription baseClass;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Cenerated component class
+ * </p>
+ */
+ private ClassDescription componentClass;
+ private String family;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component type
+ * </p>
+ */
+ private Type type;
+
+ public ComponentModel(Type key) {
+ this.type = key;
+ }
+
+ public ComponentModel() {
+
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public void merge(ComponentModel otherComponent) {
+ ComponentLibrary.merge(renderers, otherComponent.getRenderers());
+
+ //merge facets, renderers, events ...
+ attributes.putAll(otherComponent.getAttributes());
+ facets.putAll(otherComponent.getFacets());
+ ComponentLibrary.merge(events, otherComponent.getEvents());
+ ComponentLibrary.merge(renderers, otherComponent.getRenderers());
+ ComponentLibrary.merge(this, otherComponent);
+ }
+
+ @Override
+ public boolean same(ComponentModel other) {
+ if(null != getType() && null != other.getType()){
+ // Both types not null, compare them.
+ return getType().equals(other.getType());
+ }
+ // one or both types are null, compare classes.
+ if(null != getComponentClass() && getComponentClass().equals(other.getComponentClass())){
+ return true;
+ }
+ return false;
+ }
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ @XmlElement(name = "component-type", required = true)
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * Reepresent a component family. In the faces-config element that property encoded as
+ * <component><component-extension><cdk:component-family>....
+ * </p>
+ *
+ * @return the family
+ */
+ @Merge
+ public String getFamily() {
+ return family;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param family
+ * the family to set
+ */
+ public void setFamily(String family) {
+ this.family = family;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the componentClass
+ */
+ @Merge
+ public ClassDescription getComponentClass() {
+ return componentClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Represents class of that component.
+ * </p>
+ *
+ * @param componentClass
+ * the componentClass to set
+ */
+ @XmlElement(name = "component-class")
+ public void setComponentClass(ClassDescription componentClass) {
+ this.componentClass = componentClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Base class for generated components.
+ * </p>
+ *
+ * @return the baseClass
+ */
+ @Merge
+ public ClassDescription getBaseClass() {
+ return baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param baseClass
+ * the baseClass to set
+ */
+ public void setBaseClass(ClassDescription baseClass) {
+ this.baseClass = baseClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the generate
+ */
+ @Merge
+ public boolean isGenerate() {
+ return generate;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param generate the generate to set
+ */
+ public void setGenerate(boolean exists) {
+ this.generate = exists;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * Represents JSF component attributes and properties.
+ * </p>
+ *
+ * @return the attributes
+ */
+ @XmlElements({@XmlElement(name = "property", type = Property.class) ,
+ @XmlElement(name = "attribute", type = AttributeModel.class) })
+ public Map<String,Property> getAttributes() {
+ return attributes;
+ }
+
+ public Property addAttribute(String attributeName) {
+ Property attribute;
+
+ attribute = attributes.get(attributeName);
+ if(null == attribute){
+ attribute = new Property();
+ attributes.put(attributeName, attribute);
+ }
+
+ return attribute;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the facets
+ */
+ public Map<String, FacetModel> getFacets() {
+ return facets;
+ }
+
+ public FacetModel addFacet(String name) {
+ FacetModel facet = facets.get(name);
+ if(null == facet){
+ facet = new FacetModel();
+ facets.put(name, facet);
+ }
+ return facet;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the events
+ */
+ public Collection<EventModel> getEvents() {
+ return events;
+ }
+
+ public EventModel addEvent(String className) {
+
+ // TODO - use a single events collection from library.
+ EventModel event = new EventModel();
+ event.setType(new ClassDescription(className));
+ events.add(event);
+ return event;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * TODO - synchronize renderers collection with library ?
+ * @return the renderers
+ */
+ public Collection<RendererModel> getRenderers() {
+ return renderers;
+ }
+
+ public static class Type extends Key {
+ public Type(String type) {
+ super(type);
+ }
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,79 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Converter implements ModelElement<Converter> {
- private Type type;
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public Converter(Type type) {
- this.type = type;
- }
-
- public Converter() {
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.model.ModelElement#getType()
- */
- public Type getType() {
- return type;
- }
-
- @Override
- public void merge(Converter other) {
- }
-
- @Override
- public boolean same(Converter other) {
- return null != getType() && getType().equals(other.getType());
- }
-
-
- public static final class Type extends Key {
- public Type(String name) {
- super(name);
- }
- }
-
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Converter.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,74 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+//@SuppressWarnings("serial")
+public class ConverterModel implements ModelElement<ConverterModel> {
+
+ private static final long serialVersionUID = -6238591637703737886L;
+
+ private String id;
+
+ private Class<?> forClass;
+
+ public ConverterModel() {
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public Class<?> getForClass() {
+ return forClass;
+ }
+
+ public void setForClass(Class<?> forClass) {
+ this.forClass = forClass;
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public void merge(ConverterModel other) {
+ }
+
+ @Override
+ public boolean same(ConverterModel other) {
+ return false; /*null != getType() && getType().equals(other.getType());*/
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,145 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0">That bean represent {@link javax.faces.event.FacesEvent} subclass that can be fired by
- * component.</p>
- *
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Event implements ModelElement<Event> {
- private String description;
- private ClassDescription listenerInterface;
- private ClassDescription sourceInterface;
- private ClassDescription tagHandler;
-
- /**
- * <p class="changed_added_4_0"></p>
- */
- private ClassDescription type;
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param description the description to set
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the type
- */
- public ClassDescription getType() {
- return this.type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(ClassDescription type) {
- this.type = type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the listenerInterface
- */
- public ClassDescription getListenerInterface() {
- return listenerInterface;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param listenerInterface the listenerInterface to set
- */
- public void setListenerInterface(ClassDescription listenerInterface) {
- this.listenerInterface = listenerInterface;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the sourceInterface
- */
- public ClassDescription getSourceInterface() {
- return sourceInterface;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param sourceInterface the sourceInterface to set
- */
- public void setSourceInterface(ClassDescription sourceInterface) {
- this.sourceInterface = sourceInterface;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the tagHandler
- */
- public ClassDescription getTagHandler() {
- return tagHandler;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param tagHandler the tagHandler to set
- */
- public void setTagHandler(ClassDescription tagHandler) {
- this.tagHandler = tagHandler;
- }
-
- @Override
- public void merge(Event other) {
- ComponentLibrary.merge(this, other);
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- @Override
- public boolean same(Event other) {
- return null != getType() && getType().equals(other.getType());
- }
-
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Event.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,145 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0">That bean represent {@link javax.faces.event.FacesEvent} subclass that can be fired by
+ * component.</p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class EventModel implements ModelElement<EventModel> {
+ private String description;
+ private ClassDescription listenerInterface;
+ private ClassDescription sourceInterface;
+ private ClassDescription tagHandler;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ private ClassDescription type;
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the type
+ */
+ public ClassDescription getType() {
+ return this.type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(ClassDescription type) {
+ this.type = type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the listenerInterface
+ */
+ public ClassDescription getListenerInterface() {
+ return listenerInterface;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param listenerInterface the listenerInterface to set
+ */
+ public void setListenerInterface(ClassDescription listenerInterface) {
+ this.listenerInterface = listenerInterface;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the sourceInterface
+ */
+ public ClassDescription getSourceInterface() {
+ return sourceInterface;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param sourceInterface the sourceInterface to set
+ */
+ public void setSourceInterface(ClassDescription sourceInterface) {
+ this.sourceInterface = sourceInterface;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the tagHandler
+ */
+ public ClassDescription getTagHandler() {
+ return tagHandler;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param tagHandler the tagHandler to set
+ */
+ public void setTagHandler(ClassDescription tagHandler) {
+ this.tagHandler = tagHandler;
+ }
+
+ @Override
+ public void merge(EventModel other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public boolean same(EventModel other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/EventModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,76 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Facet extends ModelElementBase implements ModelElement<Facet> {
-
- private boolean generate;
- /**
- * <p class="changed_added_4_0"></p>
- * @param name
- */
- public Facet() {
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the generate
- */
- public boolean isGenerate() {
- return generate;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param generate the generate to set
- */
- public void setGenerate(boolean generate) {
- this.generate = generate;
- }
-
- @Override
- public void merge(Facet other) {
- ComponentLibrary.merge(this, other);
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- @Override
- public boolean same(Facet other) {
- return equals(other);
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacetModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Facet.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacetModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacetModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,76 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class FacetModel extends ModelElementBase implements ModelElement<FacetModel> {
+
+ private boolean generate;
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param name
+ */
+ public FacetModel() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the generate
+ */
+ public boolean isGenerate() {
+ return generate;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param generate the generate to set
+ */
+ public void setGenerate(boolean generate) {
+ this.generate = generate;
+ }
+
+ @Override
+ public void merge(FacetModel other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public boolean same(FacetModel other) {
+ return equals(other);
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/FacetModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,88 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Listener implements ModelElement<Listener> {
-
- /**
- * <p class="changed_added_4_0"></p>
- */
- private Type type;
-
- public Listener(Type type) {
- this.type = type;
- }
-
- public Listener() {
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.model.ModelElement#getType()
- */
- public Type getType() {
- return type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
-
- @Override
- public void merge(Listener other) {
-
- // TODO Auto-generated method stub
- }
-
- @Override
- public boolean same(Listener other) {
- return equals(other);
- }
-
- public static final class Type extends Key {
- public Type(String name) {
- super(name);
- }
- }
-
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ListenerModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Listener.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ListenerModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ListenerModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,88 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class ListenerModel implements ModelElement<ListenerModel> {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ private Type type;
+
+ public ListenerModel(Type type) {
+ this.type = type;
+ }
+
+ public ListenerModel() {
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.richfaces.cdk.model.ModelElement#getType()
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public void merge(ListenerModel other) {
+
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public boolean same(ListenerModel other) {
+ return equals(other);
+ }
+
+ public static final class Type extends Key {
+ public Type(String name) {
+ super(name);
+ }
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ListenerModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,128 +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.model;
-
-import java.util.Collection;
-
-import javax.faces.render.RenderKitFactory;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class RenderKit extends ModelElementBase implements ModelElement<RenderKit> {
- private final ModelCollection<Renderer> renderers = ModelCollection.<Renderer>create();
- private final ModelCollection<BehaviorRenderer> behaviorRenderers = ModelCollection.<BehaviorRenderer>create();
-
- private ClassDescription renderKitClass;
-
- public RenderKit() {
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the renderKitClass
- */
- @Merge
- public ClassDescription getRenderKitClass() {
- return renderKitClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param renderKitClass the renderKitClass to set
- */
- public void setRenderKitClass(ClassDescription renderKitClass) {
- this.renderKitClass = renderKitClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the renderers
- */
- public Collection<Renderer> getRenderers() {
- return renderers;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the behaviorRenderers
- */
- public Collection<BehaviorRenderer> getBehaviorRenderers() {
- return behaviorRenderers;
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.model.ModelElement#accept(org.richfaces.cdk.model.LibraryVisitor, java.lang.Object)
- */
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- R result = visitor.visit(this, param);
-
- return ComponentLibrary.accept(renderers, visitor, param, result);
- }
-
- @Override
- public void merge(RenderKit other) {
- ComponentLibrary.merge(renderers,other.renderers);
- ComponentLibrary.merge(this, other);
- }
-
-
- @Override
- public boolean same(RenderKit other) {
- return null != getRenderKitClass() && getRenderKitClass().equals(other.getRenderKitClass());
- }
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
- @SuppressWarnings("serial")
- public static final class Id extends Key {
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param id
- */
- public Id(String type) {
-
- // Null value means default render kit.
- super(null == type ? RenderKitFactory.HTML_BASIC_RENDER_KIT : type);
- }
-
- public String getId() {
- return super.getType();
- }
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKit.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,128 @@
+/*
+ * $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.model;
+
+import java.util.Collection;
+
+import javax.faces.render.RenderKitFactory;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class RenderKitModel extends ModelElementBase implements ModelElement<RenderKitModel> {
+ private final ModelCollection<RendererModel> renderers = ModelCollection.<RendererModel>create();
+ private final ModelCollection<BehaviorRenderer> behaviorRenderers = ModelCollection.<BehaviorRenderer>create();
+
+ private ClassDescription renderKitClass;
+
+ public RenderKitModel() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the renderKitClass
+ */
+ @Merge
+ public ClassDescription getRenderKitClass() {
+ return renderKitClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param renderKitClass the renderKitClass to set
+ */
+ public void setRenderKitClass(ClassDescription renderKitClass) {
+ this.renderKitClass = renderKitClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the renderers
+ */
+ public Collection<RendererModel> getRenderers() {
+ return renderers;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the behaviorRenderers
+ */
+ public Collection<BehaviorRenderer> getBehaviorRenderers() {
+ return behaviorRenderers;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.richfaces.cdk.model.ModelElement#accept(org.richfaces.cdk.model.LibraryVisitor, java.lang.Object)
+ */
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ R result = visitor.visit(this, param);
+
+ return ComponentLibrary.accept(renderers, visitor, param, result);
+ }
+
+ @Override
+ public void merge(RenderKitModel other) {
+ ComponentLibrary.merge(renderers,other.renderers);
+ ComponentLibrary.merge(this, other);
+ }
+
+
+ @Override
+ public boolean same(RenderKitModel other) {
+ return null != getRenderKitClass() && getRenderKitClass().equals(other.getRenderKitClass());
+ }
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ @SuppressWarnings("serial")
+ public static final class Id extends Key {
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param id
+ */
+ public Id(String type) {
+
+ // Null value means default render kit.
+ super(null == type ? RenderKitFactory.HTML_BASIC_RENDER_KIT : type);
+ }
+
+ public String getId() {
+ return super.getType();
+ }
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RenderKitModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,216 +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.model;
-
-import java.util.Map;
-
-import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.templatecompiler.model.Template;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Renderer extends ModelElementBase implements ModelElement<Renderer> {
- private String family;
- private ClassDescription rendererClass;
- private Template template;
- private Type type;
-
- private boolean rendersChildren;
-
- private Tag tag;
-
- /**
- * <p class="changed_added_4_0">
- * Component attributes
- * </p>
- */
- private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
-
- public Renderer() {}
-
- public Renderer(Type type) {
- this.type = type;
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.model.ModelElement#getType()
- */
- public Type getKey() {
- return type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
-
- public Type getType() {
- return type;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the template
- */
- @Merge
- public Template getTemplate() {
- return template;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param template the template to set
- */
- public void setTemplate(Template template) {
- this.template = template;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the family
- */
- @Merge
- public String getFamily() {
- return family;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param family the family to set
- */
- public void setFamily(String family) {
- this.family = family;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the rendererClass
- */
- public ClassDescription getRendererClass() {
- return rendererClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param rendererClass the rendererClass to set
- */
- public void setRendererClass(ClassDescription rendererClass) {
- this.rendererClass = rendererClass;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the rendersChildren
- */
- public boolean isRendersChildren() {
- return this.rendersChildren;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param rendersChildren the rendersChildren to set
- */
- public void setRendersChildren(boolean rendersChildren) {
- this.rendersChildren = rendersChildren;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the attributes
- */
- public Map<String,Property> getAttributes() {
- return this.attributes;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @return the tag
- */
- public Tag getTag() {
- return this.tag;
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param tag the tag to set
- */
- public void setTag(Tag tag) {
- this.tag = tag;
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- @Override
- public void merge(Renderer other) {
- ComponentLibrary.merge(this, other);
- }
-
- @Override
- public boolean same(Renderer other) {
- if(null != getType() && null != other.getType()){
- // compare families ?
- if(null != getFamily() && null != other.getFamily() && !getFamily().equals(other.getFamily())){
- return false;
- }
- // Both types not null, compare them.
- return getType().equals(other.getType());
- }
- // one or both types are null, compare classes.
- if(null != getRendererClass()&& getRendererClass().equals(other.getRendererClass())){
- return true;
- }
- return false;
- }
-
- /**
- * <p class="changed_added_4_0">Key for lookup renderer in the model.</p>
- * @author asmirnov(a)exadel.com
- *
- */
- @SuppressWarnings("serial")
- public static class Type extends Key {
-
- /**
- * <p class="changed_added_4_0"></p>
- * TODO - use family as part of key ?
- * @param type
- */
- public Type(String type) {
- super(type);
- }
- }
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Renderer.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,220 @@
+/*
+ * $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.model;
+
+import java.util.Map;
+
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.templatecompiler.model.Template;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+//@SuppressWarnings("serial")
+public class RendererModel extends ModelElementBase implements ModelElement<RendererModel> {
+
+ private static final long serialVersionUID = -5802466539382148578L;
+
+ private String family;
+ private ClassDescription rendererClass;
+ private Template template;
+ private Type type;
+
+ private boolean rendersChildren;
+
+ private Tag tag;
+
+ /**
+ * <p class="changed_added_4_0">
+ * Component attributes
+ * </p>
+ */
+ private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
+
+ public RendererModel() {}
+
+ public RendererModel(Type type) {
+ this.type = type;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.richfaces.cdk.model.ModelElement#getType()
+ */
+ public Type getKey() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the template
+ */
+ @Merge
+ public Template getTemplate() {
+ return template;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param template the template to set
+ */
+ public void setTemplate(Template template) {
+ this.template = template;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the family
+ */
+ @Merge
+ public String getFamily() {
+ return family;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param family the family to set
+ */
+ public void setFamily(String family) {
+ this.family = family;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendererClass
+ */
+ public ClassDescription getRendererClass() {
+ return rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendererClass the rendererClass to set
+ */
+ public void setRendererClass(ClassDescription rendererClass) {
+ this.rendererClass = rendererClass;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the rendersChildren
+ */
+ public boolean isRendersChildren() {
+ return this.rendersChildren;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param rendersChildren the rendersChildren to set
+ */
+ public void setRendersChildren(boolean rendersChildren) {
+ this.rendersChildren = rendersChildren;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the attributes
+ */
+ public Map<String,Property> getAttributes() {
+ return this.attributes;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @return the tag
+ */
+ public Tag getTag() {
+ return this.tag;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param tag the tag to set
+ */
+ public void setTag(Tag tag) {
+ this.tag = tag;
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ @Override
+ public void merge(RendererModel other) {
+ ComponentLibrary.merge(this, other);
+ }
+
+ @Override
+ public boolean same(RendererModel other) {
+ if(null != getType() && null != other.getType()){
+ // compare families ?
+ if(null != getFamily() && null != other.getFamily() && !getFamily().equals(other.getFamily())){
+ return false;
+ }
+ // Both types not null, compare them.
+ return getType().equals(other.getType());
+ }
+ // one or both types are null, compare classes.
+ if(null != getRendererClass()&& getRendererClass().equals(other.getRendererClass())){
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Key for lookup renderer in the model.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+ public static class Type extends Key {
+
+ private static final long serialVersionUID = -7819560321446149642L;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * TODO - use family as part of key ?
+ * @param type
+ */
+ public Type(String type) {
+ super(type);
+ }
+ }
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/RendererModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2010-01-05 12:32:43 UTC (rev 16239)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -1,89 +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.model;
-
-import org.richfaces.cdk.CdkException;
-
-/**
- * <p class="changed_added_4_0"></p>
- * @author asmirnov(a)exadel.com
- *
- */
-@SuppressWarnings("serial")
-public class Validator implements ModelElement<Validator> {
- private Type type;
-
- public Validator() {
- }
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public Validator(Type type) {
- this.type = type;
- }
-
- @Override
- public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
- return visitor.visit(this, param);
- }
-
- /*
- * (non-Javadoc)
- * @see org.richfaces.cdk.model.ModelElement#getType()
- */
- public Type getType() {
- return type;
- }
-
-
- /**
- * <p class="changed_added_4_0"></p>
- * @param type the type to set
- */
- public void setType(Type type) {
- this.type = type;
- }
-
- @Override
- public void merge(Validator other) {
-
- // TODO Auto-generated method stub
- }
-
- @Override
- public boolean same(Validator other) {
- return null != getType() && getType().equals(other.getType());
- }
-
- public static final class Type extends Key {
- public Type(String name) {
- super(name);
- }
- }
-
-}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java (from rev 16233, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Validator.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-01-05 13:31:41 UTC (rev 16240)
@@ -0,0 +1,89 @@
+/*
+ * $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.model;
+
+import org.richfaces.cdk.CdkException;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@SuppressWarnings("serial")
+public class ValidatorModel implements ModelElement<ValidatorModel> {
+ private Type type;
+
+ public ValidatorModel() {
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public ValidatorModel(Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
+ return visitor.visit(this, param);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.richfaces.cdk.model.ModelElement#getType()
+ */
+ public Type getType() {
+ return type;
+ }
+
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param type the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public void merge(ValidatorModel other) {
+
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public boolean same(ValidatorModel other) {
+ return null != getType() && getType().equals(other.getType());
+ }
+
+ public static final class Type extends Key {
+ public Type(String name) {
+ super(name);
+ }
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
15 years, 2 months
JBoss Rich Faces SVN: r16239 - branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-01-05 07:32:43 -0500 (Tue, 05 Jan 2010)
New Revision: 16239
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java
Log:
https://jira.jboss.org/jira/browse/RFPL-318
* test case refactored in order to provide more stable results
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java 2010-01-05 12:08:08 UTC (rev 16238)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/fileUpload/FileUploadTestCase.java 2010-01-05 12:32:43 UTC (rev 16239)
@@ -272,7 +272,12 @@
waitFor(3000);
selenium.attachFile(LOC_ADD_BUTTON, "file://" + FILE_CYAN);
- waitForElement(LOC_UPLOADED_LIST_TR);
+ Wait.failWith("Files were not uploaded.").until(new Condition() {
+ public boolean isTrue() {
+ return getJQueryCount(LOC_UPLOADED_LIST_TR) == 1;
+ }
+ });
+
count = getJQueryCount(LOC_UPLOADED_LIST_TR);
assertEquals(count, 1, MSG_RIGHT_PANEL_NUMBER_OF_ITEMS);
}
@@ -340,7 +345,11 @@
assertFalse(isDisplayed(LOC_CLEAR_ALL_BUTTON_STYLE), MSG_CLEAR_ALL_BUTTON_NOT_VISIBLE);
selenium.click(LOC_UPLOAD_BUTTON);
- waitForElement(LOC_UPLOADED_LIST_TR);
+ Wait.failWith("Files were not uploaded.").until(new Condition() {
+ public boolean isTrue() {
+ return getJQueryCount(LOC_UPLOADED_LIST_TR) == 2;
+ }
+ });
assertTrue(isDisplayed(LOC_CLEAR_ALL_BUTTON_STYLE), MSG_CLEAR_ALL_BUTTON_VISIBLE);
@@ -367,11 +376,19 @@
assertFalse(selenium.isElementPresent(LOC_CLEAR_UPLOADED_DATA_BUTTON),
MSG_CLEAR_UPLOADED_DATA_BUTTON_NOT_VISIBLE);
- waitFor(2000);
+ Wait.failWith("There should be 2 files in the list.").until(new Condition() {
+ public boolean isTrue() {
+ return getJQueryCount(LOC_NOT_UPLOADED_LIST_TR) == 2;
+ }
+ });
selenium.click(LOC_UPLOAD_BUTTON);
- waitForElement(LOC_UPLOADED_LIST_TR);
-
+ Wait.failWith("Files were not uploaded").until(new Condition() {
+ public boolean isTrue() {
+ return getJQueryCount(LOC_UPLOADED_LIST_TR) == 2;
+ }
+ });
+
assertTrue(selenium.isElementPresent(LOC_CLEAR_UPLOADED_DATA_BUTTON), MSG_CLEAR_UPLOADED_DATA_BUTTON_VISIBLE);
selenium.click(LOC_CLEAR_UPLOADED_DATA_BUTTON);
15 years, 2 months
JBoss Rich Faces SVN: r16238 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-01-05 07:08:08 -0500 (Tue, 05 Jan 2010)
New Revision: 16238
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
Log:
find UIDataTable parent
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-01-05 12:06:08 UTC (rev 16237)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-01-05 12:08:08 UTC (rev 16238)
@@ -21,8 +21,6 @@
package org.richfaces.component;
-import java.io.IOException;
-
import javax.el.ELContext;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
@@ -141,17 +139,22 @@
public DataTableState getParentState() {
DataTableState dataTableState = null;
- //TODO nick - walk by parents until UIDataTable is found or no parent exists
- UIComponent component = getParent();
- if (component instanceof UIDataTable) {
- UIDataTable dataTable = (UIDataTable) component;
- DataComponentState state = dataTable.getComponentState();
+ UIComponent parent = getParent();
+ while(parent != null && !(parent instanceof UIDataTable)) {
+ parent = parent.getParent();
+ }
+
+ if(parent == null) {
+ throw new AbortProcessingException("UISubTable should have a UIDataTable parent");
+ }
+
+ UIDataTable dataTable = (UIDataTable) parent;
+ DataComponentState state = dataTable.getComponentState();
- if (state instanceof DataTableState) {
- dataTableState = (DataTableState) state;
- }
+ if (state instanceof DataTableState) {
+ dataTableState = (DataTableState) state;
}
-
+
return dataTableState;
}
@@ -162,6 +165,7 @@
if (parentState != null) {
//TODO nick - use getClientId(FacesContext)
+ //what's wrong with getClientId()???
state = parentState.getChildState(getClientId());
}
@@ -218,14 +222,15 @@
}
MethodExpression expression = getToggleListener();
+ FacesContext context = getFacesContext();
+
if (expression != null) {
- expression.invoke(getFacesContext().getELContext(), new Object[] { toggleEvent });
+ expression.invoke(context.getELContext(), new Object[] { toggleEvent });
}
UIToggleControl toggle = (UIToggleControl)toggleEvent.getSource();
// toggle.addExecuteId((String)getAttributes().get("clientId"));
- //TODO nick - replace with getClientId(FacesContext)
- toggle.addRenderId((String)getAttributes().get("clientId"));
+ toggle.addRenderId(getClientId(context));
}
}
15 years, 2 months
JBoss Rich Faces SVN: r16237 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-01-05 07:06:08 -0500 (Tue, 05 Jan 2010)
New Revision: 16237
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
Log:
store row/cell classes and cell element in attributes map using client id.
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -49,9 +49,7 @@
Row row = holder.getRow();
row.setRowKey(context, rowKey);
try {
- encodeRowBegin(context, holder);
encodeRow(holder);
- encodeRowEnd(context, holder);
} catch (IOException e) {
// TODO: seems we need add throws IOException ???
}
@@ -71,12 +69,6 @@
public abstract void encodeRow(RowHolderBase rowHolder) throws IOException;
- public void encodeRowBegin(FacesContext context, RowHolderBase holder) throws IOException {
- }
-
- public void encodeRowEnd(FacesContext context, RowHolderBase holder) throws IOException {
- }
-
@Override
protected void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent component)
throws IOException {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -131,13 +131,26 @@
dataTable.setRowKey(context, null);
encodeTableStructure(writer, context, dataTable);
- put(context, CELL_ELEMENT_KEY, HTML.TH_ELEM);
+
+ String id = dataTable.getClientId(context);
+ put(context, id, CELL_ELEMENT_KEY, HTML.TH_ELEM);
encodeHeaderFacet(writer, context, dataTable);
encodeFooterFacet(writer, context, dataTable);
- put(context, CELL_ELEMENT_KEY, HTML.TD_ELEM);
+ put(context, id, CELL_ELEMENT_KEY, HTML.TD_ELEM);
dataTable.setRowKey(context, key);
dataTable.restoreOrigValue(context);
+ String rowClass = dataTable.getRowSkinClass();
+ String cellClass = dataTable.getCellSkinClass();
+ String firstClass = dataTable.getFirstRowSkinClass();
+
+ rowClass = mergeStyleClasses("rowClass", rowClass, dataTable);
+ cellClass = mergeStyleClasses("cellClass", cellClass, dataTable);
+ firstClass = mergeStyleClasses("firstRowClass", firstClass, dataTable);
+
+ saveRowStyles(context,id, firstClass, rowClass, cellClass);
+
+
}
@Override
@@ -192,6 +205,7 @@
}
int columns = getColumnsCount(dataTable);
+ String id = dataTable.getClientId(context);
if (columnFacetPresent) {
@@ -204,11 +218,11 @@
cellClass = mergeStyleClasses("columnFooterCellClass", cellClass, dataTable);
firstClass = mergeStyleClasses("firstColumnFooterClass", firstClass, dataTable);
- saveRowStyles(context, firstClass, rowClass, cellClass);
+ saveRowStyles(context,id, firstClass, rowClass, cellClass);
writer.startElement(HTML.TR_ELEMENT, dataTable);
encodeStyleClass(writer, context, dataTable, null, rowClass);
- encodeColumnFacet(context, writer, dataTable.columns(), "footer",columns, cellClass);
+ encodeColumnFacet(context, writer, dataTable, "footer",columns, cellClass);
writer.endElement(HTML.TR_ELEMENT);
}
@@ -222,8 +236,8 @@
cellClass = mergeStyleClasses("footerCellClass", cellClass, dataTable);
firstClass = mergeStyleClasses("footerFirstClass", firstClass, dataTable);
// TODO nick - rename method "encodeTableHeaderFacet"
- saveRowStyles(context, firstClass, rowClass, cellClass);
- encodeTableFacet(context, writer, columns, footer, "footer", rowClass, cellClass);
+ saveRowStyles(context, id, firstClass, rowClass, cellClass);
+ encodeTableFacet(context, writer, id, columns, footer, "footer", rowClass, cellClass);
}
if (encodeTfoot) {
@@ -264,7 +278,8 @@
}
int columns = getColumnsCount(dataTable);
-
+ String id = dataTable.getClientId(context);
+
if (header != null && header.isRendered()) {
String rowClass = dataTable.getHeaderSkinClass();
@@ -274,9 +289,9 @@
rowClass = mergeStyleClasses("headerClass", rowClass, dataTable);
cellClass = mergeStyleClasses("headerCellClass", cellClass, dataTable);
firstClass = mergeStyleClasses("headerFirstClass", firstClass, dataTable);
- saveRowStyles(context, firstClass, rowClass, cellClass);
+ saveRowStyles(context, id, firstClass, rowClass, cellClass);
- encodeTableFacet(context, writer, columns, header, "header", rowClass, cellClass);
+ encodeTableFacet(context, writer, id, columns, header, "header", rowClass, cellClass);
}
if (isEncodeHeaders) {
@@ -288,12 +303,12 @@
rowClass = mergeStyleClasses("columnHeaderClass", rowClass, dataTable);
cellClass = mergeStyleClasses("columnHeaderCellClass", cellClass, dataTable);
firstClass = mergeStyleClasses("columnHeaderFirstClass", firstClass, dataTable);
- saveRowStyles(context, firstClass, rowClass, cellClass);
+ saveRowStyles(context, id, firstClass, rowClass, cellClass);
writer.startElement(HTML.TR_ELEMENT, dataTable);
encodeStyleClass(writer, context, dataTable, null, rowClass);
- encodeColumnFacet(context, writer, dataTable.columns(), "header", columns, cellClass);
+ encodeColumnFacet(context, writer, dataTable, "header", columns, cellClass);
writer.endElement(HTML.TR_ELEMENT);
}
@@ -304,11 +319,14 @@
}
- protected void encodeColumnFacet(FacesContext context, ResponseWriter writer, Iterator<UIComponent> headers, String facetName, int colCount, String cellClass) throws IOException {
+ protected void encodeColumnFacet(FacesContext context, ResponseWriter writer, UIDataTableBase dataTableBase, String facetName, int colCount, String cellClass) throws IOException {
int tColCount = 0;
- String element = getCellElement(context);
+ String id = dataTableBase.getClientId(context);
+ String element = getCellElement(context, id);
+ Iterator<UIComponent> headers = dataTableBase.columns();
+
while (headers.hasNext()) {
UIComponent column = headers.next();
if (!column.isRendered()) {
@@ -347,10 +365,10 @@
}
}
- protected void encodeTableFacet(FacesContext context,ResponseWriter writer, int columns, UIComponent footer, String facetName, String rowClass, String cellClass) throws IOException {
+ protected void encodeTableFacet(FacesContext context,ResponseWriter writer, String id, int columns, UIComponent footer, String facetName, String rowClass, String cellClass) throws IOException {
boolean isColumnGroup = (footer instanceof Row);
- String element = getCellElement(context);
+ String element = getCellElement(context, id);
if(!isColumnGroup) {
writer.startElement(HTML.TR_ELEMENT, footer);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -7,8 +7,10 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.event.AbortProcessingException;
import org.richfaces.component.UIColumnGroup;
+import org.richfaces.component.UIDataTableBase;
public class ColumnGroupRenderer extends DataTableRowsRenderer {
@@ -32,7 +34,17 @@
@Override
public RowHolderBase createRowHolder(FacesContext context, UIComponent component) {
- return new RowHolder(context, (UIColumnGroup)component);
+
+ UIComponent parent = component.getParent();
+ while(parent != null && !(parent instanceof UIDataTableBase)) {
+ parent = parent.getParent();
+ }
+
+ if(parent == null) {
+ throw new AbortProcessingException("UIColumnGroup should be a child of UIDataTable or UISubTable");
+ }
+
+ return new RowHolder(context, parent.getClientId(context),(UIColumnGroup)component);
}
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -56,24 +56,9 @@
@Override
public RowHolder createRowHolder(FacesContext context, UIComponent component) {
- return new RowHolder(context, (UIDataTable)component);
+ return new RowHolder(context, component.getClientId(context), (UIDataTable)component);
}
- @Override
- public void encodeRowBegin(FacesContext context, RowHolderBase holder) throws IOException {
- UIDataTable dataTable = (UIDataTable)holder.getRow();
-
- String rowClass = dataTable.getRowSkinClass();
- String cellClass = dataTable.getCellSkinClass();
- String firstClass = dataTable.getFirstRowSkinClass();
-
- rowClass = mergeStyleClasses("rowClass", rowClass, dataTable);
- cellClass = mergeStyleClasses("cellClass", cellClass, dataTable);
- firstClass = mergeStyleClasses("firstRowClass", firstClass, dataTable);
-
- saveRowStyles(context, firstClass, rowClass, cellClass);
- }
-
public void encodeRow(RowHolderBase holder) throws IOException {
FacesContext context = holder.getContext();
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/DataTableRowsRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -23,6 +23,8 @@
public RowHolder encodeColumn(FacesContext context, UIColumn component, ResponseWriter writer, RowHolder holder) throws IOException {
+ String parentId = holder.getDataTableId();
+
if (component instanceof org.richfaces.component.UIColumn) {
org.richfaces.component.UIColumn column = (org.richfaces.component.UIColumn) component;
if (column.isBreakBefore() && holder.getProcessCell() != 0) {
@@ -34,17 +36,17 @@
if (holder.isRowStart()) {
if (holder.getCurrentRow() == 0) {
- encodeFirstRowStart(writer, context, component, holder);
+ encodeFirstRowStart(writer, context, parentId, component);
} else {
- encodeRowStart(writer, context, component, holder);
+ encodeRowStart(writer, context, parentId, component);
}
holder.setRowStart(false);
}
- encodeColumnStart(writer, context, component, holder);
+ encodeColumnStart(writer, context, parentId, component);
renderChildren(context, component);
- encodeColumnEnd(writer, context, component, holder);
+ encodeColumnEnd(writer, context, parentId, component);
if (holder.isLastColumn()) {
if (holder.getCurrentRow() == 0) {
@@ -58,9 +60,9 @@
return holder;
}
- public void encodeColumnStart(ResponseWriter writer, FacesContext context, UIComponent component, RowHolderBase holder) throws IOException {
- writer.startElement(getCellElement(context), component);
- String cellClass = getCellClass(holder.getContext());
+ public void encodeColumnStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.startElement(getCellElement(context, parentId), component);
+ String cellClass = getCellClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, cellClass);
if (component instanceof org.richfaces.component.UIColumn) {
@@ -78,14 +80,14 @@
}
}
- public void encodeColumnEnd(ResponseWriter writer, FacesContext context, UIComponent component, RowHolderBase holder) throws IOException {
- writer.endElement(getCellElement(context));
+ public void encodeColumnEnd(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
+ writer.endElement(getCellElement(context, parentId));
}
- public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, UIComponent component, RowHolderBase holder) throws IOException {
+ public void encodeFirstRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
writer.startElement(HTML.TR_ELEMENT, component);
getUtils().encodeId(context, component);
- String styleClass = getFirstRowClass(holder.getContext());
+ String styleClass = getFirstRowClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
}
@@ -93,10 +95,10 @@
writer.endElement(HTML.TR_ELEMENT);
}
- public void encodeRowStart(ResponseWriter writer, FacesContext context, UIComponent component, RowHolderBase holder) throws IOException {
+ public void encodeRowStart(ResponseWriter writer, FacesContext context, String parentId, UIComponent component) throws IOException {
writer.startElement(HTML.TR_ELEMENT, component);
getUtils().encodeId(context, component);
- String styleClass = getRowClass(holder.getContext());
+ String styleClass = getRowClass(context, parentId);
encodeStyleClass(writer, context, component, HTML.STYLE_CLASS_ATTR, styleClass);
}
@@ -105,35 +107,35 @@
}
- protected String getFirstRowClass(FacesContext context) {
- return get(context, FIRST_ROW_CLASS_KEY);
+ protected String getFirstRowClass(FacesContext context, String id) {
+ return get(context, id + FIRST_ROW_CLASS_KEY);
}
- protected String getRowClass(FacesContext context) {
- return get(context, ROW_CLASS_KEY);
+ protected String getRowClass(FacesContext context, String id) {
+ return get(context, id + ROW_CLASS_KEY);
}
- protected String getCellClass(FacesContext context) {
- return get(context, CELL_CLASS_KEY);
+ protected String getCellClass(FacesContext context, String id) {
+ return get(context, id + CELL_CLASS_KEY);
}
- protected String getCellElement(FacesContext context) {
- return get(context, CELL_ELEMENT_KEY);
+ protected String getCellElement(FacesContext context, String id) {
+ return get(context, id + CELL_ELEMENT_KEY);
}
private String get(FacesContext context, String key) {
return (String)context.getAttributes().get(key);
}
- protected void put(FacesContext context, String key, String value) {
- context.getAttributes().put(key, value);
+ protected void put(FacesContext context, String id, String key, String value) {
+ context.getAttributes().put(id + key, value);
}
//TODO nick - nested tables will not work correct
- protected void saveRowStyles(FacesContext context, String firstRowClass, String rowClass, String cellClass) {
- put(context, FIRST_ROW_CLASS_KEY, firstRowClass);
- put(context, ROW_CLASS_KEY, rowClass);
- put(context, CELL_CLASS_KEY, cellClass);
+ protected void saveRowStyles(FacesContext context, String id, String firstRowClass, String rowClass, String cellClass) {
+ put(context, id, FIRST_ROW_CLASS_KEY, firstRowClass);
+ put(context, id, ROW_CLASS_KEY, rowClass);
+ put(context, id, CELL_CLASS_KEY, cellClass);
}
public void encodeStyleClass(ResponseWriter writer, FacesContext context, UIComponent component,
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -381,13 +381,6 @@
}
@Override
- protected void encodeTableFacet(FacesContext context, ResponseWriter writer, int columns, UIComponent facet,
- String facetName, String rowClass, String cellClass) throws IOException {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public boolean containsThead() {
return false;
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -10,6 +10,8 @@
private int processCell;
+ private String dataTableId;
+
private boolean isLastColumn;
private boolean isRowStart;
@@ -19,11 +21,19 @@
return this.row;
}
- public RowHolder(FacesContext context, Row row) {
+ public RowHolder(FacesContext context, String dataTableId, Row row) {
this(context, row, 0, true);
-
+ this.dataTableId = dataTableId;
}
+ public String getDataTableId() {
+ return dataTableId;
+ }
+
+ public void setDataTableId(String dataTableId) {
+ this.dataTableId = dataTableId;
+ }
+
public RowHolder(FacesContext context, Row row, int processCell, boolean isRowStart) {
super(context);
this.row = row;
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-01-05 12:06:08 UTC (rev 16237)
@@ -30,19 +30,19 @@
cellClass = mergeStyleClasses("cellClass", cellClass, subTable);
firstClass = mergeStyleClasses("firstRowClass", firstClass, subTable);
- saveRowStyles(context, firstClass, rowClass, cellClass);
+ saveRowStyles(context, subTable.getClientId(context), firstClass, rowClass, cellClass);
}
@Override
public void encodeTableStart(ResponseWriter writer, FacesContext context, UIDataTableBase dataTable) throws IOException {
- put(context, CELL_ELEMENT_KEY, HTML.TD_ELEM);
+ put(context, dataTable.getClientId(context), CELL_ELEMENT_KEY, HTML.TD_ELEM);
UISubTable subTable = (UISubTable)dataTable;
encodeTableBodyStart(writer, context, subTable);
}
@Override
public RowHolderBase createRowHolder(FacesContext context, UIComponent component) {
- return new RowHolder(context, (UISubTable)component);
+ return new RowHolder(context, component.getClientId(context), (UISubTable)component);
}
@Override
15 years, 2 months
JBoss Rich Faces SVN: r16236 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-01-04 14:03:05 -0500 (Mon, 04 Jan 2010)
New Revision: 16236
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
Log:
RF-7868
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-04 18:08:50 UTC (rev 16235)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-04 19:03:05 UTC (rev 16236)
@@ -341,7 +341,7 @@
/**
* @deprecated
- * TODO should be
+ * TODO Other approaches of updating width of columns should be discussed.
*/
private void updateWidthOfColumns(UIComponent component, String widthString) {
if (widthString != null && widthString.length() > 0) {
15 years, 2 months
JBoss Rich Faces SVN: r16235 - in root/ui-sandbox/trunk/components/tables/ui/src/main: resources/META-INF/resources and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-01-04 13:08:50 -0500 (Mon, 04 Jan 2010)
New Revision: 16235
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js
Log:
RF-7868
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-04 13:13:05 UTC (rev 16234)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-01-04 18:08:50 UTC (rev 16235)
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -140,6 +141,7 @@
writer.endElement(HTML.DIV_ELEM);
writer.startElement(HTML.INPUT_ELEM, component);
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context) + ":wi", null);
+ writer.writeAttribute(HTML.NAME_ATTRIBUTE, component.getClientId(context) + ":wi", null);
writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
writer.endElement(HTML.INPUT_ELEM);
writer.startElement(HTML.SCRIPT_ELEM, component);
@@ -329,9 +331,35 @@
writer.endElement(HTML.TR_ELEMENT);
}
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+ Map<String, String> map = context.getExternalContext().getRequestParameterMap();
+ updateWidthOfColumns(component, map.get(component.getClientId(context) + ":wi"));
+ }
+
+ /**
+ * @deprecated
+ * TODO should be
+ */
+ private void updateWidthOfColumns(UIComponent component, String widthString) {
+ if (widthString != null && widthString.length() > 0) {
+ String[] widthArray = widthString.split(",");
+ for (int i = 0; i < widthArray.length; i++) {
+ String[] widthEntry = widthArray[i].split(":");
+ UIComponent column = component.findComponent(widthEntry[0]);
+ if (!widthEntry[1].equals(column.getAttributes().get("width"))) {
+ column.getAttributes().put("width", widthEntry[1]);
+ }
+ }
+
+ }
+ }
+
private String getColumnWidth(UIComponent column) {
String width = (String) column.getAttributes().get("width");
- if (width == null || width.indexOf("%") != -1) {
+ if (width == null || width.length() == 0 || width.indexOf("%") != -1) {
width = "100px";
}
return width;
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js 2010-01-04 13:13:05 UTC (rev 16234)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/resources/extendedDataTable.js 2010-01-04 18:08:50 UTC (rev 16235)
@@ -168,6 +168,7 @@
widthInput.value = widthsArray.toString();
updateLayout();
adjustResizers();
+ richfaces.ajax(element, event); // Maybe, event model should be used here.
};
jQuery(document).ready(initializeLayout);
15 years, 2 months
JBoss Rich Faces SVN: r16234 - branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxSamples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-01-04 08:13:05 -0500 (Mon, 04 Jan 2010)
New Revision: 16234
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxSamples/rsBean.java
Log:
https://jira.jboss.org/jira/browse/RF-8211
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxSamples/rsBean.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxSamples/rsBean.java 2010-01-03 23:35:42 UTC (rev 16233)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/ajaxSamples/rsBean.java 2010-01-04 13:13:05 UTC (rev 16234)
@@ -1,6 +1,8 @@
package org.richfaces.demo.ajaxSamples;
-public class rsBean {
+import java.io.Serializable;
+
+public class rsBean implements Serializable{
private Integer addent1;
private Integer addent2;
private Integer sum;
15 years, 2 months