JBoss Rich Faces SVN: r10955 - trunk/test-applications/auto-jsp/src/main/java/combobox.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-10-28 12:30:37 -0400 (Tue, 28 Oct 2008)
New Revision: 10955
Modified:
trunk/test-applications/auto-jsp/src/main/java/combobox/Combobox.java
Log:
Add validatorCheck method
Modified: trunk/test-applications/auto-jsp/src/main/java/combobox/Combobox.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/combobox/Combobox.java 2008-10-28 16:24:42 UTC (rev 10954)
+++ trunk/test-applications/auto-jsp/src/main/java/combobox/Combobox.java 2008-10-28 16:30:37 UTC (rev 10955)
@@ -4,14 +4,22 @@
import java.util.List;
import java.util.Random;
import org.richfaces.component.html.HtmlComboBox;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
import javax.faces.model.SelectItem;
+import javax.faces.validator.ValidatorException;
import util.componentInfo.ComponentInfo;
import util.data.Data;
+import util.parser.Attribute;
+import util.parser.Status;
+import util.parser.TLDParser;
+import util.phaseTracker.PhaseTracker;
public class Combobox {
public boolean disabled;
@@ -39,7 +47,48 @@
private String bindLabel;
private String align;
+ // for validator check
+ TLDParser tldParser = new TLDParser("comboBox");
+ private String statusValidator = "FAILED";
+ private String phaseValidator = "UNDEFINED";
+ private String validatorMessage = "Test Validator Message";
+
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+ statusValidator = "PASSED";
+ phaseValidator = PhaseTracker.currentPhase.toString();
+
+ String selectedItem = null;
+ if (value != null)
+ selectedItem = value.toString();
+ if (selectedItem.equals("Gosha"))
+ throw new ValidatorException(new FacesMessage());
+ }
+
+ public int validatorCheck() {
+ ArrayList<Attribute> attrs = tldParser.getAllAttributes();
+ int index = attrs.indexOf(new Attribute("validator"));
+ if (index == -1) {
+
+ } else {
+ Attribute attr = attrs.get(index);
+ if (statusValidator.equals("PASSED")) {
+ if (phaseValidator.equals("PROCESS_VALIDATIONS(3)")) {
+ attr.setStatus(Status.PASSED);
+ } else {
+ attr.setStatus(Status.FAILED);
+ attr.setDescription("Validator was triggered in incorrect phase");
+ }
+ } else {
+ attr.setStatus(Status.FAILED);
+ attr.setDescription("Validator was not triggered");
+ }
+ }
+
+ return 0;
+ }
+
public Combobox() {
this.disabled = false;
this.defaultLabel = "defaultLabel";
@@ -49,7 +98,7 @@
this.immediate = false;
this.inputSize = 4;
this.width = "300";
- this.value = new Data("default",0);
+ this.value = new Data("default", 0);
this.tabindex = 2;
this.showDelay = "200";
this.required = false;
@@ -63,8 +112,8 @@
this.selectItem = new ArrayList<SelectItem>();
this.bindLabel = "Click Binding";
this.align = "left";
- Random r = new Random();
- for(int i = 0; i < 10; i++){
+ Random r = new Random();
+ for (int i = 0; i < 10; i++) {
suggestionValues.add(new Data("selectItem", i));
selectItem.add(new SelectItem("selectItem"));
System.out.println(selectItem.get(i).getValue().toString());
@@ -258,12 +307,12 @@
public void setBindLabel(String bindLabel) {
this.bindLabel = bindLabel;
}
-
- public void checkBinding(ActionEvent actionEvent){
+
+ public void checkBinding(ActionEvent actionEvent) {
FacesContext context = FacesContext.getCurrentInstance();
bindLabel = htmlComboBox.getClientId(context);
- }
-
+ }
+
public String getAlign() {
return align;
}
@@ -271,9 +320,33 @@
public void setAlign(String align) {
this.align = align;
}
-
- public void addHtmlCombobox(){
+
+ public void addHtmlCombobox() {
ComponentInfo info = ComponentInfo.getInstance();
info.addField(htmlComboBox);
}
+
+ public String getStatusValidator() {
+ return statusValidator;
+ }
+
+ public void setStatusValidator(String statusValidator) {
+ this.statusValidator = statusValidator;
+ }
+
+ public String getPhaseValidator() {
+ return phaseValidator;
+ }
+
+ public void setPhaseValidator(String phaseValidator) {
+ this.phaseValidator = phaseValidator;
+ }
+
+ public String getValidatorMessage() {
+ return validatorMessage;
+ }
+
+ public void setValidatorMessage(String validatorMessage) {
+ this.validatorMessage = validatorMessage;
+ }
}
16 years, 2 months
JBoss Rich Faces SVN: r10954 - trunk/test-applications/auto-jsp/src/main/java/util/phaseTracker.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-10-28 12:24:42 -0400 (Tue, 28 Oct 2008)
New Revision: 10954
Modified:
trunk/test-applications/auto-jsp/src/main/java/util/phaseTracker/PhaseTracker.java
Log:
Add "public static PhaseId currentPhase;" variable.
Modified: trunk/test-applications/auto-jsp/src/main/java/util/phaseTracker/PhaseTracker.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/phaseTracker/PhaseTracker.java 2008-10-28 16:23:34 UTC (rev 10953)
+++ trunk/test-applications/auto-jsp/src/main/java/util/phaseTracker/PhaseTracker.java 2008-10-28 16:24:42 UTC (rev 10954)
@@ -3,10 +3,6 @@
*/
package util.phaseTracker;
-import java.util.Iterator;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
@@ -16,7 +12,12 @@
*
*/
public class PhaseTracker implements PhaseListener {
-
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 6533052212003582848L;
+
+ /** The Current JSF phase of the application. */
+ public static PhaseId currentPhase = PhaseId.ANY_PHASE;
+
/* (non-Javadoc)
* @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
*/
@@ -28,13 +29,8 @@
* @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
*/
public void beforePhase(PhaseEvent arg0) {
+ currentPhase = arg0.getPhaseId();
System.out.println("PhaseTracker.beforePhase()" + arg0.getPhaseId());
-// ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
-// Iterator names = externalContext.getRequestParameterNames();
-// while (names.hasNext()) {
-// System.out.println(names.next());
-// }
-
}
/* (non-Javadoc)
@@ -43,5 +39,4 @@
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
-
}
16 years, 2 months
JBoss Rich Faces SVN: r10953 - trunk/test-applications/auto-jsp/src/main/java/util/parser.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 12:23:34 -0400 (Tue, 28 Oct 2008)
New Revision: 10953
Added:
trunk/test-applications/auto-jsp/src/main/java/util/parser/Status.java
Modified:
trunk/test-applications/auto-jsp/src/main/java/util/parser/Attribute.java
Log:
Move enum Status to it's own file.
Modified: trunk/test-applications/auto-jsp/src/main/java/util/parser/Attribute.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/parser/Attribute.java 2008-10-28 16:19:12 UTC (rev 10952)
+++ trunk/test-applications/auto-jsp/src/main/java/util/parser/Attribute.java 2008-10-28 16:23:34 UTC (rev 10953)
@@ -59,6 +59,11 @@
return "[" + "Name: " + name + "\r\n" + "Description: " + description + "\r\n" +
"Type: " + type + "\r\n" + "Status: " + status + "]";
}
-}
-
- enum Status {NOT_READY, IMPLEMENTED, FAILED, PASSED}
+
+ @Override
+ public boolean equals(Object obj) {
+ Attribute attr = (Attribute) obj;
+
+ return (attr.getName().equals(this.name));
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/auto-jsp/src/main/java/util/parser/Status.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/parser/Status.java (rev 0)
+++ trunk/test-applications/auto-jsp/src/main/java/util/parser/Status.java 2008-10-28 16:23:34 UTC (rev 10953)
@@ -0,0 +1,3 @@
+package util.parser;
+
+public enum Status {NOT_READY, IMPLEMENTED, FAILED, PASSED}
\ No newline at end of file
16 years, 2 months
JBoss Rich Faces SVN: r10952 - trunk/test-applications/auto-jsp/src/main/java/util/parser.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 12:19:12 -0400 (Tue, 28 Oct 2008)
New Revision: 10952
Modified:
trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java
Log:
allAttributes.clear();
Modified: trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 16:08:55 UTC (rev 10951)
+++ trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 16:19:12 UTC (rev 10952)
@@ -20,7 +20,7 @@
}
public AttributesList getAllAttributes() {
-
+ allAttributes.clear();
tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
InputStream input = null;
try {
16 years, 2 months
JBoss Rich Faces SVN: r10951 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/ajaxPoll and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-10-28 12:08:55 -0400 (Tue, 28 Oct 2008)
New Revision: 10951
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxPoll/ajaxPollAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxPollTest.java
Log:
https://jira.jboss.org/jira/browse/RF-4736
https://jira.jboss.org/jira/browse/RF-4737
https://jira.jboss.org/jira/browse/RF-4738
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java 2008-10-28 15:57:28 UTC (rev 10950)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/A4JPollTestBean.java 2008-10-28 16:08:55 UTC (rev 10951)
@@ -3,56 +3,74 @@
import javax.faces.event.ActionEvent;
public class A4JPollTestBean {
-
- private Integer i = 1;
-
- private static final String POLLING = "Polling";
-
- private boolean enabled = false;
-
- public void start(ActionEvent event) {
- enabled = true;
- }
-
- public void listener(ActionEvent event) {
- i++;
- if (i == 8) {
- enabled = false;
- }
- }
-
- public String getText() {
- return POLLING.substring(0, i);
- }
- /**
- * @return the i
- */
- public Integer getI() {
- return i;
- }
+ private Integer i = 1;
- /**
- * @param i the i to set
- */
- public void setI(Integer i) {
- this.i = i;
- }
+ private static final String POLLING = "Polling";
- /**
- * @return the enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
+ private boolean enabled = false;
- /**
- * @param enabled the enabled to set
- */
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
-
-
+ private String content = "content";
+ /**
+ * Gets value of content field.
+ * @return value of content field
+ */
+ public String getContent() {
+ return content;
+ }
+
+ /**
+ * Set a new value for content field.
+ * @param content a new value for content field
+ */
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public void start(ActionEvent event) {
+ enabled = true;
+ }
+
+ public void listener(ActionEvent event) {
+ i++;
+ if (i == 8) {
+ enabled = false;
+ }
+ }
+
+ public String getText() {
+ return POLLING.substring(0, i);
+ }
+
+ /**
+ * @return the i
+ */
+ public Integer getI() {
+ return i;
+ }
+
+ /**
+ * @param i
+ * the i to set
+ */
+ public void setI(Integer i) {
+ this.i = i;
+ }
+
+ /**
+ * @return the enabled
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param enabled
+ * the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/ajaxPoll/ajaxPollAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxPollTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-10-28 15:57:28 UTC (rev 10950)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxPollTest.java 2008-10-28 16:08:55 UTC (rev 10951)
@@ -100,11 +100,33 @@
tester.testExtrenalValidationFailure();
}
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test ajaxSingle attribute");
+ tester.testAjaxSingle();
+ }
+
+ @Test
+ public void testAjaxSingleWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test ajaxSingle attribute in case of invalid children state");
+ tester.testAjaxSingleWithInternalValidationFailed();
+ }
+
@Override
public void sendAjax() {
delay(2000);
}
+ @Override
+ public void setInternalValidationFailed() {
+ String childCompId = getAutoTester(this).getClientId("") + "child";
+ setValueById(childCompId, "");
+ }
+
private void enablePoll(String id) {
writeStatus("Enable polling...");
try {
16 years, 2 months
JBoss Rich Faces SVN: r10950 - in trunk/test-applications/auto-jsp/src/main/java/util: parser and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 11:57:28 -0400 (Tue, 28 Oct 2008)
New Revision: 10950
Added:
trunk/test-applications/auto-jsp/src/main/java/util/parser/AttributesList.java
Modified:
trunk/test-applications/auto-jsp/src/main/java/util/componentInfo/ComponentInfo.java
trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java
Log:
+AttributesList
Modified: trunk/test-applications/auto-jsp/src/main/java/util/componentInfo/ComponentInfo.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/componentInfo/ComponentInfo.java 2008-10-28 15:50:33 UTC (rev 10949)
+++ trunk/test-applications/auto-jsp/src/main/java/util/componentInfo/ComponentInfo.java 2008-10-28 15:57:28 UTC (rev 10950)
@@ -12,6 +12,7 @@
import javax.faces.context.FacesContext;
import util.parser.Attribute;
+import util.parser.AttributesList;
import util.parser.TLDParser;
public class ComponentInfo {
@@ -85,16 +86,23 @@
} catch (Exception e) {
e.printStackTrace();
}
- }
+ }
+
TLDParser parser = new TLDParser(richName);
- ArrayList<Attribute> allAttributes = parser.getAllAttributes();
+ AttributesList allAttributes = parser.getAllAttributes();
for(Attribute s:allAttributes){
System.out.println(s.toString());
- }
+ }
+
+ System.out.println("----------HANDLERS----------");
+ for(Attribute attr:allAttributes.getHandlers()){
+ System.out.println(attr.getName());
+ }
+
AccessibleObject.setAccessible(fields, true);
for (Field field : fields) {
str = field.getName().substring(1);
- if (!Modifier.isStatic(field.getModifiers()) && (parser.getNamesArray().contains(str))) {
+ if (!Modifier.isStatic(field.getModifiers()) && (allAttributes.getNamesArray().contains(str))) {
if (str.startsWith("on")) {
componentAttribute.putEvent(str,
"");
Added: trunk/test-applications/auto-jsp/src/main/java/util/parser/AttributesList.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/parser/AttributesList.java (rev 0)
+++ trunk/test-applications/auto-jsp/src/main/java/util/parser/AttributesList.java 2008-10-28 15:57:28 UTC (rev 10950)
@@ -0,0 +1,78 @@
+package util.parser;
+
+import java.util.ArrayList;
+
+public class AttributesList extends ArrayList<Attribute> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3245089852351607636L;
+
+ public AttributesList(){
+ super();
+ }
+
+ public ArrayList<String> getNamesArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getName());
+ }
+ return result;
+ }
+
+ public ArrayList<String> getDescriptionArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getDescription());
+ }
+ return result;
+ }
+
+ public ArrayList<String> getTypeArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getType());
+ }
+ return result;
+ }
+
+ public ArrayList<Status> getStatusArray(){
+ ArrayList<Status> result = new ArrayList<Status>();
+ for(Attribute attr:this){
+ result.add(attr.getStatus());
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getHandlers(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if (attr.getName().startsWith("on")) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getStyles(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if (attr.getName().indexOf("tyle") != -1 || attr.getName().indexOf("lass") != -1) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getCommonAttributes(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if(!(attr.getName().startsWith("on") || (attr.getName().indexOf("tyle") != -1) || (attr.getName().indexOf("lass") != -1))){
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+}
Modified: trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java
===================================================================
--- trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:50:33 UTC (rev 10949)
+++ trunk/test-applications/auto-jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:57:28 UTC (rev 10950)
@@ -4,7 +4,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.ArrayList;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
@@ -13,14 +12,14 @@
protected String component;
protected JarEntry tld;
protected JarFile richfacesUI;
- protected ArrayList<Attribute> allAttributes;
+ protected AttributesList allAttributes;
public TLDParser(String str) {
this.component = str;
- allAttributes = new ArrayList<Attribute>();
+ allAttributes = new AttributesList();
}
- public ArrayList<Attribute> getAllAttributes() {
+ public AttributesList getAllAttributes() {
tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
InputStream input = null;
@@ -121,69 +120,5 @@
e.printStackTrace();
}
return richfacesUI;
- }
- public ArrayList<String> getNamesArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getName());
- }
- return result;
- }
-
- public ArrayList<String> getDescriptionArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getDescription());
- }
- return result;
- }
-
- public ArrayList<String> getTypeArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getType());
- }
- return result;
- }
-
- public ArrayList<Status> getStatusArray(){
- ArrayList<Status> result = new ArrayList<Status>();
- for(Attribute attr:allAttributes){
- result.add(attr.getStatus());
- }
- return result;
- }
-
- public ArrayList<String> getHandlers(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if (str.startsWith("on")) {
- result.add(str);
- }
- }
- return result;
- }
-
- public ArrayList<String> getStyles(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if (str.indexOf("tyle") != -1 || str.indexOf("lass") != -1) {
- result.add(str);
- }
- }
- return result;
- }
-
- public ArrayList<String> getCommonAttributes(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if(!(str.startsWith("on") || (str.indexOf("tyle") != -1) || (str.indexOf("lass") != -1))){
- result.add(str);
- }
- }
- return result;
- }
+ }
}
16 years, 2 months
JBoss Rich Faces SVN: r10949 - trunk/test-applications/jsp/src/main/java/util/parser.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 11:50:33 -0400 (Tue, 28 Oct 2008)
New Revision: 10949
Modified:
trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:49:19 UTC (rev 10948)
+++ trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:50:33 UTC (rev 10949)
@@ -121,70 +121,5 @@
e.printStackTrace();
}
return richfacesUI;
- }
- /*
- public ArrayList<String> getNamesArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getName());
- }
- return result;
- }
-
- public ArrayList<String> getDescriptionArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getDescription());
- }
- return result;
- }
-
- public ArrayList<String> getTypeArray(){
- ArrayList<String> result = new ArrayList<String>();
- for(Attribute attr:allAttributes){
- result.add(attr.getType());
- }
- return result;
- }
-
- public ArrayList<Status> getStatusArray(){
- ArrayList<Status> result = new ArrayList<Status>();
- for(Attribute attr:allAttributes){
- result.add(attr.getStatus());
- }
- return result;
- }
-
- public ArrayList<String> getHandlers(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if (str.startsWith("on")) {
- result.add(str);
- }
- }
- return result;
- }
-
- public ArrayList<String> getStyles(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if (str.indexOf("tyle") != -1 || str.indexOf("lass") != -1) {
- result.add(str);
- }
- }
- return result;
- }
-
- public ArrayList<String> getCommonAttributes(){
- ArrayList<String> attributes = this.getNamesArray();
- ArrayList<String> result = new ArrayList<String>();
- for(String str:attributes){
- if(!(str.startsWith("on") || (str.indexOf("tyle") != -1) || (str.indexOf("lass") != -1))){
- result.add(str);
- }
- }
- return result;
- }*/
+ }
}
16 years, 2 months
JBoss Rich Faces SVN: r10948 - in trunk/test-applications/jsp/src/main/java/util: parser and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 11:49:19 -0400 (Tue, 28 Oct 2008)
New Revision: 10948
Added:
trunk/test-applications/jsp/src/main/java/util/parser/AttributesList.java
Modified:
trunk/test-applications/jsp/src/main/java/util/componentInfo/ComponentInfo.java
trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java
Log:
TLDParser modification.
Modified: trunk/test-applications/jsp/src/main/java/util/componentInfo/ComponentInfo.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/componentInfo/ComponentInfo.java 2008-10-28 15:48:24 UTC (rev 10947)
+++ trunk/test-applications/jsp/src/main/java/util/componentInfo/ComponentInfo.java 2008-10-28 15:49:19 UTC (rev 10948)
@@ -12,6 +12,7 @@
import javax.faces.context.FacesContext;
import util.parser.Attribute;
+import util.parser.AttributesList;
import util.parser.TLDParser;
public class ComponentInfo {
@@ -87,14 +88,20 @@
}
}
TLDParser parser = new TLDParser(richName);
- ArrayList<Attribute> allAttributes = parser.getAllAttributes();
+ AttributesList allAttributes = parser.getAllAttributes();
for(Attribute s:allAttributes){
System.out.println(s.toString());
- }
+ }
+
+ System.out.println("----------HANDLERS----------");
+ for(Attribute attr:allAttributes.getHandlers()){
+ System.out.println(attr.getName());
+ }
+
AccessibleObject.setAccessible(fields, true);
for (Field field : fields) {
str = field.getName().substring(1);
- if (!Modifier.isStatic(field.getModifiers()) && (parser.getNamesArray().contains(str))) {
+ if (!Modifier.isStatic(field.getModifiers()) && (allAttributes.getNamesArray().contains(str))) {
if (str.startsWith("on")) {
componentAttribute.putEvent(str,
"");
Added: trunk/test-applications/jsp/src/main/java/util/parser/AttributesList.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/parser/AttributesList.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/util/parser/AttributesList.java 2008-10-28 15:49:19 UTC (rev 10948)
@@ -0,0 +1,78 @@
+package util.parser;
+
+import java.util.ArrayList;
+
+public class AttributesList extends ArrayList<Attribute> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3245089852351607636L;
+
+ public AttributesList(){
+ super();
+ }
+
+ public ArrayList<String> getNamesArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getName());
+ }
+ return result;
+ }
+
+ public ArrayList<String> getDescriptionArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getDescription());
+ }
+ return result;
+ }
+
+ public ArrayList<String> getTypeArray(){
+ ArrayList<String> result = new ArrayList<String>();
+ for(Attribute attr:this){
+ result.add(attr.getType());
+ }
+ return result;
+ }
+
+ public ArrayList<Status> getStatusArray(){
+ ArrayList<Status> result = new ArrayList<Status>();
+ for(Attribute attr:this){
+ result.add(attr.getStatus());
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getHandlers(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if (attr.getName().startsWith("on")) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getStyles(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if (attr.getName().indexOf("tyle") != -1 || attr.getName().indexOf("lass") != -1) {
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+ public ArrayList<Attribute> getCommonAttributes(){
+ ArrayList<Attribute> result = new ArrayList<Attribute>();
+ for(Attribute attr:this){
+ if(!(attr.getName().startsWith("on") || (attr.getName().indexOf("tyle") != -1) || (attr.getName().indexOf("lass") != -1))){
+ result.add(attr);
+ }
+ }
+ return result;
+ }
+
+}
Modified: trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:48:24 UTC (rev 10947)
+++ trunk/test-applications/jsp/src/main/java/util/parser/TLDParser.java 2008-10-28 15:49:19 UTC (rev 10948)
@@ -13,14 +13,14 @@
protected String component;
protected JarEntry tld;
protected JarFile richfacesUI;
- protected ArrayList<Attribute> allAttributes;
+ protected AttributesList allAttributes;
public TLDParser(String str) {
this.component = str;
- allAttributes = new ArrayList<Attribute>();
+ allAttributes = new AttributesList();
}
- public ArrayList<Attribute> getAllAttributes() {
+ public AttributesList getAllAttributes() {
tld = getRichfacesUI().getJarEntry("META-INF/richfaces.tld");
InputStream input = null;
@@ -122,6 +122,7 @@
}
return richfacesUI;
}
+ /*
public ArrayList<String> getNamesArray(){
ArrayList<String> result = new ArrayList<String>();
for(Attribute attr:allAttributes){
@@ -185,5 +186,5 @@
}
}
return result;
- }
+ }*/
}
16 years, 2 months
JBoss Rich Faces SVN: r10947 - trunk/test-applications/jsp/src/main/webapp/Calendar.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-10-28 11:48:24 -0400 (Tue, 28 Oct 2008)
New Revision: 10947
Modified:
trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
Log:
remove toolTipMode
Modified: trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2008-10-28 15:07:55 UTC (rev 10946)
+++ trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2008-10-28 15:48:24 UTC (rev 10947)
@@ -54,8 +54,7 @@
disabled="#{calendarBean.disabled}"
readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
- zindex="#{calendarBean.zindex}"
- toolTipMode="#{calendarBean.toolTipMode}"
+ zindex="#{calendarBean.zindex}"
rendered="#{calendarBean.renderedClient}" focus="popupModeID"
mode="client" required="#{calendarBean.required}"
requiredMessage="Required Message" timeZone="#{calendarBean.tmZone}"
@@ -140,8 +139,7 @@
disabled="#{calendarBean.disabled}"
readonly="#{calendarBean.readonly}"
bypassUpdates="#{calendarBean.bypassUpdates}"
- zindex="#{calendarBean.zindex}"
- toolTipMode="#{calendarBean.toolTipMode}"
+ zindex="#{calendarBean.zindex}"
rendered="#{calendarBean.renderedAjax}" focus="popupModeID"
mode="ajax" required="#{calendarBean.required}"
requiredMessage="Required Message" timeZone="#{calendarBean.tmZone}"
16 years, 2 months
JBoss Rich Faces SVN: r10946 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-10-28 11:07:55 -0400 (Tue, 28 Oct 2008)
New Revision: 10946
Modified:
trunk/ui/core/src/main/config/component/form.xml
Log:
https://jira.jboss.org/jira/browse/RF-4556
Modified: trunk/ui/core/src/main/config/component/form.xml
===================================================================
--- trunk/ui/core/src/main/config/component/form.xml 2008-10-28 15:04:43 UTC (rev 10945)
+++ trunk/ui/core/src/main/config/component/form.xml 2008-10-28 15:07:55 UTC (rev 10946)
@@ -42,6 +42,7 @@
&ui_component_attributes;
&html_form_attributes;
&ajax_component_attributes;
+ &html_style_attributes;
<property>
<name>ajaxSubmit</name>
<classname>boolean</classname>
16 years, 2 months