Author: nbelaevski
Date: 2007-10-21 23:26:53 -0400 (Sun, 21 Oct 2007)
New Revision: 3460
Added:
trunk/framework/impl/src/main/java/org/richfaces/webapp/
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
Removed:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/SimpleActionMethodBinding.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentBodyTagBase.java
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/ant/JSFGeneratorTask.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/PropertyBean.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagBean.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/BuilderContext.java
trunk/cdk/generator/src/main/resources/META-INF/schema/component-config.dtd
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/draggable_attributes.ent
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/dropzone_attributes.ent
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_command_attributes.ent
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_input_attributes.ent
trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates/taghandler.vm
trunk/cdk/generator/src/main/resources/META-INF/templates/tagtest.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/taghandler.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
trunk/samples/virtualEarth-sample/
trunk/ui/core/pom.xml
trunk/ui/core/src/main/config/component/actionParameter.xml
trunk/ui/core/src/main/config/component/commandButton.xml
trunk/ui/core/src/main/config/component/commandLink.xml
trunk/ui/core/src/main/config/component/form.xml
trunk/ui/core/src/main/config/component/function.xml
trunk/ui/core/src/main/config/component/poll.xml
trunk/ui/core/src/main/config/component/push.xml
trunk/ui/core/src/main/config/component/repeat.xml
trunk/ui/core/src/main/config/component/support.xml
trunk/ui/core/src/main/config/taglib/ajax.tld.include
trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml
trunk/ui/dataTable/src/main/config/component/colgroup.xml
trunk/ui/dataTable/src/main/config/component/dataGrid.xml
trunk/ui/dataTable/src/main/config/component/dataList.xml
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/datascroller/src/main/config/component/datascroller.xml
trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml
trunk/ui/menu-components/src/main/config/component/menucomponents.xml
trunk/ui/panel/src/test/java/org/richfaces/taglib/PanelTagTest.java
trunk/ui/panelbar/src/main/config/component/panelbar.xml
trunk/ui/panelmenu/src/main/config/component/panelMenu.xml
trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
trunk/ui/simpleTogglePanel/src/main/config/component/simpleTogglePanel.xml
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/taglib/SimpleTogglePanelTagBase.java
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java
trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
trunk/ui/tabPanel/src/main/java/org/richfaces/taglib/TabPanelTagBase.java
trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
trunk/ui/tree/src/main/config/component/tree.xml
Log:
switch to JSF 1.2/JSP 2.1 in progress
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/ant/JSFGeneratorTask.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/ant/JSFGeneratorTask.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/ant/JSFGeneratorTask.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -296,7 +296,7 @@
_config.parseConfig(new File(getConfigs().getDir(getProject()),file));
}
}
- _config.checkComopnentProperties();
+ _config.checkComponentProperties();
} catch (ParsingException e) {
e.printStackTrace();
throw new BuildException("Error building ", e);
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/BuilderConfig.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -400,7 +400,7 @@
* classpath to find user components, renderers, tags
* @throws ConfigurationException
*/
- public void checkComopnentProperties() throws ParsingException {
+ public void checkComponentProperties() throws ParsingException {
// ClassLoader loader = getProject().createClassLoader(classpath);
// if(null == loader) {
// loader = this.getClass().getClassLoader();
@@ -433,9 +433,7 @@
listenerProperty.setElonly(true);
listenerProperty.setAttachedstate(true);
listenerProperty.setMethodargs(listener
- .getEventclass()
- + ".class");
-
+ .getEventclass());
listener.addSuitableComponent(bean);
}
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/PropertyBean.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/PropertyBean.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/PropertyBean.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -98,17 +98,27 @@
private String _methodargs = null;
/**
+ * Return type for {@link javax.faces.el.MethodBinding}
+ * or other reflection-based properties.
+ * instanses of calls.
+ */
+ private String _returntype = null;
+
+ /**
* Indicate what this property Required for component.
*/
private boolean _required = false;
-
+
static {
defaults = new HashMap<String,String>();
- defaults.put("boolean","false");
- defaults.put("int","Integer.MIN_VALUE");
- defaults.put("long","Long.MIN_VALUE");
- defaults.put("float","Float.MIN_VALUE");
- defaults.put("double","Double.MIN_VALUE");
+ defaults.put(Boolean.TYPE.getName(),"false");
+ defaults.put(Byte.TYPE.getName(), "Byte.MIN_VALUE");
+ defaults.put(Character.TYPE.getName(), "Character.MIN_VALUE");
+ defaults.put(Integer.TYPE.getName(), "Integer.MIN_VALUE");
+ defaults.put(Long.TYPE.getName(), "Long.MIN_VALUE");
+ defaults.put(Float.TYPE.getName(), "Float.MIN_VALUE");
+ defaults.put(Double.TYPE.getName(), "Double.MIN_VALUE");
+ defaults.put(Short.TYPE.getName(), "Short.MIN_VALUE");
}
/**
@@ -243,13 +253,23 @@
public String getMethodArgsClasses(){
if(null != this._methodargs){
StringBuffer result = new StringBuffer();
- String[] classes = SEPARATOR_PATTERN.split(this._methodargs);
+ String[] classes = SEPARATOR_PATTERN.split(this._methodargs.trim());
for (int i = 0; i < classes.length; i++) {
String argumentClass = classes[i];
- if(i!=0){
- result.append(',');
+
+ if (argumentClass.length() != 0) {
+ if(i!=0){
+ result.append(',');
+ }
+ result.append(argumentClass).append(".class");
+ } else {
+ if (classes.length == 1) {
+ //no arguments
+ break;
+ } else {
+ throw new IllegalArgumentException("Error parsing methodargs: " +
this._methodargs);
+ }
}
- result.append(argumentClass).append(".class");
}
return result.toString();
} else {
@@ -321,7 +341,7 @@
if (null != getClassname()) {
return super.getSimpleClassName();
}
- return "void";
+ return Void.TYPE.getName();
}
/**
@@ -342,6 +362,17 @@
}
+ public String getReturntype() {
+ if (null != _returntype) {
+ return _returntype;
+ }
+ return Void.TYPE.getName();
+ }
+
+ public void setReturntype(String _returntype) {
+ this._returntype = _returntype;
+ }
+
public boolean isSimpleType() {
return defaults.containsKey(getClassname());
}
@@ -352,7 +383,7 @@
if("Int".equals(name)){
name="Integer";
} else if("Char".equals(name)){
- name="Charter";
+ name="Character";
}
return name;
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagBean.java 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/TagBean.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -42,7 +42,7 @@
*/
public TagBean() {
super();
- setSuperclass("com.exadel.vcp.framework.taglib.UIComponentTagBase");
+ setSuperclass("org.ajax4jsf.webapp.taglib.UIComponentTagBase");
}
/**
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/BuilderContext.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/BuilderContext.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/velocity/BuilderContext.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -50,7 +50,7 @@
Properties velocityProperties = new Properties();
try {
velocityProperties.load(BuilderContext.class.getClassLoader()
- .getResourceAsStream(TEMPLATES_PATH+"/velocity.properties"));
+ .getResourceAsStream(TEMPLATES12_PATH+"/velocity.properties"));
} catch (Exception e) {
e.printStackTrace();
}
Modified: trunk/cdk/generator/src/main/resources/META-INF/schema/component-config.dtd
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/schema/component-config.dtd 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/schema/component-config.dtd 2007-10-22
03:26:53 UTC (rev 3460)
@@ -88,7 +88,7 @@
<!ELEMENT properties ((include|properties|property)*)>
<!-- Define single property for this component -->
-<!ELEMENT property
(name,classname?,description?,defaultvalue?,methodargs?,alias*)>
+<!ELEMENT property
(name,classname?,description?,defaultvalue?,methodargs?,returntype?,alias*)>
<!-- default value for property -->
<!ELEMENT defaultvalue (#PCDATA)>
@@ -96,6 +96,9 @@
<!-- comma-separated list of method call parameters classes for Method-binded property
-->
<!ELEMENT methodargs (#PCDATA)>
+<!-- return type for method call parameters classes for Method-binded property -->
+<!ELEMENT returntype (#PCDATA)>
+
<!-- alias for property in JSP tag -->
<!ELEMENT alias (#PCDATA)>
@@ -246,4 +249,4 @@
<!ENTITY standard_select_one_listbox_attributes PUBLIC
"standard_select_one_listbox_attributes"
"entities/standard_select_one_listbox_attributes.ent">
<!ENTITY standard_select_one_menu_attributes PUBLIC
"standard_select_one_menu_attributes"
"entities/standard_select_one_menu_attributes.ent">
<!ENTITY standard_select_one_radio_attributes PUBLIC
"standard_select_one_radio_attributes"
"entities/standard_select_one_radio_attributes.ent">
--->
\ No newline at end of file
+-->
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent 2007-10-22
03:26:53 UTC (rev 3460)
@@ -3,7 +3,7 @@
<name>ajaxListener</name>
<defaultvalue>null</defaultvalue>
<classname>javax.faces.el.MethodBinding</classname>
- <methodargs>org.ajax4jsf.event.AjaxEvent.class</methodargs>
+ <methodargs>org.ajax4jsf.event.AjaxEvent</methodargs>
<description> MethodBinding representing an action listener method that
will be notified when this component is activated by the ajax Request and handle it. The
expression must evaluate to a public method that takes an AjaxEvent parameter, with a
return type of void</description>
</property>
<property hidden="true">
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/draggable_attributes.ent
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/draggable_attributes.ent 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/draggable_attributes.ent 2007-10-22
03:26:53 UTC (rev 3460)
@@ -24,13 +24,13 @@
<classname>java.lang.String</classname>
<description>A JavaScript event handler called after a drag
operation</description>
</property>
- <property elonly="true" attachedstate="true">
- <name>dragListener</name>
- <classname>javax.faces.el.MethodBinding</classname>
- <description>
- MethodBinding representing an listener method that will be notified afrer drag
operation.
- </description>
- <methodargs>org.ajax4jsf.event.DragEvent.class</methodargs>
- </property>
+ <property elonly="true" attachedstate="true">
+ <name>dragListener</name>
+ <classname>javax.faces.el.MethodBinding</classname>
+ <description>
+ MethodBinding representing an listener method that will be notified afrer drag
operation.
+ </description>
+ <methodargs>org.ajax4jsf.event.DragEvent</methodargs>
+ </property>
</properties>
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/dropzone_attributes.ent
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/dropzone_attributes.ent 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/dropzone_attributes.ent 2007-10-22
03:26:53 UTC (rev 3460)
@@ -43,6 +43,6 @@
MethodBinding representing an action listener method that will be notified afrer drop
operation
]]>
</description>
- <methodargs>org.ajax4jsf.event.DropEvent.class</methodargs>
+ <methodargs>org.ajax4jsf.event.DropEvent</methodargs>
</property>
</properties>
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_command_attributes.ent
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_command_attributes.ent 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_command_attributes.ent 2007-10-22
03:26:53 UTC (rev 3460)
@@ -13,6 +13,7 @@
processing lifecycle, depending on the value of the immediate
property
</description>
+ <returntype>java.lang.Object</returntype>
<methodargs> </methodargs>
</property>
<property elonly="true" attachedstate="true">
@@ -21,7 +22,7 @@
<description>
MethodBinding pointing at method accepting an ActionEvent with return type
void
</description>
- <methodargs>javax.faces.event.ActionEvent.class</methodargs>
+ <methodargs>javax.faces.event.ActionEvent</methodargs>
</property>
<property>
<name>immediate</name>
Modified:
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_input_attributes.ent
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_input_attributes.ent 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ui_input_attributes.ent 2007-10-22
03:26:53 UTC (rev 3460)
@@ -20,7 +20,7 @@
<property attachedstate="true">
<name>validator</name>
<classname>javax.faces.el.MethodBinding</classname>
- <methodargs> </methodargs>
+ <methodargs>javax.faces.context.FacesContext,
javax.faces.component.UIComponent, java.lang.Object</methodargs>
<description>
MethodBinding pointing at a method that is called during
Process Validations phase of the request processing lifecycle,
@@ -30,7 +30,7 @@
<property attachedstate="true">
<name>valueChangeListener</name>
<classname>javax.faces.el.MethodBinding</classname>
- <methodargs> </methodargs>
+ <methodargs>javax.faces.event.ValueChangeEvent</methodargs>
<description>Listener for value changes</description>
</property>
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -99,7 +99,7 @@
if (isValueReference(this._${prop.name}))
{
MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ new
Class[]{${prop.methodArgsClasses}});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2007-10-21 15:05:17
UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/tag.vm 2007-10-22 03:26:53
UTC (rev 3460)
@@ -116,7 +116,7 @@
if (isValueReference(this._${prop.name}))
{
MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ new
Class[]{${prop.methodArgsClasses}});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/taghandler.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/taghandler.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/taghandler.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -75,7 +75,7 @@
static class ${prop.name}Mapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] {${prop.methodargs}};
+ private static final Class[] SIGNATURE = new Class[] {${prop.methodArgsClasses}};
private final TagAttribute _action;
/**
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/tagtest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/tagtest.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/tagtest.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -144,7 +144,7 @@
if (isValueReference(this._${prop.name}))
{
MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ new
Class[]{${prop.methodArgsClasses}});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/component.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -10,14 +10,9 @@
#end
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-#if(${generator.key})
+import javax.el.ValueExpression;
+import javax.el.ELException;
-import java.io.IOException;
-import javax.faces.FacesException;
-import org.ajax4jsf.framework.util.base64.Codec;
-#end
-
/**
* Component-Type ${component.name}
* Component-Family ${component.family}
@@ -87,9 +82,9 @@
if(this._${prop.name}Set){
return this._${prop.name};
}
- ValueBinding vb = getValueBinding("${prop.name}");
- if (vb != null) {
- ${prop.boxingClass} value = (${prop.boxingClass})
vb.getValue(getFacesContext());
+ ValueExpression ve = getValueExpression("${prop.name}");
+ if (ve != null) {
+ ${prop.boxingClass} value = (${prop.boxingClass})
ve.getValue(getFacesContext().getELContext());
if (null == value) {
return this._${prop.name};
}
@@ -101,11 +96,11 @@
if (null != this._${prop.name})
{
return this._${prop.name};
- #if( !$prop.isInstanceof("javax.faces.el.MethodBinding") &&
!$prop.isInstanceof("javax.faces.el.ValueBinding"))
+ #if( !$prop.isInstanceof("javax.el.MethodExpression") &&
!$prop.isInstanceof("javax.el.ValueExpression"))
}
- ValueBinding vb = getValueBinding("${prop.name}");
- if (null != vb){
- return (${prop.simpleClassName})vb.getValue(getFacesContext());
+ ValueExpression ve = getValueExpression("${prop.name}");
+ if (null != ve){
+ return
(${prop.simpleClassName})ve.getValue(getFacesContext().getELContext());
#end
} else {
return ${prop.defaultvalue};
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -7,7 +7,16 @@
#foreach($import in $imports)
import $import ;
#end
+
+import javax.el.ELException;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
+import javax.el.MethodExpression;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
+import javax.el.ValueExpression;
+import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
+import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
import ${component.classname};
public class $tag.simpleClassName extends $tag.superclass {
@@ -15,42 +24,39 @@
// Fields
#foreach( $prop in $component.properties )
#if( !$prop.existintag )
+ #if($prop.classname == "javax.el.MethodExpression" || $prop.classname ==
"javax.faces.el.MethodBinding")
+ #set($type = "MethodExpression")
+ #else
+ #set($type = "ValueExpression")
+ #end
+
/*
* $prop.name
* ${prop.xmlEncodedDescription}
*/
- private String _$prop.name = null;
-
- #end
-#end
-// Setters
-#foreach( $prop in $component.properties )
- #if( !$prop.existintag )
- /*
- * $prop.name
- * ${prop.xmlEncodedDescription}
- */
+ private $type _${prop.name};
/**
* $prop.description
* Setter for $prop.name
* @param $prop.name - new value
*/
- public void ${prop.setterName}( String __${prop.name} ){
+ public void ${prop.setterName}( $type __${prop.name} ){
this._${prop.name} = __${prop.name};
}
-
- #end
+
#if( $prop.alias)
/**
* ${prop.xmlEncodedDescription}
* Setter for alias of $prop.name as $prop.alias
* @param $prop.name - new value
*/
- public void set${prop.upperFirstChar($prop.alias)}( String __${prop.alias} ){
+ public void set${prop.upperFirstChar($prop.alias)}( $type __${prop.alias} ){
this.${prop.setterName}(__${prop.alias});
}
#end
-#end
+ #end
+#end
+
// Release
/* (non-Javadoc)
@@ -74,32 +80,36 @@
{
// TODO Auto-generated method stub
super.setProperties(component);
-
+ ${component.simpleClassName} comp = (${component.simpleClassName}) component;
#foreach( $prop in $component.properties )
#if( !$prop.existintag )
#if(!$prop.el)
- if(null != this._${prop.name} && isValueReference(this._${prop.name})){
+ if(null != this._${prop.name} && !this._${prop.name}.isLiteralText()){
throw new IllegalArgumentException("Component ${component.name} with Id " +
component.getClientId(getFacesContext()) +" not allowed EL expression for property
${prop.name}");
}
- #end
+ #end
+
+ #if($prop.elonly)
+ if(null != this._${prop.name} && this._${prop.name}.isLiteralText()){
+ throw new IllegalArgumentException("Component ${component.name} with Id " +
component.getClientId(getFacesContext()) +" allows only EL expressions for property
${prop.name}");
+ }
+ #end
+
#if($prop.name == "action")
- setActionProperty(component, this._${prop.name});
+ setActionProperty(comp, this._${prop.name});
#elseif($prop.name == "actionListener")
- setActionListenerProperty(component, this._${prop.name});
+ setActionListenerProperty(comp, this._${prop.name});
#elseif($prop.name == "converter")
- setConverterProperty(component, this._${prop.name});
+ setConverterProperty(comp, this._${prop.name});
#elseif($prop.name == "validator")
- setValidatorProperty(component, this._${prop.name});
+ setValidatorProperty(comp, this._${prop.name});
#elseif($prop.name == "valueChangeListener")
- setValueChangedListenerProperty(component, this._${prop.name});
- #elseif($prop.name == "value")
- setValueProperty(component, this._${prop.name});
+ setValueChangeListenerProperty(comp, this._${prop.name});
#elseif( $prop.isInstanceof("javax.faces.el.MethodBinding") )
if(null != this._${prop.name}){
- if (isValueReference(this._${prop.name}))
+ if (!this._${prop.name}.isLiteralText())
{
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ MethodBinding mb = new
MethodBindingMethodExpressionAdaptor(this._${prop.name});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
@@ -107,21 +117,43 @@
getFacesContext().getExternalContext().log("Component " +
component.getClientId(getFacesContext()) + " has invalid ${prop.name} value: " +
this._${prop.name});
}
}
- #elseif($prop.elonly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
- setValueBinding(component, "${prop.name}",this._${prop.name});
- #elseif(${prop.simpleType})
- // Simple type - ${prop.simpleClassName}
- set${prop.boxingClass}Property(component,
"${prop.name}",this._${prop.name});
- #elseif($prop.classname == "java.lang.Boolean" || $prop.classname ==
"java.lang.Integer" || $prop.classname == "java.lang.Long")
- set${prop.simpleClassName}Property(component,
"${prop.name}",this._${prop.name});
- #elseif( $prop.classname == "java.lang.String")
- setStringProperty(component, "${prop.name}",this._${prop.name});
- #elseif( $prop.classname == "java.lang.Object")
- // TODO - handle object
- setStringProperty(component, "${prop.name}",this._${prop.name});
+ #elseif($prop.isInstanceof("javax.faces.el.ValueBinding") )
+ if(null != this._${prop.name}){
+ ValueBinding vb = new ValueBindingValueExpressionAdaptor(this._${prop.name});
+ ((${component.simpleClassName})component).${prop.setterName}(vb);
+ }
+ #elseif($prop.isInstanceof("javax.el.MethodExpression") )
+ if(null != this._${prop.name}){
+ ((${component.simpleClassName})component).${prop.setterName}(this._${prop.name});
+ }
#else
- // TODO - setup properties for other cases.
- // name ${prop.name} with type $prop.classname
+ if (this._${prop.name} != null) {
+ if (this._${prop.name}.isLiteralText()) {
+ try {
+ #if (${prop.simpleType})
+ #set ($propertyClass = ${prop.boxingClass})
+ #else
+ #set ($propertyClass = ${prop.classname})
+ #end
+
+ $propertyClass __${prop.name} = ($propertyClass) getFacesContext().
+ getApplication().
+ getExpressionFactory().
+ coerceToType(this._${prop.name}.getExpressionString(),
+ ${propertyClass}.class);
+
+ #if (${prop.simpleType})
+ comp.${prop.setterName}(__${prop.name}.${prop.classname}Value());
+ #else
+ comp.${prop.setterName}(__${prop.name});
+ #end
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("${prop.name}", this._${prop.name});
+ }
+ }
#end
#end
#end
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2007-10-21 15:05:17
UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2007-10-22 03:26:53
UTC (rev 3460)
@@ -96,7 +96,7 @@
#elseif($prop.name == "validator")
setValidatorProperty(component, this._${prop.name});
#elseif($prop.name == "valueChangeListener")
- setValueChangedListenerProperty(component, this._${prop.name});
+ setValueChangeListenerProperty(component, this._${prop.name});
#elseif($prop.name == "value")
setValueProperty(component, this._${prop.name});
#elseif($prop.elonly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
@@ -116,7 +116,7 @@
if (isValueReference(this._${prop.name}))
{
MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ new
Class[]{${prop.methodArgsClasses}});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/taghandler.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/taghandler.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/taghandler.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -75,7 +75,7 @@
static class ${prop.name}Mapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] {${prop.methodargs}};
+ private static final Class[] SIGNATURE = new Class[] {${prop.methodArgsClasses}};
private final TagAttribute _action;
/**
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/taglib.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN"
-
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
+
+<taglib
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_${taglib.jspversion.r...;,
'_')}.xsd"
+ version="${taglib.jspversion}">
<tlib-version>${taglib.tlibversion}</tlib-version>
- <jsp-version>${taglib.jspversion}</jsp-version>
+## <jsp-version>${taglib.jspversion}</jsp-version>
#if(${taglib.shortname})
<short-name>${taglib.shortname}</short-name>
#end
@@ -16,28 +18,40 @@
#foreach( $component in ${components})
#if($component.tag)
<tag>
- <name>${component.tag.name}</name>
- <tag-class>${component.tag.classname}</tag-class>
- <body-content>${component.tag.bodyContent}</body-content>
- #if(${component.tag.displayname})
- <display-name>${component.tag.xmlEncodedDisplayname}</display-name>
- #elseif(${component.displayname})
- <display-name>${component.xmlEncodedDisplayname}</display-name>
- #end
#if(${component.tag.description})
<description>${component.tag.xmlEncodedDescription}</description>
#else
<description>${component.xmlEncodedDescription}</description>
#end
+ #if(${component.tag.displayname})
+ <display-name>${component.tag.xmlEncodedDisplayname}</display-name>
+ #elseif(${component.displayname})
+ <display-name>${component.xmlEncodedDisplayname}</display-name>
+ #end
+ <name>${component.tag.name}</name>
+ <tag-class>${component.tag.classname}</tag-class>
+ <body-content>${component.tag.bodyContent}</body-content>
#foreach( $prop in ${component.properties} )
#if( !${prop.hidden} && !${prop.disabled} )
<attribute>
+ <description>${prop.xmlEncodedDescription}</description>
<name>${prop.name}</name>
#if(${prop.required})
<required>true</required>
#end
- <rtexprvalue>false</rtexprvalue>
- <description>${prop.xmlEncodedDescription}</description>
+ #if(${prop.el})
+ #if( !$prop.isInstanceof("javax.faces.el.MethodBinding") )
+ <deferred-value>
+ <type>${prop.classname}</type>
+ </deferred-value>
+ #else
+ <deferred-method>
+ <method-signature>${prop.returntype}
${prop.name}(${prop.methodargs})</method-signature>
+ </deferred-method>
+ #end
+ #else
+ <rtexprvalue>false</rtexprvalue>
+ #end
</attribute>
#if( $prop.alias )
<attribute>
@@ -133,11 +147,7 @@
#foreach( $listener in ${listeners})
#if($listener.tag)
<tag>
- #if($listener.tag.name)
<name>${listener.tag.name}</name>
- #else
- <name>${listener.name}</name>
- #end
<tag-class>${listener.tag.classname}</tag-class>
<body-content>${listener.tag.bodyContent}</body-content>
#if(${listener.tag.displayname})
@@ -150,24 +160,6 @@
#elseif(${listener.xmlEncodedDescription})
<description>${listener.xmlEncodedDescription}</description>
#end
-
- <attribute>
- <name>type</name>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Attribute defines the fully qualified Java class name for listener
- </description>
- </attribute>
-
- <attribute>
- <name>binding</name>
- <rtexprvalue>false</rtexprvalue>
- <description>
- The attribute takes a value-binding expression for a component property of a backing
bean
- </description>
- </attribute>
-
-
#foreach( $prop in ${listener.properties} )
#if( !${prop.hidden} && !${prop.disabled} )
<attribute>
@@ -192,4 +184,4 @@
#end
-</taglib>
\ No newline at end of file
+</taglib>
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -124,7 +124,7 @@
#elseif($prop.name == "validator")
setValidatorProperty(component, this._${prop.name});
#elseif($prop.name == "valueChangeListener")
- setValueChangedListenerProperty(component, this._${prop.name});
+ setValueChangeListenerProperty(component, this._${prop.name});
#elseif($prop.name == "value")
setValueProperty(component, this._${prop.name});
#elseif($prop.elonly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
@@ -144,7 +144,7 @@
if (isValueReference(this._${prop.name}))
{
MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(this._${prop.name},
- new
Class[]{${prop.methodargs}});
+ new
Class[]{${prop.methodArgsClasses}});
((${component.simpleClassName})component).${prop.setterName}(mb);
}
else
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/validatorTag.vm 2007-10-22
03:26:53 UTC (rev 3460)
@@ -18,10 +18,7 @@
public class $tag.simpleClassName extends $tag.superclass {
- //private String validatorId = "${validator.id}";
-
-
-// Fields
+ // Fields
#foreach( $prop in $validator.properties )
#if( !$prop.existintag )
/*
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -198,12 +198,16 @@
library.setRenderkits(renderkits);
}
Taglib taglib = library.getTaglib();
- if (null == taglib) {
+ if (null != taglib) {
+ getLog().debug("Taglib uri is " + taglib.getUri());
+ getLog().debug("Taglib shortname is " + taglib.getShortName());
+ } else {
taglib = new Taglib();
library.setTaglib(taglib);
}
if (null == taglib.getDisplayName()) {
taglib.setDisplayName(project.getDescription());
+
}
if( null == taglib.getJspVersion()){
// Jsf 1.2 can use JSP 2.1 only, other - 2.0
@@ -312,4 +316,4 @@
}
-}
\ No newline at end of file
+}
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -252,7 +252,7 @@
for (int i = 0; i < files.length; i++) {
builderConfig.parseConfig(files[i]);
}
- builderConfig.checkComopnentProperties();
+ builderConfig.checkComponentProperties();
return builderConfig;
}
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm 2007-10-21 15:05:17
UTC (rev 3459)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/tld.vm 2007-10-22 03:26:53
UTC (rev 3460)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN"
-
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
- <tlib-version>${taglib.tlibVersion}</tlib-version>
- <jsp-version>${taglib.jspVersion}</jsp-version>
+
+<taglib
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="${library.taglib.jspVersion}">
+
+<tlib-version>${taglib.tlibVersion}</tlib-version>
#if(${taglib.shortName})
<short-name>${taglib.shortName}</short-name>
#end
@@ -11,8 +11,8 @@
#if(${taglib.displayName})
<display-name>${taglib.displayName}</display-name>
#end
-#if(${library.description})
- <description>${library.description}</description>
+#if(${taglib.description})
+ <description>${taglib.description}</description>
#end
#if(${taglib.validatorClass})
<validator>
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -256,6 +256,7 @@
public static final String NO_EDITABLE_VALUE_HOLDER_ERROR =
"NO_EDITABLE_VALUE_HOLDER_ERROR";
public static final String INVALID_VALIDATION_EXPRESSION =
"INVALID_VALIDATION_EXPRESSION";
public static final String NO_ACTION_SOURCE_ERROR = "NO_ACTION_SOURCE_ERROR";
+ public static final String NO_ACTION_SOURCE2_ERROR =
"NO_ACTION_SOURCE2_ERROR";
public static final String INVALID_ACTION_LISTENER =
"INVALID_ACTION_LISTENER";
public static final String INVALID_VALUE_CHANGE_LISTENER =
"INVALID_VALUE_CHANGE_LISTENER";
public static final String NO_VALUE_REFERENCE_ERROR =
"NO_VALUE_REFERENCE_ERROR";
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/HtmlComponentTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -21,6 +21,7 @@
package org.ajax4jsf.webapp.taglib;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
@@ -34,23 +35,23 @@
*/
public abstract class HtmlComponentTagBase extends UIComponentTagBase {
//HTML universal attributes
- private String _dir;
- private String _lang;
- private String _style;
- private String _styleClass;
- private String _title;
+ private ValueExpression _dir;
+ private ValueExpression _lang;
+ private ValueExpression _style;
+ private ValueExpression _styleClass;
+ private ValueExpression _title;
//HTML event handler attributes
- private String _onclick;
- private String _ondblclick;
- private String _onkeydown;
- private String _onkeypress;
- private String _onkeyup;
- private String _onmousedown;
- private String _onmousemove;
- private String _onmouseout;
- private String _onmouseover;
- private String _onmouseup;
+ private ValueExpression _onclick;
+ private ValueExpression _ondblclick;
+ private ValueExpression _onkeydown;
+ private ValueExpression _onkeypress;
+ private ValueExpression _onkeyup;
+ private ValueExpression _onmousedown;
+ private ValueExpression _onmousemove;
+ private ValueExpression _onmouseout;
+ private ValueExpression _onmouseover;
+ private ValueExpression _onmouseup;
public void release() {
super.release();
@@ -76,94 +77,94 @@
protected void setProperties(UIComponent component)
{
super.setProperties(component);
- setStringProperty(component, HTML.dir_ATTRIBUTE, _dir);
- setStringProperty(component, HTML.lang_ATTRIBUTE, _lang);
- setStringProperty(component, HTML.style_ATTRIBUTE, _style);
- setStringProperty(component, HTML.title_ATTRIBUTE, _title);
- setStringProperty(component, HTML.STYLE_CLASS_ATTR, _styleClass);
- setStringProperty(component, HTML.onclick_ATTRIBUTE, _onclick);
- setStringProperty(component, HTML.ondblclick_ATTRIBUTE, _ondblclick);
- setStringProperty(component, HTML.onmousedown_ATTRIBUTE, _onmousedown);
- setStringProperty(component, HTML.onmouseup_ATTRIBUTE, _onmouseup);
- setStringProperty(component, HTML.onmouseover_ATTRIBUTE, _onmouseover);
- setStringProperty(component, HTML.onmousemove_ATTRIBUTE, _onmousemove);
- setStringProperty(component, HTML.onmouseout_ATTRIBUTE, _onmouseout);
- setStringProperty(component, HTML.onkeypress_ATTRIBUTE, _onkeypress);
- setStringProperty(component, HTML.onkeydown_ATTRIBUTE, _onkeydown);
- setStringProperty(component, HTML.onkeyup_ATTRIBUTE, _onkeyup);
+ component.setValueExpression(HTML.dir_ATTRIBUTE, _dir);
+ component.setValueExpression(HTML.lang_ATTRIBUTE, _lang);
+ component.setValueExpression(HTML.style_ATTRIBUTE, _style);
+ component.setValueExpression(HTML.title_ATTRIBUTE, _title);
+ component.setValueExpression(HTML.STYLE_CLASS_ATTR, _styleClass);
+ component.setValueExpression(HTML.onclick_ATTRIBUTE, _onclick);
+ component.setValueExpression(HTML.ondblclick_ATTRIBUTE, _ondblclick);
+ component.setValueExpression(HTML.onmousedown_ATTRIBUTE, _onmousedown);
+ component.setValueExpression(HTML.onmouseup_ATTRIBUTE, _onmouseup);
+ component.setValueExpression(HTML.onmouseover_ATTRIBUTE, _onmouseover);
+ component.setValueExpression(HTML.onmousemove_ATTRIBUTE, _onmousemove);
+ component.setValueExpression(HTML.onmouseout_ATTRIBUTE, _onmouseout);
+ component.setValueExpression(HTML.onkeypress_ATTRIBUTE, _onkeypress);
+ component.setValueExpression(HTML.onkeydown_ATTRIBUTE, _onkeydown);
+ component.setValueExpression(HTML.onkeyup_ATTRIBUTE, _onkeyup);
}
- public void setStyleClass(String styleClass)
+ public void setStyleClass(ValueExpression styleClass)
{
_styleClass = styleClass;
}
- public void setDir(String dir)
+ public void setDir(ValueExpression dir)
{
_dir = dir;
}
- public void setLang(String lang)
+ public void setLang(ValueExpression lang)
{
_lang = lang;
}
- public void setStyle(String style)
+ public void setStyle(ValueExpression style)
{
_style = style;
}
- public void setTitle(String title)
+ public void setTitle(ValueExpression title)
{
_title = title;
}
- public void setOnclick(String onclick)
+ public void setOnclick(ValueExpression onclick)
{
_onclick = onclick;
}
- public void setOndblclick(String ondblclick)
+ public void setOndblclick(ValueExpression ondblclick)
{
_ondblclick = ondblclick;
}
- public void setOnmousedown(String onmousedown)
+ public void setOnmousedown(ValueExpression onmousedown)
{
_onmousedown = onmousedown;
}
- public void setOnmouseup(String onmouseup)
+ public void setOnmouseup(ValueExpression onmouseup)
{
_onmouseup = onmouseup;
}
- public void setOnmouseover(String onmouseover)
+ public void setOnmouseover(ValueExpression onmouseover)
{
_onmouseover = onmouseover;
}
- public void setOnmousemove(String onmousemove)
+ public void setOnmousemove(ValueExpression onmousemove)
{
_onmousemove = onmousemove;
}
- public void setOnmouseout(String onmouseout)
+ public void setOnmouseout(ValueExpression onmouseout)
{
_onmouseout = onmouseout;
}
- public void setOnkeypress(String onkeypress)
+ public void setOnkeypress(ValueExpression onkeypress)
{
_onkeypress = onkeypress;
}
- public void setOnkeydown(String onkeydown)
+ public void setOnkeydown(ValueExpression onkeydown)
{
_onkeydown = onkeydown;
}
- public void setOnkeyup(String onkeyup)
+ public void setOnkeyup(ValueExpression onkeyup)
{
_onkeyup = onkeyup;
}
Deleted:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/SimpleActionMethodBinding.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/SimpleActionMethodBinding.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/SimpleActionMethodBinding.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -1,93 +0,0 @@
-/**
- * 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.ajax4jsf.webapp.taglib;
-
-import javax.faces.component.StateHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.MethodNotFoundException;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:56 $
- *
- */
-/**
- * Simple method binding for constant action outcome.
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:56 $
- *
- */
-public class SimpleActionMethodBinding extends MethodBinding implements StateHolder {
- // private static final Log log =
- // LogFactory.getLog(SimpleActionMethodBinding.class);
-
- private String _outcome;
-
- public SimpleActionMethodBinding(String outcome) {
- _outcome = outcome;
- }
-
- public Object invoke(FacesContext facescontext, Object aobj[])
- throws EvaluationException, MethodNotFoundException {
- return _outcome;
- }
-
- public Class getType(FacesContext facescontext)
- throws MethodNotFoundException {
- return String.class;
- }
-
- // ~ StateHolder support
- // ----------------------------------------------------------------------------
-
- private boolean _transient = false;
-
- /**
- * Empty constructor, so that new instances can be created when restoring
- * state.
- */
- public SimpleActionMethodBinding() {
- _outcome = null;
- }
-
- public Object saveState(FacesContext facescontext) {
- return _outcome;
- }
-
- public void restoreState(FacesContext facescontext, Object obj) {
- _outcome = (String) obj;
- }
-
- public boolean isTransient() {
- return _transient;
- }
-
- public void setTransient(boolean flag) {
- _transient = flag;
- }
-
- public String toString() {
- return _outcome;
- }
-}
Deleted:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentBodyTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentBodyTagBase.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentBodyTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -1,382 +0,0 @@
-/**
- * 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.ajax4jsf.webapp.taglib;
-
-import javax.faces.component.ActionSource;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UICommand;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIGraphic;
-import javax.faces.component.UIParameter;
-import javax.faces.component.UISelectBoolean;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.webapp.UIComponentBodyTag;
-
-import org.ajax4jsf.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Base class with utility functions for all JSF tags. Get from apache MyFaces
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:55 $
- *
- */
-public abstract class UIComponentBodyTagBase extends UIComponentBodyTag {
-
- //Special UIComponent attributes (ValueHolder, ConvertibleValueHolder)
- private String _value;
- private String _converter;
- //attributes id, rendered and binding are handled by UIComponentTag
-
- /**
- * @param converter The converter to set.
- */
- public void setConverter(String converter) {
- _converter = converter;
- }
-
- /**
- * @param value The value to set.
- */
- public void setValue(String value) {
- _value = value;
- }
-
- public void release() {
- super.release();
-
- _value=null;
- _converter=null;
- }
-
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
-
- //rendererType already handled by UIComponentTag
-
- setValueProperty(component, _value);
- setConverterProperty(component, _converter);
- }
-
- // sub class helpers
- private static final Log log = LogFactory.getLog(UIComponentBodyTagBase.class);
-
- private static final Class[] VALIDATOR_ARGS = {FacesContext.class,
- UIComponent.class,
- Object.class};
- private static final Class[] ACTION_LISTENER_ARGS = {ActionEvent.class};
- private static final Class[] VALUE_LISTENER_ARGS = {ValueChangeEvent.class};
-
- protected void setCharterProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, new Character(value.charAt(0)));
- }
- }
- }
- protected void setIntegerProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Integer.valueOf(value));
- }
- }
- }
-
- protected void setLongProperty(UIComponent component, String propName, String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Long.valueOf(value));
- }
- }
- }
-
- protected void setFloatProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Float.valueOf(value));
- }
- }
- }
- protected void setDoubleProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Double.valueOf(value));
- }
- }
- }
-
- protected void setStringProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //TODO: Warning if component has no such property (with reflection)
- component.getAttributes().put(propName, value);
- }
- }
- }
-
- protected void setBooleanProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //TODO: More sophisticated way to convert boolean value (yes/no, 1/0,
on/off, etc.)
- component.getAttributes().put(propName, Boolean.valueOf(value));
- }
- }
- }
-
- protected void setValueProperty(UIComponent component, String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding("value", vb);
- }
- else if (component instanceof UICommand)
- {
- ((UICommand)component).setValue(value);
- }
- else if (component instanceof UIParameter)
- {
- ((UIParameter)component).setValue(value);
- }
- else if (component instanceof UISelectBoolean)
- {
- ((UISelectBoolean)component).setValue(Boolean.valueOf(value));
- }
- else if (component instanceof UIGraphic)
- {
- ((UIGraphic)component).setValue(value);
- }
- //Since many input components are ValueHolders the special components
- //must come first, ValueHolder is the last resort.
- else if (component instanceof ValueHolder)
- {
- ((ValueHolder)component).setValue(value);
- }
- else
- {
- log.error(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
- }
- }
- }
-
- protected void setConverterProperty(UIComponent component, String value)
- {
- if (value != null)
- {
- if (component instanceof ValueHolder)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding("converter", vb);
- }
- else
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter =
facesContext.getApplication().createConverter(value);
- ((ValueHolder)component).setConverter(converter);
- }
- }
- else
- {
- log.error(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
- }
- }
- }
-
- protected void setValidatorProperty(UIComponent component, String validator)
- {
- if (validator != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getId()));
- }
- if (isValueReference(validator))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(validator,
-
VALIDATOR_ARGS);
- ((EditableValueHolder)component).setValidator(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_VALIDATION_EXPRESSION,
component.getId(), validator));
- }
- }
- }
-
- protected void setActionProperty(UIComponent component, String action)
- {
- if (action != null)
- {
- if (!(component instanceof ActionSource))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE_ERROR,
component.getClientId(getFacesContext())));
- }
- MethodBinding mb;
- if (isValueReference(action))
- {
- mb = getFacesContext().getApplication().createMethodBinding(action,
null);
- }
- else
- {
- mb = new SimpleActionMethodBinding(action);
- }
- ((ActionSource)component).setAction(mb);
- }
- }
-
- protected void setActionListenerProperty(UIComponent component, String
actionListener)
- {
- if (actionListener != null)
- {
- if (!(component instanceof ActionSource))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE_ERROR,
component.getClientId(getFacesContext())));
- }
- if (isValueReference(actionListener))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(actionListener,
-
ACTION_LISTENER_ARGS);
- ((ActionSource)component).setActionListener(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_ACTION_LISTENER,
component.getClientId(getFacesContext()), actionListener));
- }
- }
- }
-
- protected void setValueChangedListenerProperty(UIComponent component, String
valueChangedListener)
- {
- if (valueChangedListener != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getClientId(getFacesContext())));
- }
- if (isValueReference(valueChangedListener))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(valueChangedListener,
-
VALUE_LISTENER_ARGS);
- ((EditableValueHolder)component).setValueChangeListener(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_VALUE_CHANGE_LISTENER,
component.getClientId(getFacesContext()), valueChangedListener));
- }
- }
- }
-
- protected void setValueBinding(UIComponent component,
- String propName,
- String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR, new
Object[]{component.getId(), propName, value}));
- }
- }
- }
-
-
-
-}
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/taglib/UIComponentTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -1,383 +1,130 @@
/**
- * 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.ajax4jsf.webapp.taglib;
-import javax.faces.component.ActionSource;
-import javax.faces.component.EditableValueHolder;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIGraphic;
import javax.faces.component.UIParameter;
import javax.faces.component.UISelectBoolean;
import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.ValueBinding;
import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
-import javax.faces.webapp.UIComponentTag;
-import org.ajax4jsf.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.richfaces.webapp.taglib.UIComponentELTagBase;
/**
- * Base class with utility functions for all JSF tags. Get from apache MyFaces
- * @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:59:55 $
- *
+ * @author Maksim Kaszynski
+ *
*/
-public abstract class UIComponentTagBase extends UIComponentTag {
+public abstract class UIComponentTagBase extends UIComponentELTagBase {
- //Special UIComponent attributes (ValueHolder, ConvertibleValueHolder)
- private String _value;
- private String _converter;
- //attributes id, rendered and binding are handled by UIComponentTag
+ protected ExpressionFactory getExpressionFactory() {
+ return getFacesContext().getApplication().getExpressionFactory();
+ }
- /**
- * @param converter The converter to set.
- */
- public void setConverter(String converter) {
- _converter = converter;
+ protected void setProperty(UIComponent component, Class<?> type,
+ String propName, String value) {
+ if (value != null) {
+ ValueExpression valueExpression = getExpressionFactory()
+ .createValueExpression(getELContext(), value, type);
+
+ if (valueExpression.isLiteralText()) {
+ component.getAttributes().put(propName,
+ getExpressionFactory().coerceToType(value, type));
+ } else {
+ component.setValueExpression(propName, valueExpression);
+ }
+ }
}
- /**
- * @param value The value to set.
- */
- public void setValue(String value) {
- _value = value;
+ protected void setIntegerProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, Integer.class, propName, value);
}
- public void release() {
- super.release();
+ protected void setLongProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, Long.class, propName, value);
+ }
- _value=null;
- _converter=null;
- }
+ protected void setFloatProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, Float.class, propName, value);
+ }
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
+ protected void setDoubleProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, Double.class, propName, value);
+ }
+ protected void setStringProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, String.class, propName, value);
+ }
- //rendererType already handled by UIComponentTag
+ protected void setBooleanProperty(UIComponent component, String propName,
+ String value) {
+ setProperty(component, Boolean.class, propName, value);
+ }
- setValueProperty(component, _value);
- setConverterProperty(component, _converter);
- }
+ protected void setValueProperty(UIComponent component, String value) {
+ if (value != null) {
+ ValueExpression expression = getExpressionFactory()
+ .createValueExpression(getELContext(), value, Object.class);
- // sub class helpers
- private static final Log log = LogFactory.getLog(UIComponentTagBase.class);
+ if (!expression.isLiteralText()) {
+ component.setValueExpression("value", expression);
+ } else if (component instanceof UICommand) {
+ ((UICommand) component).setValue(value);
+ } else if (component instanceof UIParameter) {
+ ((UIParameter) component).setValue(value);
+ } else if (component instanceof UISelectBoolean) {
+ ((UISelectBoolean) component).setValue(Boolean.valueOf(value));
+ } else if (component instanceof UIGraphic) {
+ ((UIGraphic) component).setValue(value);
+ }
+ // Since many input components are ValueHolders the special
+ // components
+ // must come first, ValueHolder is the last resort.
+ else if (component instanceof ValueHolder) {
+ ((ValueHolder) component).setValue(value);
+ } else {
+ component.getAttributes().put("value", value);
+ }
+ }
+ }
- private static final Class[] VALIDATOR_ARGS = {FacesContext.class,
- UIComponent.class,
- Object.class};
- private static final Class[] ACTION_LISTENER_ARGS = {ActionEvent.class};
- private static final Class[] VALUE_LISTENER_ARGS = {ValueChangeEvent.class};
-
- protected void setCharterProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, new Character(value.charAt(0)));
- }
+ public boolean isValueReference(String s) {
+ return !getExpressionFactory().createValueExpression(s, Object.class).isLiteralText();
+ }
+
+ protected void setActionProperty(UIComponent component, String action) {
+ if (action != null) {
+ MethodExpression expression =
+ getExpressionFactory().createMethodExpression(getELContext(), action,
String.class, new Class[] {});
+ setActionProperty(component, expression);
}
}
- protected void setIntegerProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Integer.valueOf(value));
- }
- }
- }
- protected void setLongProperty(UIComponent component, String propName, String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Long.valueOf(value));
- }
+ protected void setActionListenerProperty(UIComponent component, String
actionListener){
+ if (actionListener != null) {
+ MethodExpression expression =
+ getExpressionFactory().createMethodExpression(getELContext(), actionListener,
String.class, new Class[] {ActionEvent.class});
+ setActionListenerProperty(component, expression);
}
}
- protected void setFloatProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Float.valueOf(value));
- }
+ protected void setValueChangedListenerProperty(UIComponent component, String
valueChangedListener) {
+ if (valueChangedListener != null) {
+ MethodExpression expression =
+ getExpressionFactory().createMethodExpression(getELContext(),
valueChangedListener, String.class, new Class[] {ValueChangeEvent.class});
+ setValueChangeListenerProperty(component, expression);
}
}
- protected void setDoubleProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //FIXME: should use converter maybe?
- component.getAttributes().put(propName, Double.valueOf(value));
- }
- }
- }
-
- protected void setStringProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //TODO: Warning if component has no such property (with reflection)
- component.getAttributes().put(propName, value);
- }
- }
- }
- protected void setBooleanProperty(UIComponent component, String propName, String
value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- //TODO: More sophisticated way to convert boolean value (yes/no, 1/0,
on/off, etc.)
- component.getAttributes().put(propName, Boolean.valueOf(value));
- }
- }
- }
-
- protected void setValueProperty(UIComponent component, String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding("value", vb);
- }
- else if (component instanceof UICommand)
- {
- ((UICommand)component).setValue(value);
- }
- else if (component instanceof UIParameter)
- {
- ((UIParameter)component).setValue(value);
- }
- else if (component instanceof UISelectBoolean)
- {
- ((UISelectBoolean)component).setValue(Boolean.valueOf(value));
- }
- else if (component instanceof UIGraphic)
- {
- ((UIGraphic)component).setValue(value);
- }
- //Since many input components are ValueHolders the special components
- //must come first, ValueHolder is the last resort.
- else if (component instanceof ValueHolder)
- {
- ((ValueHolder)component).setValue(value);
- }
- else
- {
- component.getAttributes().put("value", value);
- }
- }
- }
-
- protected void setConverterProperty(UIComponent component, String value)
- {
- if (value != null)
- {
- if (component instanceof ValueHolder)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding("converter", vb);
- }
- else
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter =
facesContext.getApplication().createConverter(value);
- ((ValueHolder)component).setConverter(converter);
- }
- }
- else
- {
- log.error(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
- }
- }
- }
-
- protected void setValidatorProperty(UIComponent component, String validator)
- {
- if (validator != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getId()));
- }
- if (isValueReference(validator))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(validator,
-
VALIDATOR_ARGS);
- ((EditableValueHolder)component).setValidator(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_VALIDATION_EXPRESSION,
component.getId(), validator));
- }
- }
- }
-
- protected void setActionProperty(UIComponent component, String action)
- {
- if (action != null)
- {
- if (!(component instanceof ActionSource))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE_ERROR,
component.getClientId(getFacesContext())));
- }
- MethodBinding mb;
- if (isValueReference(action))
- {
- mb = getFacesContext().getApplication().createMethodBinding(action,
null);
- }
- else
- {
- mb = new SimpleActionMethodBinding(action);
- }
- ((ActionSource)component).setAction(mb);
- }
- }
-
- protected void setActionListenerProperty(UIComponent component, String
actionListener)
- {
- if (actionListener != null)
- {
- if (!(component instanceof ActionSource))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE_ERROR,
component.getClientId(getFacesContext())));
- }
- if (isValueReference(actionListener))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(actionListener,
-
ACTION_LISTENER_ARGS);
- ((ActionSource)component).setActionListener(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_ACTION_LISTENER,
component.getClientId(getFacesContext()), actionListener));
- }
- }
- }
-
- protected void setValueChangedListenerProperty(UIComponent component, String
valueChangedListener)
- {
- if (valueChangedListener != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getClientId(getFacesContext())));
- }
- if (isValueReference(valueChangedListener))
- {
- MethodBinding mb =
getFacesContext().getApplication().createMethodBinding(valueChangedListener,
-
VALUE_LISTENER_ARGS);
- ((EditableValueHolder)component).setValueChangeListener(mb);
- }
- else
- {
- log.error(Messages.getMessage(Messages.INVALID_VALUE_CHANGE_LISTENER,
component.getClientId(getFacesContext()), valueChangedListener));
- }
- }
- }
-
- protected void setValueBinding(UIComponent component,
- String propName,
- String value)
- {
- if (value != null)
- {
- if (isValueReference(value))
- {
- ValueBinding vb =
getFacesContext().getApplication().createValueBinding(value);
- component.setValueBinding(propName, vb);
- }
- else
- {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR, new
Object[]{component.getId(), propName, value}));
- }
- }
- }
-
-
-
}
-
Added:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -0,0 +1,77 @@
+/**
+ *
+ */
+package org.richfaces.webapp.taglib;
+
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.MethodNotFoundException;
+
+/**
+ * Maps {@link MethodExpression} to {@link MethodBinding}
+ * @author Maksim Kaszynski
+ *
+ */
+@SuppressWarnings("deprecation")
+public class MethodBindingMethodExpressionAdaptor extends MethodBinding implements
StateHolder{
+
+ private MethodExpression expression;
+ private boolean tranzient;
+ /* (non-Javadoc)
+ * @see javax.faces.el.MethodBinding#getType(javax.faces.context.FacesContext)
+ */
+
+ public MethodBindingMethodExpressionAdaptor(MethodExpression expression) {
+ super();
+ this.expression = expression;
+ }
+
+ @Override
+ public Class<?> getType(FacesContext context) throws MethodNotFoundException {
+ try {
+ return expression.getMethodInfo(context.getELContext()).getReturnType();
+ } catch (javax.el.MethodNotFoundException e) {
+ throw new MethodNotFoundException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.MethodBinding#invoke(javax.faces.context.FacesContext,
java.lang.Object[])
+ */
+ @Override
+ public Object invoke(FacesContext context, Object[] params)
+ throws EvaluationException, MethodNotFoundException {
+ try {
+ return expression.invoke(context.getELContext(), params);
+ } catch (javax.el.MethodNotFoundException e) {
+ throw new MethodNotFoundException(e);
+ } catch (ELException e) {
+ throw new EvaluationException(e);
+ }
+ }
+
+ public boolean isTransient() {
+ return tranzient;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ expression = (MethodExpression) state;
+ }
+
+ public Object saveState(FacesContext context) {
+ return expression;
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ tranzient = newTransientValue;
+ }
+
+ @Override
+ public String getExpressionString() {
+ return expression.getExpressionString();
+ }
+}
Added:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -0,0 +1,158 @@
+/**
+ *
+ */
+package org.richfaces.webapp.taglib;
+
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIInput;
+import javax.faces.el.MethodBinding;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class SimpleComponentTag extends UIComponentELTagBase {
+
+ private MethodExpression _action;
+ private MethodExpression _actionListener;
+ private MethodExpression _valueChangeListener;
+ private MethodExpression _validator;
+ private ValueExpression _converter;
+ private ValueExpression _title;
+ private ValueExpression _value;
+ private MethodExpression _legacyBinding;
+ private MethodExpression _methodExpression;
+
+ static class MyUIComponent extends UIComponentBase {
+ private MethodExpression methodExpression;
+ private MethodBinding legacyMethodBinding;
+
+ @Override
+ public String getFamily() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public MethodBinding getLegacyMethodBinding() {
+ return legacyMethodBinding;
+ }
+
+ public void setLegacyMethodBinding(MethodBinding legacyMethodBinding) {
+ this.legacyMethodBinding = legacyMethodBinding;
+ }
+
+ public MethodExpression getMethodExpression() {
+ return methodExpression;
+ }
+
+ public void setMethodExpression(MethodExpression methodExpression) {
+ this.methodExpression = methodExpression;
+ }
+
+ }
+
+ public SimpleComponentTag() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public String getComponentType() {
+ return UIInput.COMPONENT_TYPE;
+ }
+
+ @Override
+ public String getRendererType() {
+ return "javax.faces.Text";
+ }
+
+ @Override
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ MyUIComponent myUIComponent = (MyUIComponent) component;
+
+ myUIComponent.setValueExpression("value", _value);
+
+ setActionListenerProperty(myUIComponent, _actionListener);
+ setActionProperty(myUIComponent, _action);
+ setConverterProperty(myUIComponent, _converter);
+ setValidatorProperty(myUIComponent, _validator);
+
+
+ if (_methodExpression != null) {
+ myUIComponent.setMethodExpression(_methodExpression);
+ }
+
+ if (_legacyBinding != null) {
+ myUIComponent.setLegacyMethodBinding(new
MethodBindingMethodExpressionAdaptor(_legacyBinding));
+ }
+
+
+ }
+
+ @Override
+ public void release() {
+ super.release();
+
+ }
+
+ public void setAction(MethodExpression _action) {
+ this._action = _action;
+ }
+
+ public MethodExpression getAction() {
+ return _action;
+ }
+
+
+ public MethodExpression getActionListener() {
+ return _actionListener;
+ }
+
+ public void setActionListener(MethodExpression listener) {
+ _actionListener = listener;
+ }
+
+ public MethodExpression getValueChangeListener() {
+ return _valueChangeListener;
+ }
+
+ public void setValueChangeListener(MethodExpression changeListener) {
+ _valueChangeListener = changeListener;
+ }
+
+ public MethodExpression getValidator() {
+ return _validator;
+ }
+
+ public void setValidator(MethodExpression _validator) {
+ this._validator = _validator;
+ }
+
+ public ValueExpression getConverter() {
+ return _converter;
+ }
+
+ public void setConverter(ValueExpression _converter) {
+ this._converter = _converter;
+ }
+
+ public ValueExpression getTitle() {
+ return _title;
+ }
+
+ public void setTitle(ValueExpression _title) {
+ this._title = _title;
+ }
+
+ public ValueExpression getValue() {
+ return _value;
+ }
+
+ public void setValue(ValueExpression _value) {
+ this._value = _value;
+ }
+
+
+}
Added:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -0,0 +1,92 @@
+/**
+ *
+ */
+package org.richfaces.webapp.taglib;
+
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+import javax.faces.component.ActionSource2;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.MethodExpressionActionListener;
+import javax.faces.event.MethodExpressionValueChangeListener;
+import javax.faces.validator.MethodExpressionValidator;
+import javax.faces.webapp.UIComponentELTag;
+
+import org.ajax4jsf.Messages;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class UIComponentELTagBase extends UIComponentELTag {
+
+ private static final Log log = LogFactory.getLog(UIComponentELTagBase.class);
+
+ protected void setActionListenerProperty(UIComponent component, MethodExpression
actionListener) {
+ if (actionListener != null) {
+ if (component instanceof ActionSource2) {
+ ActionSource2 actionSource2 = (ActionSource2) component;
+ actionSource2.addActionListener(new MethodExpressionActionListener(actionListener));
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE2_ERROR,
component.getClientId(getFacesContext())));
+ }
+ }
+ }
+
+ protected void setActionProperty(UIComponent component, MethodExpression action) {
+ if (action != null) {
+ if (component instanceof ActionSource2) {
+ ActionSource2 actionSource2 = (ActionSource2) component;
+ actionSource2.setActionExpression(action);
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_ACTION_SOURCE2_ERROR,
component.getClientId(getFacesContext())));
+ }
+ }
+ }
+
+ protected void setConverterProperty(UIComponent component, ValueExpression converter) {
+ if (converter != null) {
+ if (component instanceof ValueHolder) {
+ ValueHolder output = (ValueHolder) component;
+ if (!converter.isLiteralText()) {
+ component.setValueExpression("converter", converter);
+ } else {
+ Converter conv =
FacesContext.getCurrentInstance().getApplication().createConverter(converter.getExpressionString());
+ output.setConverter(conv);
+ }
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
+ }
+ }
+ }
+
+ protected void setValidatorProperty(UIComponent component, MethodExpression validator)
{
+
+ if (validator != null) {
+ if (component instanceof EditableValueHolder) {
+ EditableValueHolder input = (EditableValueHolder) component;
+ input.addValidator(new MethodExpressionValidator(validator));
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getId()));
+ }
+ }
+ }
+
+ protected void setValueChangeListenerProperty(UIComponent component, MethodExpression
valueChangeListener) {
+ if (valueChangeListener != null) {
+ if (component instanceof EditableValueHolder) {
+ EditableValueHolder input = (EditableValueHolder) component;
+ input.addValueChangeListener(new
MethodExpressionValueChangeListener(valueChangeListener));
+ } else {
+ throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_EDITABLE_VALUE_HOLDER_ERROR,
component.getId()));
+ }
+ }
+ }
+}
Added:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
(rev 0)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -0,0 +1,116 @@
+/**
+ *
+ */
+package org.richfaces.webapp.taglib;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.PropertyNotFoundException;
+import javax.faces.el.ValueBinding;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+@SuppressWarnings("deprecation")
+public class ValueBindingValueExpressionAdaptor extends ValueBinding implements
StateHolder {
+
+ private ValueExpression expression;
+ private boolean tranzient;
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.ValueBinding#getType(javax.faces.context.FacesContext)
+ */
+ @Override
+ public Class<?> getType(FacesContext context) throws EvaluationException,
+ PropertyNotFoundException {
+ try {
+ return expression.getType(context.getELContext());
+ } catch (javax.el.PropertyNotFoundException e) {
+ throw new PropertyNotFoundException(e);
+ } catch (ELException e) {
+ throw new EvaluationException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.ValueBinding#getValue(javax.faces.context.FacesContext)
+ */
+ @Override
+ public Object getValue(FacesContext context) throws EvaluationException,
+ PropertyNotFoundException {
+ try {
+ return expression.getValue(context.getELContext());
+ } catch(javax.el.PropertyNotFoundException e) {
+ throw new PropertyNotFoundException(e);
+ } catch (ELException e) {
+ throw new EvaluationException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.ValueBinding#isReadOnly(javax.faces.context.FacesContext)
+ */
+ @Override
+ public boolean isReadOnly(FacesContext context) throws EvaluationException,
+ PropertyNotFoundException {
+ try {
+ return expression.isReadOnly(context.getELContext());
+ } catch(javax.el.PropertyNotFoundException e) {
+ throw new PropertyNotFoundException(e);
+ } catch (ELException e) {
+ throw new EvaluationException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.ValueBinding#setValue(javax.faces.context.FacesContext,
java.lang.Object)
+ */
+ @Override
+ public void setValue(FacesContext context, Object value)
+ throws EvaluationException, PropertyNotFoundException {
+
+ try {
+ expression.setValue(context.getELContext(), value);
+ } catch(javax.el.PropertyNotFoundException e) {
+ throw new PropertyNotFoundException(e);
+ } catch (ELException e) {
+ throw new EvaluationException(e);
+ }
+
+ }
+
+ public boolean isTransient() {
+ return tranzient;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ expression = (ValueExpression) state;
+ }
+
+ public Object saveState(FacesContext context) {
+ return expression;
+ }
+
+ public void setTransient(boolean newTransientValue) {
+ tranzient = newTransientValue;
+ }
+
+ public ValueExpression getExpression() {
+ return expression;
+ }
+
+ public void setExpression(ValueExpression expression) {
+ this.expression = expression;
+ }
+
+ public ValueBindingValueExpressionAdaptor(ValueExpression expression) {
+ super();
+ this.expression = expression;
+ }
+
+
+}
Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2007-10-22
03:26:53 UTC (rev 3460)
@@ -189,6 +189,7 @@
NO_EDITABLE_VALUE_HOLDER_ERROR=Component {0} is no EditableValueHolder
INVALID_VALIDATION_EXPRESSION=Component {0} has invalid validation expression {1}
NO_ACTION_SOURCE_ERROR=Component {0} is no ActionSource
+NO_ACTION_SOURCE2_ERROR=Component {0} is no ActionSource2
INVALID_ACTION_LISTENER=Component {0} has invalid actionListener value\: {1}
INVALID_VALUE_CHANGE_LISTENER=Component {0} has invalid valueChangedListener expression
{1}
NO_VALUE_REFERENCE_ERROR=Component {0} attribute {1} must be a value reference, was {2}
Property changes on: trunk/samples/virtualEarth-sample
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
Modified: trunk/ui/core/pom.xml
===================================================================
--- trunk/ui/core/pom.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/core/pom.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -44,4 +44,4 @@
</build>
<dependencies>
</dependencies>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/ui/core/src/main/config/component/actionParameter.xml
===================================================================
--- trunk/ui/core/src/main/config/component/actionParameter.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/core/src/main/config/component/actionParameter.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -89,4 +89,4 @@
</property>
</component>
-</components>
\ No newline at end of file
+</components>
Modified: trunk/ui/core/src/main/config/component/commandButton.xml
===================================================================
--- trunk/ui/core/src/main/config/component/commandButton.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/core/src/main/config/component/commandButton.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -106,10 +106,8 @@
<classname>int</classname>
<description>Timeout ( in ms ) for request.</description>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/core/src/main/config/component/commandLink.xml
===================================================================
--- trunk/ui/core/src/main/config/component/commandLink.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/core/src/main/config/component/commandLink.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -87,10 +87,8 @@
<classname>int</classname>
<description>Timeout ( in ms ) for request.</description>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/core/src/main/config/component/form.xml
===================================================================
--- trunk/ui/core/src/main/config/component/form.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/core/src/main/config/component/form.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -62,7 +62,7 @@
</property>
<property>
<name>prependId</name>
- <classname>java.lang.String</classname>
+ <classname>boolean</classname>
<description>The flag indicating whether or not this form should prepend its id
to its descendent id during the clientId generation process. If this flag is not set, the
default value is true.</description>
</property>
<property disabled="true">
@@ -108,20 +108,16 @@
&ui_command_attributes;
&html_anchor_attributes;
&html_events;
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
<property>
<name>disabled</name>
<classname>boolean</classname>
<description>When set for a form control, this boolean attribute disables
the control for user input.</description>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
</component>
Modified: trunk/ui/core/src/main/config/component/function.xml
===================================================================
--- trunk/ui/core/src/main/config/component/function.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/core/src/main/config/component/function.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -60,10 +60,8 @@
<name>value</name>
<classname>java.lang.Object</classname>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
</component>
</components>
\ No newline at end of file
Modified: trunk/ui/core/src/main/config/component/poll.xml
===================================================================
--- trunk/ui/core/src/main/config/component/poll.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/core/src/main/config/component/poll.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -50,10 +50,8 @@
&ui_component_attributes;
&ui_command_attributes;
&ajax_component_attributes;
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
<property>
<name>onsubmit</name>
Modified: trunk/ui/core/src/main/config/component/push.xml
===================================================================
--- trunk/ui/core/src/main/config/component/push.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/core/src/main/config/component/push.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -60,10 +60,8 @@
</description>
<methodargs>java.util.EventListener</methodargs>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
<!--
<property>
Modified: trunk/ui/core/src/main/config/component/repeat.xml
===================================================================
--- trunk/ui/core/src/main/config/component/repeat.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/core/src/main/config/component/repeat.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -46,7 +46,7 @@
&ui_component_attributes;
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition.</description>
</property>
<property el="false">
@@ -61,7 +61,7 @@
</property>
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines strings that are updated after an AJAX
request.</description>
</property>
<property el="false">
Modified: trunk/ui/core/src/main/config/component/support.xml
===================================================================
--- trunk/ui/core/src/main/config/component/support.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/core/src/main/config/component/support.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -75,10 +75,8 @@
&ui_component_attributes;
&ui_command_attributes;
&ajax_component_attributes;
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression.</description>
</property>
<property>
<name>onsubmit</name>
Modified: trunk/ui/core/src/main/config/taglib/ajax.tld.include
===================================================================
--- trunk/ui/core/src/main/config/taglib/ajax.tld.include 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/core/src/main/config/taglib/ajax.tld.include 2007-10-22 03:26:53 UTC (rev
3460)
@@ -1,73 +1,54 @@
<taglib>
-
<tag>
-
- <name>ajaxListener</name>
-
- <tag-class>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</tag-class>
-
<description>
-
This works the same as ActionListener or ValueChangeListener, but for an AJAX
container. Add the specified class
-
as a listener for AjaxEvent (sent in case of an AJAX request
-
for this container).
-
</description>
-
+
+ <name>ajaxListener</name>
+
+ <tag-class>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</tag-class>
+
+ <body-content>JSP</body-content>
+
<attribute>
-
+ <description> Fully qualified Java class name of an AjaxListener to be created
and registered.</description>
<name>type</name>
-
<required>true</required>
-
- <rtexprvalue>false</rtexprvalue>
-
- <description> Fully qualified Java class name of an AjaxListener to be created
and registered.</description>
-
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
-
</tag>
-
+
<tag>
-
- <name>keepAlive</name>
-
- <tag-class>org.ajax4jsf.taglib.html.jsp.KeepAliveTag</tag-class>
-
<description>
-
This tag get bean by EL expression '#{'+name+'}' and store bean
instance in component tree. After restoring view state, bean is putted to request-scope
attributes with name.
-
Since, every view will be use own instance of bean for expressions
'#{name....}'
-
</description>
-
+ <name>keepAlive</name>
+
+ <tag-class>org.ajax4jsf.taglib.html.jsp.KeepAliveTag</tag-class>
+
+ <body-content>JSP</body-content>
+
<attribute>
-
+ <description> name of bean for EL-expressions.</description>
<name>beanName</name>
-
<required>true</required>
-
- <rtexprvalue>false</rtexprvalue>
-
- <description> name of bean for EL-expressions.</description>
-
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
-
+
<attribute>
-
+ <description> if true, bean value restored in ajax requests
only.</description>
<name>ajaxOnly</name>
-
<required>false</required>
-
- <rtexprvalue>false</rtexprvalue>
-
- <description> if true, bean value restored in ajax requests
only.</description>
-
+ <deferred-value>
+ <type>java.lang.String</type>
+ </deferred-value>
</attribute>
-
</tag>
-
</taglib>
\ No newline at end of file
Modified: trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml
===================================================================
--- trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/dataFilterSlider/src/main/config/component/dataFilterSlider.xml 2007-10-22
03:26:53 UTC (rev 3460)
@@ -182,7 +182,6 @@
</property>
<property hidden="true">
<name>active</name>
- <classname>java.lang.String</classname>
</property>
</component>
&listeners;
Modified: trunk/ui/dataTable/src/main/config/component/colgroup.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/dataTable/src/main/config/component/colgroup.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -31,7 +31,7 @@
&html_universal_attributes;
<property>
<name>breakBefore</name>
- <classname>java.lang.String</classname>
+ <classname>boolean</classname>
<description>if "true" next column begins from the first
row</description>
</property>
<property>
@@ -50,13 +50,13 @@
A comma-delimited list of CSS style classes that is applied to popup table rows. A
space separated list of classes may also be specified for any individual row. The styles
are applied, in turn, to each row in the table. For example, if the list has two elements,
the first style class in the list is applied to the first row, the second to the second
row, the first to the third row, the second to the fourth row, etc. In other words, we
keep iterating through the list until we reach the end, and then we start at the beginning
again
</description>
</property>
- <property disabled="true" hidden="true">
+ <property disabled="false" hidden="true">
<name>sortable</name>
<classname>boolean</classname>
<description></description>
<defaultvalue>true</defaultvalue>
</property>
- <property disabled="true" hidden="true">
+ <property disabled="false" hidden="true">
<name>sortExpression</name>
<classname>java.lang.String</classname>
<description></description>
Modified: trunk/ui/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/dataTable/src/main/config/component/dataGrid.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -37,7 +37,7 @@
</property>
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property>
@@ -174,7 +174,7 @@
</property>
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
</component>
Modified: trunk/ui/dataTable/src/main/config/component/dataList.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataList.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/dataTable/src/main/config/component/dataList.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -39,7 +39,7 @@
</property>
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property>
@@ -67,7 +67,7 @@
</property>
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
<!--
@@ -117,7 +117,7 @@
</property>
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property>
@@ -144,7 +144,7 @@
</property>
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
<!--
@@ -201,7 +201,7 @@
-->
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property>
@@ -226,7 +226,7 @@
</property>
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -34,7 +34,7 @@
&spec_table_attributes;
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property>
@@ -99,7 +99,7 @@
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
<property>
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -33,7 +33,7 @@
&spec_table_attributes;
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
<property disabled="true" hidden="true">
@@ -42,7 +42,7 @@
<description>
</description>
</property>
- <property disabled="true" hidden="true">
+ <property disabled="false" hidden="true">
<name>sortable</name>
<classname>boolean</classname>
<description></description>
@@ -51,7 +51,7 @@
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
<property>
Modified: trunk/ui/datascroller/src/main/config/component/datascroller.xml
===================================================================
--- trunk/ui/datascroller/src/main/config/component/datascroller.xml 2007-10-21 15:05:17
UTC (rev 3459)
+++ trunk/ui/datascroller/src/main/config/component/datascroller.xml 2007-10-22 03:26:53
UTC (rev 3460)
@@ -255,16 +255,13 @@
<defaultvalue><![CDATA["show"]]></defaultvalue>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression</description>
</property>
<property hidden="true">
<name>firstRow</name>
- <classname>java.lang.String</classname>
</property>
<property hidden="true">
Modified: trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -42,11 +42,11 @@
-->
<property elonly="true" attachedstate="true">
<name>dragListener</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description>
MethodBinding representing an action listener method that will be notified after drag
operation
</description>
- <methodargs>org.richfaces.event.DragEvent.class</methodargs>
+ <methodargs>org.richfaces.event.DragEvent</methodargs>
</property>
<property>
<name>disableDefault</name>
@@ -64,8 +64,6 @@
</property>
<property hidden="true" >
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding
expression</description>
</property>
</component>
Modified: trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -32,14 +32,14 @@
&dropzone_attributes;
&ajax_component_attributes;
- <property>
+ <property elonly="true" attachedstate="true">
<name>dropListener</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description><![CDATA[
MethodBinding representing an action listener method that will be notified after drop
operation.
]]>
</description>
- <methodargs>org.richfaces.event.DropEvent.class</methodargs>
+ <methodargs>org.richfaces.event.DropEvent</methodargs>
</property>
<property>
<name>disableDefault</name>
@@ -67,8 +67,6 @@
<property hidden="true" >
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding
expression</description>
</property>
</component>
<listener>
Modified: trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/inputnumber-spinner/src/main/config/resources/resources-config.xml 2007-10-22
03:26:53 UTC (rev 3460)
@@ -6,7 +6,7 @@
<resource
class="org.richfaces.renderkit.html.images.background.SpinnerFieldGradient">
<name>org.richfaces.renderkit.html.images.background.SpinnerFieldGradient</name>
</resource>
- <resource
class="org.richfaces.renderkit.html.images.buttons.SpinnerButtonImage">
+ <!--resource
class="org.richfaces.renderkit.html.images.buttons.SpinnerButtonImage">
<name>org.richfaces.renderkit.html.images.buttons.SpinnerButtonImage</name>
- </resource>
+ </resource-->
</resource-config>
Modified: trunk/ui/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2007-10-22
03:26:53 UTC (rev 3460)
@@ -189,10 +189,8 @@
<description>Path to the icon to be displayed for the disabled item
state.
</description>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression</description>
</property>
<property>
<name>disabled</name>
Modified: trunk/ui/panel/src/test/java/org/richfaces/taglib/PanelTagTest.java
===================================================================
--- trunk/ui/panel/src/test/java/org/richfaces/taglib/PanelTagTest.java 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/panel/src/test/java/org/richfaces/taglib/PanelTagTest.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -3,26 +3,12 @@
*/
package org.richfaces.taglib;
-import java.io.IOException;
-import java.util.Enumeration;
-
import javax.faces.webapp.UIComponentTag;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.el.ExpressionEvaluator;
-import javax.servlet.jsp.el.VariableResolver;
import javax.servlet.jsp.tagext.Tag;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.shale.test.el.MockValueExpression;
import org.richfaces.component.html.HtmlPanel;
/**
@@ -86,8 +72,8 @@
*/
public void testSetPropertiesUIComponent() throws JspException {
HtmlPanel panel = new HtmlPanel();
- panelTag.setBodyClass("panel");
- panelTag.setHeaderClass("headClass");
+ panelTag.setBodyClass(new MockValueExpression("panel", String.class));
+ panelTag.setHeaderClass(new MockValueExpression("headClass", String.class));
panelTag.setProperties(panel);
assertEquals("panel", panel.getBodyClass());
assertEquals("headClass", panel.getHeaderClass());
Modified: trunk/ui/panelbar/src/main/config/component/panelbar.xml
===================================================================
--- trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -130,7 +130,6 @@
<property hidden="true">
<name>valid</name>
- <classname>java.lang.String</classname>
</property>
</component>
Modified: trunk/ui/panelmenu/src/main/config/component/panelMenu.xml
===================================================================
--- trunk/ui/panelmenu/src/main/config/component/panelMenu.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/panelmenu/src/main/config/component/panelMenu.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -418,29 +418,12 @@
<description>Defines representation text for menuItem.</description>
</property-->
&listeners;
- <property>
- <name>action</name>
- <classname>java.lang.String</classname>
- <description>MethodBinding pointing at the application action to be invoked, if
this UIComponent is activated by the user, during the Apply Request Values or Invoke
Application phase of the request processing lifecycle, depending on the value of the
immediate property</description>
- </property>
- <property>
- <name>actionListener</name>
- <classname>java.lang.String</classname>
- <description>MethodBinding pointing at method accepting an ActionEvent with
return type void</description>
- </property>
<property>
<name>target</name>
<classname>java.lang.String</classname>
<description>Target frame for action to execute.</description>
</property>
- <property>
- <name>immediate</name>
- <classname>boolean</classname>
- <description>A flag indicating that this component value must be converted and
validated
- immediately (that is, during Apply Request Values phase), rather than waiting until
- a Process Validations phase. </description>
- </property>
&ui_component_attributes;
&html_input_attributes;
&html_input_events;
@@ -448,6 +431,7 @@
&ui_output_attributes;
&html_events;
&ajax_component_attributes;
+ &ui_command_attributes;
<property>
<name>oncollapse</name>
<classname>java.lang.String</classname>
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
===================================================================
---
trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -37,9 +37,6 @@
public static final String COMPONENT_TYPE = "org.richfaces.panelMenuGroup";
- private MethodBinding actionListener = null;
- private MethodBinding action = null;
-
public abstract String getStyleClass();
public abstract void setStyleClass(String styleClass);
@@ -92,14 +89,6 @@
addFacesListener(listener);
}
- public MethodBinding getAction() {
- return action;
- }
-
- public MethodBinding getActionListener() {
- return (this.actionListener);
- }
-
public ActionListener[] getActionListeners() {
ActionListener al[] = (ActionListener [])
getFacesListeners(ActionListener.class);
@@ -111,30 +100,6 @@
removeFacesListener(listener);
}
- public void setAction(MethodBinding action) {
- this.action = action;
- }
-
- public void setActionListener(MethodBinding actionListener) {
- this.actionListener = actionListener;
- }
-
- public void restoreState(FacesContext context, Object state) {
- Object values[] = (Object[]) state;
- super.restoreState(context, values[0]);
- action = (MethodBinding) restoreAttachedState(context, values[1]);
- actionListener = (MethodBinding) restoreAttachedState(context,
- values[2]);
- }
-
- public Object saveState(FacesContext context) {
- Object values[] = new Object[3];
- values[0] = super.saveState(context);
- values[1] = saveAttachedState(context, action);
- values[2] = saveAttachedState(context, actionListener);
- return values;
- }
-
public void queueEvent(FacesEvent event) {
if(event instanceof ActionEvent && this == event.getSource()){
if (isImmediate()) {
Modified:
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
---
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2007-10-22
03:26:53 UTC (rev 3460)
@@ -60,7 +60,7 @@
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
@@ -234,7 +234,7 @@
<property>
<name>ajaxKeys</name>
- <classname>java.lang.String</classname>
+ <classname>java.util.Set</classname>
<description>This attribute defines rows that are updated after an AJAX
request</description>
</property>
Modified: trunk/ui/simpleTogglePanel/src/main/config/component/simpleTogglePanel.xml
===================================================================
--- trunk/ui/simpleTogglePanel/src/main/config/component/simpleTogglePanel.xml 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/simpleTogglePanel/src/main/config/component/simpleTogglePanel.xml 2007-10-22
03:26:53 UTC (rev 3460)
@@ -49,11 +49,6 @@
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
- <property>
- <name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression</description>
- </property>
<property>
<name>height</name>
<classname>java.lang.String</classname>
Modified:
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/taglib/SimpleTogglePanelTagBase.java
===================================================================
---
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/taglib/SimpleTogglePanelTagBase.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/taglib/SimpleTogglePanelTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -21,40 +21,60 @@
package org.richfaces.taglib;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.ajax4jsf.webapp.taglib.HtmlComponentTagBase;
+import org.richfaces.component.UISimpleTogglePanel;
public abstract class SimpleTogglePanelTagBase extends HtmlComponentTagBase {
private boolean _openedSet = false;
- private String _value = null;
+ private ValueExpression _value = null;
- private void logValueDeprecation(String value) {
+ private void logValueDeprecation(ValueExpression value) {
FacesContext facesContext = getFacesContext();
facesContext.getExternalContext().log("opened attribute has been already set for
component with id: " + this.getId() +
- "[" + this._value + "]. value attribute is deprecated and thus has
been dropped!");
+ "[" + value.getExpressionString() + "]. value attribute is deprecated
and thus has been dropped!");
}
- public void setOpened(String opened) {
- if (_value != null) {
+ public void setOpened(ValueExpression opened) {
+ if (!_openedSet && _value != null) {
logValueDeprecation(_value);
}
- _openedSet = false;
- super.setValue(opened);
+ _value = opened;
_openedSet = true;
}
- public void setValue(String value) {
+ public void setValue(ValueExpression value) {
if (!_openedSet) {
_value = value;
- super.setValue(value);
} else {
- logValueDeprecation(value);
+ logValueDeprecation(_value);
}
}
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ if (_value != null) {
+ if (_value.isLiteralText()) {
+ try {
+ UISimpleTogglePanel panel = (UISimpleTogglePanel) component;
+ panel.setOpened(Boolean.valueOf(_value.getExpressionString()));
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("opened", _value);
+ }
+ }
+ }
+
public void release() {
super.release();
_openedSet = false;
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-10-21 15:05:17
UTC (rev 3459)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-10-22 03:26:53
UTC (rev 3460)
@@ -66,10 +66,13 @@
&html_table_attributes;
<property elonly="true">
<name>suggestionAction</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<methodargs>
java.lang.Object
</methodargs>
+ <returntype>
+ java.lang.Object
+ </returntype>
<description>
<![CDATA[Method calls an expression to get a collection of suggestion
data on request. It must have one parameter with a type of Object with content of input
component and must return any type allowed for <h:datatable> ]]>
</description>
@@ -332,8 +335,6 @@
</property>
<property hidden="true">
<name>rows</name>
- <classname>java.lang.String</classname>
- <description>rows</description>
</property>
<property>
<name>nothingLabel</name>
@@ -343,5 +344,8 @@
It isn't selectable and list is closed as always after click on it and nothing is
put to input.
</description>
</property>
+ <property hidden="true" disabled="true">
+ <name>upValue</name>
+ </property>
</component>
</components>
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java
===================================================================
---
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/component/UISuggestionBox.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -23,10 +23,10 @@
import java.util.Map;
+import javax.el.MethodExpression;
import javax.faces.component.UIData;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
@@ -102,14 +102,14 @@
*
* @return suggestionAction value from local variable or value bindings
*/
- public abstract MethodBinding getSuggestionAction();
+ public abstract MethodExpression getSuggestionAction();
/**
* Setter for suggestionAction.
*
- * @param action {@link javax.faces.el.MethodBinding}
+ * @param action {@link javax.el.MethodExpression}
*/
- public abstract void setSuggestionAction(MethodBinding action);
+ public abstract void setSuggestionAction(MethodExpression action);
/**
* Getter for converter.
@@ -337,10 +337,10 @@
public void setupValue(FacesContext context) {
Object value = getSubmitedValue();
- MethodBinding suggestingAction = getSuggestionAction();
+ MethodExpression suggestingAction = getSuggestionAction();
if (null != suggestingAction) {
setValue(suggestingAction.invoke(
- context, new Object[]{value}));
+ context.getELContext(), new Object[]{value}));
}
}
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java
===================================================================
---
trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java 2007-10-21
15:05:17 UTC (rev 3459)
+++
trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -21,15 +21,15 @@
package org.richfaces.taglib;
+import org.richfaces.component.UISuggestionBox;
+
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.Metadata;
import com.sun.facelets.tag.MetadataTarget;
import com.sun.facelets.tag.TagAttribute;
import com.sun.facelets.tag.jsf.ComponentConfig;
-import org.richfaces.component.UISuggestionBox;
/**
* Component tag handler for Facelets.
@@ -136,8 +136,8 @@
public void applyMetadata(final FaceletContext context,
final Object instance) {
((UISuggestionBox) instance)
- .setSuggestionAction(new LegacyMethodBinding(this.action
- .getMethodExpression(context, null, SIGNATURE)));
+ .setSuggestionAction(this.action
+ .getMethodExpression(context, null, SIGNATURE));
}
}
}
Modified: trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
===================================================================
--- trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2007-10-21 15:05:17 UTC (rev
3459)
+++ trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2007-10-22 03:26:53 UTC (rev
3460)
@@ -175,10 +175,8 @@
<name>value</name>
<classname>java.lang.Object</classname>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression</description>
</property>
<property>
<name>name</name>
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/taglib/TabPanelTagBase.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/taglib/TabPanelTagBase.java 2007-10-21
15:05:17 UTC (rev 3459)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/taglib/TabPanelTagBase.java 2007-10-22
03:26:53 UTC (rev 3460)
@@ -21,9 +21,14 @@
package org.richfaces.taglib;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import org.ajax4jsf.webapp.taglib.HtmlComponentTagBase;
+import org.richfaces.component.UITabPanel;
/**
*
@@ -37,33 +42,48 @@
public abstract class TabPanelTagBase extends HtmlComponentTagBase {
private boolean _selectedTabSet = false;
- private String _value = null;
+ private ValueExpression _value = null;
- private void logValueDeprecation(String value) {
+ private void logValueDeprecation(ValueExpression value) {
FacesContext facesContext = getFacesContext();
facesContext.getExternalContext().log("selectedTab attribute has been already set
for component with id: " + this.getId() +
- "[" + this._value + "]. value attribute is deprecated and thus has
been dropped!");
+ "[" + value.getExpressionString() + "]. value attribute is deprecated
and thus has been dropped!");
}
- public void setSelectedTab(String tab) {
- if (_value != null) {
- logValueDeprecation(_value);
+ public void setSelectedTab(ValueExpression tab) {
+ if (!_selectedTabSet && _value != null) {
+ logValueDeprecation(tab);
}
- _selectedTabSet = false;
- super.setValue(tab);
+ _value = tab;
_selectedTabSet = true;
}
- public void setValue(String value) {
+ public void setValue(ValueExpression value) {
if (!_selectedTabSet) {
_value = value;
- super.setValue(value);
} else {
- logValueDeprecation(value);
+ logValueDeprecation(_value);
}
}
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (_value != null) {
+ if (_value.isLiteralText()) {
+ UITabPanel tabPanel = (UITabPanel) component;
+ try {
+ tabPanel.setSelectedTab(_value.getExpressionString());
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ } else {
+ component.setValueExpression("selectedTab", _value);
+ }
+ }
+ }
+
public void release() {
super.release();
_selectedTabSet = false;
Modified: trunk/ui/togglePanel/src/main/config/component/togglePanel.xml
===================================================================
--- trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2007-10-21 15:05:17 UTC
(rev 3459)
+++ trunk/ui/togglePanel/src/main/config/component/togglePanel.xml 2007-10-22 03:26:53 UTC
(rev 3460)
@@ -92,12 +92,10 @@
</property>
<property hidden="true">
<name>localValueSet</name>
- <classname>boolean</classname>
</property>
<property hidden="true">
<name>valid</name>
- <classname>java.lang.String</classname>
</property>
@@ -195,10 +193,8 @@
</description>
</property>
- <property>
+ <property hidden="true">
<name>actionExpression</name>
- <classname>java.lang.String</classname>
- <description>The action method binding expression</description>
</property>
<property>
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2007-10-21 15:05:17 UTC (rev 3459)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2007-10-22 03:26:53 UTC (rev 3460)
@@ -69,7 +69,7 @@
</property>
<property>
<name>componentState</name>
- <classname>java.lang.String</classname>
+ <classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or
redefinition</description>
</property>
<property>