[richfaces-svn-commits] JBoss Rich Faces SVN: r15804 - in root/framework/trunk/impl/src/main/java/org/richfaces: webapp/taglib and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Nov 2 05:55:43 EST 2009


Author: Alex.Kolonitsky
Date: 2009-11-02 05:55:43 -0500 (Mon, 02 Nov 2009)
New Revision: 15804

Modified:
   root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java
   root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
   root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java
Log:
Code style policy
https://jira.jboss.org/jira/browse/RFPL-195

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/VersionBean.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -19,8 +19,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
-package org.richfaces; 
 
+
+package org.richfaces;
+
 /**
  * Vendor and version information for A4J project
  * @author asmirnov at exadel.com (latest modification by $Author$)
@@ -28,74 +30,76 @@
  *
  */
 public class VersionBean {
+    public static final int MAJOR_VERSION = 4;
+    public static final int MINOR_VERSION = 0;
+    public static final String PROJECT_NAME = "Jboss Richfaces";
 
-	public static final String VENDOR = "richfaces.org";
-	public static final int MAJOR_VERSION = 4;
-	public static final int MINOR_VERSION = 0;
-	public static final String PROJECT_NAME = "Jboss Richfaces";
-	
-	/**
-	 * Revision version, must be auto modified by  CVS 
-	 */	
-	public static final String REVISION = "0-SNAPSHOT" ;
-	public static final String SCM_REVISION = "	SVN $Revision$ $Date$";//$Revision$ $Date$";
-	public static final Version _version = new Version();
-	
-	public String getVendor() {
-		return VENDOR;
-	}
-	
-	public Version getVersion() {
-		return _version;
-	}
+    /**
+     * Revision version, must be auto modified by  CVS
+     */
+    public static final String REVISION = "0-SNAPSHOT";
 
-	public String getProjectName() {
-		return PROJECT_NAME;
-	}
-	
-	/**
-	 * Class for incapsulate version info.
-	 * @author asmirnov at exadel.com (latest modification by $Author$)
-	 * @version $Revision$ $Date$
-	 *
-	 */
-	public static class Version {
-		
-		public static final String _versionInfo = "v."+MAJOR_VERSION+ '.' +MINOR_VERSION+ '.' +REVISION+SCM_REVISION;
+    /**
+     * $Revision$ $Date$";
+     */
+    public static final String SCM_REVISION =
+        " SVN $Revision$ $Date$";
+    public static final String VENDOR = "richfaces.org";
+    public static final Version VERSION = new Version();
 
-		public static final String _resourceVersionInfo = MAJOR_VERSION + "_" + MINOR_VERSION + "_" + REVISION;
+    public String getVendor() {
+        return VENDOR;
+    }
 
-		public int getMajor() {
-			return MAJOR_VERSION;
-		}
+    public Version getVersion() {
+        return VERSION;
+    }
 
-		public int getMinor() {
-			return MINOR_VERSION;
-		}
-		
-		public String getRevision() {
-			return REVISION;
-		}
-		
-		public String getResourceVersion() {
-			return _resourceVersionInfo;
-		}
-		
-/* (non-Javadoc)
-		 * @see java.lang.Object#toString()
-		 */
-		public String toString() {
-			return _versionInfo;
-		}
-		
-	}
+    public String getProjectName() {
+        return PROJECT_NAME;
+    }
 
+    /*
+     *  (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
 
-	/* (non-Javadoc)
-	 * @see java.lang.Object#toString()
-	 */
-	public String toString() {
-		// TODO Auto-generated method stub
-		return getProjectName() + " by "+getVendor()+", version "+getVersion().toString();
-	}
+        // TODO Auto-generated method stub
+        return getProjectName() + " by " + getVendor() + ", version " + getVersion().toString();
+    }
+
+    /**
+     * Class for incapsulate version info.
+     * @author asmirnov at exadel.com (latest modification by $Author$)
+     * @version $Revision$ $Date$
+     *
+     */
+    public static class Version {
+        public static final String VERSION_INFO = "v." + MAJOR_VERSION + '.' + MINOR_VERSION + '.' + REVISION
+                                                  + SCM_REVISION;
+        public static final String RESOURCE_VERSION_INFO = MAJOR_VERSION + "_" + MINOR_VERSION + "_" + REVISION;
+
+        public int getMajor() {
+            return MAJOR_VERSION;
+        }
+
+        public int getMinor() {
+            return MINOR_VERSION;
+        }
+
+        public String getRevision() {
+            return REVISION;
+        }
+
+        public String getResourceVersion() {
+            return RESOURCE_VERSION_INFO;
+        }
+
+        @Override
+        public String toString() {
+            return VERSION_INFO;
+        }
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/package-info.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -1,3 +1,4 @@
+
 /**
  * Base package for RichFaces classes
  */

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodBindingMethodExpressionAdaptor.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -18,10 +18,14 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
+
+
+
 package org.richfaces.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;
@@ -34,66 +38,66 @@
  *
  */
 @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() {
-		// TODO Auto-generated constructor stub
-	}
-	
-	public MethodBindingMethodExpressionAdaptor(MethodExpression expression) {
-		super();
-		this.expression = expression;
-	}
+public class MethodBindingMethodExpressionAdaptor extends MethodBinding implements StateHolder {
+    private MethodExpression expression;
+    private boolean tranzient;
 
-	@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#getType(javax.faces.context.FacesContext)
+     */
+    public MethodBindingMethodExpressionAdaptor() {
 
-	/* (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);
-		}
-	}
+        // TODO Auto-generated constructor stub
+    }
 
-	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;
-	}
+    public MethodBindingMethodExpressionAdaptor(MethodExpression expression) {
+        super();
+        this.expression = expression;
+    }
 
-	@Override
-	public String getExpressionString() {
-		return expression.getExpressionString();
-	}
-	
-	
+    @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();
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/MethodExpressionMethodBindingAdaptor.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
+
+
 package org.richfaces.webapp.taglib;
 
 import java.io.Serializable;
@@ -27,6 +29,7 @@
 import javax.el.ELException;
 import javax.el.MethodExpression;
 import javax.el.MethodInfo;
+
 import javax.faces.FacesException;
 import javax.faces.component.StateHolder;
 import javax.faces.context.FacesContext;
@@ -39,151 +42,165 @@
  *
  */
 @SuppressWarnings("deprecation")
-public class MethodExpressionMethodBindingAdaptor extends MethodExpression
-		implements StateHolder, Serializable {
+public class MethodExpressionMethodBindingAdaptor extends MethodExpression implements StateHolder, Serializable {
+    private static final long serialVersionUID = 1L;
+    private MethodBinding binding;
+    private boolean tranzient;
 
-	private static final long serialVersionUID = 1L;
+    public MethodExpressionMethodBindingAdaptor() {}
 
-	private MethodBinding binding;
-	
-	private boolean tranzient;
-	
-	public MethodExpressionMethodBindingAdaptor() {
-	}
-	
-	public MethodExpressionMethodBindingAdaptor(MethodBinding binding) {
-		this.binding = binding;
-	}
+    public MethodExpressionMethodBindingAdaptor(MethodBinding binding) {
+        this.binding = binding;
+    }
 
+    /*
+     *  (non-Javadoc)
+     * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
+     */
+    @Override
+    public MethodInfo getMethodInfo(ELContext context) {
+        FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
 
-	/* (non-Javadoc)
-	 * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
-	 */
-	@Override
-	public MethodInfo getMethodInfo(ELContext context) {
-		FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
-		try {
+        try {
+            return new MethodInfo(null, binding.getType(context2), null);
+        } catch (MethodNotFoundException e) {
+            throw new javax.el.MethodNotFoundException(e);
+        } catch (EvaluationException e) {
+            throw new ELException(e);
+        }
+    }
 
-			return new MethodInfo(null, binding.getType(context2), null);
-			
-		} catch (MethodNotFoundException e) {
-			throw new javax.el.MethodNotFoundException(e);
-		} catch(EvaluationException e) {
-			throw new ELException(e);
-		}
-	}
+    /*
+     *  (non-Javadoc)
+     * @see javax.el.MethodExpression#invoke(javax.el.ELContext, java.lang.Object[])
+     */
+    @Override
+    public Object invoke(ELContext context, Object[] params) {
+        FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
 
-	/* (non-Javadoc)
-	 * @see javax.el.MethodExpression#invoke(javax.el.ELContext, java.lang.Object[])
-	 */
-	@Override
-	public Object invoke(ELContext context, Object[] params) {
-		FacesContext context2 = (FacesContext) context.getContext(FacesContext.class);
-		try {
-			return binding.invoke(context2, params);
-		} catch (MethodNotFoundException e) {
-			throw new javax.el.MethodNotFoundException(e);
-		} catch (EvaluationException e) {
-			throw new ELException(e);
-		} 
-	}
+        try {
+            return binding.invoke(context2, params);
+        } catch (MethodNotFoundException e) {
+            throw new javax.el.MethodNotFoundException(e);
+        } catch (EvaluationException e) {
+            throw new ELException(e);
+        }
+    }
 
+    /*
+     *  (non-Javadoc)
+     * @see javax.el.Expression#getExpressionString()
+     */
+    @Override
+    public String getExpressionString() {
+        return binding.getExpressionString();
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.el.Expression#getExpressionString()
-	 */
-	@Override
-	public String getExpressionString() {
-		return binding.getExpressionString();
-	}
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
 
+        result = prime * result + ((binding == null) ? 0 : binding.hashCode());
 
-	@Override
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((binding == null) ? 0 : binding.hashCode());
-		return result;
-	}
+        return result;
+    }
 
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (getClass() != obj.getClass())
-			return false;
-		MethodExpressionMethodBindingAdaptor other = (MethodExpressionMethodBindingAdaptor) obj;
-		if (binding == null) {
-			if (other.binding != null)
-				return false;
-		} else if (!binding.equals(other.binding))
-			return false;
-		return true;
-	}
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
 
-	/* (non-Javadoc)
-	 * @see javax.el.Expression#isLiteralText()
-	 */
-	@Override
-	public boolean isLiteralText() {
-		String expr = binding.getExpressionString();
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+
+        MethodExpressionMethodBindingAdaptor other = (MethodExpressionMethodBindingAdaptor) obj;
+
+        if (binding == null) {
+            if (other.binding != null) {
+                return false;
+            }
+        } else if (!binding.equals(other.binding)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see javax.el.Expression#isLiteralText()
+     */
+    @Override
+    public boolean isLiteralText() {
+        String expr = binding.getExpressionString();
+
         return !(expr.startsWith("#{") && expr.endsWith("}"));
-	}
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.faces.component.StateHolder#isTransient()
-	 */
-	public boolean isTransient() {
-		return tranzient;
-	}
+    /*
+     *  (non-Javadoc)
+     * @see javax.faces.component.StateHolder#isTransient()
+     */
+    public boolean isTransient() {
+        return tranzient;
+    }
 
-	/* (non-Javadoc)
-	 * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
-	 */
-	public void restoreState(FacesContext context, Object state) {
-		if (state instanceof MethodBinding) {
-			binding = (MethodBinding) state;
-		} else {
-			Object [] states = (Object[]) state;
-			String className = states[0].toString();
-			ClassLoader loader = Thread.currentThread().getContextClassLoader();
-			if (loader == null) {
-				loader = this.getClass().getClassLoader();
-			}
-			try {
-				Class<?> bindingClass = Class.forName(className, true, loader);
-				binding = (MethodBinding) bindingClass.newInstance();
-				((StateHolder) binding).restoreState(context, states[1]);
-			} catch (Exception e) {
-				throw new FacesException(e);
-			}
-			
-		}
-	}
+    /*
+     *  (non-Javadoc)
+     * @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
+     */
+    public void restoreState(FacesContext context, Object state) {
+        if (state instanceof MethodBinding) {
+            binding = (MethodBinding) state;
+        } else {
+            Object[] states = (Object[]) state;
+            String className = states[0].toString();
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
 
-	/* (non-Javadoc)
-	 * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
-	 */
-	public Object saveState(FacesContext context) {
-		if (binding instanceof StateHolder) {
-			Object[] state = new Object[2];
-			state[0] = binding.getClass().getName();
-			state[1] = ((StateHolder) binding).saveState(context);
-			return state;
-		} else {
-			return binding;
-		}
-	}
+            if (loader == null) {
+                loader = this.getClass().getClassLoader();
+            }
 
-	/* (non-Javadoc)
-	 * @see javax.faces.component.StateHolder#setTransient(boolean)
-	 */
-	public void setTransient(boolean newTransientValue) {
-		tranzient = newTransientValue;
-	}
+            try {
+                Class<?> bindingClass = Class.forName(className, true, loader);
 
-	public MethodBinding getBinding() {
-		return binding;
-	}
+                binding = (MethodBinding) bindingClass.newInstance();
+                ((StateHolder) binding).restoreState(context, states[1]);
+            } catch (Exception e) {
+                throw new FacesException(e);
+            }
+        }
+    }
 
+    /*
+     *  (non-Javadoc)
+     * @see javax.faces.component.StateHolder#saveState(javax.faces.context.FacesContext)
+     */
+    public Object saveState(FacesContext context) {
+        if (binding instanceof StateHolder) {
+            Object[] state = new Object[2];
+
+            state[0] = binding.getClass().getName();
+            state[1] = ((StateHolder) binding).saveState(context);
+
+            return state;
+        } else {
+            return binding;
+        }
+    }
+
+    /*
+     *  (non-Javadoc)
+     * @see javax.faces.component.StateHolder#setTransient(boolean)
+     */
+    public void setTransient(boolean newTransientValue) {
+        tranzient = newTransientValue;
+    }
+
+    public MethodBinding getBinding() {
+        return binding;
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/SimpleComponentTag.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -18,10 +18,14 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
+
+
+
 package org.richfaces.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;
@@ -32,144 +36,138 @@
  *
  */
 public class SimpleComponentTag extends UIComponentELTagBase {
+    private MethodExpression action;
+    private MethodExpression actionListener;
+    private ValueExpression converter;
+    private MethodExpression legacyBinding;
+    private MethodExpression methodExpression;
+    private ValueExpression title;
+    private MethodExpression validator;
+    private ValueExpression value;
+    private MethodExpression valueChangeListener;
 
-	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;
+    public SimpleComponentTag() {
 
-		@Override
-		public String getFamily() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-		public MethodBinding getLegacyMethodBinding() {
-			return legacyMethodBinding;
-		}
+        // TODO Auto-generated constructor stub
+    }
 
-		public void setLegacyMethodBinding(MethodBinding legacyMethodBinding) {
-			this.legacyMethodBinding = legacyMethodBinding;
-		}
+    @Override
+    public String getComponentType() {
+        return UIInput.COMPONENT_TYPE;
+    }
 
-		public MethodExpression getMethodExpression() {
-			return methodExpression;
-		}
+    @Override
+    public String getRendererType() {
+        return "javax.faces.Text";
+    }
 
-		public void setMethodExpression(MethodExpression methodExpression) {
-			this.methodExpression = methodExpression;
-		}
-		
-	}
-	
-	public SimpleComponentTag() {
-		// TODO Auto-generated constructor stub
-	}
+    @Override
+    protected void setProperties(UIComponent component) {
+        super.setProperties(component);
 
-	@Override
-	public String getComponentType() {
-		return UIInput.COMPONENT_TYPE;
-	}
+        MyUIComponent myUIComponent = (MyUIComponent) component;
 
-	@Override
-	public String getRendererType() {
-		return "javax.faces.Text";
-	}
+        myUIComponent.setValueExpression("value", value);
+        setActionListenerProperty(myUIComponent, actionListener);
+        setActionProperty(myUIComponent, action);
+        setConverterProperty(myUIComponent, converter);
+        setValidatorProperty(myUIComponent, validator);
 
-	@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;
-	}
+        if (methodExpression != null) {
+            myUIComponent.setMethodExpression(methodExpression);
+        }
 
-	public MethodExpression getAction() {
-		return _action;
-	}
+        if (legacyBinding != null) {
+            myUIComponent.setLegacyMethodBinding(new MethodBindingMethodExpressionAdaptor(legacyBinding));
+        }
+    }
 
+    @Override
+    public void release() {
+        super.release();
+    }
 
-	public MethodExpression getActionListener() {
-		return _actionListener;
-	}
+    public void setAction(MethodExpression action) {
+        this.action = action;
+    }
 
-	public void setActionListener(MethodExpression listener) {
-		_actionListener = listener;
-	}
+    public MethodExpression getAction() {
+        return action;
+    }
 
-	public MethodExpression getValueChangeListener() {
-		return _valueChangeListener;
-	}
+    public MethodExpression getActionListener() {
+        return actionListener;
+    }
 
-	public void setValueChangeListener(MethodExpression changeListener) {
-		_valueChangeListener = changeListener;
-	}
+    public void setActionListener(MethodExpression listener) {
+        actionListener = listener;
+    }
 
-	public MethodExpression getValidator() {
-		return _validator;
-	}
+    public MethodExpression getValueChangeListener() {
+        return valueChangeListener;
+    }
 
-	public void setValidator(MethodExpression _validator) {
-		this._validator = _validator;
-	}
+    public void setValueChangeListener(MethodExpression changeListener) {
+        valueChangeListener = changeListener;
+    }
 
-	public ValueExpression getConverter() {
-		return _converter;
-	}
+    public MethodExpression getValidator() {
+        return validator;
+    }
 
-	public void setConverter(ValueExpression _converter) {
-		this._converter = _converter;
-	}
+    public void setValidator(MethodExpression validator) {
+        this.validator = validator;
+    }
 
-	public ValueExpression getTitle() {
-		return _title;
-	}
+    public ValueExpression getConverter() {
+        return converter;
+    }
 
-	public void setTitle(ValueExpression _title) {
-		this._title = _title;
-	}
+    public void setConverter(ValueExpression converter) {
+        this.converter = converter;
+    }
 
-	public ValueExpression getValue() {
-		return _value;
-	}
+    public ValueExpression getTitle() {
+        return title;
+    }
 
-	public void setValue(ValueExpression _value) {
-		this._value = _value;
-	}
-	
-	
+    public void setTitle(ValueExpression title) {
+        this.title = title;
+    }
+
+    public ValueExpression getValue() {
+        return value;
+    }
+
+    public void setValue(ValueExpression value) {
+        this.value = value;
+    }
+
+    static class MyUIComponent extends UIComponentBase {
+        private MethodBinding legacyMethodBinding;
+        private MethodExpression methodExpression;
+
+        @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;
+        }
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -18,10 +18,18 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
+
+
+
 package org.richfaces.webapp.taglib;
 
+import org.ajax4jsf.Messages;
+
+import org.richfaces.component.UIDataAdaptor;
+
 import javax.el.MethodExpression;
 import javax.el.ValueExpression;
+
 import javax.faces.component.ActionSource2;
 import javax.faces.component.EditableValueHolder;
 import javax.faces.component.UIComponent;
@@ -33,90 +41,100 @@
 import javax.faces.validator.MethodExpressionValidator;
 import javax.faces.webapp.UIComponentELTag;
 
-import org.ajax4jsf.Messages;
-import org.richfaces.component.UIDataAdaptor;
-
 /**
  * @author Maksim Kaszynski
  *
  */
 public abstract class UIComponentELTagBase extends UIComponentELTag {
-	
-	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 setActionListenerProperty(UIComponent component, MethodExpression actionListener) {
+        if (actionListener != null) {
+            if (component instanceof ActionSource2) {
+                ActionSource2 actionSource2 = (ActionSource2) component;
 
-	protected void setConverterProperty(UIComponent component, ValueExpression converter) {
+                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()));
-			}
+            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 setRowKeyConverterProperty(UIComponent component, ValueExpression converter) {
+    }
+
+    protected void setRowKeyConverterProperty(UIComponent component, ValueExpression converter) {
         if (converter != null) {
-			if (component instanceof UIDataAdaptor) {
-				UIDataAdaptor data = (UIDataAdaptor) component;
-		            if (!converter.isLiteralText()) {
-		                component.setValueExpression("rowKeyConverter", converter);
-		            } else {
-		                Converter conv = FacesContext.getCurrentInstance().getApplication().createConverter(converter.getExpressionString());
-		                data.setRowKeyConverter(conv);
-		            }
-			} else {
-				 throw new IllegalArgumentException(Messages.getMessage(Messages.NO_DATA_ADAPTOR, component.getClass().getName()));
-			}
+            if (component instanceof UIDataAdaptor) {
+                UIDataAdaptor data = (UIDataAdaptor) component;
+
+                if (!converter.isLiteralText()) {
+                    component.setValueExpression("rowKeyConverter", converter);
+                } else {
+                    Converter conv = FacesContext.getCurrentInstance().getApplication().createConverter(
+                                         converter.getExpressionString());
+
+                    data.setRowKeyConverter(conv);
+                }
+            } else {
+                throw new IllegalArgumentException(Messages.getMessage(Messages.NO_DATA_ADAPTOR,
+                        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()));
-			}
-		}
-	}
+    }
+
+    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()));
+            }
+        }
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/ValueBindingValueExpressionAdaptor.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -18,10 +18,14 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
+
+
+
 package org.richfaces.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;
@@ -34,104 +38,100 @@
  */
 @SuppressWarnings("deprecation")
 public class ValueBindingValueExpressionAdaptor extends ValueBinding implements StateHolder {
+    private ValueExpression expression;
+    private boolean tranzient;
 
-	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);
-		}
-	}
+    public ValueBindingValueExpressionAdaptor() {
 
-	/* (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);
-		}
-	}
+        // TODO Auto-generated constructor stub
+    }
 
-	/* (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);
-		}
-	}
+    public ValueBindingValueExpressionAdaptor(ValueExpression expression) {
+        super();
+        this.expression = expression;
+    }
 
-	/* (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;
-	}
+    /*
+     *  (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);
+        }
+    }
 
-	public ValueExpression getExpression() {
-		return expression;
-	}
+    /*
+     *  (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);
+        }
+    }
 
-	public void setExpression(ValueExpression expression) {
-		this.expression = expression;
-	}
-	
-	public ValueBindingValueExpressionAdaptor() {
-		// TODO Auto-generated constructor stub
-	}
+    /*
+     *  (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);
+        }
+    }
 
-	public ValueBindingValueExpressionAdaptor(ValueExpression expression) {
-		super();
-		this.expression = expression;
-	}
+    /*
+     *  (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;
+    }
 }

Modified: root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java	2009-11-02 07:28:47 UTC (rev 15803)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/webapp/taglib/package-info.java	2009-11-02 10:55:43 UTC (rev 15804)
@@ -1,3 +1,4 @@
+
 /**
  * Basic tag classes
  */



More information about the richfaces-svn-commits mailing list