JBoss Rich Faces SVN: r14915 - in branches/community/3.3.X/ui/componentControl/src: main/java/org/richfaces/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-07-14 05:21:44 -0400 (Tue, 14 Jul 2009)
New Revision: 14915
Modified:
branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
branches/community/3.3.X/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
branches/community/3.3.X/ui/componentControl/src/main/templates/htmlComponentControl.jspx
branches/community/3.3.X/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7474
patch modified and applied
Modified: branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java
===================================================================
--- branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2009-07-14 08:29:06 UTC (rev 14914)
+++ branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/component/UIComponentControl.java 2009-07-14 09:21:44 UTC (rev 14915)
@@ -34,6 +34,8 @@
import org.ajax4jsf.component.EventValueExpression;
import org.ajax4jsf.component.JavaScriptParameter;
import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSLiteral;
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
import org.apache.commons.logging.Log;
@@ -68,26 +70,38 @@
JSFunction invocation = new JSFunction("Richfaces.componentControl.performOperation");
invocation.addParameter(new JSReference("event"));
- invocation.addParameter(getEvent());
- invocation.addParameter(targetId);
- invocation.addParameter(getOperation());
- addOptions(invocation);
+ addOptions(invocation, getEvent(), targetId, getOperation());
return invocation.toScript();
}
- public void addOptions(JSFunction function) {
+ private static boolean isContextMenuEvent(String event) {
+ return ("contextmenu".equalsIgnoreCase(event) || "oncontextmenu".equalsIgnoreCase(event));
+ }
+
+ public void addOptions(JSFunction function, String event, String targetId, String operation) {
+ function.addParameter(event);
+ function.addParameter(targetId);
+ function.addParameter(operation);
+
+ boolean parametersEncoded = false;
+
String params = getEncodedParametersMap();
-
- if (params.length()!=0) {
- function.addParameter(new JSReference("function(){return{"+params+"}}"));
+ if (params.length() != 0) {
+ parametersEncoded = true;
+ //parameters should be evaluated in time of componentControl execution, not at page rendering
+ //e.g. event.clientX, that's why they're rendered in function
+ JSFunctionDefinition parametersFunction = new JSFunctionDefinition().
+ addToBody("return{").addToBody(params).addToBody("}");
+
+ function.addParameter(parametersFunction);
}
- String event = (String) getEvent();
+
boolean disableDefault = isDisableDefault();
- boolean isOnContextMenu = ("contextmenu".equalsIgnoreCase(event) || "oncontextmenu".equalsIgnoreCase(event));
- if ( isOnContextMenu ^ disableDefault ) {
- if (params.length()==0) {
- function.addParameter(new JSReference("{}"));
+ boolean isOnContextMenu = isContextMenuEvent(event);
+ if (isOnContextMenu ^ disableDefault) {
+ if (!parametersEncoded) {
+ function.addParameter(JSLiteral.EMPTY_HASH);
}
function.addParameter(disableDefault);
}
@@ -179,8 +193,7 @@
}
}
- String event = getEvent();
- return ("contextmenu".equalsIgnoreCase(event) || "oncontextmenu".equalsIgnoreCase(event));
+ return isContextMenuEvent(getEvent());
}
public void setDisableDefault(boolean disableDefault) {
Modified: branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
===================================================================
--- branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2009-07-14 08:29:06 UTC (rev 14914)
+++ branches/community/3.3.X/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2009-07-14 09:21:44 UTC (rev 14915)
@@ -21,9 +21,6 @@
package org.richfaces.renderkit;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import javax.faces.FacesException;
@@ -35,7 +32,7 @@
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
-import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIComponentControl;
import org.richfaces.component.util.HtmlUtil;
@@ -43,186 +40,137 @@
public class ComponentControlRendererBase extends HeaderResourcesRendererBase {
- /**
- * Constant for "immediate" attach timing option
- */
- private static final String IMMEDIATE = "immediate";
+ /**
+ * Constant for "immediate" attach timing option
+ */
+ private static final String IMMEDIATE = "immediate";
- /**
- * Constant for "onAvailable" attach timing option
- */
- private static final String ON_AVAILABLE = "onavailable";
+ /**
+ * Constant for "onAvailable" attach timing option
+ */
+ private static final String ON_AVAILABLE = "onavailable";
- /**
- * Constant for "onload" attach timing option
- */
- private static final String ON_LOAD = "onload";
+ /**
+ * Constant for "onload" attach timing option
+ */
+ private static final String ON_LOAD = "onload";
- protected Class<UIComponentControl> getComponentClass() {
- return UIComponentControl.class;
- }
+ protected Class<UIComponentControl> getComponentClass() {
+ return UIComponentControl.class;
+ }
- /**
- * Additional scripts.
- */
- private final InternetResource[] additionalScripts = { new org.ajax4jsf.javascript.PrototypeScript(),
- new org.ajax4jsf.javascript.AjaxScript(), getResource("/org/richfaces/renderkit/html/scripts/available.js") };
+ /**
+ * Additional scripts.
+ */
+ private final InternetResource[] additionalScripts = { new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.AjaxScript(), getResource("/org/richfaces/renderkit/html/scripts/available.js") };
- /**
- * Perform validation of the component control configuration. Throws FacesException in case validation fails.
- * @param clientId - id of the component
- * @param name - component name
- * @param attachTiming - timing options
- * @param forAttr - client ids of target components
- * @param operation - operation performed on target components
- */
- protected void checkValidity(String clientId, String name, String attachTiming, String forAttr, String operation) {
- if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
- throw new FacesException("The attachTiming attribute of the controlComponent (id='" + clientId
- + "') has an invalid value:'" + attachTiming + "'. It may have only the following values: '"
- + IMMEDIATE + "', '" + ON_LOAD + "', '" + ON_AVAILABLE + "'");
- }
-
- if (operation == null || operation.trim().length() == 0) {
- throw new FacesException("The operation attribute of the controlComponent (id='" + clientId
- + "') must be specified");
- }
- }
+ /**
+ * Perform validation of the component control configuration. Throws FacesException in case validation fails.
+ * @param clientId - id of the component
+ * @param name - component name
+ * @param attachTiming - timing options
+ * @param forAttr - client ids of target components
+ * @param operation - operation performed on target components
+ */
+ protected void checkValidity(String clientId, String name, String attachTiming, String forAttr, String operation) {
+ if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
+ throw new FacesException("The attachTiming attribute of the controlComponent (id='" + clientId
+ + "') has an invalid value:'" + attachTiming + "'. It may have only the following values: '"
+ + IMMEDIATE + "', '" + ON_LOAD + "', '" + ON_AVAILABLE + "'");
+ }
- protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
- return HtmlUtil.expandIdSelector(HtmlUtil.idsToIdSelector(selector), component, context);
- }
+ if (operation == null || operation.trim().length() == 0) {
+ throw new FacesException("The operation attribute of the controlComponent (id='" + clientId
+ + "') must be specified");
+ }
+ }
- /**
- * Gets additional scripts.
- *
- * @return array of resources
- */
- protected InternetResource[] getScripts() {
- return additionalScripts;
- }
+ protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
+ return HtmlUtil.expandIdSelector(HtmlUtil.idsToIdSelector(selector), component, context);
+ }
- /**
- * Returns String representation of object. If object is null,
- * returns empty String.
- * @param obj - object
- * @return String representation of object.
- */
- private static String convertToString(Object obj ) {
- return ( obj == null ? "" : obj.toString() );
- }
-
- private static String convertToString(List array, String separator ) {
- StringBuilder sb = new StringBuilder();
- boolean close = false;
- Iterator<Object> i = array.iterator();
- while (i.hasNext())
- {
- Object item = i.next();
- if (close) {
- sb.append(separator);
- } else {
- close = true;
- }
- sb.append(item);
- }
- return sb.toString();
- }
-
- public void getScript(FacesContext context, UIComponent component) throws IOException {
-
- UIComponentControl componentControl = (UIComponentControl) component;
- ResponseWriter writer = context.getResponseWriter();
-
- Map<String, Object> attributes = component.getAttributes();
-
- JSFunctionDefinition function = null;
- List<JSFunction> functionArray = new ArrayList<JSFunction>();
-
- String name = convertToString(attributes.get("name"));
- String attachTo = convertToString(attributes.get("attachTo"));
- String forAttr = convertToString(attributes.get("for"));
- forAttr = replaceClientIds(context, component, forAttr);
- String operation = convertToString(attributes.get("operation"));
- String attachTiming = componentControl.getAttachTiming();
- checkValidity(componentControl.getClientId(context), name, attachTiming, forAttr, operation);
- String event = convertToString(attributes.get("event"));
-
- String performScript = null;
-
- if (!"".equals(name.trim())) {
- JSFunction subFunction = new JSFunction("Richfaces.componentControl.performOperation");
- subFunction.addParameter(new JSReference("cevent"));
- subFunction.addParameter(event);
- subFunction.addParameter(forAttr);
- subFunction.addParameter(operation);
- componentControl.addOptions(subFunction);
-
- function = new JSFunctionDefinition("cevent");
- function.setName(name);
- function.addToBody(subFunction);
- performScript = function.toString();
- }
-
- if (attachTo != null && attachTo.trim().length() != 0 && !"#".equals(attachTo)) {
-
- boolean isImmediate = attachTiming.equals(IMMEDIATE);
- boolean isOnLoad = attachTiming.equals(ON_LOAD);
- boolean isOnAvailable = attachTiming.equals(ON_AVAILABLE);
-
- if (!(isImmediate || isOnLoad || isOnAvailable)) {
- // unknown value of property "attachTiming"
- return;
- }
-
- String pattern = "\\s*,\\s*";
- // "attachTo" attribute may contain several ids splitted by ","
- String[] result = attachTo.split(pattern);
- for (int i = 0; i < result.length; i++) {
- JSFunction mainFunction = null;
- if (isOnLoad) {
- mainFunction = new JSFunction("jQuery(document).ready");
- } else if (isOnAvailable) {
- UIComponent target = RendererUtils.getInstance().findComponentFor(context, component, result[i]);
- String clientId = (target != null) ? target.getClientId(context) : result[i];
- mainFunction = new JSFunction("Richfaces.onAvailable",clientId);
- } else if (isImmediate) {
- }
-
- if (mainFunction!=null)
- {
- JSFunction subFunction = new JSFunction("Richfaces.componentControl.attachEvent");
- subFunction.addParameter(replaceClientIds(context, component, result[i]));
- subFunction.addParameter(event);
- subFunction.addParameter(forAttr);
- subFunction.addParameter(operation);
- componentControl.addOptions(subFunction);
-
- function = new JSFunctionDefinition("");
- function.addToBody(subFunction);
-
- mainFunction.addParameter(function);
- functionArray.add(mainFunction);
- }
- }
- }
-
- if (!functionArray.isEmpty() || performScript!=null) {
- writer.startElement("script", componentControl);
- getUtils().writeAttribute(writer, "type", "text/javascript");
- writer.writeText("//", null);
- writer.write("<![CDATA[\n");
- if (performScript!= null) {
- writer.write(performScript);
- writer.write(";");
- }
- if (!functionArray.isEmpty()) {
- writer.write(convertToString(functionArray, ";"));
- writer.write(";");
- }
- writer.writeText("\n//", null);
- writer.write("]]>");
- writer.endElement("script");
- }
- }
+ /**
+ * Gets additional scripts.
+ *
+ * @return array of resources
+ */
+ protected InternetResource[] getScripts() {
+ return additionalScripts;
+ }
+
+ /**
+ * Returns String representation of object. If object is null,
+ * returns empty String.
+ * @param obj - object
+ * @return String representation of object.
+ */
+ private static String convertToString(Object obj ) {
+ return ( obj == null ? "" : obj.toString() );
+ }
+
+ public void writeScript(FacesContext context, UIComponent component) throws IOException {
+
+ UIComponentControl componentControl = (UIComponentControl) component;
+ ResponseWriter writer = context.getResponseWriter();
+
+ Map<String, Object> attributes = component.getAttributes();
+
+ String name = convertToString(attributes.get("name"));
+ String attachTo = convertToString(attributes.get("attachTo"));
+ String forAttr = convertToString(attributes.get("for"));
+ forAttr = replaceClientIds(context, component, forAttr);
+ String operation = convertToString(attributes.get("operation"));
+ String attachTiming = componentControl.getAttachTiming();
+ checkValidity(componentControl.getClientId(context), name, attachTiming, forAttr, operation);
+ String event = convertToString(attributes.get("event"));
+
+ JSFunctionDefinition namedFunction = null;
+ JSFunction eventFunction = null;
+
+ if (name.trim().length() != 0) {
+ JSFunction subFunction = new JSFunction("Richfaces.componentControl.performOperation");
+ subFunction.addParameter(new JSReference("event"));
+ componentControl.addOptions(subFunction, event, forAttr, operation);
+
+ namedFunction = new JSFunctionDefinition("event");
+ namedFunction.setName(name);
+ namedFunction.addToBody(subFunction);
+ }
+
+ if (attachTo != null && attachTo.trim().length() != 0 && !"#".equals(attachTo)) {
+ boolean isImmediate = attachTiming.equals(IMMEDIATE);
+ boolean isOnLoad = attachTiming.equals(ON_LOAD);
+ boolean isOnAvailable = attachTiming.equals(ON_AVAILABLE);
+
+ if (isOnLoad) {
+ eventFunction = new JSFunction("Richfaces.componentControl.attachReady");
+ } else if (isOnAvailable) {
+ eventFunction = new JSFunction("Richfaces.componentControl.attachAvailable");
+ } else if (isImmediate) {
+ eventFunction = new JSFunction("Richfaces.componentControl.attachEvent");
+ } else {
+ // unknown value of property "attachTiming"
+ return;
+ }
+
+ // "attachTo" attribute may contain several ids splitted by ","
+ String selector = replaceClientIds(context, component, attachTo);
+ eventFunction.addParameter(selector);
+ componentControl.addOptions(eventFunction, event, forAttr, operation);
+ }
+
+ if (eventFunction != null || namedFunction != null) {
+ writer.startElement(HTML.SCRIPT_ELEM, componentControl);
+ getUtils().writeAttribute(writer, HTML.TYPE_ATTR, "text/javascript");
+ if (namedFunction != null) {
+ writer.writeText(namedFunction.toScript(), component, null);
+ writer.writeText(";", component, null);
+ }
+ if (eventFunction != null) {
+ writer.writeText(eventFunction.toScript(), component, null);
+ }
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
+ }
}
\ No newline at end of file
Modified: branches/community/3.3.X/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
===================================================================
--- branches/community/3.3.X/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2009-07-14 08:29:06 UTC (rev 14914)
+++ branches/community/3.3.X/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2009-07-14 09:21:44 UTC (rev 14915)
@@ -30,14 +30,30 @@
};
Richfaces.componentControl.attachEvent = function(attachTo, aevent, forAttr, operation, params, disableDefault) {
- jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent),function(cevent) {
- Richfaces.componentControl.performOperation(cevent, aevent, forAttr, operation, params, disableDefault);
+ jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent),function(event) {
+ Richfaces.componentControl.performOperation(event, aevent, forAttr, operation, params, disableDefault);
}).each(function() {
Richfaces.componentControl.applyDecorations(this, forAttr, function(element) {
//TODO: handle component decoration
});
});
};
+
+Richfaces.componentControl.attachAvailable = function(attachTo, aevent, forAttr, operation, params, disableDefault) {
+ var ids = attachTo.split(',');
+ for (var i = 0; i < ids.length; i++) {
+ var id = ids[i];
+ Richfaces.onAvailable(id.replace(/^#|\\(:)/g, "$1"), function() {
+ Richfaces.componentControl.attachEvent(id, aevent, forAttr, operation, params, disableDefault);
+ });
+ }
+};
+
+Richfaces.componentControl.attachReady = function(attachTo, aevent, forAttr, operation, params, disableDefault) {
+ jQuery(document).ready(function() {
+ Richfaces.componentControl.attachEvent(attachTo, aevent, forAttr, operation, params, disableDefault);
+ });
+};
Richfaces.componentControl.checkDisableDefault = function (ename, disableDefault) {
if (disableDefault==undefined) {
@@ -46,15 +62,15 @@
} else {
return disableDefault;
}
-}
+};
-Richfaces.componentControl.performOperation = function( cevent, aevent, forAttr, operation, params, disableDefault) {
+Richfaces.componentControl.performOperation = function(event, aevent, forAttr, operation, params, disableDefault) {
// stop event before event isn't extended by prototype
if (Richfaces.componentControl.checkDisableDefault(aevent, disableDefault)) {
- var event = jQuery.event.fix(cevent);
- event.stopPropagation();
- event.preventDefault();
+ var fixedEvent = jQuery.event.fix(event);
+ fixedEvent.stopPropagation();
+ fixedEvent.preventDefault();
}
Richfaces.componentControl.eachComponent(forAttr, function(component) {
@@ -63,7 +79,7 @@
paramsValue = params();
}
- component[operation](cevent, paramsValue);
+ component[operation](event, paramsValue);
});
};
Modified: branches/community/3.3.X/ui/componentControl/src/main/templates/htmlComponentControl.jspx
===================================================================
--- branches/community/3.3.X/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2009-07-14 08:29:06 UTC (rev 14914)
+++ branches/community/3.3.X/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2009-07-14 09:21:44 UTC (rev 14915)
@@ -1,22 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
+<f:root xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
xmlns:ui=" http://ajax4jsf.org/cdk/ui"
xmlns:u=" http://ajax4jsf.org/cdk/u"
xmlns:x=" http://ajax4jsf.org/cdk/x"
class="org.richfaces.renderkit.html.ComponentControlRenderer"
baseclass="org.richfaces.renderkit.ComponentControlRendererBase"
- component="org.richfaces.component.UIComponentControl"
- >
+ component="org.richfaces.component.UIComponentControl">
<h:scripts>/org/richfaces/renderkit/html/scripts/jquery/jquery.js,/org/richfaces/renderkit/html/script/controlUtils.js</h:scripts>
-<f:clientid var="clientId"/>
+ <f:call name="writeScript" />
-<jsp:scriptlet>
-<![CDATA[
- getScript(context, component);
-]]>
-</jsp:scriptlet>
-
</f:root>
Modified: branches/community/3.3.X/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java
===================================================================
--- branches/community/3.3.X/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java 2009-07-14 08:29:06 UTC (rev 14914)
+++ branches/community/3.3.X/ui/componentControl/src/test/java/org/richfaces/component/ComponentControlTest.java 2009-07-14 09:21:44 UTC (rev 14915)
@@ -144,7 +144,7 @@
String eventString = null;
for (Object obj : scripts) {
HtmlScript element = (HtmlScript) obj;
- if (element.asXml().contains("Richfaces.componentControl.attachEvent")) {
+ if (element.asXml().contains("Richfaces.componentControl.attachAvailable")) {
eventString = element.asXml();
break;
}
15 years, 2 months
JBoss Rich Faces SVN: r14914 - branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-07-14 04:29:06 -0400 (Tue, 14 Jul 2009)
New Revision: 14914
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
toolTip: if direction="auto" toolTip has not appeared
https://jira.jboss.org/jira/browse/RF-7506
Modified: branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-07-14 08:24:35 UTC (rev 14913)
+++ branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2009-07-14 08:29:06 UTC (rev 14914)
@@ -50,6 +50,9 @@
public class ToolTipRenderer extends AjaxComponentRendererBase {
+ private static final String DIRECTION_AUTO = "auto";
+ private static final String DIRECTION_BOTTOM_RIGHT = "bottom-right";
+
private static final String AJAX_MODE = "ajax";
private final InternetResource[] styles = { getResource("/org/richfaces/renderkit/html/css/tooltip.xcss") };
@@ -283,7 +286,11 @@
utils.addToScriptHash(options, "onshow", showFunc);
utils.addToScriptHash(options, "disabled", toolTip.isDisabled(), "false");
- utils.addToScriptHash(options, "direction", toolTip.getDirection(), "bottom-right");
+ String direction = toolTip.getDirection();
+ if (DIRECTION_AUTO.equalsIgnoreCase(direction)) {
+ direction = DIRECTION_BOTTOM_RIGHT;
+ }
+ utils.addToScriptHash(options, "direction", direction, DIRECTION_BOTTOM_RIGHT);
utils.addToScriptHash(options, "followMouse", toolTip.isFollowMouse(), "false");
utils.addToScriptHash(options, "horizontalOffset", toolTip.getHorizontalOffset(), "10");
utils.addToScriptHash(options, "verticalOffset", toolTip.getVerticalOffset(), "10");
15 years, 2 months
JBoss Rich Faces SVN: r14913 - branches/community/3.3.X/examples/photoalbum/source.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-14 04:24:35 -0400 (Tue, 14 Jul 2009)
New Revision: 14913
Modified:
branches/community/3.3.X/examples/photoalbum/source/pom.xml
Log:
photoalbum snapshots repository added
Modified: branches/community/3.3.X/examples/photoalbum/source/pom.xml
===================================================================
--- branches/community/3.3.X/examples/photoalbum/source/pom.xml 2009-07-13 16:02:09 UTC (rev 14912)
+++ branches/community/3.3.X/examples/photoalbum/source/pom.xml 2009-07-14 08:24:35 UTC (rev 14913)
@@ -46,6 +46,12 @@
<name>Jboss Repository for Maven</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>Jboss Snapshots Repository for Maven</name>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots><enabled>true</enabled></snapshots>
+ </repository>
</repositories>
<modules>
<module>ejb</module>
15 years, 2 months
JBoss Rich Faces SVN: r14912 - in root/framework/trunk/impl/src/test/resources/META-INF: skins and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 12:02:09 -0400 (Mon, 13 Jul 2009)
New Revision: 14912
Added:
root/framework/trunk/impl/src/test/resources/META-INF/skins/
root/framework/trunk/impl/src/test/resources/META-INF/skins/DEFAULT.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/cyclic.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase1.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase2.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest_base.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/noref.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/style.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/style_base.skin.properties
root/framework/trunk/impl/src/test/resources/META-INF/skins/test.skin.properties
Log:
Missing skins test resources added
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/DEFAULT.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/DEFAULT.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/DEFAULT.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,11 @@
+customFormColor=#F5F0E7
+a=default
+
+b=&a
+
+c=&b
+
+x=xxx
+
+y=&x
+
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/cyclic.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/cyclic.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/cyclic.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,4 @@
+base.property=base.string
+
+x=&x
+
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase1.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase1.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase1.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,2 @@
+default=&a
+selfBase=&selfValue
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase2.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase2.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/dynabase2.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,2 @@
+default=&x
+selfBase=&selfValue
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,5 @@
+baseSkin=#{test.bean}
+
+self=&selfBase
+
+selfValue=itself
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest_base.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest_base.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/dynatest_base.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1 @@
+customFormColor=#AAA
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/noref.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/noref.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/noref.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,4 @@
+base.property=base.string
+
+x=&z
+
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/style.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/style.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/style.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,8 @@
+generalStyleSheet=resource\://skin/style.xcss
+intermediateTextColor=&customFormColor
+intermediateTextSize=&intermediateTextSizeBase
+
+generalTextColor=&intermediateTextColor
+
+additionalTextColor=&additionalBaseTextColor
+textColor=white.textcolor
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/style_base.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/style_base.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/style_base.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,4 @@
+intermediateTextColor=green.intermediate
+intermediateTextSizeBase=10px
+additionalBaseTextColor=&textColor
+defaultBaseTextColor=&customFormColor
\ No newline at end of file
Added: root/framework/trunk/impl/src/test/resources/META-INF/skins/test.skin.properties
===================================================================
--- root/framework/trunk/impl/src/test/resources/META-INF/skins/test.skin.properties (rev 0)
+++ root/framework/trunk/impl/src/test/resources/META-INF/skins/test.skin.properties 2009-07-13 16:02:09 UTC (rev 14912)
@@ -0,0 +1,4 @@
+base.property=base.string
+
+x=yyy
+
15 years, 2 months
JBoss Rich Faces SVN: r14911 - root/examples/trunk/components.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 09:05:13 -0400 (Mon, 13 Jul 2009)
New Revision: 14911
Modified:
root/examples/trunk/components/pom.xml
Log:
core-demo added to pom.xml
Modified: root/examples/trunk/components/pom.xml
===================================================================
--- root/examples/trunk/components/pom.xml 2009-07-13 12:26:43 UTC (rev 14910)
+++ root/examples/trunk/components/pom.xml 2009-07-13 13:05:13 UTC (rev 14911)
@@ -17,6 +17,7 @@
<packaging>pom</packaging>
<modules>
+ <module>core-demo</module>
<module>calendar-demo</module>
<module>panel-demo</module>
<module>tree-demo</module>
15 years, 2 months
JBoss Rich Faces SVN: r14910 - branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 08:26:43 -0400 (Mon, 13 Jul 2009)
New Revision: 14910
Modified:
branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
Log:
framework/api: added EMPTY_HASH and EMPTY_LIST constants to JSLiteral
Modified: branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java
===================================================================
--- branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-13 11:01:29 UTC (rev 14909)
+++ branches/community/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/JSLiteral.java 2009-07-13 12:26:43 UTC (rev 14910)
@@ -31,7 +31,22 @@
/** Javascript literal text */
private String literal;
+ private static final class ImmutableJSLiteral extends JSLiteral {
+ public ImmutableJSLiteral(String literal) {
+ super(literal);
+ }
+
+ @Override
+ public void setLiteral(String literal) {
+ throw new UnsupportedOperationException();
+ }
+ };
+
+ public static final JSLiteral EMPTY_HASH = new ImmutableJSLiteral("{}");
+
+ public static final JSLiteral EMPTY_LIST = new ImmutableJSLiteral("[]");
+
/**
* Default constructor
*/
15 years, 2 months
JBoss Rich Faces SVN: r14909 - root and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 07:01:29 -0400 (Mon, 13 Jul 2009)
New Revision: 14909
Added:
root/cdk/
root/docs/
root/examples-sandbox/
root/examples/
root/framework/
root/ui/
Removed:
cdk/
docs/
examples-sandbox/
examples/
framework/
ui/
Log:
new build layout moved under root folder
Copied: root/cdk (from rev 14908, cdk)
Copied: root/docs (from rev 14908, docs)
Copied: root/examples (from rev 14908, examples)
Copied: root/examples-sandbox (from rev 14908, examples-sandbox)
Copied: root/framework (from rev 14908, framework)
Copied: root/ui (from rev 14908, ui)
15 years, 2 months
JBoss Rich Faces SVN: r14908 - /.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 06:58:43 -0400 (Mon, 13 Jul 2009)
New Revision: 14908
Added:
root/
Log:
root folder added
15 years, 2 months
JBoss Rich Faces SVN: r14907 - in ui/trunk/components/core: src/test/java/org/ajax4jsf/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-13 06:19:10 -0400 (Mon, 13 Jul 2009)
New Revision: 14907
Modified:
ui/trunk/components/core/pom.xml
ui/trunk/components/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
Log:
UI unit test updated
Modified: ui/trunk/components/core/pom.xml
===================================================================
--- ui/trunk/components/core/pom.xml 2009-07-12 23:01:55 UTC (rev 14906)
+++ ui/trunk/components/core/pom.xml 2009-07-13 10:19:10 UTC (rev 14907)
@@ -44,5 +44,10 @@
<artifactId>richfaces-test-base</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Modified: ui/trunk/components/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java
===================================================================
--- ui/trunk/components/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2009-07-12 23:01:55 UTC (rev 14906)
+++ ui/trunk/components/core/src/test/java/org/ajax4jsf/component/ActionListenerTest.java 2009-07-13 10:19:10 UTC (rev 14907)
@@ -33,26 +33,20 @@
import javax.faces.convert.IntegerConverter;
import javax.faces.event.ActionEvent;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.test.AbstractFacesTest;
/**
* @author shura
*
*/
-public class ActionListenerTest extends AbstractAjax4JsfTestCase {
+public class ActionListenerTest extends AbstractFacesTest {
- /**
- * @param name
- */
- public ActionListenerTest(String name) {
- super(name);
- }
-
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
public void setUp() throws Exception {
super.setUp();
+ setupFacesRequest();
}
/* (non-Javadoc)
@@ -148,9 +142,8 @@
expressionFactory.createValueExpression(elContext, "#{bean.first}", Integer.TYPE);
param.setAssignToBinding(expression);
Bean bean = new Bean();
- request.setAttribute("bean", bean);
- request.addParameter("param", "123");
- externalContext.getRequestParameterMap().put("param", "123");
+ facesContext.getExternalContext().getRequestMap().put("bean", bean);
+ this.connection.addRequestParameter("param", "123");
command.addActionListener(param);
command.broadcast(new ActionEvent(command));
assertEquals(123, bean.getFirst());
15 years, 2 months
JBoss Rich Faces SVN: r14906 - in ui/trunk: version-matrix and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-07-12 19:01:55 -0400 (Sun, 12 Jul 2009)
New Revision: 14906
Modified:
ui/trunk/pom.xml
ui/trunk/version-matrix/pom.xml
Log:
ui/components: updated JSF groupId and dependencies
Modified: ui/trunk/pom.xml
===================================================================
--- ui/trunk/pom.xml 2009-07-12 22:59:51 UTC (rev 14905)
+++ ui/trunk/pom.xml 2009-07-12 23:01:55 UTC (rev 14906)
@@ -68,7 +68,7 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<scope>provided</scope>
</dependency>
Modified: ui/trunk/version-matrix/pom.xml
===================================================================
--- ui/trunk/version-matrix/pom.xml 2009-07-12 22:59:51 UTC (rev 14905)
+++ ui/trunk/version-matrix/pom.xml 2009-07-12 23:01:55 UTC (rev 14906)
@@ -87,10 +87,15 @@
<version>4.4</version>
</dependency>
<dependency>
- <groupId>javax.faces</groupId>
+ <groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>2.0.0-PR2_3</version>
+ <version>2.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </dependency>
<!-- Dependencies of JSF 2.0 -->
<!-- Included because of http://jira.codehaus.org/browse/MNG-2205 -->
15 years, 2 months