JBoss Rich Faces SVN: r6618 - trunk/ui/componentControl/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-07 07:17:22 -0500 (Fri, 07 Mar 2008)
New Revision: 6618
Modified:
trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
Log:
fixed syntax for J5
Modified: trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
===================================================================
--- trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2008-03-07 12:17:16 UTC (rev 6617)
+++ trunk/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2008-03-07 12:17:22 UTC (rev 6618)
@@ -61,7 +61,7 @@
}
public String getEncodedParametersMap() {
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
boolean shouldClose = false;
@@ -71,7 +71,7 @@
shouldClose = true;
}
- for (Iterator it = this.getChildren().iterator(); it.hasNext();) {
+ for (Iterator<UIComponent> it = this.getChildren().iterator(); it.hasNext();) {
UIComponent child = (UIComponent) it.next();
if (child instanceof UIParameter) {
String name = ((UIParameter) child).getName();
16 years, 10 months
JBoss Rich Faces SVN: r6617 - in trunk/framework/api/src: main/java/org/ajax4jsf/application and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-07 07:17:16 -0500 (Fri, 07 Mar 2008)
New Revision: 6617
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java
trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
trunk/framework/api/src/main/java/org/richfaces/component/Row.java
trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
Log:
fixed syntax for J5
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -30,7 +30,7 @@
public class Messages {
private static final String BUNDLE_NAME = "org.ajax4jsf.messages";
- private static Map bundles = new HashMap();
+ private static Map<ClassLoader, ResourceBundle> bundles = new HashMap<ClassLoader, ResourceBundle>();
private static synchronized ResourceBundle getBundle() {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/application/AjaxSingleException.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -11,8 +11,10 @@
*/
public class AjaxSingleException extends RuntimeException {
- private UIComponent component;
+ private static final long serialVersionUID = 6624397496732241667L;
+ private UIComponent component;
+
/**
* @param component
*/
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -159,9 +159,9 @@
_log.debug(Messages.getMessage(Messages.CREATE_ALTERNATE_HANDLER, handlerClass));
}
try {
- Class clazz = classLoader.loadClass(handlerClass);
+ Class<?> clazz = classLoader.loadClass(handlerClass);
try {
- Constructor constructor = clazz
+ Constructor<?> constructor = clazz
.getConstructor(new Class[] { ViewHandler.class });
_handler = (ViewHandler) constructor
.newInstance(new Object[] { _handler });
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxChildrenEncoder.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -49,7 +49,7 @@
* @throws IOException
*/
public void encodeAjaxChild(FacesContext context,
- String path,Set ids,Set renderedAreas) throws IOException ;
+ String path,Set<String> ids,Set<String> renderedAreas) throws IOException ;
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxContainerBase.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -21,11 +21,8 @@
package org.ajax4jsf.component;
-import java.util.Collection;
-import java.util.Set;
+import javax.el.MethodExpression;
-import javax.faces.el.MethodBinding;
-
/**
* Base interface for controller component, managed AJAX Requests.
* Component, implemented this interface, must always return <code>true</code> for
@@ -42,7 +39,7 @@
*
* @see javax.faces.component.ActionSource#getActionListener()
*/
- public MethodBinding getAjaxListener();
+ public MethodExpression getAjaxListener();
/**
* setter for AjaxListener <code>MethodBinding</code>
@@ -52,7 +49,7 @@
*
* @see javax.faces.component.ActionSource#setActionListener(javax.faces.el.MethodBinding)
*/
- public void setAjaxListener(MethodBinding AjaxListener);
+ public void setAjaxListener(MethodExpression AjaxListener);
/**
* getter for flag immediate call Listener's on PhaseId.APPLY_REQUEST_VALUES phase.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/component/AjaxDataEncoder.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -35,9 +35,9 @@
/**
* @return Set for values of {@link ExtendedDataModel} keys, encoded in ajax response by this component.
*/
- public Set getAjaxKeys();
+ public Set<Object> getAjaxKeys();
- public void setAjaxKeys(Set ajaxKeys);
+ public void setAjaxKeys(Set<Object> ajaxKeys);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -11,7 +11,6 @@
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.el.VariableResolver;
import org.ajax4jsf.resource.util.URLToStreamHelper;
@@ -22,7 +21,7 @@
*/
public static final String AJAX_CONTEXT_KEY = "ajaxContext";
- public abstract Map getCommonAjaxParameters();
+ public abstract Map<String, Object> getCommonAjaxParameters();
public abstract String getAjaxActionURL(FacesContext context);
@@ -44,7 +43,7 @@
public abstract void addRenderedArea(String id);
- public abstract Set getAjaxRenderedAreas();
+ public abstract Set<String> getAjaxRenderedAreas();
public abstract void addComponentToAjaxRender(UIComponent base, String id);
@@ -52,7 +51,7 @@
public abstract void addRegionsFromComponent(UIComponent component);
- public abstract Set getAjaxAreasToRender();
+ public abstract Set<String> getAjaxAreasToRender();
public abstract boolean isAjaxRequest(FacesContext context);
@@ -86,7 +85,6 @@
/**
* Get instance of current AJAX Context. Instance get by
- * {@link VariableResolver#resolveVariable(FacesContext, String)} for
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
*
* @return memento instance for current request
@@ -100,13 +98,13 @@
/**
* Get instance of current AJAX Context. Instance get by
- * {@link VariableResolver#resolveVariable(FacesContext, String)} for
* variable {@link AjaxContext#AJAX_CONTEXT_KEY}
*
* @param context
* current FacesContext
* @return instance of AjaxContext.
*/
+ @SuppressWarnings("unchecked")
public static AjaxContext getCurrentInstance(FacesContext context) {
if (null == context) {
throw new NullPointerException("FacesContext is null");
@@ -179,7 +177,7 @@
public abstract void release();
- public abstract Map getResponseDataMap();
+ public abstract Map<String, Object> getResponseDataMap();
public abstract void setAjaxRequest(boolean b);
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxListener.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -30,7 +30,7 @@
*/
public interface AjaxListener extends FacesListener {
- public static final Class[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
+ public static final Class<?>[] AJAX_LISTENER_ARGS = { AjaxEvent.class };
/**
* @param event - to process
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxRenderEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -33,6 +33,11 @@
public class AjaxRenderEvent extends FacesEvent {
/**
+ *
+ */
+ private static final long serialVersionUID = 5877851431032645762L;
+
+ /**
* @param component
*/
public AjaxRenderEvent(UIComponent component) {
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/event/AjaxSingleEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -15,6 +15,11 @@
public class AjaxSingleEvent extends FacesEvent {
/**
+ *
+ */
+ private static final long serialVersionUID = -3730999641944478334L;
+
+ /**
* @param arg0
*/
public AjaxSingleEvent(UIComponent arg0) {
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/AjaxSubmitFunction.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -26,9 +26,6 @@
import javax.faces.component.UIComponent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* @author shura
*
@@ -56,17 +53,17 @@
*/
public static final String LIMITTOLIST_ATTR_NAME = "limitToList";
- private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
+ //private static Log log = LogFactory.getLog(AjaxSubmitFunction.class);
public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
- private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
+ //private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
private UIComponent component;
- private Map options = new HashMap();
+ private Map<String, Object> options = new HashMap<String, Object>();
- private Map requestParameters = new HashMap();
+ private Map<String, String> requestParameters = new HashMap<String, String>();
/**
*
@@ -85,14 +82,17 @@
/**
* @return the options
*/
- public Map getOptions() {
+ public Map<String, Object> getOptions() {
return this.options;
}
/**
* @return the requestParameters
*/
- public Map getRequestParameters() {
+ public Map<String, String> getRequestParameters() {
return this.requestParameters;
}
+ public UIComponent getComponent() {
+ return component;
+ }
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSEncoder.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -26,7 +26,7 @@
* Encode chars as JavaScript sequences
*/
public class JSEncoder {
- private char APOSTROPHE[] = { '\\', '\'' };
+ //private char APOSTROPHE[] = { '\\', '\'' };
private static final char ENCODE_HEX[] = "0123456789ABCDEF".toCharArray();
@@ -44,7 +44,7 @@
private static final char ENCODE_BS[] = "\\\\".toCharArray();
- private static final char ENCODE_ESC[] = "\\e".toCharArray();
+ //private static final char ENCODE_ESC[] = "\\e".toCharArray();
/**
* Create a new instance of this <code>XMLEncoder</code>.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunction.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -22,6 +22,7 @@
package org.ajax4jsf.javascript;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -34,36 +35,17 @@
private String name;
- private List<Object> parameters = null;
+ private List<Object> parameters = new ArrayList<Object>();
/**
* @param name
- */
- public JSFunction(String name) {
- // TODO Auto-generated constructor stub
- this.name = name;
- }
-
- /**
- * @param name
* @param parameters
*/
- public JSFunction(String name, List<Object> parameters) {
- // TODO Auto-generated constructor stub
+ public JSFunction(String name, Object ... parameters) {
this.name = name;
- this.parameters = parameters;
+ this.parameters.addAll(Arrays.asList(parameters));
}
- /**
- * @param name
- * @param parameters
- */
- public JSFunction(String name, Object parameter) {
- // TODO Auto-generated constructor stub
- this.name = name;
- this.parameters = new ArrayList<Object>(1);
- this.parameters.add(parameter);
- }
public JSFunction addParameter(Object parameter) {
getParameters().add(parameter);
@@ -96,9 +78,6 @@
* @return the parameters
*/
public List<Object> getParameters() {
- if (this.parameters == null) {
- this.parameters = new ArrayList<Object>();
- }
return this.parameters;
}
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSFunctionDefinition.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -22,6 +22,7 @@
package org.ajax4jsf.javascript;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -35,38 +36,24 @@
- private List parameters = new ArrayList();
+ private List<Object> parameters = new ArrayList<Object>();
private StringBuffer body = new StringBuffer();
private String name ;
-
- public JSFunctionDefinition(){
- }
-
- public JSFunctionDefinition( List parameters)
- {
-
- this.parameters = parameters;
- }
-
/**
- * @param body
- * @param parameters
+ * Construct {@link JSFunctionDefinition} with arbitrary list of params
+ * @param params
*/
- public JSFunctionDefinition( Object parameter)
- {
- this.parameters.add(parameter);
- }
-
-
- public JSFunctionDefinition addParameter(Object parameter)
- {
- this.parameters.add(parameter);
- return this;
- }
-
+ public JSFunctionDefinition(Object ... params) {
+ parameters.addAll(Arrays.asList(params));
+ }
+
+ public void addParameter(Object param) {
+ parameters.add(param);
+ }
+
public JSFunctionDefinition addToBody(Object body)
{
this.body.append(body);
@@ -83,7 +70,7 @@
}
functionString.append("(");
boolean first = true;
- for (Iterator param = parameters.iterator(); param.hasNext();)
+ for (Iterator<Object> param = parameters.iterator(); param.hasNext();)
{
Object element = param.next();
if(!first){
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/JSObject.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -21,7 +21,6 @@
package org.ajax4jsf.javascript;
-import java.util.List;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -33,33 +32,14 @@
/**
* @param name
+ * @param parameter
*/
- public JSObject(String name)
+ public JSObject(String name, Object ... parameters)
{
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param name
- * @param parameters
- */
- public JSObject(String name, List parameters)
- {
super(name, parameters);
// TODO Auto-generated constructor stub
}
- /**
- * @param name
- * @param parameter
- */
- public JSObject(String name, Object parameter)
- {
- super(name, parameter);
- // TODO Auto-generated constructor stub
- }
-
public void appendScript(StringBuffer functionString)
{
functionString.append("new ");
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -56,7 +56,7 @@
} else if (obj instanceof ScriptString) {
return ((ScriptString) obj).toScript();
} else if (obj.getClass().isArray()) {
- StringBuffer ret = new StringBuffer("[");
+ StringBuilder ret = new StringBuilder("[");
boolean first = true;
for (int i = 0; i < Array.getLength(obj); i++) {
Object element = Array.get(obj, i);
@@ -69,10 +69,15 @@
return ret.append("] ").toString();
} else if (obj instanceof Collection) {
// Collections put as JavaScript array.
- Collection collection = (Collection) obj;
- StringBuffer ret = new StringBuffer("[");
+
+
+ @SuppressWarnings("unchecked")
+ Collection<Object> collection = (Collection<Object>) obj;
+
+
+ StringBuilder ret = new StringBuilder("[");
boolean first = true;
- for (Iterator iter = collection.iterator(); iter.hasNext();) {
+ for (Iterator<Object> iter = collection.iterator(); iter.hasNext();) {
Object element = iter.next();
if (!first) {
ret.append(',');
@@ -82,13 +87,15 @@
}
return ret.append("] ").toString();
} else if (obj instanceof Map) {
+
// Maps put as JavaScript hash.
- Map map = (Map) obj;
+ @SuppressWarnings("unchecked")
+ Map<Object, Object> map = (Map<Object, Object>) obj;
- StringBuffer ret = new StringBuffer("{");
+ StringBuilder ret = new StringBuilder("{");
boolean first = true;
- for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {
- Map.Entry entry = (Map.Entry) iter.next();
+ for (Iterator<Map.Entry<Object, Object>> iter = map.entrySet().iterator(); iter.hasNext();) {
+ Map.Entry<Object, Object> entry = iter.next();
if (!first) {
ret.append(',');
}
@@ -104,13 +111,13 @@
return obj.toString();
} else if (obj instanceof String) {
// all other put as encoded strings.
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
addEncodedString(ret, obj);
return ret.toString();
}
// All other objects threaded as Java Beans.
try {
- StringBuffer ret = new StringBuffer("{");
+ StringBuilder ret = new StringBuilder("{");
PropertyDescriptor[] propertyDescriptors = PropertyUtils
.getPropertyDescriptors(obj);
boolean first = true;
@@ -135,14 +142,14 @@
}
}
- public static void addEncodedString(StringBuffer buff, Object obj) {
+ public static void addEncodedString(StringBuilder buff, Object obj) {
buff.append("'");
addEncoded(buff, obj);
buff.append("'");
}
- public static void addEncoded(StringBuffer buff, Object obj) {
+ public static void addEncoded(StringBuilder buff, Object obj) {
JSEncoder encoder = new JSEncoder();
char chars[] = obj.toString().toCharArray();
for (int i = 0; i < chars.length; i++) {
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/DataComponentState.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -21,7 +21,6 @@
package org.ajax4jsf.model;
-import javax.faces.component.StateHolder;
/**
* Interface for classes keeped current iterable component state, as :
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/RepeatState.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -23,8 +23,6 @@
import java.io.Serializable;
-import javax.faces.context.FacesContext;
-
/**
* @author shura
*
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -29,6 +29,7 @@
* @author shura
*
*/
+@SuppressWarnings("serial")
public abstract class SerializableDataModel extends ExtendedDataModel implements Serializable {
/**
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/AjaxRenderer.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -23,7 +23,7 @@
* @throws IOException
*/
public void encodeAjaxChildren(FacesContext context, UIComponent component,
- String path, Set ids, Set renderedAreas) throws IOException;
+ String path, Set<String> ids, Set<String> renderedAreas) throws IOException;
/**
* @param context
@@ -34,7 +34,7 @@
* @throws IOException
*/
public void encodeAjaxComponent(FacesContext context,
- UIComponent component, String currentPath, Set ids,
- Set renderedAreas) throws IOException;
+ UIComponent component, String currentPath, Set<String> ids,
+ Set<String> renderedAreas) throws IOException;
}
\ No newline at end of file
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/HeaderResourceProducer.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -41,7 +41,7 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderScripts(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
/**
* Return set of strings with URI's of nessesary CSS styles.
@@ -50,6 +50,6 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderStyles(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/renderkit/UserResourceRenderer.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -20,7 +20,7 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderScripts(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderScripts(FacesContext context, UIComponent component);
/**
* Return set of strings with URI's of nessesary CSS styles.
@@ -29,6 +29,6 @@
* @param component TODO
* @return - set of URI's or null
*/
- public LinkedHashSet getHeaderStyles(FacesContext context, UIComponent component);
+ public LinkedHashSet<String> getHeaderStyles(FacesContext context, UIComponent component);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResource.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -107,7 +107,7 @@
* @param attributes
* @throws IOException
*/
- public void encode(FacesContext context, Object data,Map attributes) throws IOException;
+ public void encode(FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
/**
* Encode start tag, attributes and body ( for inline script or style )
@@ -116,7 +116,7 @@
* @param attrs
* @throws IOException
*/
- public void encodeBegin(FacesContext context, Object component, Map attrs) throws IOException;
+ public void encodeBegin(FacesContext context, Object component, Map<String, Object> attrs) throws IOException;
/**
* Encode closed tag.
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/InternetResourceBuilder.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -131,7 +131,8 @@
/**
* static instance variable.
*/
- private static Map instances = Collections.synchronizedMap(new HashMap());
+ private static Map<ClassLoader, InternetResourceBuilder> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, InternetResourceBuilder> ());
/**
* Get ( or create if nessesary ) instance of builder for current
@@ -161,7 +162,7 @@
reader.close();
in.close();
}
- Class builderClass = loader.loadClass(serviceClassName);
+ Class<?> builderClass = loader.loadClass(serviceClassName);
instance = (InternetResourceBuilder) builderClass.newInstance();
if (log.isDebugEnabled()) {
log.debug("Create instance of InternetBuilder from class "
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceComponent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -23,7 +23,7 @@
import java.util.Date;
-import javax.faces.el.MethodBinding;
+import javax.el.MethodExpression;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -111,11 +111,11 @@
* Get El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
* @return
*/
- public abstract MethodBinding getCreateContent();
+ public abstract MethodExpression getCreateContent();
/**
* Set El binding to method in user bean to send resource. Method will called with two parameters - restored data object and servlet output stream.
* @param newvalue
*/
- public abstract void setCreateContent(MethodBinding newvalue);
+ public abstract void setCreateContent(MethodExpression newvalue);
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceNotFoundException.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -34,6 +34,11 @@
/**
*
*/
+ private static final long serialVersionUID = -3263301605684963184L;
+
+ /**
+ *
+ */
public ResourceNotFoundException() {
super();
// TODO Auto-generated constructor stub
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/ResourceRenderer.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -53,9 +53,9 @@
* @param data
* @throws IOException
*/
- void encode(InternetResource resource, FacesContext context, Object data, Map attributes) throws IOException;
+ void encode(InternetResource resource, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
- void encodeBegin(InternetResource base, FacesContext context, Object data, Map attributes) throws IOException;
+ void encodeBegin(InternetResource base, FacesContext context, Object data, Map<String, Object> attributes) throws IOException;
void encodeEnd(InternetResource base, FacesContext context, Object data) throws IOException;
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Row.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* Marker interface for table columns, rendered as entire row.
* @author shura
@@ -34,6 +36,6 @@
* Get iterator for all columns contained in this row.
* @return
*/
- public Iterator columns();
+ public Iterator<UIComponent> columns();
}
Modified: trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/component/xml/XmlNodeData.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -42,9 +42,9 @@
private String text;
- private Map attributes = new HashMap();
+ private Map<String, Object> attributes = new HashMap<String, Object>();
- public Map getAttributes() {
+ public Map<String, Object> getAttributes() {
return attributes;
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/event/AjaxExpandedEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -34,6 +34,11 @@
public class AjaxExpandedEvent extends NodeExpandedEvent {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5191468583939051390L;
+
public AjaxExpandedEvent(UIComponent component) {
super(component);
}
Modified: trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/event/AttributedEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -37,13 +37,15 @@
*/
public abstract class AttributedEvent extends FacesEvent implements AttributeHolder{
- private Map attributes = new HashMap();
+ private static final long serialVersionUID = 1L;
+
+ private Map<String, Object> attributes = new HashMap<String, Object>();
public AttributedEvent(UIComponent component) {
super(component);
}
- public AttributedEvent(UIComponent component, Map attributes) {
+ public AttributedEvent(UIComponent component, Map<String, Object> attributes) {
super(component);
this.attributes.putAll(attributes);
}
@@ -67,14 +69,14 @@
*/
public void applyAttributes(UIComponent component) {
- Map attrs = component.getAttributes();
+ Map<String, Object> attrs = component.getAttributes();
- for(Iterator iterator = attributes.entrySet().iterator();
+ for(Iterator<Map.Entry<String, Object>> iterator = attributes.entrySet().iterator();
iterator.hasNext(); ) {
- Map.Entry entry = (Map.Entry) iterator.next();
+ Map.Entry<String, Object> entry = iterator.next();
- String key = entry.getKey().toString();
+ String key = entry.getKey();
Object value = entry.getValue();
if (value == null) {
Modified: trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/event/DataFilterSliderEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -32,7 +32,11 @@
*/
public class DataFilterSliderEvent extends AjaxEvent {
- private Integer oldSliderVal;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Integer oldSliderVal;
private Integer newSliderVal;
/**
Modified: trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/event/ScrollableGridViewEvent.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -32,6 +32,10 @@
/**
+ *
+ */
+ private static final long serialVersionUID = -7417387605074667926L;
+ /**
* number of rows to update
*/
protected int rows;
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ListRowKey.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -32,7 +32,7 @@
*/
public class ListRowKey extends TreeRowKey {
- private ArrayList path;
+ private ArrayList<Object> path;
/**
*
@@ -48,7 +48,7 @@
*/
public ListRowKey() {
super();
- this.path = new ArrayList();
+ this.path = new ArrayList<Object>();
}
/**
@@ -58,9 +58,9 @@
public ListRowKey(ListRowKey parentRowKey) {
super();
if (parentRowKey != null) {
- this.path = (ArrayList) parentRowKey.path.clone();
+ this.path = (ArrayList<Object>) parentRowKey.path.clone();
} else {
- this.path = new ArrayList();
+ this.path = new ArrayList<Object>();
}
}
@@ -74,8 +74,8 @@
this.path.add(pathElement);
}
- private static ArrayList parsePath(String path) {
- ArrayList result = new ArrayList();
+ private static ArrayList<Object> parsePath(String path) {
+ ArrayList<Object> result = new ArrayList<Object>();
String trimmedPath = path.trim();
@@ -119,10 +119,10 @@
* List constructor
* @param list List of strings to create corresponding row key from
*/
- public ListRowKey(List list) {
+ public ListRowKey(List<Object> list) {
super();
- this.path = new ArrayList(list);
+ this.path = new ArrayList<Object>(list);
}
/**
@@ -131,7 +131,7 @@
*/
public ListRowKey(Object path) {
super();
- this.path = new ArrayList(1);
+ this.path = new ArrayList<Object>(1);
this.path.add(path);
}
@@ -148,7 +148,7 @@
return path.size();
}
- public Iterator iterator() {
+ public Iterator<Object> iterator() {
return path.iterator();
}
@@ -175,7 +175,7 @@
return true;
}
- public Iterator getSubPathIterator(int fromIndex) {
+ public Iterator<Object> getSubPathIterator(int fromIndex) {
return path.listIterator(fromIndex);
}
@@ -195,7 +195,7 @@
public String getPath() {
StringBuffer result = new StringBuffer();
- Iterator iterator = path.iterator();
+ Iterator<Object> iterator = path.iterator();
boolean hasNext = iterator.hasNext();
while (hasNext) {
@@ -228,8 +228,8 @@
public int getCommonPathLength(TreeRowKey otherRowKey) {
if (otherRowKey == null)
return 0;
- Iterator iterator = this.iterator();
- Iterator otherIterator = otherRowKey.iterator();
+ Iterator<Object> iterator = this.iterator();
+ Iterator<?> otherIterator = otherRowKey.iterator();
int length = 0;
while (iterator.hasNext() && otherIterator.hasNext()
&& iterator.next().equals(otherIterator.next()))
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ListShuttleDataModel.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -28,7 +28,7 @@
private SequenceDataModel sourceModel;
private SequenceDataModel targetModel;
- private Map data;
+ private Map<Object, Object> data;
private Object wrappedData;
@@ -49,10 +49,10 @@
public void walk(final FacesContext context, final DataVisitor visitor, final Range range,
final Object argument) throws IOException {
if (data != null) {
- Iterator iterator = data.entrySet().iterator();
+ Iterator<Entry<Object, Object>> iterator = data.entrySet().iterator();
while (iterator.hasNext()) {
- Entry entry =(Map.Entry) iterator.next();
+ Entry<Object, Object> entry = iterator.next();
visitor.process(context, entry.getKey(), argument);
}
@@ -140,7 +140,7 @@
this.wrappedData = data;
if (data instanceof Map) {
- this.data = (Map) data;
+ this.data = (Map<Object, Object>) data;
} else {
DataModel[] models = (DataModel[]) data;
this.sourceModel = new SequenceDataModel(models[0]);
Modified: trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/MapDataModel.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -26,7 +26,7 @@
*/
public class MapDataModel extends ExtendedDataModel {
- private Map map;
+ private Map<Object, Object> map;
private Object rowKey;
private Object wrappedData;
@@ -60,7 +60,7 @@
public void walk(FacesContext context, DataVisitor visitor, Range range,
Object argument) throws IOException {
if (map != null) {
- for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
+ for (Iterator<Object> iterator = map.keySet().iterator(); iterator.hasNext();) {
Object key = (Object) iterator.next();
visitor.process(context, key, argument);
@@ -132,24 +132,24 @@
public void setWrappedData(Object data) {
this.wrappedData = data;
if (data instanceof NamedNodeMap) {
- this.map = new AbstractMap() {
+ this.map = new AbstractMap<Object, Object>() {
- private Set entrySet = new AbstractSet() {
+ private Set<Entry<Object, Object>> entrySet = new AbstractSet<Entry<Object, Object>>() {
- public Iterator iterator() {
- return new Iterator() {
+ public Iterator<Entry<Object, Object>> iterator() {
+ return new Iterator<Entry<Object, Object>>() {
private int index = 0;
public boolean hasNext() {
return index < ((NamedNodeMap) getWrappedData()).getLength();
}
- public Object next() {
+ public Entry<Object, Object> next() {
final Node node = ((NamedNodeMap) getWrappedData()).item(index++);
if (node == null) {
throw new NoSuchElementException();
} else {
- return new Map.Entry() {
+ return new Map.Entry<Object, Object>() {
public Object getKey() {
return node.getNodeName();
@@ -187,13 +187,13 @@
return ((NamedNodeMap) getWrappedData()).getNamedItem((String) key);
}
- public Set entrySet() {
+ public Set<Entry<Object, Object>> entrySet() {
return entrySet;
}
};
} else if (data != null) {
- this.map = (Map) data;
+ this.map = (Map<Object, Object>) data;
} else {
this.map = null;
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/OrderingListDataModel.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -7,6 +7,7 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.Map.Entry;
import javax.faces.context.FacesContext;
@@ -24,7 +25,7 @@
*/
public class OrderingListDataModel extends ExtendedDataModel {
- private Map data;
+ private Map<Object, Object> data;
private Object rowKey;
@@ -39,11 +40,11 @@
public void walk(FacesContext context, DataVisitor visitor, Range range,
Object argument) throws IOException {
- Set entrySet = data.entrySet();
- Iterator iterator = entrySet.iterator();
+ Set<Entry<Object,Object>> entrySet = data.entrySet();
+ Iterator<Entry<Object, Object>> iterator = entrySet.iterator();
while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry) iterator.next();
+ Entry<Object, Object> entry = iterator.next();
visitor.process(context, entry.getKey(), argument);
}
@@ -77,7 +78,7 @@
public void setWrappedData(Object data) {
this.rowKey = null;
- this.data = (Map) data;
+ this.data = (Map<Object, Object>) data;
}
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -27,7 +27,7 @@
* @author Maksim Kaszynski
*
*/
-public abstract class ScrollableTableDataModel extends ExtendedDataModel {
+public abstract class ScrollableTableDataModel<T> extends ExtendedDataModel {
/**
* Simple implementation - index-based row key
@@ -91,7 +91,7 @@
private Object rowKey;
- private Map mapping;
+ private Map<Object, T> mapping;
private SortOrder lastSortOrder;
@@ -104,7 +104,7 @@
* @param sortOrder
* @return list of ordered data
*/
- public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
+ public abstract List<T> loadData(int startRow, int endRow, SortOrder sortOrder);
/**
@@ -124,12 +124,12 @@
lastSortOrder = sequenceRange.getSortOrder();
- List objects = loadData(startIndex, last, lastSortOrder);
+ List<T> objects = loadData(startIndex, last, lastSortOrder);
- mapping = new HashMap();
+ mapping = new HashMap<Object, T>();
for (int i = 0; i < objects.size(); i++,startIndex++) {
- Object data = objects.get(i);
+ T data = objects.get(i);
Object key = getId(data);
if (key == null) {
@@ -155,12 +155,12 @@
* @param id
* @return
*/
- public Object getObjectById(Object id) {
+ public T getObjectById(Object id) {
if (id instanceof SimpleRowKey) {
int i = ((SimpleRowKey) id).intValue();
- List<?> l = loadData(i, i + 1, lastSortOrder);
+ List<T> l = loadData(i, i + 1, lastSortOrder);
return l.get(0);
@@ -177,7 +177,7 @@
* @param o
* @return
*/
- public Object getId(Object o) {
+ public Object getId(T o) {
return null;
}
@@ -229,14 +229,14 @@
log.trace("loadAndMap " + id);
}
- Object o = getObjectById(id);
- if (o != null) {
+ T t = getObjectById(id);
+ if (t != null) {
if (mapping == null) {
- mapping = new HashMap();
+ mapping = new HashMap<Object, T>();
}
- mapping.put(id, o);
+ mapping.put(id, t);
}
- return o;
+ return t;
}
/*
* FIXME: This method is most likely redundant
Modified: trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/selection/Selection.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -12,7 +12,7 @@
*/
public interface Selection extends Serializable {
- public Iterator getKeys();
+ public Iterator<Object> getKeys();
public int size();
Modified: trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/model/selection/SimpleSelection.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -3,7 +3,6 @@
*/
package org.richfaces.model.selection;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -16,7 +15,7 @@
private static final long serialVersionUID = 1L;
- private Set keys = new LinkedHashSet();
+ private Set<Object> keys = new LinkedHashSet<Object>();
public boolean addKey(Object rowKey) {
return keys.add(rowKey);
@@ -26,7 +25,7 @@
return keys.remove(rowKey);
}
- public Iterator getKeys() {
+ public Iterator<Object> getKeys() {
return keys.iterator();
}
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -51,13 +51,14 @@
/**
* static instance variable.
*/
- private static Map instances = Collections.synchronizedMap(new HashMap());
+ private static Map<ClassLoader, SkinFactory> instances =
+ Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
private static final Log log = LogFactory.getLog(SkinFactory.class);
public static void reset() {
- instances = Collections.synchronizedMap(new HashMap());
+ instances = Collections.synchronizedMap(new HashMap<ClassLoader, SkinFactory>());
}
/**
@@ -88,10 +89,10 @@
Messages.SET_SKIN_FACTORY_INFO,
factoryClassName));
}
- Class clazz = Class.forName(factoryClassName, false, loader);
+ Class<?> clazz = Class.forName(factoryClassName, false, loader);
try {
// try construct factory chain.
- Constructor factoryConstructor = clazz
+ Constructor<?> factoryConstructor = clazz
.getConstructor(new Class[] { SkinFactory.class });
instance = (SkinFactory) factoryConstructor
.newInstance(new Object[] { instance });
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/SkinNotFoundException.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -25,6 +25,11 @@
public class SkinNotFoundException extends FacesException {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2498031536712930735L;
+
public SkinNotFoundException() {
super();
// TODO Auto-generated constructor stub
Modified: trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
===================================================================
--- trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2008-03-07 12:16:51 UTC (rev 6616)
+++ trunk/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2008-03-07 12:17:16 UTC (rev 6617)
@@ -200,7 +200,7 @@
* Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer, java.lang.Object)}.
*/
public void testAddEncodedString() {
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
ScriptUtils.addEncodedString(buff, "foo");
assertEquals("'foo'", buff.toString());
}
@@ -209,7 +209,7 @@
* Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer, java.lang.Object)}.
*/
public void testAddEncoded() {
- StringBuffer buff = new StringBuffer();
+ StringBuilder buff = new StringBuilder();
ScriptUtils.addEncoded(buff, "foo\"\'");
assertEquals("foo\\\"\\\'", buff.toString());
}
16 years, 10 months
JBoss Rich Faces SVN: r6616 - in trunk/cdk/generator/src/main: resources/META-INF/schema/entities and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-07 07:16:51 -0500 (Fri, 07 Mar 2008)
New Revision: 6616
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/JsfBean.java
trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent
Log:
fixed syntax for J5
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/JsfBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/JsfBean.java 2008-03-07 12:16:44 UTC (rev 6615)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/JsfBean.java 2008-03-07 12:16:51 UTC (rev 6616)
@@ -23,6 +23,8 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.List;
import org.ajax4jsf.builder.generator.Logger;
@@ -114,6 +116,11 @@
return getClassname();
}
+ public List<JsfBean> getGenericTypes() {
+ return Collections.emptyList();
+ }
+
+
/**
* @param classname The classname to set.
*/
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 2008-03-07 12:16:44 UTC (rev 6615)
+++ trunk/cdk/generator/src/main/resources/META-INF/schema/entities/ajax_region_attributes.ent 2008-03-07 12:16:51 UTC (rev 6616)
@@ -2,9 +2,9 @@
<property elonly="true" el="true" attachedstate="true" >
<name>ajaxListener</name>
<defaultvalue>null</defaultvalue>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<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>
+ <description> MethodExpression 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">
<name>submitted</name>
16 years, 10 months
JBoss Rich Faces SVN: r6615 - in trunk/ui/core/src: main/java/org/ajax4jsf/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-07 07:16:44 -0500 (Fri, 07 Mar 2008)
New Revision: 6615
Modified:
trunk/ui/core/src/main/config/component/mediaOutput.xml
trunk/ui/core/src/main/config/component/push.xml
trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
Log:
fixed syntax for J5
Modified: trunk/ui/core/src/main/config/component/mediaOutput.xml
===================================================================
--- trunk/ui/core/src/main/config/component/mediaOutput.xml 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/config/component/mediaOutput.xml 2008-03-07 12:16:44 UTC (rev 6615)
@@ -131,7 +131,7 @@
</property>
<property elonly="true">
<name>createContent</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description>
<![CDATA[
Method call expression to send generated resource to OutputStream. It must have two parameter with a type of java.io.OutputStream
Modified: trunk/ui/core/src/main/config/component/push.xml
===================================================================
--- trunk/ui/core/src/main/config/component/push.xml 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/config/component/push.xml 2008-03-07 12:16:44 UTC (rev 6615)
@@ -55,7 +55,7 @@
<name>eventProducer</name>
- <classname>javax.faces.el.MethodBinding</classname>
+ <classname>javax.el.MethodExpression</classname>
<description>
MethodBinding pointing at method accepting an PushEventListener with return type void.
User bean must register this listener and send EventObject to this listener on ready.
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/ResourceBundleMap.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -34,7 +34,7 @@
* @author shura
*
*/
-public class ResourceBundleMap implements Map {
+public class ResourceBundleMap implements Map<String, Object> {
private ResourceBundle _bundle;
@@ -95,7 +95,7 @@
/* (non-Javadoc)
* @see java.util.Map#put(java.lang.Object, java.lang.Object)
*/
- public Object put(Object arg0, Object arg1) {
+ public Object put(String arg0, Object arg1) {
throw new UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
}
@@ -106,12 +106,6 @@
throw new UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_REMOVE_VALUE));
}
- /* (non-Javadoc)
- * @see java.util.Map#putAll(java.util.Map)
- */
- public void putAll(Map arg0) {
- throw new UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
- }
/* (non-Javadoc)
* @see java.util.Map#clear()
@@ -123,7 +117,7 @@
/* (non-Javadoc)
* @see java.util.Map#keySet()
*/
- public Set keySet() {
+ public Set<String> keySet() {
// TODO Auto-generated method stub
return null;
}
@@ -131,17 +125,18 @@
/* (non-Javadoc)
* @see java.util.Map#values()
*/
- public Collection values() {
+ public Collection<Object> values() {
// TODO Auto-generated method stub
return null;
}
- /* (non-Javadoc)
- * @see java.util.Map#entrySet()
- */
- public Set entrySet() {
+ public Set<java.util.Map.Entry<String, Object>> entrySet() {
// TODO Auto-generated method stub
return null;
}
+
+ public void putAll(Map<? extends String, ? extends Object> t) {
+ throw new UnsupportedOperationException(Messages.getMessage(Messages.BUNDLE_MAP_NO_PUT_VALUE));
+ }
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIActionParameter.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -21,12 +21,13 @@
package org.ajax4jsf.component;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponentBase;
import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
@@ -46,13 +47,13 @@
/***************************************************************************
* Binding for update on ActionEvent
*/
- private ValueBinding _assignToBinding = null;
+ private ValueExpression _assignToBinding = null;
- public void setAssignToBinding(ValueBinding propertyBinding) {
+ public void setAssignToBinding(ValueExpression propertyBinding) {
this._assignToBinding = propertyBinding;
}
- public ValueBinding getAssignToBinding() {
+ public ValueExpression getAssignToBinding() {
return _assignToBinding;
}
@@ -117,7 +118,7 @@
Object value = super.getValue();
// TODO - perform conversion if converter is present.
if (null != value) {
- Class type = value.getClass();
+ Class<?> type = value.getClass();
FacesContext context = getFacesContext();
Converter converter = createConverter(context, type);
if (null != converter) {
@@ -138,13 +139,14 @@
*/
public void processAction(ActionEvent actionEvent)
throws AbortProcessingException {
- FacesContext context = FacesContext.getCurrentInstance();
- ValueBinding updateBinding = getAssignToBinding();
- if (updateBinding != null && (!updateBinding.isReadOnly(context))) {
+ FacesContext context = getFacesContext();
+ ELContext elContext = context.getELContext();
+ ValueExpression updateBinding = getAssignToBinding();
+ if (updateBinding != null && (!updateBinding.isReadOnly(elContext))) {
Object requestValue = context.getExternalContext()
.getRequestParameterMap().get(getName());
if (requestValue != null && requestValue instanceof String) {
- Class type = updateBinding.getType(context);
+ Class<?> type = updateBinding.getType(elContext);
Converter converter = createConverter(context, type);
if (null != converter) {
requestValue = converter.getAsObject(context, this,
@@ -153,7 +155,7 @@
}
}
if (null != requestValue) {
- updateBinding.setValue(context, requestValue);
+ updateBinding.setValue(elContext, requestValue);
}
}
@@ -165,7 +167,7 @@
* @return
* @throws FacesException
*/
- private Converter createConverter(FacesContext context, Class type)
+ private Converter createConverter(FacesContext context, Class<?> type)
throws FacesException {
Converter converter = getConverter();
if (converter == null && type != null && !type.equals(String.class)
@@ -189,7 +191,7 @@
Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
// restore fields values
- _assignToBinding = (ValueBinding) UIComponentBase.restoreAttachedState(
+ _assignToBinding = (ValueExpression) UIComponentBase.restoreAttachedState(
context, values[1]);
_noEscape = (Boolean) values[2];
_converter = (Converter) UIComponentBase.restoreAttachedState(context,
@@ -225,9 +227,11 @@
if (null != field) {
return field.booleanValue();
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return ((Boolean) vb.getValue(getFacesContext())).booleanValue();
+ FacesContext context = getFacesContext();
+ ELContext elContext = context.getELContext();
+ return ((Boolean) vb.getValue(elContext)).booleanValue();
} else {
return false;
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxForm.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -57,7 +57,7 @@
decode(context);
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processDecodes(context);
@@ -74,7 +74,7 @@
if (context == null) throw new NullPointerException("context");
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processValidators(context);
@@ -92,7 +92,7 @@
if (context == null) throw new NullPointerException("context");
if (mustProcessed(context))
{
- for (Iterator it = getFacetsAndChildren(); it.hasNext();)
+ for (Iterator<UIComponent> it = getFacetsAndChildren(); it.hasNext();)
{
UIComponent childOrFacet = (UIComponent) it.next();
childOrFacet.processUpdates(context);
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxRegion.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -23,12 +23,12 @@
import java.io.IOException;
+import javax.el.MethodExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
@@ -129,7 +129,7 @@
*
* @see org.ajax4jsf.framework.ajax.AjaxViewBrige#getAjaxListener()
*/
- public MethodBinding getAjaxListener() {
+ public MethodExpression getAjaxListener() {
return brige.getAjaxListener();
}
@@ -180,7 +180,7 @@
*
* @see org.ajax4jsf.framework.ajax.AjaxViewBrige#setAjaxListener(javax.faces.el.MethodBinding)
*/
- public void setAjaxListener(MethodBinding ajaxListener) {
+ public void setAjaxListener(MethodExpression ajaxListener) {
brige.setAjaxListener(ajaxListener);
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxStatus.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -23,11 +23,12 @@
import java.io.Serializable;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import org.ajax4jsf.Messages;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -349,9 +350,9 @@
if( null != field){
return field;
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return vb.getValue(getFacesContext());
+ return vb.getValue(getELContext());
} else {
return null;
}
@@ -367,13 +368,16 @@
if( fieldSet ){
return field;
}
- ValueBinding vb = getValueBinding(name);
+ ValueExpression vb = getValueExpression(name);
if (null != vb) {
- return ((Boolean)vb.getValue(getFacesContext())).booleanValue();
+ return ((Boolean)vb.getValue(getELContext())).booleanValue();
} else {
return false;
}
}
+ private ELContext getELContext() {
+ return getFacesContext().getELContext();
+ }
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIAjaxSupport.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -21,10 +21,10 @@
package org.ajax4jsf.component;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import org.ajax4jsf.Messages;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -67,27 +67,22 @@
*/
public abstract void setOnsubmit(String newOnsubmit);
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIComponentBase#setValueBinding(java.lang.String,
- * javax.faces.el.ValueBinding)
- */
- public void setValueBinding(String arg0, ValueBinding arg1) {
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
// var - not allowed name. must be literal.
- if ("var".equals(arg0)) {
+ if ("var".equals(name)) {
throw new FacesException(Messages.getMessage(
Messages.VAR_MUST_BE_LITERAL,
getClientId(getFacesContext())));
}
- if ("event".equals(arg0)) {
+ if ("event".equals(name)) {
throw new FacesException(Messages.getMessage(
Messages.EVENT_MUST_BE_LITERAL,
getClientId(getFacesContext())));
}
- super.setValueBinding(arg0, arg1);
+ super.setValueExpression(name, binding);
}
-
+
/**
* Create Special <code>ValueBinding</code> for build JavaScrept event
* code in parent component from this.
@@ -95,12 +90,12 @@
* @return <code>EventValueBinding</code> based on properties of current
* component
*/
- private ValueBinding getEventValueBinding() {
+ private ValueExpression getEventValueBinding() {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.CREATE_JAVASCRIPT_EVENT,
getId()));
}
- return new EventValueBinding(this);
+ return new EventValueExpression(this);
}
/**
@@ -165,7 +160,7 @@
}
public void setParentProperties(UIComponent parent) {
- ValueBinding valueBinding;
+ ValueExpression valueBinding;
if (null != getEvent()) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
@@ -174,7 +169,7 @@
// for non action/data components, or for non-default events - build
// listener for this instance.
valueBinding = getEventValueBinding();
- parent.setValueBinding(getEvent(), valueBinding);
+ parent.setValueExpression(getEvent(), valueBinding);
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -21,11 +21,12 @@
package org.ajax4jsf.component;
+import javax.el.ELContext;
+import javax.el.ValueExpression;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -67,11 +68,11 @@
* viewId for included page. Setter for viewId @param viewId - new value
*/
public void setViewId(String __viewId) {
- ValueBinding vb = getValueBinding("viewId");
- FacesContext facesContext = getFacesContext();
- if (null != vb && (!vb.isReadOnly(facesContext))) {
+ ValueExpression vb = getValueExpression("viewId");
+ ELContext elContext = getELContext();
+ if (null != vb && (!vb.isReadOnly(elContext))) {
// Change value of viewId in backed bean, if possible.
- vb.setValue(facesContext, __viewId);
+ vb.setValue(elContext, __viewId);
} else {
this._viewId = __viewId;
}
@@ -85,9 +86,9 @@
if (null != this._viewId) {
return this._viewId;
}
- ValueBinding vb = getValueBinding("viewId");
+ ValueExpression vb = getValueExpression("viewId");
if (null != vb) {
- return (String) vb.getValue(getFacesContext());
+ return (String) vb.getValue(getELContext());
} else {
return null;
}
@@ -102,9 +103,9 @@
if (null != this._layout) {
return this._layout;
}
- ValueBinding vb = getValueBinding("layout");
+ ValueExpression vb = getValueExpression("layout");
if (null != vb) {
- return (String) vb.getValue(getFacesContext());
+ return (String) vb.getValue(getELContext());
} else {
return null;
}
@@ -232,6 +233,11 @@
// }
}
+ private ELContext getELContext() {
+ return getFacesContext().getELContext();
+ }
+
+ @SuppressWarnings("serial")
private static class EventWrapper extends FacesEvent {
private FacesEvent wrapped;
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -3,8 +3,6 @@
*/
package org.ajax4jsf.component;
-import java.lang.reflect.Method;
-
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -18,6 +16,7 @@
*/
public class UIPortlet extends UIComponentBase implements NamingContainer {
+
private static final Log _log = LogFactory.getLog(UIPortlet.class);
/**
* <p>The standard component type for this component.</p>
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPush.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -23,9 +23,9 @@
import java.io.IOException;
+import javax.el.MethodExpression;
import javax.faces.component.NamingContainer;
import javax.faces.context.FacesContext;
-import javax.faces.el.MethodBinding;
import javax.servlet.http.HttpSession;
import org.ajax4jsf.webapp.PollEventsManager;
@@ -51,10 +51,10 @@
}
public void encodeBegin(FacesContext context) throws IOException {
- MethodBinding producer = getEventProducer();
+ MethodExpression producer = getEventProducer();
// Subscribe events producer to push status listener.
if(null != producer){
- producer.invoke(context, new Object[]{getListener(context)});
+ producer.invoke(context.getELContext(), new Object[]{getListener(context)});
}
super.encodeBegin(context);
}
@@ -83,9 +83,9 @@
_submitted = submitted;
}
- public abstract MethodBinding getEventProducer();
+ public abstract MethodExpression getEventProducer();
- public abstract void setEventProducer(MethodBinding producer);
+ public abstract void setEventProducer(MethodExpression producer);
/**
* @return time in mc for polling interval.
*/
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIRepeat.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -23,7 +23,9 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* @author shura
*
@@ -33,7 +35,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -41,7 +43,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -31,7 +31,6 @@
import org.ajax4jsf.component.UIActionParameter;
import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyValueBinding;
import com.sun.facelets.tag.MetaRule;
import com.sun.facelets.tag.MetaRuleset;
import com.sun.facelets.tag.Metadata;
@@ -115,9 +114,8 @@
}
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIActionParameter) instance).setAssignToBinding(
- new LegacyValueBinding(attr.getValueExpression(ctx,
- Object.class)));
+ ((UIActionParameter) instance).setAssignToBinding(attr.getValueExpression(ctx,
+ Object.class));
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -26,7 +26,6 @@
import org.ajax4jsf.component.UIMediaOutput;
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;
@@ -96,7 +95,7 @@
*/
static class MMediaActionMapper extends Metadata {
- private static final Class[] MMEDIA_ACTION_SIG = new Class[] {OutputStream.class,Object.class};
+ private static final Class<?>[] MMEDIA_ACTION_SIG = new Class[] {OutputStream.class,Object.class};
private final TagAttribute _send;
/**
@@ -111,9 +110,8 @@
*/
public void applyMetadata(FaceletContext ctx, Object instance) {
((UIMediaOutput) instance)
- .setCreateContent(new LegacyMethodBinding(this._send
- .getMethodExpression(ctx, null,
- MMEDIA_ACTION_SIG)));
+ .setCreateContent(this._send.getMethodExpression(ctx, null,
+ MMEDIA_ACTION_SIG));
}
}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/ActionParamTag.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -31,7 +31,6 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.component.UIActionParameter;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
-import org.richfaces.webapp.taglib.ValueBindingValueExpressionAdaptor;
/**
@@ -90,7 +89,7 @@
if (_assignTo != null) {
if (_assignTo.isLiteralText()) throw new IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_REFERENCE_ERROR_2, _assignTo));
UIActionParameter al = (UIActionParameter)component;
- al.setAssignToBinding(new ValueBindingValueExpressionAdaptor(_assignTo));
+ al.setAssignToBinding(_assignTo);
if (_converter != null)
{
if (!_converter.isLiteralText()) {
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/taglib/html/jsp/AjaxRegionTag.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -30,7 +30,6 @@
import org.ajax4jsf.component.UIAjaxRegion;
import org.ajax4jsf.renderkit.html.AjaxRegionRenderer;
import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
-import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
/**
@@ -113,7 +112,7 @@
if (ajaxListener.isLiteralText()) {
getFacesContext().getExternalContext().log(Messages.getMessage(Messages.INVALID_EXPRESSION, ajaxListener));
}
- ((AjaxContainer) component).setAjaxListener(new MethodBindingMethodExpressionAdaptor(ajaxListener));
+ ((AjaxContainer) component).setAjaxListener(ajaxListener);
}
}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2008-03-07 12:16:28 UTC (rev 6614)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2008-03-07 12:16:44 UTC (rev 6615)
@@ -23,6 +23,9 @@
import java.io.Serializable;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -139,7 +142,11 @@
UIActionParameter param = new UIActionParameter();
param.setConverter(new IntegerConverter());
param.setName("param");
- param.setAssignToBinding(application.createValueBinding("#{bean.first}"));
+ ELContext elContext = facesContext.getELContext();
+ ExpressionFactory expressionFactory = application.getExpressionFactory();
+ ValueExpression expression =
+ expressionFactory.createValueExpression(elContext, "#{bean.first}", Integer.TYPE);
+ param.setAssignToBinding(expression);
Bean bean = new Bean();
request.setAttribute("bean", bean);
request.addParameter("param", "123");
16 years, 10 months
JBoss Rich Faces SVN: r6614 - in trunk/ui/dataTable/src/main/java/org/richfaces: renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-07 07:16:28 -0500 (Fri, 07 Mar 2008)
New Revision: 6614
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
Log:
fixed syntax for J5
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/Row.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* Marker interface for table columns, rendered as entire row.
* @author shura
@@ -34,6 +36,6 @@
* Get iterator for all columns contained in this row.
* @return
*/
- public Iterator columns();
+ public Iterator<UIComponent> columns();
}
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumnGroup.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,6 +23,7 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIPanel;
import org.apache.commons.collections.iterators.FilterIterator;
@@ -37,7 +38,8 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Colgroup";
- public Iterator columns(){
+ @SuppressWarnings("unchecked")
+ public Iterator<UIComponent> columns(){
return new FilterIterator(getChildren().iterator(),UIDataTable.isColumn);
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataDefinitionList.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.apache.commons.collections.Predicate;
import org.apache.commons.collections.Transformer;
import org.apache.commons.collections.iterators.FilterIterator;
@@ -66,7 +68,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIRepeat#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
return filteredFacets(fixedPredicate);
}
@@ -75,7 +77,8 @@
* @param predicate - filter for select facets names.
* @return
*/
- private Iterator filteredFacets(Predicate predicate) {
+ @SuppressWarnings("unchecked")
+ private Iterator<UIComponent> filteredFacets(Predicate predicate) {
FilterIterator fixed= new FilterIterator(getFacets().keySet().iterator(),predicate);
return new TransformIterator(fixed,new FacetTransformer());
@@ -84,7 +87,8 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIRepeat#dataChildren()
*/
- protected Iterator dataChildren() {
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return new IteratorChain(getChildren().iterator(),filteredFacets(termsPredicate));
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataGrid.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.component.SequenceDataAdaptor;
/**
@@ -57,7 +59,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -65,7 +67,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataList.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.component.SequenceDataAdaptor;
/**
@@ -38,7 +40,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#dataChildren()
*/
- protected Iterator dataChildren() {
+ protected Iterator<UIComponent> dataChildren() {
// TODO Auto-generated method stub
return getChildren().iterator();
}
@@ -46,7 +48,7 @@
/* (non-Javadoc)
* @see org.ajax4jsf.ajax.repeat.UIDataAdaptor#fixedChildren()
*/
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
// TODO Auto-generated method stub
return getFacets().values().iterator();
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -208,12 +208,13 @@
return new ModifiableModel(dataModel, getVar(), getFilterFields(), getSortFields());
}
+ @SuppressWarnings("unchecked")
public Collection<Object> getSortPriority(){
ValueExpression ve = getValueExpression("sortPriority");
if (ve != null) {
Collection<Object> value = null;
try {
- value = (Collection) ve.getValue(getFacesContext().getELContext());
+ value = (Collection<Object>) ve.getValue(getFacesContext().getELContext());
} catch (ELException e) {
throw new FacesException(e);
}
@@ -249,9 +250,10 @@
}
@Override
+ @SuppressWarnings("unchecked")
public void restoreState(FacesContext context, Object state) {
Object[] states = (Object[]) state;
super.restoreState(context, states[0]);
- sortPriority = (Collection)states[1];
+ sortPriority = (Collection<Object>)states[1];
}
}
\ No newline at end of file
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UISubTable.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -23,7 +23,9 @@
import java.util.Iterator;
+import javax.faces.component.UIComponent;
+
/**
* JSF component class
*
@@ -52,7 +54,7 @@
/* (non-Javadoc)
* @see org.richfaces.component.UIDataTable#columns()
*/
- public Iterator columns() {
+ public Iterator<UIComponent> columns() {
return super.columns();
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -30,7 +30,6 @@
import org.ajax4jsf.component.UIDataAdaptor;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.UIDataGrid;
-import org.richfaces.component.UIDataTable;
/**
* @author shura
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -35,7 +35,6 @@
import org.ajax4jsf.renderkit.RendererUtils;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.richfaces.component.Row;
-import org.richfaces.component.UIDataTable;
/**
* @author shura
@@ -55,23 +54,23 @@
};
- public static final Object ROW_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String ROW_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".rowClass";
- public static final Object SKIN_ROW_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String SKIN_ROW_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".skinRowClass";
- public static final Object CELL_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String CELL_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".cellClass";
- public static final Object SKIN_CELL_CLASS_KEY = AbstractRowsRenderer.class
+ public static final String SKIN_CELL_CLASS_KEY = AbstractRowsRenderer.class
.getName()
+ ".skinCellClass";
- public static final Object SKIN_FIRST_ROW_CLASS_KEY = AbstractRowsRenderer.class.getName()+".firstRowSkinClass";
+ public static final String SKIN_FIRST_ROW_CLASS_KEY = AbstractRowsRenderer.class.getName()+".firstRowSkinClass";
/*
* (non-Javadoc)
@@ -256,7 +255,7 @@
protected void encodeCellChildren(FacesContext context, UIComponent cell,
String skinFirstRowClass, String skinRowClass, String rowClass,
String skinCellClass, String cellClass) throws IOException {
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
// Save top level class parameters ( if any ), and put new for this
// component
Object savedRowClass = requestMap.get(ROW_CLASS_KEY);
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -96,7 +96,7 @@
int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent header = table.getHeader();
- Iterator headers = columnFacets(table,"header");
+ Iterator<UIComponent> headers = columnFacets(table,"header");
Iterator<UIComponent> colums = table.columns();
int colCount = calculateRowColumns(table.columns());
@@ -134,7 +134,7 @@
}
protected void encodeHeaderFacets(FacesContext context,
- ResponseWriter writer, Iterator headers, String skinCellClass,
+ ResponseWriter writer, Iterator<UIComponent> headers, String skinCellClass,
String headerClass, String facetName, String element, int colCount)
throws IOException {
int t_colCount = 0;
@@ -188,8 +188,8 @@
int columns) throws IOException {
ResponseWriter writer = context.getResponseWriter();
UIComponent footer = table.getFooter();
- Iterator footers = columnFacets(table,"footer");
- Iterator tableColumns = table.columns();//columnFacets(table,"footer");
+ Iterator<UIComponent> footers = columnFacets(table,"footer");
+ Iterator<UIComponent> tableColumns = table.columns();//columnFacets(table,"footer");
int colCount = calculateRowColumns(table.columns());
if (footer != null || footers.hasNext()) {
writer.startElement("tfoot", table);
@@ -224,7 +224,7 @@
throws IOException {
UIDataTable table = (UIDataTable) holder.getTable();
ResponseWriter writer = context.getResponseWriter();
- Iterator iter = table.columns();
+ Iterator<UIComponent> iter = table.columns();
boolean first = true;
int currentColumn = 0;
UIComponent column = null;
@@ -325,7 +325,8 @@
*
* Changed by Alexej Kushunin
*/
- protected Iterator columnFacets(UIDataTable table,final String name){
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> columnFacets(UIDataTable table,final String name){
return new FilterIterator(table.columns(), new Predicate() {
public boolean evaluate(Object input) {
@@ -355,7 +356,7 @@
count = span.intValue();
} else {
// calculate max html columns count for all columns/rows children.
- Iterator col = table.columns();
+ Iterator<UIComponent> col = table.columns();
count = calculateRowColumns(col);
}
return count;
@@ -369,7 +370,7 @@
* Iterator other all columns in table.
* @return
*/
- protected int calculateRowColumns(Iterator col) {
+ protected int calculateRowColumns(Iterator<UIComponent> col) {
int count = 0;
int currentLength = 0;
while (col.hasNext()) {
@@ -537,8 +538,14 @@
UIComponent table = column.getParent();
String id = table.getClientId(context);
JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(table, context);
- Map eventOptions = AjaxRendererUtils.buildEventOptions(context, table);
- Map parameters = (Map) eventOptions.get("parameters");
+ Map<String, Object> eventOptions = AjaxRendererUtils.buildEventOptions(context, table);
+
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> parameters =
+ (Map<String, Object>) eventOptions.get("parameters");
+
+
parameters.put(id, SORT_FILTER_PARAMETER);
if (sortable) {
parameters.put(SORT_FILTER_PARAMETER, column.getClientId(context));
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -30,7 +30,6 @@
import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.RendererBase;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
/**
* @author shur
@@ -42,7 +41,7 @@
public String styleClass(FacesContext context , UIComponent component){
StringBuffer styleClass = new StringBuffer();
// Construct predefined classes
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object parentPredefined = requestMap.get(AbstractRowsRenderer.SKIN_CELL_CLASS_KEY);
if (null != parentPredefined) {
styleClass.append(parentPredefined).append(" ");
@@ -126,7 +125,7 @@
}
}
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
return UIColumn.class;
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -22,17 +22,11 @@
package org.richfaces.renderkit;
import java.io.IOException;
-import java.util.Map;
-import javax.faces.FacesException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-
public interface HeaderEncodeStrategy {
public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -44,7 +44,7 @@
this.table = table;
this.rowCounter = 0;
this.gridRowCounter = 0;
- Map attributes = table.getAttributes();
+ Map<String, Object> attributes = table.getAttributes();
String classes = (String) attributes.get("rowClasses");
if(null != classes){
rowClasses=classes.split(",");
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/ColgroupRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -41,7 +41,7 @@
*/
public class ColgroupRenderer extends AbstractRowsRenderer {
- private static final String[] STYLE_ATTRS = { "style", "class" };
+ //private static final String[] STYLE_ATTRS = { "style", "class" };
public static final String[] EVENT_ATTRS ;
static {
@@ -71,12 +71,12 @@
if (null != columnClasses) {
classes = columnClasses.split(",");
}
- Iterator iter = colgroup.columns();
+ Iterator<UIComponent> iter = colgroup.columns();
boolean first = true;
int currentColumn = 0;
int currentRow = 0;
UIComponent column = null;
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
while (iter.hasNext()) {
column = (UIComponent) iter.next();
if (column instanceof Column) {
@@ -151,7 +151,7 @@
} else {
styleClass = (String) colspan.getAttributes().get("styleClass");
}
- Map requestMap = context.getExternalContext().getRequestMap();
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
Object skinRowClass = currentRow == 0 ? requestMap
.get(AbstractRowsRenderer.SKIN_FIRST_ROW_CLASS_KEY)
: requestMap.get(AbstractRowsRenderer.SKIN_ROW_CLASS_KEY);
@@ -191,7 +191,7 @@
*
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
// TODO Auto-generated method stub
return UIColumnGroup.class;
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/SubTableRenderer.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -61,7 +61,7 @@
private void encodeHeaderRow(ResponseWriter writer, FacesContext context, UIComponent component,String facetName) throws IOException {
UIDataTable dataTable = (UIDataTable) component;
Iterator<UIComponent> columns = dataTable.columns();//columnFacets(dataTable,facetName);
- Iterator headers = columnFacets(dataTable,facetName);
+ Iterator<UIComponent> headers = columnFacets(dataTable,facetName);
int colCount = calculateRowColumns(dataTable.columns());
String headerClass = (String) component.getAttributes().get(
facetName+"Class");
@@ -109,7 +109,7 @@
*
* @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
*/
- protected Class getComponentClass() {
+ protected Class<? extends UIComponent> getComponentClass() {
// TODO Auto-generated method stub
return UISubTable.class;
}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java 2008-03-07 10:10:37 UTC (rev 6613)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/util/ColumnUtil.java 2008-03-07 12:16:28 UTC (rev 6614)
@@ -21,8 +21,8 @@
package org.richfaces.util;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
-import javax.faces.el.ValueBinding;
import org.richfaces.component.Column;
@@ -46,7 +46,7 @@
UIComponent component = (UIComponent) column;
- ValueBinding binding = component.getValueBinding("sortExpression");
+ ValueExpression binding = component.getValueExpression("sortExpression");
if (binding != null) {
return binding.getExpressionString();
16 years, 10 months
JBoss Rich Faces SVN: r6613 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-03-07 05:10:37 -0500 (Fri, 07 Mar 2008)
New Revision: 6613
Modified:
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
Log:
http://jira.jboss.com/jira/browse/RF-2174
showButtonsLabel attribute was added with an image
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-07 08:21:02 UTC (rev 6612)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-03-07 10:10:37 UTC (rev 6613)
@@ -146,8 +146,7 @@
<property> "copyControlLabel"</property></emphasis>,
<emphasis> <property> "removeControlLabel"</property></emphasis>,
<emphasis> <property> "removeAllControlLabel"</property></emphasis> attributes.
- If you want not to display labels on the buttons of move controls you need to set
- <emphasis> <property> "showButtonsLabel"</property></emphasis> to<property> "false"</property>.
+
</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -160,7 +159,21 @@
<f:selectItems value="#{pickBean.testList}"/>
</rich:pickList>
...]]></programlisting>
-
+ <para>
+ If you want not to display labels on the buttons of move controls you need to set
+ <emphasis> <property> "showButtonsLabel"</property></emphasis> to<property> "false"</property>.
+ </para>
+ <figure>
+ <title>Move control buttons without labels</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/picklist_no_lbls.png"/>
+ </imageobject>
+ </mediaobject>
+
+ </figure>
+
<para>
<emphasis> <property> "switchByClick"</property></emphasis> provides an option to copy and remove a list item by one click,
default the value of this attribute is <property> "false"</property> , and you need a double click to copy, remove a list item.
16 years, 10 months
JBoss Rich Faces SVN: r6612 - in management/design: inplaceSelect/design and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2008-03-07 03:21:02 -0500 (Fri, 07 Mar 2008)
New Revision: 6612
Modified:
management/design/inplaceInput/design/inplaceInput.html
management/design/inplaceSelect/design/inplaceSelect.html
Log:
Modified: management/design/inplaceInput/design/inplaceInput.html
===================================================================
--- management/design/inplaceInput/design/inplaceInput.html 2008-03-06 20:48:48 UTC (rev 6611)
+++ management/design/inplaceInput/design/inplaceInput.html 2008-03-07 08:21:02 UTC (rev 6612)
@@ -23,12 +23,6 @@
.is_strut{width : 100px; height : 1px}
-.is_view_block{position : relative; width : 100%;; padding : 0px 0px 0px 0px; border : 0px; margin : 0px;}
-.is_edit_state_block{background : #FBFF8E/*editBackgroundColor*/; position : relative; width : 100%;; padding : 0px 0px 0px 0px; border : 0px; margin : 0px;}
-.is_field_block{background : #FBFF8E/*editBackgroundColor*/; padding : 0px 0px 0px 0px; border : 0px; margin : 0px; width : 100%;}
-
-
-
.is_edit_state_block_div{position : relative;}
.is_view_block_div{position : relative; padding : 2px 2px 2px 5px; border : 0px; margin :0px;}
.is_edit_block_div{background : #FBFF8E/*editBackgroundColor*/; position : relative; padding : 0px; border : 0px; margin : 2px 2px 2px 5px;}
@@ -124,63 +118,8 @@
</fieldset>
-<fieldset><legend>Edit State (block variant 1)</legend><br><br>
-<Table class="tab_example" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <input type="Text" class="is_view_block" readonly="readonly" value="View mode">
- </td>
- <td>
- <input type="Text" class="is_view_block" readonly="readonly" value="View mode">
- </td>
- </tr>
- <tr>
- <td>
- <div class="is_edit_state_block">
- <input type="Text" value="Edit mode" class="is_field_block"><div class="is_btn_set_block">
- <div class="is_shadow">
- <table cellpadding="0" cellspacing="0" border="0" class="is_shadow_size">
- <tr>
- <td class="is_shadow_tl">
- <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
- </td>
- <td class="is_shadow_tr">
- <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
- </td>
- </tr>
- <tr>
- <td class="is_shadow_bl">
- <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
- </td>
- <td class="is_shadow_br">
- <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
- </td>
- </tr>
- </table>
- </div>
- <div style="position : relative">
- <input type="image" src="images/ico_ok.gif" class="is_btn" onmousedown="this.className='is_btn_press'" onmouseout="this.className='is_btn'" onmouseup="this.className='is_btn'"><input type="image" src="images/ico_cancel.gif" class="is_btn" onmousedown="this.className='is_btn_press'" onmouseout="this.className='is_btn'" onmouseup="this.className='is_btn'">
- </div>
- </div>
- </div>
- </td>
- <td>
- <input type="Text" class="is_view_block" readonly="readonly" value="View mode">
- </td>
- </tr>
- <tr>
- <td>
- <input type="Text" class="is_view_block" readonly="readonly" value="View mode">
- </td>
- <td>
- <input type="Text" class="is_view_block is_changed_state" readonly="readonly" value="View mode">
- </td>
- </tr>
-</table>
-</fieldset>
-
-<fieldset><legend>Edit State (variant 2)</legend><br><br>
+<fieldset><legend>Edit State (block)</legend><br><br>
<Table class="tab_example" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
@@ -229,7 +168,7 @@
<div class="is_view_block_div">View mode</div>
</td>
<td>
- <div class="is_view_block_div">View mode</div>
+ <div class="is_view_block_div is_changed_state">View mode</div>
</td>
</tr>
</table>
Modified: management/design/inplaceSelect/design/inplaceSelect.html
===================================================================
--- management/design/inplaceSelect/design/inplaceSelect.html 2008-03-06 20:48:48 UTC (rev 6611)
+++ management/design/inplaceSelect/design/inplaceSelect.html 2008-03-07 08:21:02 UTC (rev 6612)
@@ -8,6 +8,8 @@
body{padding : 30px;}
fieldset{padding : 30px; border : 1px solid #c0c0c0;}
legend{font-weight : bold}
+.tab_example {width : 700px; border-top:1px solid #c0c0c0; border-left:1px solid #c0c0c0;}
+.tab_example td{width : 350px; border-bottom:1px solid #c0c0c0; border-right:1px solid #c0c0c0;}
.insel_default_state{white-space : nowrap; background-color : #f1f1f1/*editorBackgroundColor*/; border-bottom : 1px dashed #000000/*generalTextColor*/; padding-left : 3px; padding-right : 3px;}
@@ -28,14 +30,16 @@
padding : 0px;
margin : 0px;}
+.insel_arrow_block{background : #FEFFDA/*editBackgroundColor*/; padding : 0px 0px 0px 0px; border : 0px; margin : 0px; width : 12px; position : absolute; top:1px; right : 0px;background-image:url(images/mark_list.gif); background-position : center right; background-repeat : no-repeat;}
+.insel_btn_set_block{ position : absolute; top:0px; right : -13px; white-space : nowrap}
-.insel_btn_set{ position : absolute; top:0px; left : 114px; white-space : nowrap}
+.insel_btn_set{ position : absolute; top:0px; left : 114px; white-space : nowrap}
.insel_shadow{ top:0; left:0; position : absolute;}
.insel_shadow_size{ width : 34px; height : 16px;}
-.insel_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
-.insel_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
-.insel_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
-.insel_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
+.insel_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left; border : 0px !important}
+.insel_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right; border : 0px !important}
+.insel_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left; border : 0px !important}
+.insel_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right; border : 0px !important}
.cb_list_cord{ position : relative; font-size : 0px;d!isplay : none}/*DDL is hidden!!!!!*/
.cb_list_scroll{ overflow : auto; height : 100px;}
.cb_list_position{ position : absolute; top:1px; left:0px;}
@@ -45,13 +49,19 @@
.cb_font{ font-size : 11px/*generalSizeFont*/; font-family : arial/*generalFamilyFont*/; color : #000000/*generalTextColor*/}
.cb_select{ padding : 1px; background-color: #4a75b5; border : 1px dotted #4a75b5; color: white;/*generalTextColor*/}
-.cb_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left;}
-.cb_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right;}
-.cb_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left;}
-.cb_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right;}
+.cb_shadow_tl{ background : url(images/bg_shadow.png) repeat-x top left; border : 0px !important}
+.cb_shadow_tr{ background : url(images/bg_shadow.png) repeat-x top right; border : 0px !important}
+.cb_shadow_bl{ background : url(images/bg_shadow.png) repeat-x bottom left; border : 0px !important}
+.cb_shadow_br{ background : url(images/bg_shadow.png) repeat-x bottom right; border : 0px !important}
-
+.insel_edit_state_block_div{position : relative;}
+.insel_view_block_div{position : relative; padding : 2px 2px 2px 5px; border : 0px; margin :0px;}
+.insel_edit_block_div{background : #FEFFDA/*editBackgroundColor*/; position : relative; padding : 0px; border : 0px; margin : 2px 2px 2px 5px;}
+.insel_field_block_div{background : #FEFFDA/*editBackgroundColor*/;padding :0px; border : 0px; margin : 0px 0px 0px 0px; width : 344px;}
+.insel_edit_block_bg_div{ position : absolute; top:0px; left : 0px; background : #FEFFDA/*editBackgroundColor*/; width : 349px; height : 17px; text-align : right}
+
+
</style>
</head>
@@ -157,5 +167,106 @@
</fieldset>
+<fieldset><legend>Edit State (block)</legend><br><br>
+<Table class="tab_example" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <div class="insel_view_block_div">View mode</div>
+ </td>
+ <td>
+ <div class="insel_view_block_div">View mode</div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div class="insel_edit_state_block_div">
+ <div class="insel_view_block_div">View mode</div><div class="insel_edit_block_bg_div"><input type="Text" value="Edit mode" class="insel_field_block_div"></div><div class="insel_btn_set_block">
+ <div class="insel_btn_set_block">
+ <div class="insel_shadow">
+ <table cellpadding="0" cellspacing="0" border="0" class="insel_shadow_size">
+ <tr>
+ <td class="insel_shadow_tl">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ <td class="insel_shadow_tr">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ <tr>
+ <td class="insel_shadow_bl">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ <td class="insel_shadow_br">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div style="position : relative">
+ <input type="image" src="images/ico_ok.gif" class="insel_btn" onmousedown="this.className='insel_btn_press'" onmouseout="this.className='insel_btn'" onmouseup="this.className='insel_btn'"><input type="image" src="images/ico_cancel.gif" class="insel_btn" onmousedown="this.className='insel_btn_press'" onmouseout="this.className='insel_btn'" onmouseup="this.className='insel_btn'">
+ </div>
+ </div>
+ </div>
+ <input readonly="readonly" type="Text" value="" class="insel_arrow_block">
+ <div style="position : relative">
+ <div class="cb_width_list" style="position : absolute; height : 100px; left : -1px; top: -1px">
+ <iframe class="cb_width_list cb_list_scroll cb_list_position" frameborder="0"></iframe>
+ <div class="cb_shadow">
+ <table cellpadding="0" cellspacing="0" border="0" width="257" height="109">
+ <tr>
+ <td class="cb_shadow_tl">
+ <img src="images/spacer.gif" width="10" height="1" alt="" border="0"><br>
+ </td>
+ <td class="cb_shadow_tr">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ <tr>
+ <td class="cb_shadow_bl">
+ <img src="images/spacer.gif" width="1" height="10" alt="" border="0"><br>
+ </td>
+ <td class="cb_shadow_br">
+ <img src="images/spacer.gif" width="10" height="10" alt="" border="0"><br>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="cb_list_position">
+ <div class="cb_list_decoration">
+ <div class="cb_list_scroll cb_width_list">
+ <div class="cb_option cb_font">Option 1</div>
+ <div class="cb_option cb_font">Option 2</div>
+ <div class="cb_option cb_font">Option 3</div>
+ <div class="cb_option cb_font">Option 4</div>
+ <div class="cb_option cb_font cb_select">Opt</div>
+ <div class="cb_option cb_font">Option 6</div>
+ <div class="cb_option cb_font">Option 7</div>
+ <div class="cb_option cb_font">Option 8</div>
+ <div class="cb_option cb_font">Option 9</div>
+ <div class="cb_option cb_font">Option 0</div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </td>
+ <td>
+ <div class="insel_view_block_div">View mode</div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div class="insel_view_block_div">View mode</div>
+ </td>
+ <td>
+ <div class="insel_view_block_div insel_changed_state">View mode</div>
+ </td>
+ </tr>
+</table>
+</fieldset>
+
+
</body>
</html>
16 years, 10 months
JBoss Rich Faces SVN: r6611 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-03-06 15:48:48 -0500 (Thu, 06 Mar 2008)
New Revision: 6611
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
template was changed.
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-06 20:30:53 UTC (rev 6610)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-06 20:48:48 UTC (rev 6611)
@@ -4,7 +4,7 @@
Richfaces.InplaceInput.prototype = {
- initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams) {
+ initialize: function(clientId, temValueKeepId, valueKeepId, tabberId, strutId, attributes, events, classes, barParams, textId) {
this.inplaceInput = $(clientId);
this.inplaceInput.component = this;
@@ -17,6 +17,8 @@
this.classes = classes;
+ this.textNode = $(textId);
+
this.currentText = this.getCurrentText();
this.value = this.valueKeeper.value;
@@ -170,6 +172,7 @@
if (this.bar) {
this.bar.hide();
}
+ this.textPositioning(this.coords);
this.tabber.show();
this.tempValueKeeper.hide();
},
@@ -182,15 +185,16 @@
this.changeState(Richfaces.InplaceInput.STATES[1]);
var inputSize = this.setInputWidth(textSize);
- var coordsVal = Richfaces.InplaceInput.getElemXY(this.inplaceInput);
- var coordsStrut = Richfaces.InplaceInput.getElemXY(this.strut);
-
this.tabber.hide();
+ this.coords = this.getCoords();
this.inplaceInput.className = this.classes.COMPONENT.EDITABLE;
this.setStrutWidth(textSize);
+
+ var strCoord = Richfaces.InplaceInput.getElemXY(this.strut);
+
this.tempValueKeeper.style.left = 0 + "px";
- this.tempValueKeeper.style.top = (coordsVal.top - coordsStrut.top) + "px";
+ this.tempValueKeeper.style.top = (this.coords.top - strCoord.top)+ "px";
this.tempValueKeeper.show();
@@ -206,7 +210,7 @@
setStrutWidth : function(textSize) {
this.tempValueKeeper.show();
- this.strut.style.width = "100px";
+ this.strut.style.width = textSize + "px";
this.strut.show();
},
@@ -214,10 +218,11 @@
this.changeState(Richfaces.InplaceInput.STATES[0]);
this.createNewText(this.currentText);
+
this.inplaceInput.className = this.classes.COMPONENT.VIEW.NORMAL;
this.inplaceInput.observe("mouseover", function(e){this.inplaceMouseOverHandler(e);}.bindAsEventListener(this));
- this.strut.hide();
+ //this.strut.hide();
},
startChangedState : function () {
@@ -225,8 +230,9 @@
//this.createNewText(this.valueKeeper.value);
this.createNewText(this.currentText);
+
this.inplaceInput.className = this.classes.COMPONENT.CHANGED.NORMAL;
- this.strut.hide();
+ //this.strut.hide();
},
/**
@@ -322,20 +328,33 @@
},
deleteViewArtifacts : function () {
- var text = this.inplaceInput.childNodes[5];
+ var text = this.textNode.firstChild;
if (text) {
- this.inplaceInput.removeChild(text);
+ this.textNode.removeChild(text);
}
},
getCurrentText : function() {
- return this.inplaceInput.childNodes[5];
+ return this.textNode.firstChild;
},
createNewText : function(text) {
if (!this.getCurrentText()) {
- this.inplaceInput.appendChild(document.createTextNode(text.nodeValue||text));
+ this.textNode.appendChild(document.createTextNode(text.nodeValue||text));
}
+ },
+
+ textPositioning : function(coord) {
+ this.textNode.style.left = coord.left + "px";
+ this.textNode.style.top = coord.top + "px";
+ },
+
+ getCoords: function() {
+ var coordsVal = Richfaces.InplaceInput.getElemXY(this.inplaceInput);
+ var coordsStrut = Richfaces.InplaceInput.getElemXY(this.strut);
+
+ //return {top : (coordsVal.top - coordsStrut.top), left : 0};
+ return {top : coordsVal.top, left : coordsVal.left};
}
};
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 20:30:53 UTC (rev 6610)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-06 20:48:48 UTC (rev 6611)
@@ -60,7 +60,7 @@
<span id="#{clientId}" class='rich-inplace rich-inplace-view #{component.attributes["styleClass"]}'
x:passThruWithExclusions="id,styleClass,class,style">
<input id="#{clientId}tabber" type="button" value="" style="width: 1px; position: absolute; left: -32767px;" />
- <img id="#{clientId}strut" src="#{spacer}" class="rich-inplace-input-strut"/>
+ <img id="#{clientId}strut" src="#{spacer}" class="rich-inplace-input-strut" style="width:100px"/>
<input id='#{clientId}tempValue'
class='rich-inplace-field'
style='display:none;position:absolute;'
@@ -139,7 +139,7 @@
]]>
</jsp:scriptlet>
</div>
- #{value}
+ <span id="#{clientId}text" style="position:absolute;">#{value}</span>
</span>
@@ -149,6 +149,9 @@
#{this:encodeScriptEvents(context, component)};
#{this:encodeInplaceInputCss(context, component)};
- var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber', '#{clientId}strut', attributes, events, classes, ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow']);
+ var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
+ '#{clientId}strut', attributes, events, classes, ['#{clientId}bar',
+ '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow'],
+ '#{clientId}text');
</script>
</f:root>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6610 - in trunk/ui/dataTable/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-06 15:30:53 -0500 (Thu, 06 Mar 2008)
New Revision: 6610
Modified:
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2422
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-03-06 18:28:05 UTC (rev 6609)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-03-06 20:30:53 UTC (rev 6610)
@@ -104,4 +104,10 @@
<classname>java.lang.String</classname>
<description>Event for filter input that forces the filtration (default = onchange)</description>
<defaultvalue>"onchange"</defaultvalue>
-</property>
+</property>
+<property>
+ <name>filterDefaultLabel</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+</property>
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-03-06 18:28:05 UTC (rev 6609)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIColumn.java 2008-03-06 20:30:53 UTC (rev 6610)
@@ -49,9 +49,11 @@
private String filterValue;
public abstract String getSortMode();
-
public abstract void setSortMode(String mode);
+ public abstract String getFilterDefaultLabel();
+ public abstract void setFilterDefaultLabel(String label);
+
public FilterField getFilterField(){
FilterField filterField = null;
MethodExpression filterMethod = getFilterMethod();
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-06 18:28:05 UTC (rev 6609)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-03-06 20:30:53 UTC (rev 6610)
@@ -510,14 +510,22 @@
column.getFacets().put(FILTER_INPUT_FACET_NAME, filterValueInput);
filterValueInput.getAttributes().put(HTML.onclick_ATTRIBUTE, "Event.stop(event);");
}
- String onkeydownEvent = inplaceInput ? "oninputkeydown" : HTML.onkeydown_ATTRIBUTE;
+ String onkeydownEvent = HTML.onkeydown_ATTRIBUTE;
String filterEvent = (String) column.getAttributes().get("filterEvent");
+ if (inplaceInput) {
+ onkeydownEvent = "oninputkeydown";
+ filterValueInput.getAttributes().put("defaultLabel", column.getAttributes().get("filterDefaultLabel"));
+ }
if (null == filterEvent || "".equals(filterEvent)) {
filterEvent = "onchange";
}
+
filterValueInput.getAttributes().put(filterEvent, buffer);
- filterValueInput.getAttributes().put(onkeydownEvent, "RichFaces.blurFilterInput(event);");
+ if (!onkeydownEvent.equals(filterEvent)) {
+ filterValueInput.getAttributes().put(onkeydownEvent, "RichFaces.blurFilterInput(event);");
+ }
+
filterValueInput.setValue(column.getAttributes().get("filterValue"));
getUtils().encodeBeginFormIfNessesary(context, column);
16 years, 10 months
JBoss Rich Faces SVN: r6609 - in trunk/ui: dropdown-menu/src/main/java/org/richfaces/renderkit/html and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-06 13:28:05 -0500 (Thu, 06 Mar 2008)
New Revision: 6609
Added:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/menu-components/src/main/config/component/menucomponents.xml
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1650
http://jira.jboss.com/jira/browse/RF-2372
http://jira.jboss.com/jira/browse/RF-2066
Modified: trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java
===================================================================
--- trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererDelegate.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -57,7 +57,7 @@
buffer.append(".");
function = new JSFunction("asSubMenu");
function.addParameter(component.getParent().getClientId(context)+"_menu");
- function.addParameter("ref"+component.getClientId(context));
+ function.addParameter(component.getClientId(context));
String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
Modified: trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -57,7 +57,7 @@
buffer.append(".");
function = new JSFunction("asSubMenu");
function.addParameter(component.getParent().getClientId(context)+"_menu");
- function.addParameter("ref"+component.getClientId(context));
+ function.addParameter(component.getClientId(context));
String evt = (String) component.getAttributes().get("event");
if(evt == null || evt.trim().length() == 0){
evt = "onmouseover";
Modified: trunk/ui/menu-components/src/main/config/component/menucomponents.xml
===================================================================
--- trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/config/component/menucomponents.xml 2008-03-06 18:28:05 UTC (rev 6609)
@@ -143,6 +143,12 @@
<classname>java.lang.String</classname>
<description>Class to be applied to icon element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>labelClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to label element</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
<name>converter</name>
@@ -281,6 +287,12 @@
<classname>java.lang.String</classname>
<description>CSS style rules to be applied to icon element</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
+ <name>labelClass</name>
+ <classname>java.lang.String</classname>
+ <description>Class to be applied to label element</description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
</property>
&ajax_component_attributes;
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -93,7 +93,7 @@
}
} else if (kid instanceof UIMenuGroup) {
UIMenuGroup menuGroup = (UIMenuGroup) kid;
- itemId = "ref" + kid.getClientId(context);
+ itemId = kid.getClientId(context);
flcloseonclick = 0;
if ((disabled = menuGroup.isDisabled())) {
flagGroup = 2;
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuGroupRendererBase.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -35,7 +35,13 @@
-public class MenuGroupRendererBase extends HeaderResourcesRendererBase {
+public class MenuGroupRendererBase extends HeaderResourcesRendererBase {
+
+ private MenuItemRendererDelegate delegate;
+
+ public MenuGroupRendererBase() {
+ delegate = new MenuItemRendererDelegate();
+ }
protected Class getComponentClass() {
return UIMenuGroup.class;
@@ -53,52 +59,7 @@
public void initializeStyleClasses(FacesContext context, UIMenuGroup menuGroup) {
ComponentVariables variables =
ComponentsVariableResolver.getVariables(this, menuGroup);
- UIComponent parentMenu = getParentMenu(context, menuGroup);
- Object itemClass = parentMenu.getAttributes().get("itemClass");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
- Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
- Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
- Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
-
- if (null == itemClass) {
- itemClass = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
- if (null == disabledItemClass) {
- disabledItemClass = "";
- }
- if (null == disabledItemStyle) {
- disabledItemStyle = "";
- }
- if (null == selectItemClass) {
- selectItemClass = "";
- }
-
- if (menuGroup.isDisabled()) {
- variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
- itemClass + " " + disabledItemClass + " " + menuGroup.getStyleClass());
- variables.setVariable("menuGroupStyle",
- itemStyle + "; " + disabledItemStyle + "; " + menuGroup.getStyle());
- variables.setVariable("menuGroupMouseMove", "");
- variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-disabled");
- variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label-disabled");
- variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder-disabled");
- } else {
- variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
- itemClass + " " + menuGroup.getStyleClass());
- variables.setVariable("menuGroupHoverClass", "this.className='dr-menu-item dr-menu-item-enabled rich-menu-group " +
- itemClass + " " + selectItemClass + " " + menuGroup.getStyleClass() + "'");
- variables.setVariable("menuGroupStyle",
- itemStyle + "; " + menuGroup.getStyle());
- variables.setVariable("menuGroupMouseMove", menuGroup.getAttributes().get("onmousemove"));
- variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled");
- variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label");
- variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder");
- variables.setVariable("onmouseoutInlineStyles", processInlineStyles(context, menuGroup, false));
- variables.setVariable("onmouseoverInlineStyles", processInlineStyles(context, menuGroup, true));
- }
+ delegate.initializeStyles(context, menuGroup, menuGroup.isDisabled(), variables);
}
public void initializeResources(FacesContext context, UIMenuGroup menuGroup)
@@ -142,52 +103,12 @@
}
protected UIComponent getParentMenu(FacesContext context, UIMenuGroup menuGroup) {
- UIComponent parent = menuGroup.getParent();
- while (null != parent) {
- if (parent instanceof org.richfaces.component.MenuComponent) {
- return parent;
- }
- parent = parent.getParent();
- }
- throw new FacesException( "Parent menu for menu group (id="
- + menuGroup.getClientId(context) + ") has not been found.");
+ return delegate.getParentMenu(context, menuGroup);
}
protected String processInlineStyles(FacesContext context,
UIMenuGroup menuGroup, boolean isOnmouseover) {
- StringBuffer buffer = new StringBuffer();
- Object style = menuGroup.getAttributes().get("style");
- Object selectStyle = menuGroup.getAttributes().get("selectStyle");
-
- UIComponent parentMenu = getParentMenu(context, menuGroup);
- Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
-
- if (null == selectStyle) {
- selectStyle = "";
- }
- if (null == selectItemStyle) {
- selectItemStyle = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
-
- selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
-
- buffer.append("$('ref" + menuGroup.getClientId(context) + "').style.cssText='");
-
- if (null != style) {
- buffer.append(style.toString() + "; ");
- }
-
- if (isOnmouseover) {
- buffer.append(selectStyle.toString() + ";';");
- } else {
- buffer.append(itemStyle.toString() + ";';");
- }
-
- return buffer.toString();
+ return delegate.processInlineStyles(context, menuGroup, isOnmouseover);
}
}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererBase.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -47,6 +47,12 @@
public class MenuItemRendererBase extends CompositeRenderer {
+
+ private MenuItemRendererDelegate delegate;
+
+ public MenuItemRendererBase() {
+ delegate = new MenuItemRendererDelegate();
+ }
protected Class getComponentClass() {
return UIMenuItem.class;
@@ -136,11 +142,10 @@
context, menuItem);
}
variables.setVariable("icon", resource);
-
+
if (menuItem.isDisabled()) {
variables.setVariable("iconDisabledClasses",
"dr-menu-icon-disabled rich-menu-item-icon-disabled");
- variables.setVariable("menuItemLabelClass", "rich-menu-item-label rich-menu-item-label-disabled");
} else {
variables.setVariable("onmouseoutInlineStyles",
@@ -195,7 +200,6 @@
if (resource.length() > 0) {
variables.setVariable("onclick", scriptValue.toString());
}
- variables.setVariable("menuItemLabelClass", "rich-menu-item-label");
}
}
@@ -238,108 +242,17 @@
return MenuComponent.MODE_SERVER;
}
- protected String processInlineStyles(FacesContext context,
- UIMenuItem menuItem,
- boolean isOnmouseover) {
-
- StringBuffer buffer = new StringBuffer();
- Object style = menuItem.getAttributes().get("style");
- Object selectStyle = menuItem.getAttributes().get("selectStyle");
-
- UIComponent parentMenu = getParentMenu(context, menuItem);
- Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
-
- if (null == selectStyle) {
- selectStyle = "";
- }
- if (null == selectItemStyle) {
- selectItemStyle = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
-
- selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
-
- buffer.append("$('" + menuItem.getClientId(context) + "').style.cssText='");
-
- if (null != style) {
- buffer.append(style.toString() + "; ");
- }
-
- if (isOnmouseover) {
- buffer.append(selectStyle.toString() + ";';");
- } else {
- buffer.append(itemStyle.toString() + ";';");
- }
-
- return buffer.toString();
+ protected String processInlineStyles(FacesContext context, UIMenuItem menuItem, boolean isOnmouseover) {
+ return delegate.processInlineStyles(context, menuItem, isOnmouseover);
}
protected UIComponent getParentMenu(FacesContext context, UIMenuItem menuItem) {
- UIComponent parent = menuItem.getParent();
- while (null != parent) {
- if (parent instanceof org.richfaces.component.MenuComponent) {
- return parent;
- }
- parent = parent.getParent();
- }
- throw new FacesException( "Parent menu for menu item (id="
- + menuItem.getClientId(context) + ") has not been found.");
+ return delegate.getParentMenu(context, menuItem);
}
public void initializeStyles(FacesContext context, UIMenuItem menuItem) {
- ComponentVariables variables =
+ ComponentVariables variables =
ComponentsVariableResolver.getVariables(this, menuItem);
- UIComponent parentMenu = getParentMenu(context, menuItem);
- Object itemClass = parentMenu.getAttributes().get("itemClass");
- Object itemStyle = parentMenu.getAttributes().get("itemStyle");
- Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
- Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
- Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
- Object selectClass = menuItem.getAttributes().get("selectClass");
- Object styleClass = menuItem.getStyleClass();
-
- if (null == itemClass) {
- itemClass = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
- if (null == disabledItemClass) {
- disabledItemClass = "";
- }
- if (null == disabledItemStyle) {
- disabledItemStyle = "";
- }
- if (null == selectItemClass) {
- selectItemClass = "";
- }
- if (null == styleClass) {
- styleClass = "";
- }
- if (null == selectClass) {
- selectClass = "";
- }
-
- if (menuItem.isDisabled()) {
- variables.setVariable("menuItemClass",
- "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled " +
- menuItem.getStyleClass() + " " +
- itemClass + " " + disabledItemClass);
- variables.setVariable("menuItemStyle",
- itemStyle + "; " + disabledItemStyle + "; " + menuItem.getStyle());
- } else {
- variables.setVariable("menuItemClass",
- "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " +
- styleClass + " " + itemClass);
- variables.setVariable("menuItemStyle",
- itemStyle + "; " + menuItem.getStyle());
- variables.setVariable("menuItemHoverClass",
- "this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover " +
- styleClass + " " + selectClass +
- selectItemClass + "';");
- }
+ delegate.initializeStyles(context, menuItem, menuItem.isDisabled(), variables);
}
}
Added: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java (rev 0)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -0,0 +1,175 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.RendererBase;
+
+public class MenuItemRendererDelegate extends RendererBase {
+
+ protected void initializeStyles(FacesContext context, UIComponent menuItem,
+ boolean disabled, ComponentVariables variables) {
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+ Object itemClass = parentMenu.getAttributes().get("itemClass");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+ Object disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
+ Object disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+ Object selectItemClass = parentMenu.getAttributes().get("selectItemClass");
+ Object selectClass = menuItem.getAttributes().get("selectClass");
+ Object styleClass = menuItem.getAttributes().get("styleClass");
+ Object style = parentMenu.getAttributes().get("style");
+ Object labelClass = (String)menuItem.getAttributes().get("labelClass");
+ Object disabledLabelClass = (String)menuItem.getAttributes().get("labelClass");
+ Object selectedLabelClass = (String)menuItem.getAttributes().get("labelClass");
+
+ if (null == labelClass) {
+ labelClass = "";
+ }
+ if (null == disabledLabelClass) {
+ disabledLabelClass = "";
+ }
+ if (null == selectedLabelClass) {
+ selectedLabelClass = "";
+ }
+ if (null == itemClass) {
+ itemClass = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+ if (null == disabledItemClass) {
+ disabledItemClass = "";
+ }
+ if (null == disabledItemStyle) {
+ disabledItemStyle = "";
+ }
+ if (null == selectItemClass) {
+ selectItemClass = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+ if (null == selectClass) {
+ selectClass = "";
+ }
+ if (null == style) {
+ style = "";
+ }
+
+ if (disabled) {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled " +
+ styleClass + " " +
+ itemClass + " " + disabledItemClass);
+ variables.setVariable("menuItemStyle",
+ itemStyle + "; " + disabledItemStyle + "; " + style);
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label rich-menu-item-label-disabled " +
+ labelClass + " " + disabledLabelClass);
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
+ itemClass + " " + disabledItemClass + " " + styleClass);
+ variables.setVariable("menuItemMouseMove", "");
+ variables.setVariable("menuItemItemIconClass", "rich-menu-item-icon-disabled");
+ variables.setVariable("menuItemItemLabelClass", "rich-menu-item-label-disabled " + labelClass);
+ variables.setVariable("menuItemItemFolderClass", "rich-menu-item-folder-disabled");
+ } else {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " +
+ styleClass + " " + itemClass);
+ variables.setVariable("menuItemStyle", itemStyle + "; " + style);
+ variables.setVariable("menuItemHoverClass",
+ "this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover " +
+ styleClass + " " + selectClass +
+ selectItemClass + "';");
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label " + labelClass);
+ variables.setVariable("selectLabelClass", selectedLabelClass);
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + styleClass);
+ variables.setVariable("menuItemMouseMove", menuItem.getAttributes().get("onmousemove"));
+ variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled");
+ variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label " + labelClass);
+ variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder");
+ variables.setVariable("onmouseoutInlineStyles", processInlineStyles(context, menuItem, false));
+ variables.setVariable("onmouseoverInlineStyles", processInlineStyles(context, menuItem, true));
+
+ variables.setVariable("menuGroupHoverClass", "this.className='dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + selectItemClass + " " + styleClass + "'");
+ }
+ }
+
+ protected String processInlineStyles(FacesContext context, UIComponent menuItem, boolean isOnmouseover) {
+
+ StringBuffer buffer = new StringBuffer();
+ Object style = menuItem.getAttributes().get("style");
+ Object selectStyle = menuItem.getAttributes().get("selectStyle");
+
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+ Object selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
+ Object itemStyle = parentMenu.getAttributes().get("itemStyle");
+
+ if (null == selectStyle) {
+ selectStyle = "";
+ }
+ if (null == selectItemStyle) {
+ selectItemStyle = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+
+ selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
+
+ buffer.append("$('" + menuItem.getClientId(context) + "').style.cssText='");
+
+ if (null != style) {
+ buffer.append(style.toString() + "; ");
+ }
+
+ if (isOnmouseover) {
+ buffer.append(selectStyle.toString() + ";';");
+ } else {
+ buffer.append(itemStyle.toString() + ";';");
+ }
+
+ return buffer.toString();
+ }
+
+ protected UIComponent getParentMenu(FacesContext context, UIComponent menuItem) {
+ UIComponent parent = menuItem.getParent();
+ while (null != parent) {
+ if (parent instanceof org.richfaces.component.MenuComponent) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ throw new FacesException( "Parent menu for menu group (id="
+ + menuItem.getClientId(context) + ") has not been found.");
+ }
+
+ protected Class getComponentClass() {
+ return null;
+ }
+
+}
Modified: trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-03-06 18:28:05 UTC (rev 6609)
@@ -1065,7 +1065,7 @@
this.level = RichFaces.Menu.Layers.layers[parentv].level + 1;
RichFaces.Menu.Layers.father[this.id] = parentv;
if(!refLayerName){
- refLayerName = 'ref' + parentv;
+ refLayerName = parentv;
}
var refLayer = $(refLayerName);
this.refItem = RichFaces.Menu.Layers.layers[parentv].items[refLayerName];
@@ -1297,7 +1297,7 @@
Event.extend(event);
//window.status = $(event.relatedTarget).inspect();
if (this.options.onmouseout) {
- if (this.options.onmouseover.call(element, event) == false) {
+ if (this.options.onmouseout.call(element, event) == false) {
Event.stop(event);
return;
};
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-03-06 18:28:05 UTC (rev 6609)
@@ -23,14 +23,14 @@
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif" var="spacer" />
- <div id="ref#{clientId}"
+ <div id="#{clientId}"
class="#{menuGroupClass}"
- style="#{menuGroupStyle}"
- onmousemove="#{menuGroupMouseMove}"
- onmouseout="this.className='#{menuGroupClass}'; #{onmouseoutInlineStyles}"
- onmouseover="#{menuGroupHoverClass}; #{onmouseoverInlineStyles}" >
+ style="#{menuItemStyle}"
+ onmousemove="#{menuItemMouseMove}"
+ onmouseout="if (RichFaces.Menu.isWithin(event, this)) return; this.className='#{menuGroupClass}'; #{onmouseoutInlineStyles}"
+ onmouseover="if (RichFaces.Menu.isWithin(event, this)) return; #{menuGroupHoverClass}; #{onmouseoverInlineStyles}" >
- <span id="ref#{clientId}:icon"
+ <span id="#{clientId}:icon"
class="dr-menu-icon #{menuGroupItemIconClass} #{component.attributes['iconClass']}">
<jsp:scriptlet>
<![CDATA[
@@ -53,7 +53,7 @@
<jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
</span>
- <span id="ref#{clientId}:anchor" class="#{menuGroupItemLabelClass}">
+ <span id="#{clientId}:anchor" class="#{menuGroupItemLabelClass}">
#{component.attributes['value']}
</span>
@@ -64,7 +64,7 @@
if (iconFolderFacet != null && iconFolderFacet.isRendered()) {
]]>
</jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass}">
+ <div id="#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass}">
<jsp:scriptlet>
<![CDATA[
renderChild(context, iconFolderFacet);
@@ -75,7 +75,7 @@
<jsp:scriptlet>
<![CDATA[} else if (component.getAttributes().get(iconFolder)!=null) {]]>
</jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass} #{component.attributes['iconClass']}">
+ <div id="#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass} #{component.attributes['iconClass']}">
<img width="16" height="16"
style="#{component.attributes['iconStyle']}"
src="#{actualIconFolder}"/>
@@ -83,7 +83,7 @@
<jsp:scriptlet>
<![CDATA[} else {]]>
</jsp:scriptlet>
- <div id="ref#{clientId}:folder" class="dr-menu-node dr-menu-node-icon #{menuGroupItemFolderClass}"/>
+ <div id="#{clientId}:folder" class="dr-menu-node dr-menu-node-icon #{menuGroupItemFolderClass}"/>
<jsp:scriptlet>
<![CDATA[}]]>
</jsp:scriptlet>
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-03-06 18:28:05 UTC (rev 6609)
@@ -56,14 +56,16 @@
<div id="#{clientId}"
class="#{menuItemClass}"
- onmouseout="this.className='#{menuItemClass}';
+ onmouseout="if (RichFaces.Menu.isWithin(event, this)) return;
+ this.className='#{menuItemClass}';
#{onmouseoutInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon rich-menu-item-icon #{component.attributes['iconClass']}';
- $('#{clientId}:anchor').className='rich-menu-item-label';"
- onmouseover="#{menuItemHoverClass};
+ Element.removeClassName($('#{clientId}:anchor'), 'rich-menu-item-label-selected');"
+ onmouseover="if (RichFaces.Menu.isWithin(event, this)) return;
+ #{menuItemHoverClass};
#{onmouseoverInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected #{component.attributes['iconClass']}';
- $('#{clientId}:anchor').className='rich-menu-item-label rich-menu-item-label-selected';"
+ Element.addClassName($('#{clientId}:anchor'), 'rich-menu-item-label-selected');"
style="#{menuItemStyle}"
onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect} #{onclick}; Event.stop(event);"
onmouseup="Event.stop(event); #{component.attributes['onmouseup']}">
Modified: trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java
===================================================================
--- trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java 2008-03-06 18:26:15 UTC (rev 6608)
+++ trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuGroupComponentTest.java 2008-03-06 18:28:05 UTC (rev 6609)
@@ -100,8 +100,7 @@
HtmlPage page = renderView();
assertNotNull(page);
// System.out.println(page.asXml());
- HtmlElement div = page.getHtmlElementById("ref"
- + menuGroup.getClientId(facesContext));
+ HtmlElement div = page.getHtmlElementById(menuGroup.getClientId(facesContext));
assertNotNull(div);
assertEquals("div", div.getNodeName());
16 years, 10 months