Author: nbelaevski
Date: 2010-09-06 09:40:47 -0400 (Mon, 06 Sep 2010)
New Revision: 19121
Added:
branches/RF-7560/ui/common/ui/src/main/java/org/richfaces/view/facelets/TagHandlerUtils.java
Modified:
branches/RF-7560/core/api/src/main/java/org/richfaces/application/configuration/ConfigurationServiceHelper.java
branches/RF-7560/core/impl/src/main/java/org/richfaces/application/CoreConfiguration.java
branches/RF-7560/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/ActionListenerHandler.java
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/LazyActionListener.java
branches/RF-7560/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
branches/RF-7560/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java
Log:
RF-7560
Modified:
branches/RF-7560/core/api/src/main/java/org/richfaces/application/configuration/ConfigurationServiceHelper.java
===================================================================
---
branches/RF-7560/core/api/src/main/java/org/richfaces/application/configuration/ConfigurationServiceHelper.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/core/api/src/main/java/org/richfaces/application/configuration/ConfigurationServiceHelper.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -31,6 +31,8 @@
*/
public final class ConfigurationServiceHelper {
+ private ConfigurationServiceHelper() {}
+
public static final Boolean getBooleanConfigurationValue(FacesContext facesContext,
Enum<?> key) {
return
ServiceTracker.getService(ConfigurationService.class).getBooleanValue(facesContext, key);
}
Modified:
branches/RF-7560/core/impl/src/main/java/org/richfaces/application/CoreConfiguration.java
===================================================================
---
branches/RF-7560/core/impl/src/main/java/org/richfaces/application/CoreConfiguration.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/core/impl/src/main/java/org/richfaces/application/CoreConfiguration.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -22,7 +22,6 @@
package org.richfaces.application;
import org.richfaces.application.configuration.ConfigurationItem;
-import org.richfaces.skin.Skin;
/**
* @author Nick Belaevski
@@ -49,7 +48,7 @@
* Name of web application init parameter for current skin . Can be simple
* String for non-modified name, or EL-expression for calculate current
* skin. If EL evaluated to <code>String</code> - used as skin name,
if to
- * instance of {@link Skin } - used this instance. by default -
+ * instance of {@link org.richfaces.Skin } - used this instance. by default -
* "org.richfaces.skin"
*/
@ConfigurationItem(names = SKIN_PARAM_NAME)
Modified:
branches/RF-7560/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java
===================================================================
---
branches/RF-7560/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/core/impl/src/test/java/org/richfaces/resource/ResourceHandlerImplTest.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -50,6 +50,8 @@
import org.richfaces.application.ServicesFactory;
import org.richfaces.application.ServicesFactoryImpl;
import org.richfaces.application.Uptime;
+import org.richfaces.application.configuration.ConfigurationService;
+import org.richfaces.application.configuration.ConfigurationServiceImpl;
import org.richfaces.util.Util;
import com.gargoylesoftware.htmlunit.Cache;
@@ -250,6 +252,7 @@
injector.setInstance(org.richfaces.cache.Cache.class,mockCache);
injector.setInstance(Uptime.class, new Uptime());
injector.setInstance(DependencyInjector.class, new
DependencyInjectionServiceImpl());
+ injector.setInstance(ConfigurationService.class, new
ConfigurationServiceImpl());
}
}));
Copied:
branches/RF-7560/ui/common/ui/src/main/java/org/richfaces/view/facelets/TagHandlerUtils.java
(from rev 19094,
trunk/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/TagHandlerUtils.java)
===================================================================
---
branches/RF-7560/ui/common/ui/src/main/java/org/richfaces/view/facelets/TagHandlerUtils.java
(rev 0)
+++
branches/RF-7560/ui/common/ui/src/main/java/org/richfaces/view/facelets/TagHandlerUtils.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.richfaces.view.facelets;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.AttachedObjectHandler;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class TagHandlerUtils {
+
+ // TODO - is that implementation dependency?
+ private static final String JAVAX_FACES_RETARGETABLE_HANDLERS =
"javax.faces.RetargetableHandlers";
+
+ private TagHandlerUtils() {
+ //utility class constructor
+ }
+
+ public static List<AttachedObjectHandler>
getOrCreateRetargetableHandlersList(UIComponent component) {
+ Map<String, Object> attrs = component.getAttributes();
+ @SuppressWarnings({
+ "unchecked"}) List<AttachedObjectHandler> list =
+ (List<AttachedObjectHandler>)
attrs.get(JAVAX_FACES_RETARGETABLE_HANDLERS);
+
+ if (list == null) {
+ list = new ArrayList<AttachedObjectHandler>();
+ attrs.put(JAVAX_FACES_RETARGETABLE_HANDLERS, list);
+ }
+
+ return list;
+ }
+
+ public static <T> Class<? extends T> loadClass(String className,
Class<T> type)
+ throws ClassNotFoundException, ClassCastException {
+
+ ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+ Class<?> loadedClass = Class.forName(className, false, ccl);
+
+ return loadedClass.asSubclass(type);
+ }
+
+}
Modified:
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/ActionListenerHandler.java
===================================================================
---
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/ActionListenerHandler.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/ActionListenerHandler.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -40,6 +40,8 @@
import javax.faces.view.facelets.TagException;
import javax.faces.view.facelets.TagHandler;
+import org.richfaces.view.facelets.TagHandlerUtils;
+
/**
* @author Nick Belaevski
*
Modified:
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java
===================================================================
---
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/AjaxHandler.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -47,6 +47,7 @@
import org.ajax4jsf.component.behavior.AjaxBehavior;
import org.richfaces.component.AbstractAttachQueue;
+import org.richfaces.view.facelets.TagHandlerUtils;
import org.richfaces.view.facelets.html.BehaviorStack.BehaviorInfo;
import org.richfaces.view.facelets.tag.AjaxBehaviorRule;
Modified:
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/LazyActionListener.java
===================================================================
---
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/LazyActionListener.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/ui/core/ui/src/main/java/org/richfaces/view/facelets/html/LazyActionListener.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -32,6 +32,7 @@
import org.richfaces.cdk.annotations.Event;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.view.facelets.TagHandlerUtils;
/**
* @author Nick Belaevski
Modified:
branches/RF-7560/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
===================================================================
---
branches/RF-7560/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -57,12 +57,12 @@
HtmlElement previous = getPreviousButton(page, scrollerId);
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// currently selected digital button
HtmlElement dc1 = getDigitalButton(page, scrollerId, 1);
assertEquals("span", dc1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
dc1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
dc1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// digital buttons
HtmlElement d2 = getDigitalButton(page, scrollerId, 2);
@@ -88,8 +88,8 @@
// next/fastForward/last buttons with arrows
HtmlElement next = getNextButton(page, scrollerId);
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
- assertEquals("javascript:void(0);",
next.getAttribute(HTML.HREF_ATTR));
+ assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("javascript:void(0);",
next.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement fastForward = getFastForwardButton(page, scrollerId);
assertEquals("a", fastForward.getNodeName());
@@ -151,12 +151,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -171,12 +171,12 @@
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -198,12 +198,12 @@
next.click();
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller outside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -218,12 +218,12 @@
HtmlElement currentDigital2 = getDigitalButton(page, secondScrollerId, i);
assertEquals("span", currentDigital2.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital2.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// if scroller inside dataTable has switched
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
- assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-dtl rf-ds-cur",
currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// check if page has switched
assertEquals(i + " page content", getCurrentPageContent(page, i));
@@ -443,7 +443,7 @@
assertEquals("rf-ds-btn rf-ds-r",
last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
last = getFastForwardButton(page, secondScrollerId);
@@ -456,7 +456,7 @@
assertEquals("rf-ds-btn rf-ds-r",
last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-r",
next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is disabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -470,7 +470,7 @@
assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
@@ -480,10 +480,10 @@
assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l rf-ds-dis",
previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private void checkLastPageButtons(HtmlPage page, String firstScrollerId, String
secondScrollerId) throws Exception {
@@ -499,7 +499,7 @@
assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
next.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
@@ -513,7 +513,7 @@
assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
next.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-r rf-ds-dis",
next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is enabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -527,7 +527,7 @@
assertEquals("rf-ds-btn rf-ds-l",
first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l",
previous.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l",
previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
@@ -540,7 +540,7 @@
assertEquals("rf-ds-btn rf-ds-l",
first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-l",
previous.getAttribute(HTML.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-l",
previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private String getCurrentPageContent(HtmlPage page, int i) throws Exception {
Modified:
branches/RF-7560/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java
===================================================================
---
branches/RF-7560/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java 2010-09-03
18:18:05 UTC (rev 19120)
+++
branches/RF-7560/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/ChangeExpandListenerHandler.java 2010-09-06
13:40:47 UTC (rev 19121)
@@ -22,10 +22,6 @@
package org.richfaces.view.facelets.html;
-import org.richfaces.event.ChangeExpandEvent;
-import org.richfaces.event.ChangeExpandListener;
-import org.richfaces.event.ChangeExpandSource;
-
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -33,6 +29,10 @@
import javax.faces.view.facelets.FaceletContext;
import javax.faces.view.facelets.TagConfig;
+import org.richfaces.event.ChangeExpandEvent;
+import org.richfaces.event.ChangeExpandListener;
+import org.richfaces.event.ChangeExpandSource;
+
/**
*
* @author akolonitsky