Author: nbelaevski
Date: 2010-10-27 11:07:36 -0400 (Wed, 27 Oct 2010)
New Revision: 19690
Added:
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java
branches/RF-7817/ui/output/ui/richfaces-suppressions.xml
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
branches/RF-7817/ui/output/ui/src/test/resources/org/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
Removed:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
Modified:
branches/RF-7817/ui/output/api/pom.xml
branches/RF-7817/ui/output/ui/pom.xml
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml
branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
Log:
Merged revisions
19156-19157,19159-19160,19176,19186-19187,19190,19194,19196,19199,19203-19204,19231-19234,19248-19249,19255-19256,19258-19262,19276,19279-19281,19283,19285,19291-19299,19307,19312,19315,19318-19319,19325,19341-19342,19345-19351,19353-19355,19358-19359,19364,19367-19369,19371,19374-19377,19379-19385,19387,19393-19394,19400,19402-19404,19418-19422,19426,19430-19431,19434-19441,19443-19444,19446,19468,19470,19477,19491,19498-19499,19501,19504,19506-19507,19517-19519,19525,19542-19543,19548,19550,19555,19557,19560-19561,19565-19566,19571-19573,19582-19585,19592-19593,19599,19601-19602,19613,19646,19657-19659,19665,19671-19674
via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
Modified: branches/RF-7817/ui/output/api/pom.xml
===================================================================
--- branches/RF-7817/ui/output/api/pom.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/api/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -34,6 +34,14 @@
<name>Richfaces UI Components: Output API</name>
<packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<!-- runtime -->
<dependency>
Copied: branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java
(from rev 19674, trunk/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java)
===================================================================
--- branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java
(rev 0)
+++
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderAlignment.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,9 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Aug 24, 2010
+ */
+public enum HeaderAlignment {
+ left, center, right, bottom, top
+}
Copied: branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java
(from rev 19674, trunk/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java)
===================================================================
--- branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java
(rev 0)
+++
branches/RF-7817/ui/output/api/src/main/java/org/richfaces/HeaderPosition.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,9 @@
+package org.richfaces;
+
+/**
+ * @author akolonitsky
+ * @since Aug 24, 2010
+ */
+public enum HeaderPosition {
+ top, left, right, bottom
+}
Modified: branches/RF-7817/ui/output/ui/pom.xml
===================================================================
--- branches/RF-7817/ui/output/ui/pom.xml 2010-10-27 15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/pom.xml 2010-10-27 15:07:36 UTC (rev 19690)
@@ -38,11 +38,10 @@
<build>
<plugins>
<plugin>
- <!-- Checkstyle only required here because suppressions needed -->
- <artifactId>maven-checkstyle-plugin</artifactId>
- <configuration>
-
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
- </configuration>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+
<suppressionsLocation>${project.basedir}/richfaces-suppressions.xml</suppressionsLocation>
+ </configuration>
</plugin>
<plugin>
<groupId>org.richfaces.cdk</groupId>
@@ -69,6 +68,12 @@
<groupId>org.richfaces.ui.output</groupId>
<artifactId>richfaces-ui-output-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <version>1.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<scm>
Copied: branches/RF-7817/ui/output/ui/richfaces-suppressions.xml (from rev 19674,
trunk/ui/output/ui/richfaces-suppressions.xml)
===================================================================
--- branches/RF-7817/ui/output/ui/richfaces-suppressions.xml (rev
0)
+++ branches/RF-7817/ui/output/ui/richfaces-suppressions.xml 2010-10-27 15:07:36 UTC (rev
19690)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE suppressions PUBLIC
+ "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+ "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+
+<suppressions>
+ <suppress checks="IllegalCatch"
files="AbstractTogglePanel.java" />
+</suppressions>
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,344 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * UIProgressBar.java Date created: 19.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.component;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.html.ProgressBarBaseRenderer;
+import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
+
+/**
+ * Class provides base component class for progress bar
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+@JsfComponent(tag = @Tag(type = TagType.Facelets), renderer = @JsfRenderer(type =
"org.richfaces.ProgressBarRenderer"))
+public abstract class AbstractProgressBar extends UIComponentBase{
+
+ /** Component type */
+ public static final String COMPONENT_TYPE = "org.richfaces.ProgressBar";
+
+ /** Component family */
+ public static final String COMPONENT_FAMILY = "org.richfaces.ProgressBar";
+
+ /** Request parameter name containing component state to render */
+ public static final String FORCE_PERCENT_PARAM = "forcePercent";
+
+ /** Percent param name */
+ private static final String PERCENT_PARAM = "percent";
+
+ /** Max value attribute name */
+ private static final String MAXVALUE = "maxValue";
+
+ /** Min value attribute name */
+ private static final String MINVALUE = "minValue";
+
+ /** Enabled attribute name */
+ private static final String ENABLED = "enabled";
+
+ /** Enabled attribute name */
+ private static final String INTERVAL = "interval";
+
+ /** Markup data key */
+ private static final String MARKUP = "markup";
+
+ /** Complete class attribute name */
+ private static final String COMPLETECLASS = "completeClass";
+
+ /** Remain class attribute name */
+ private static final String REMAINCLASS = "remainClass";
+
+ /** Style class attribute name */
+ private static final String STYLECLASS = "styleClass";
+
+ /** Context key */
+ private static final String CONTEXT = "context";
+ @Attribute(events = @EventName("click"))
+ public abstract String getOnclick();
+
+ @Attribute(events = @EventName("dblclick"))
+ public abstract String getOndblclick();
+
+ @Attribute(events = @EventName("mousedown"))
+ public abstract String getOnmousedown();
+
+ @Attribute(events = @EventName("mouseup"))
+ public abstract String getOnmouseup();
+
+ @Attribute(events = @EventName("mouseover"))
+ public abstract String getOnmouseover();
+
+ @Attribute(events = @EventName("mousemove"))
+ public abstract String getOnmousemove();
+
+ @Attribute(events = @EventName("mouseout"))
+ public abstract String getOnmouseout();
+
+ @Attribute(events = @EventName("submit"))
+ public abstract String getOnsubmit();
+
+
+ @Attribute
+ public abstract String getLabel();
+
+ @Attribute
+ public abstract Object getData();
+ public abstract void setData(Object data);
+ @Attribute(defaultValue = "1000")
+ public abstract int getInterval();
+
+ @Attribute(defaultValue = "false")
+ public abstract boolean isEnabled();
+
+ @Attribute(events = @EventName("beforedomupdate"))
+ public abstract String getOnbeforedomupdate();
+
+ @Attribute(events = @EventName("complete"))
+ public abstract String getOncomplete();
+
+ @Attribute
+ public abstract String getCompleteClass();
+
+ @Attribute
+ public abstract String getFinishClass();
+
+ @Attribute
+ public abstract String getInitialClass();
+
+ @Attribute
+ public abstract String getRemainClass();
+
+ @Attribute
+ public abstract String getFocus();
+
+ @Attribute
+ public abstract String getReRenderAfterComplete();
+
+ @Attribute
+ public abstract String getMode();
+
+ @Attribute
+ public abstract int getMaxValue();
+
+ @Attribute
+ public abstract int getMinValue();
+
+ @Attribute
+ public abstract Object getValue();
+
+ @Attribute
+ public abstract Object getParameters();
+
+
+ /**
+ * Method performs broadcasting of jsf events to progress bar component
+ *
+ * @param event -
+ * Faces Event instance
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Map<String, String> params =
facesContext.getExternalContext().getRequestParameterMap();
+ String clientId = this.getClientId(facesContext);
+
+ if (!params.containsKey(clientId)) {
+ return;
+ }
+ if (!params.containsKey(FORCE_PERCENT_PARAM)
+ && params.containsKey(PERCENT_PARAM)) {
+ Number value = NumberUtils.getNumber(this.getAttributes().get(
+ HtmlConstants.VALUE_ATTRIBUTE));
+ PartialViewContext pvc =
FacesContext.getCurrentInstance().getPartialViewContext();
+ pvc.getRenderIds().remove(
+ this.getClientId());
+ this.setData(getResponseData(value, facesContext));
+
+ } else if (params.containsKey(FORCE_PERCENT_PARAM)) {
+ PartialViewContext pvc =
FacesContext.getCurrentInstance().getPartialViewContext();
+ pvc.getRenderIds().add(this.getClientId());
+ String forcedState = params.get(FORCE_PERCENT_PARAM);
+ if ("completeState".equals(forcedState)) {
+ Object reRender =
this.getAttributes().get("reRenderAfterComplete");
+ Set<String> ajaxRegions =
CoreAjaxRendererUtils.asIdsSet(reRender);
+ if (ajaxRegions != null) {
+ for (Iterator<String> iter = ajaxRegions.iterator();
iter.hasNext();) {
+ String id = iter.next();
+ pvc.getExecuteIds().add(id);
+ pvc.getRenderIds().add(id);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns ajax response data
+ *
+ * @param uiComponent
+ * @param percent
+ * @return
+ */
+ private Map<Object, Object> getResponseData(Number value,
+ FacesContext facesContext) {
+
+ ProgressBarBaseRenderer renderer = (ProgressBarBaseRenderer) this
+ .getRenderer(facesContext);
+
+ Map<Object, Object> map = new HashMap<Object, Object>();
+ map.put(HtmlConstants.VALUE_ATTRIBUTE, value);
+ map.put(INTERVAL, this.getInterval());
+
+ if (this.getAttributes().get(HtmlConstants.STYLE_ATTRIBUTE) != null) {
+ map.put(HtmlConstants.STYLE_ATTRIBUTE, this.getAttributes()
+ .get(HtmlConstants.STYLE_ATTRIBUTE));
+ }
+
+ map.put(ENABLED, (Boolean) this.getAttributes().get(ENABLED));
+
+ if (!isSimple(renderer)) {
+ map.put(MARKUP, getMarkup(facesContext, renderer));
+ map.put(CONTEXT, getContext(renderer, value));
+ }
+
+ addStyles2Responce(map, COMPLETECLASS, this.getAttributes().get(
+ COMPLETECLASS));
+ addStyles2Responce(map, REMAINCLASS, this.getAttributes().get(
+ REMAINCLASS));
+ addStyles2Responce(map, STYLECLASS, this.getAttributes().get(
+ STYLECLASS));
+ return map;
+
+ }
+
+ /**
+ * Returns context for macrosubstitution
+ *
+ * @param renderer
+ * @param percent
+ * @return
+ */
+ private JSLiteral getContext(ProgressBarBaseRenderer renderer,
+ Number percent) {
+ StringBuffer buffer = new StringBuffer("{");
+ buffer.append("\"value\":");
+ buffer.append(ScriptUtils.toScript(percent.toString())).append(",");
+ buffer.append("\"minValue\":");
+ buffer.append(
+ ScriptUtils.toScript(this.getAttributes().get(MINVALUE)
+ .toString())).append(",");
+ buffer.append("\"maxValue\":");
+ buffer.append(ScriptUtils.toScript(this.getAttributes().get(MAXVALUE)
+ .toString()));
+
+ String parameters = handleParameters(renderer.getParameters(this));
+ if (parameters != null) {
+ buffer.append(",");
+ buffer.append(parameters);
+ }
+ buffer.append("}");
+ return new JSLiteral(buffer.toString());
+ }
+
+ private String handleParameters(String str){
+ if (str != null && str.length() > 0) {
+ StringBuilder s = new StringBuilder();
+ while(str.indexOf(":") != -1){
+ String a = str.substring(0, str.indexOf(":"));
+ str = str.substring(str.indexOf(":") );
+ s.append("\"");
+ s.append(a);
+ s.append("\"");
+ if (str.indexOf(",") != -1) {
+ String b = str.substring(0, str.indexOf(",") +1);
+ str = str.substring(str.indexOf(",") +1 );
+ s.append(b);
+ } else{
+ s.append(str);
+ return s.toString();
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return true if markup is simple
+ *
+ * @return
+ */
+ private boolean isSimple(ProgressBarBaseRenderer renderer) {
+ return renderer.isSimpleMarkup(this);
+ }
+
+ /**
+ * Returns label markup
+ *
+ * @param context
+ * @param renderer
+ * @return
+ */
+ private String getMarkup(FacesContext context,
+ ProgressBarBaseRenderer renderer) {
+ return renderer.getMarkup(context, this).toString();
+ }
+
+ /**
+ * Add component classes to ajax response
+ *
+ * @param buffer
+ * @param attr
+ * @param newValue
+ */
+ private void addStyles2Responce(Map<Object, Object> map, String key,
+ Object className) {
+ if (className != null) {
+ map.put(key, className);
+ }
+ }
+
+}
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+public abstract class AbstractTabPanel extends UITogglePanel {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanel";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TabPanel";
+
+ protected AbstractTabPanel() {
+ setRendererType("org.richfaces.TabPanel");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ @Override
+ public String getActiveItem() {
+ String res = super.getActiveItem();
+ if (res == null) {
+ res = getFirstItem().getName();
+ }
+ return res;
+ }
+}
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -459,9 +459,9 @@
}
public AbstractTogglePanelItem getItemByIndex(final int index) {
- List<AbstractTogglePanelItem> children = getRenderedChildren();
+ List<AbstractTogglePanelItem> children = getRenderedItems();
if (isCycledSwitching()) {
- int size = getRenderedChildren().size();
+ int size = getRenderedItems().size();
return children.get((size + index) % size);
} else if (index < 0 || index >= children.size()) {
return null;
@@ -470,7 +470,7 @@
}
}
- private List<AbstractTogglePanelItem> getRenderedChildren() {
+ public List<AbstractTogglePanelItem> getRenderedItems() {
List<AbstractTogglePanelItem> res = new
ArrayList<AbstractTogglePanelItem>(getChildCount());
for (UIComponent child : getChildren()) {
if (child.isRendered() && child instanceof AbstractTogglePanelItem)
{
@@ -516,7 +516,7 @@
}
public AbstractTogglePanelItem getLastItem() {
- return getItemByIndex(getRenderedChildren().size() - 1);
+ return getItemByIndex(getRenderedItems().size() - 1);
}
public int getChildIndex(String name) {
@@ -524,7 +524,7 @@
throw new IllegalArgumentException("Name is required parameter.");
}
- List<AbstractTogglePanelItem> items = getRenderedChildren();
+ List<AbstractTogglePanelItem> items = getRenderedItems();
for (int ind = 0; ind < items.size(); ind++) {
if (name.equals(items.get(ind).getName())) {
return ind;
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanelTitledItem.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -41,7 +41,7 @@
public enum HeaderStates {
active("act"),
inactive("inact"),
- disable("dis");
+ disabled("dis");
private final String abbreviation;
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java (from
rev 19674, trunk/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/NumberUtils.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,40 @@
+package org.richfaces.component;
+
+import java.math.BigDecimal;
+
+public final class NumberUtils {
+ private NumberUtils() {
+
+ }
+ /**
+ * Converts value attr to number value
+ *
+ * @param v -
+ * value attr
+ * @return result
+ */
+ public static Number getNumber(Object v) {
+ Number result = null;
+ if (v != null) {
+ try {
+ if (v instanceof String) { // String
+ result = Double.parseDouble((String) v);
+ } else {
+ Number n = (Number) v;
+ if ((n instanceof BigDecimal) || (n instanceof Double) // Double
+ // or
+ //
BigDecimal
+ || (n instanceof Float)) {
+ result = n.floatValue();
+ } else if (n instanceof Integer || n instanceof Long) { // Integer
+ result = n.longValue();
+ }
+ }
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ return result;
+ }
+ return new Integer(0);
+ }
+}
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/UITogglePanelTitledItem.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -44,7 +44,7 @@
}
public String getHeader() {
- return (String) getStateHelper().eval(PropertyKeys.header);
+ return (String) getStateHelper().eval(PropertyKeys.header, getName());
}
public void setHeader(String header) {
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -25,6 +25,7 @@
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehaviorContext;
+import javax.faces.context.FacesContext;
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.richfaces.component.AbstractTogglePanel;
@@ -97,17 +98,26 @@
+ comp.getClientId(getFacesContext()) + ") has not been
found.");
}
} else {
- UIComponent control = comp;
- while (control != null) {
- if (control instanceof AbstractTogglePanel) {
- return (AbstractTogglePanel) control;
- }
+ return getEnclosedPanel(comp);
+ }
+ }
- control = control.getParent();
+ public static AbstractTogglePanel getEnclosedPanel(UIComponent comp) {
+ if (comp == null) {
+ return null;
+ }
+
+ UIComponent control = comp;
+ while (control != null) {
+ if (control instanceof AbstractTogglePanel) {
+ return (AbstractTogglePanel) control;
}
- throw new FacesException("Parent panel for control (id="
- + comp.getClientId(getFacesContext()) + ") has not been
found.");
+
+ control = control.getParent();
}
+
+ throw new FacesException("Parent panel for control (id="
+ + comp.getClientId(FacesContext.getCurrentInstance()) + ") has not
been found.");
}
@Override
@@ -125,4 +135,4 @@
// setTargetPanel((String) value);
// }
}
-}
\ No newline at end of file
+}
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlAccordionItem.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -22,20 +22,22 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
public class HtmlAccordionItem extends UITogglePanelTitledItem implements
ClientBehaviorHolder {
- public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
+ public static final String COMPONENT_TYPE = "org.richfaces.AccordionItem";
public static final String COMPONENT_FAMILY =
"org.richfaces.TogglePanelTitledItem";
@@ -94,8 +96,12 @@
return COMPONENT_FAMILY;
}
+ public HtmlAccordion getAccordion() {
+ return (HtmlAccordion) ToggleControl.getEnclosedPanel(this);
+ }
+
public String getHeaderClassActive() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassActive);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassActive,
getAccordion().getItemHeaderClassActive());
}
public void setHeaderClassActive(String headerClassActive) {
@@ -103,7 +109,7 @@
}
public String getHeaderClassDisabled() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled,
getAccordion().getItemHeaderClassDisabled());
}
public void setHeaderClassDisabled(String headerClassDisabled) {
@@ -111,7 +117,7 @@
}
public String getHeaderClassInactive() {
- return (String) getStateHelper().eval(PropertyKeys.headerClassInactive);
+ return (String) getStateHelper().eval(PropertyKeys.headerClassInactive,
getAccordion().getItemHeaderClassInactive());
}
public void setHeaderClassInactive(String headerClassInactive) {
@@ -119,7 +125,7 @@
}
public String getHeaderClass() {
- return (String) getStateHelper().eval(PropertyKeys.headerClass);
+ return (String) getStateHelper().eval(PropertyKeys.headerClass,
getAccordion().getItemHeaderClass());
}
public void setHeaderClass(String headerClass) {
@@ -135,7 +141,7 @@
}
public String getContentClass() {
- return (String) getStateHelper().eval(PropertyKeys.contentClass);
+ return (String) getStateHelper().eval(PropertyKeys.contentClass,
getAccordion().getItemContentClass());
}
public void setContentClass(String contentClass) {
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTab.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,309 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component.html;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class HtmlTab extends UITogglePanelTitledItem implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanelItem";
+
+ public static final String COMPONENT_FAMILY =
"org.richfaces.TogglePanelTitledItem";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "headerclick",
+ "headerdblclick",
+ "headermousedown",
+ "headermousemove",
+ "headermouseup",
+ "enter",
+ "leave",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup"
+ ));
+
+
+ public enum PropertyKeys {
+ headerClassActive,
+ headerClassDisabled,
+ headerClassInactive,
+ headerClass,
+ headerStyle,
+ contentClass,
+ onheaderclick,
+ onheaderdblclick,
+ onheadermousedown,
+ onheadermousemove,
+ onheadermouseup,
+ onenter,
+ onleave,
+ lang,
+ title,
+ style,
+ styleClass,
+ dir,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup
+ }
+
+ public HtmlTab() {
+ setRendererType("org.richfaces.Tab");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public HtmlTabPanel getTabPanel() {
+ return (HtmlTabPanel) this.getParent();
+ }
+
+ public String getHeaderClassActive() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassActive,
getTabPanel().getTabHeaderClassActive());
+ }
+
+ public void setHeaderClassActive(String headerClassActive) {
+ getStateHelper().put(PropertyKeys.headerClassActive, headerClassActive);
+ }
+
+ public String getHeaderClassDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassDisabled,
getTabPanel().getTabHeaderClassDisabled());
+ }
+
+ public void setHeaderClassDisabled(String headerClassDisabled) {
+ getStateHelper().put(PropertyKeys.headerClassDisabled, headerClassDisabled);
+ }
+
+ public String getHeaderClassInactive() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClassInactive,
getTabPanel().getTabHeaderClassInactive());
+ }
+
+ public void setHeaderClassInactive(String headerClassInactive) {
+ getStateHelper().put(PropertyKeys.headerClassInactive, headerClassInactive);
+ }
+
+ public String getHeaderClass() {
+ return (String) getStateHelper().eval(PropertyKeys.headerClass,
getTabPanel().getTabHeaderClass());
+ }
+
+ public void setHeaderClass(String headerClass) {
+ getStateHelper().put(PropertyKeys.headerClass, headerClass);
+ }
+
+ public String getHeaderStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.headerStyle);
+ }
+
+ public void setHeaderStyle(String headerStyle) {
+ getStateHelper().put(PropertyKeys.headerStyle, headerStyle);
+ }
+
+ public String getContentClass() {
+ return (String) getStateHelper().eval(PropertyKeys.contentClass,
getTabPanel().getTabContentClass());
+ }
+
+ public void setContentClass(String contentClass) {
+ getStateHelper().put(PropertyKeys.contentClass, contentClass);
+ }
+
+ public String getOnheaderclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onheaderclick);
+ }
+
+ public void setOnheaderclick(String onheaderclick) {
+ getStateHelper().put(PropertyKeys.onheaderclick, onheaderclick);
+ }
+
+ public String getOnheaderdblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onheaderdblclick);
+ }
+
+ public void setOnheaderdblclick(String onheaderdblclick) {
+ getStateHelper().put(PropertyKeys.onheaderdblclick, onheaderdblclick);
+ }
+
+ public String getOnheadermousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermousedown);
+ }
+
+ public void setOnheadermousedown(String onheadermousedown) {
+ getStateHelper().put(PropertyKeys.onheadermousedown, onheadermousedown);
+ }
+
+ public String getOnheadermousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermousemove);
+ }
+
+ public void setOnheadermousemove(String onheadermousemove) {
+ getStateHelper().put(PropertyKeys.onheadermousemove, onheadermousemove);
+ }
+
+ public String getOnheadermouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onheadermouseup);
+ }
+
+ public void setOnheadermouseup(String onheadermouseup) {
+ getStateHelper().put(PropertyKeys.onheadermouseup, onheadermouseup);
+ }
+
+ public String getOnenter() {
+ return (String) getStateHelper().eval(PropertyKeys.onenter);
+ }
+
+ public void setOnenter(String onenter) {
+ getStateHelper().put(PropertyKeys.onenter, onenter);
+ }
+
+ public String getOnleave() {
+ return (String) getStateHelper().eval(PropertyKeys.onleave);
+ }
+
+ public void setOnleave(String onleave) {
+ getStateHelper().put(PropertyKeys.onleave, onleave);
+ }
+
+ public String getLang() {
+ return (String) getStateHelper().eval(PropertyKeys.lang);
+ }
+
+ public void setLang(String lang) {
+ getStateHelper().put(PropertyKeys.lang, lang);
+ }
+
+ public String getTitle() {
+ return (String) getStateHelper().eval(PropertyKeys.title);
+ }
+
+ public void setTitle(String title) {
+ getStateHelper().put(PropertyKeys.title, title);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getDir() {
+ return (String) getStateHelper().eval(PropertyKeys.dir);
+ }
+
+ public void setDir(String dir) {
+ getStateHelper().put(PropertyKeys.dir, dir);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTabPanel.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,265 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component.html;
+
+import org.richfaces.HeaderPosition;
+import org.richfaces.HeaderAlignment;
+import org.richfaces.component.AbstractTabPanel;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class HtmlTabPanel extends AbstractTabPanel implements ClientBehaviorHolder {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.TabPanel";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.TabPanel";
+
+ private static final Collection<String> EVENT_NAMES =
Collections.unmodifiableCollection(Arrays.asList(
+ "itemchange",
+ "beforeitemchange",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup"
+ ));
+
+
+ public enum PropertyKeys {
+ headerPosition,
+ headerAlignment,
+ tabHeaderClassActive,
+ tabHeaderClassDisabled,
+ tabHeaderClassInactive,
+ tabContentClass,
+ tabHeaderClass,
+ onitemchange,
+ onbeforeitemchange,
+ lang,
+ title,
+ style,
+ styleClass,
+ dir,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup
+ }
+
+ public HtmlTabPanel() {
+ setRendererType("org.richfaces.TabPanel");
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ public HeaderPosition getHeaderPosition() {
+ return (HeaderPosition) getStateHelper().eval(PropertyKeys.headerPosition);
+ }
+
+ public void setHeaderPosition(HeaderPosition headerPosition) {
+ getStateHelper().put(PropertyKeys.headerPosition, headerPosition);
+ }
+
+ public HeaderAlignment getHeaderAlignment() {
+ return (HeaderAlignment) getStateHelper().eval(PropertyKeys.headerAlignment);
+ }
+
+ public void setHeaderAlignment(HeaderAlignment headerAlignment) {
+ getStateHelper().put(PropertyKeys.headerAlignment, headerAlignment);
+ }
+
+ public String getTabHeaderClassActive() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassActive);
+ }
+
+ public void setTabHeaderClassActive(String tabHeaderClassActive) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassActive, tabHeaderClassActive);
+ }
+
+ public String getTabHeaderClassDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassDisabled);
+ }
+
+ public void setTabHeaderClassDisabled(String tabHeaderClassDisabled) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassDisabled,
tabHeaderClassDisabled);
+ }
+
+ public String getTabHeaderClassInactive() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClassInactive);
+ }
+
+ public void setTabHeaderClassInactive(String tabHeaderClassInactive) {
+ getStateHelper().put(PropertyKeys.tabHeaderClassInactive,
tabHeaderClassInactive);
+ }
+
+ public String getTabContentClass() {
+ return (String) getStateHelper().eval(PropertyKeys.tabContentClass);
+ }
+
+ public void setTabContentClass(String tabContentClass) {
+ getStateHelper().put(PropertyKeys.tabContentClass, tabContentClass);
+ }
+
+ public String getTabHeaderClass() {
+ return (String) getStateHelper().eval(PropertyKeys.tabHeaderClass);
+ }
+
+ public void setTabHeaderClass(String tabHeaderClass) {
+ getStateHelper().put(PropertyKeys.tabHeaderClass, tabHeaderClass);
+ }
+
+ public String getOnitemchange() {
+ return (String) getStateHelper().eval(PropertyKeys.onitemchange);
+ }
+
+ public void setOnitemchange(String onitemchange) {
+ getStateHelper().put(PropertyKeys.onitemchange, onitemchange);
+ }
+
+ public String getOnbeforeitemchange() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeitemchange);
+ }
+
+ public void setOnbeforeitemchange(String onbeforeitemchange) {
+ getStateHelper().put(PropertyKeys.onbeforeitemchange, onbeforeitemchange);
+ }
+
+ public String getLang() {
+ return (String) getStateHelper().eval(PropertyKeys.lang);
+ }
+
+ public void setLang(String lang) {
+ getStateHelper().put(PropertyKeys.lang, lang);
+ }
+
+ public String getTitle() {
+ return (String) getStateHelper().eval(PropertyKeys.title);
+ }
+
+ public void setTitle(String title) {
+ getStateHelper().put(PropertyKeys.title, title);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getDir() {
+ return (String) getStateHelper().eval(PropertyKeys.dir);
+ }
+
+ public void setDir(String dir) {
+ getStateHelper().put(PropertyKeys.dir, dir);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+
+
+ @Override
+ public Collection<String> getEventNames() {
+ return EVENT_NAMES;
+ }
+}
+
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlTogglePanelTitledItem.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -22,17 +22,19 @@
package org.richfaces.component.html;
-import org.richfaces.component.UITogglePanelTitledItem;
-import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+
+import org.richfaces.component.UITogglePanelTitledItem;
+
/**
* @author akolonitsky
* @since 2010-08-13
*/
+//TODO alex - what's the purpose of this class?
public class HtmlTogglePanelTitledItem extends UITogglePanelTitledItem implements
ClientBehaviorHolder {
public static final String COMPONENT_TYPE =
"org.richfaces.TogglePanelTitledItem";
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -137,7 +137,7 @@
boolean isDisabled = titledItem.isDisabled();
encodeHeader(context, titledItem, writer, HeaderStates.inactive, !isActive
&& !isDisabled);
encodeHeader(context, titledItem, writer, HeaderStates.active, isActive
&& !isDisabled);
- encodeHeader(context, titledItem, writer, HeaderStates.disable, isDisabled);
+ encodeHeader(context, titledItem, writer, HeaderStates.disabled, isDisabled);
writer.endElement("div");
}
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -21,15 +21,14 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
+import org.richfaces.component.UIPanel;
+import org.richfaces.renderkit.RendererBase;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import java.io.IOException;
-import org.richfaces.component.UIPanel;
-import org.richfaces.renderkit.RendererBase;
-
/**
* @author amarkhel
* @since Jun 14, 2010
@@ -39,12 +38,12 @@
public PanelBaseRenderer() {
}
-
+
public void renderHeaderFacet(FacesContext context, UIComponent component) throws
IOException {
- UIComponent headerFacet = component.getFacet("header");
- headerFacet.encodeAll(context);
+ UIComponent headerFacet = component.getFacet("header");
+ headerFacet.encodeAll(context);
}
-
+
@Override
protected Class<? extends UIComponent> getComponentClass() {
return UIPanel.class;
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -1,5 +1,7 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
@@ -20,7 +22,6 @@
import org.richfaces.json.JSONException;
import org.richfaces.json.JSONMap;
import org.richfaces.renderkit.RendererBase;
-import org.richfaces.renderkit.util.RendererUtils;
//TODO nick - JSF have concept of library, it should be used instead of '/' in
resource names
@ResourceDependencies( {
@@ -176,41 +177,47 @@
result.append("',");
Map<String, Object> attributes = component.getAttributes();
Map<String, Object> options = new HashMap<String, Object>();
- RendererUtils utils = getUtils();
- utils.addToScriptHash(options, "width", panel.getWidth(),
"-1");
- utils.addToScriptHash(options, "height", panel.getHeight(),
"-1");
- utils.addToScriptHash(options, "minWidth", panel.getMinWidth(),
"-1");
- utils.addToScriptHash(options, "minHeight", panel.getMinHeight(),
"-1");
- utils.addToScriptHash(options, "maxWidth", panel.getMaxWidth(),
"" +Integer.MAX_VALUE);
- utils.addToScriptHash(options, "maxHeight", panel.getMaxHeight(),
"" +Integer.MAX_VALUE);
- utils.addToScriptHash(options, "moveable", panel.isMoveable(),
"true");
- utils.addToScriptHash(options, "followByScroll",
panel.isFollowByScroll(), "true");
- utils.addToScriptHash(options, "left", panel.getLeft(),
"auto");
- utils.addToScriptHash(options, "top", panel.getTop(),
"auto");
- utils.addToScriptHash(options, "zindex", panel.getZIndex(),
"100");
- utils.addToScriptHash(options, "shadowDepth", panel.getShadowDepth(),
"2");
- utils.addToScriptHash(options, "shadowOpacity",
panel.getShadowOpacity(), "0.1");
- utils.addToScriptHash(options, "domElementAttachment",
panel.getDomElementAttachment());
+ addToScriptHash(options, "width", panel.getWidth(), "-1");
+ addToScriptHash(options, "height", panel.getHeight(), "-1");
+ addToScriptHash(options, "minWidth", panel.getMinWidth(),
"-1");
+ addToScriptHash(options, "minHeight", panel.getMinHeight(),
"-1");
+ addToScriptHash(options, "maxWidth", panel.getMaxWidth(), ""
+Integer.MAX_VALUE);
+ addToScriptHash(options, "maxHeight", panel.getMaxHeight(),
"" +Integer.MAX_VALUE);
+ addToScriptHash(options, "moveable", panel.isMoveable(),
"true");
+ addToScriptHash(options, "followByScroll", panel.isFollowByScroll(),
"true");
+ addToScriptHash(options, "left", panel.getLeft(), "auto");
+ addToScriptHash(options, "top", panel.getTop(), "auto");
+ addToScriptHash(options, "zindex", panel.getZIndex(),
"100");
+ addToScriptHash(options, "shadowDepth", panel.getShadowDepth(),
"2");
+ addToScriptHash(options, "shadowOpacity", panel.getShadowOpacity(),
"0.1");
+ addToScriptHash(options, "domElementAttachment",
panel.getDomElementAttachment());
- utils.addToScriptHash(options, "keepVisualState",
panel.isKeepVisualState(), "false");
- utils.addToScriptHash(options, "show", panel.isShow(),
"false");
- utils.addToScriptHash(options, "modal", panel.isModal(),
"true");
- utils.addToScriptHash(options, "autosized", panel.isAutosized(),
"false");
- utils.addToScriptHash(options, "resizeable", panel.isResizeable(),
"false");
- utils.addToScriptHash(options, "overlapEmbedObjects",
panel.isOverlapEmbedObjects(), "false");
- utils.addToScriptHash(options, "visualOptions",
writeVisualOptions(context, panel));
- utils.addToScriptHash(options, "onresize",
attributes.get("onresize"));
- utils.addToScriptHash(options, "onmove",
attributes.get("onmove"));
- utils.addToScriptHash(options, "onshow",
attributes.get("onshow"));
- utils.addToScriptHash(options, "onhide",
attributes.get("onhide"));
- utils.addToScriptHash(options, "onbeforeshow",
attributes.get("onbeforeshow"));
- utils.addToScriptHash(options, "onbeforehide",
attributes.get("onbeforehide"));
+ addToScriptHash(options, "keepVisualState", panel.isKeepVisualState(),
"false");
+ addToScriptHash(options, "show", panel.isShow(), "false");
+ addToScriptHash(options, "modal", panel.isModal(), "true");
+ addToScriptHash(options, "autosized", panel.isAutosized(),
"false");
+ addToScriptHash(options, "resizeable", panel.isResizeable(),
"false");
+ addToScriptHash(options, "overlapEmbedObjects",
panel.isOverlapEmbedObjects(), "false");
+ addToScriptHash(options, "visualOptions", writeVisualOptions(context,
panel));
+ addToScriptHash(options, "onresize",
buildEventFunction(attributes.get("onresize")));
+ addToScriptHash(options, "onmove",
buildEventFunction(attributes.get("onmove")));
+ addToScriptHash(options, "onshow",
buildEventFunction(attributes.get("onshow")));
+ addToScriptHash(options, "onhide",
buildEventFunction(attributes.get("onhide")));
+ addToScriptHash(options, "onbeforeshow",
buildEventFunction(attributes.get("onbeforeshow")));
+ addToScriptHash(options, "onbeforehide",
buildEventFunction(attributes.get("onbeforehide")));
result.append(ScriptUtils.toScript(options));
result.append(");");
return result.toString();
}
+ private Object buildEventFunction(Object eventFunction) {
+ if(eventFunction != null && eventFunction.toString().length() > 0) {
+ return "new Function(\"" + eventFunction.toString() +
"\");";
+ }
+ return null;
+ }
+
public Map<String, Object> getHandledVisualOptions(AbstractPopupPanel panel) {
String options = panel.getVisualOptions();
Map<String, Object> result;
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarAnimatedBackgroundImage.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,168 @@
+/*
+ * 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.renderkit.html;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.util.ColorUtils;
+import org.richfaces.resource.CacheableResource;
+import org.richfaces.resource.DynamicResource;
+import org.richfaces.resource.ImageType;
+import org.richfaces.resource.Java2DAnimatedUserResource;
+import org.richfaces.resource.StateHolderResource;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+//TODO - add version
+@DynamicResource
+public class ProgressBarAnimatedBackgroundImage implements Java2DAnimatedUserResource,
StateHolderResource, CacheableResource {
+
+ private static final int NUMBER_OF_FRAMES = 12;
+
+ private static final Dimension DIMENSION = new Dimension(24, 48);
+
+ private int frameNumber = 0;
+
+ private Color basicColor;
+
+ public Map<String, String> getResponseHeaders() {
+ return null;
+ }
+
+ public Date getLastModified() {
+ return null;
+ }
+
+ public ImageType getImageType() {
+ return ImageType.GIF;
+ }
+
+ public Dimension getDimension() {
+ return DIMENSION;
+ }
+
+ public boolean isLooped() {
+ return true;
+ }
+
+ public int getFrameDelay() {
+ return 1000;
+ }
+
+ public void startFramesSequence() {
+ frameNumber = 0;
+ }
+
+ public boolean hasNextFrame() {
+ return frameNumber < NUMBER_OF_FRAMES;
+ }
+
+ /**
+ * Creates a main stage for progress bar background.
+ *
+ * @param context
+ * resource context
+ * @return a <code>BufferedImage</code> object
+ */
+ private BufferedImage createMainStage() {
+ Color progressbarBackgroundColor = basicColor;
+ Color progressbarSpiralColor = ColorUtils.adjustLightness(basicColor, 0.2f);
+
+ Dimension dimension = getDimension();
+ BufferedImage retVal = getImageType().createImage(dimension.width,
dimension.height * 2);
+ Graphics g = retVal.getGraphics();
+ try {
+ g.setColor(progressbarBackgroundColor);
+ g.fillRect(0, 0, dimension.width, dimension.height * 2);
+ g.setColor(progressbarSpiralColor);
+ for (int k : new int[] { -24, 0, 24, 48, 72 }) {
+ g.fillPolygon(new int[] { 0, 24, 24, 0 }, new int[] { 24 + k, k, 12 + k,
36 + k }, 4);
+ }
+ } finally {
+ if (g != null) {
+ g.dispose();
+ }
+ }
+
+ return retVal;
+ }
+
+ public void paint(Graphics2D g2d, Dimension dimension) {
+ frameNumber++;
+
+ BufferedImage mainStage = createMainStage();
+ BufferedImage frame = mainStage.getSubimage(0, 48 - frameNumber * 2,
dimension.width, dimension.height);
+ g2d.drawImage(frame, null, null);
+ Color progressbarShadowStartColor =
ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.7f), 0.6f);
+ Color progressbarShadowEndColor =
ColorUtils.overwriteAlpha(ColorUtils.adjustLightness(basicColor, 0.3f), 0.6f);
+ // paint a shadow in the form of semi-transparent gradient
+ g2d.setPaint(new GradientPaint(0, 0, progressbarShadowStartColor, 0, 7,
progressbarShadowEndColor));
+ g2d.fillRect(0, 0, dimension.width, 7);
+ }
+
+ public boolean isTransient() {
+ return false;
+ }
+
+ public void writeState(FacesContext context, DataOutput dataOutput) throws
IOException {
+ // TODO Auto-generated method stub
+ Skin skin = SkinFactory.getInstance(context).getSkin(context);
+ Integer color = skin.getColorParameter(context, Skin.SELECT_CONTROL_COLOR);
+ dataOutput.writeInt(color.intValue());
+ }
+
+ public void readState(FacesContext context, DataInput dataInput) throws IOException
{
+ basicColor = new Color(dataInput.readInt());
+ }
+
+ public boolean isCacheable(FacesContext context) {
+ return true;
+ }
+
+ public Date getExpires(FacesContext context) {
+ return null;
+ }
+
+ public int getTimeToLive(FacesContext context) {
+ return 0;
+ }
+
+ public String getEntityTag(FacesContext context) {
+ return null;
+ }
+}
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ProgressBarBaseRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,396 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * AbstractProgressBarRenderer.java Date created: 20.12.2007
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+
+package org.richfaces.renderkit.html;
+
+import static org.richfaces.renderkit.RenderKitUtils.addToScriptHash;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.event.ActionEvent;
+
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.richfaces.component.AbstractProgressBar;
+import org.richfaces.component.NumberUtils;
+import org.richfaces.log.Logger;
+import org.richfaces.log.RichfacesLogger;
+import org.richfaces.renderkit.RendererBase;
+import org.richfaces.renderkit.util.RendererUtils;
+
+/**
+ * Abstract progress bar renderer
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+@ResourceDependencies( {
+ @ResourceDependency(library = "org.richfaces", name =
"ajax.reslib"),
+ @ResourceDependency(library = "org.richfaces", name =
"base-component.reslib"),
+ @ResourceDependency(library = "org.richfaces", name =
"progressBar.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"progressBar.ecss")
+
+})
+public class ProgressBarBaseRenderer extends RendererBase {
+
+ private static final String INITIAL_FACET = "initial";
+ private static final String COMPLETE_FACET = "complete";
+ private static final Logger LOG = RichfacesLogger.APPLICATION.getLogger();
+
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+ if (component.isRendered()) {
+ new ActionEvent(component).queue();
+ PartialViewContext pvc = context.getPartialViewContext();
+ pvc.getRenderIds().add(component.getClientId(context));
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component) throws
IOException {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.ajax4jsf.renderkit.RendererBase#doEncodeChildren(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void doEncodeChildren(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+
+ }
+
+ public final boolean getRendersChildren() {
+ return true;
+ }
+
+ /**
+ * Gets state forced from javascript
+ *
+ * @param component
+ * @return
+ */
+ public String getForcedState(FacesContext context, UIComponent component) {
+ String forcedState = null;
+ Map<String, String> params = context.getExternalContext()
+ .getRequestParameterMap();
+ if (params.containsKey(AbstractProgressBar.FORCE_PERCENT_PARAM)) {
+ forcedState = params.get(AbstractProgressBar.FORCE_PERCENT_PARAM);
+ }
+ return forcedState;
+ }
+
+ /**
+ * Renderes label markup
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public StringBuffer getMarkup(FacesContext context, UIComponent component) {
+ StringBuffer result = new StringBuffer();
+ try {
+ result = new StringBuffer(getMarkupBody(context, component,
hasChildren(component)));
+
+ } catch (Exception e) {
+ LOG.error("Error occurred during rendering of progress bar label. It
switched to empty string", e);
+ }
+
+ return result;
+
+ }
+
+
+
+ protected String getMarkupBody(FacesContext context, UIComponent component, boolean
children) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ StringWriter dumpingWriter = new StringWriter();
+ ResponseWriter clonedWriter = writer.cloneWithWriter(dumpingWriter);
+ context.setResponseWriter(clonedWriter);
+ try {
+ if (children) {
+ this.renderChildren(context, component);
+ } else if (component.getAttributes().get("label") != null) {
+
clonedWriter.write(component.getAttributes().get("label").toString());
+ }
+ } finally {
+ clonedWriter.flush();
+ context.setResponseWriter(writer);
+ }
+
+ return dumpingWriter.toString();
+ }
+
+
+
+
+ /**
+ * Encodes script for state rendering in client mode
+ *
+ * @param context
+ * @param component
+ * @param state
+ * @throws IOException
+ */
+ public String getRenderStateScript(FacesContext context,
+ UIComponent component, String state) throws IOException {
+ StringBuffer script = new StringBuffer("\n");
+ script.append(
+ "RichFaces.$('" + component.getClientId(context)
+ + "').renderState('").append(state).append(
+ "');");
+ return script.toString();
+ }
+
+
+
+ /**
+ * Encode initial javascript
+ *
+ * @param context
+ * @param component
+ * @throws IOException
+ */
+ public String getInitialScript(FacesContext context,
+ UIComponent component, String state) throws IOException {
+ AbstractProgressBar progressBar = (AbstractProgressBar) component;
+ StringBuffer script = new StringBuffer();
+ Map<String, Object> options = new HashMap<String, Object>();
+ RendererUtils utils = getUtils();
+
+ String clientId = component.getClientId(context);
+
+ addToScriptHash(options, "mode",
component.getAttributes().get("mode"), "ajax");
+ addToScriptHash(options, "minValue",
component.getAttributes().get("minValue"), "0");
+ addToScriptHash(options, "maxValue",
component.getAttributes().get("maxValue"), "100");
+ addToScriptHash(options, "context", getContext(component));
+
+ Integer interval = new Integer(progressBar.getInterval());
+ addToScriptHash(options, "pollinterval", interval);
+ addToScriptHash(options, "enabled", progressBar.isEnabled());
+ addToScriptHash(options, "pollId", progressBar.getClientId(context));
+ addToScriptHash(options, "state", state, "initialState");
+ addToScriptHash(options, "value",
NumberUtils.getNumber(component.getAttributes().get("value")));
+ addToScriptHash(options, "onsubmit",
buildEventFunction(component.getAttributes().get("onsubmit")));
+ script.append("new
RichFaces.ui.ProgressBar('").append(clientId).append("'");
+ if (!options.isEmpty()) {
+ script.append(",").append(ScriptUtils.toScript(options));
+ }
+ script.append(")\n;");
+ return script.toString();
+ }
+
+ private Object buildEventFunction(Object eventFunction) {
+ if(eventFunction != null && eventFunction.toString().length() > 0) {
+ return "new Function(\"" + eventFunction.toString() +
"\");";
+ }
+ return null;
+ }
+
+ /**
+ * Creates options map for AJAX requests
+ *
+ * @param clientId
+ * @param progressBar
+ * @param context
+ * @return
+ */
+ public String getPollScript(FacesContext context, UIComponent component) {
+ return "RichFaces.$('" + component.getClientId() +
"').poll()";
+
+ }
+
+ public String getStopPollScript(FacesContext context, UIComponent component) {
+ return "RichFaces.$('" + component.getClientId() +
"').disable()";
+
+ }
+
+ /**
+ * Check if component mode is AJAX
+ *
+ * @param component
+ * @return
+ */
+ public boolean isAjaxMode(UIComponent component) {
+ String mode = (String) component.getAttributes().get("mode");
+ return "ajax".equalsIgnoreCase(mode);
+ }
+
+ public String getCurrentOrForcedState(FacesContext context, UIComponent component){
+ String forcedState = getForcedState(context,component);
+ if (forcedState != null) {
+ return forcedState;
+ }
+ return getCurrentState(context, component);
+ }
+
+ public String getCurrentState(FacesContext context, UIComponent component){
+ Number minValue =
NumberUtils.getNumber(component.getAttributes().get("minValue"));
+ Number maxValue =
NumberUtils.getNumber(component.getAttributes().get("maxValue"));
+ Number value =
NumberUtils.getNumber(component.getAttributes().get("value"));
+ if (value.doubleValue() <= minValue.doubleValue()) {
+ return "initialState";
+ } else if (value.doubleValue() > maxValue.doubleValue()) {
+ return "completeState";
+ } else {
+ return "progressState";
+ }
+ }
+
+ public String getShellStyle(FacesContext context, UIComponent component){
+ return (!isSimpleMarkup(component)) ? "rf-pb-shl-dig "
+ : "rf-pb-shl ";
+ }
+
+ public String getWidth(UIComponent component){
+ Number value =
NumberUtils.getNumber(component.getAttributes().get("value"));
+ Number minValue =
NumberUtils.getNumber(component.getAttributes().get("minValue"));
+ Number maxValue =
NumberUtils.getNumber(component.getAttributes().get("maxValue"));
+ Number percent = calculatePercent(value, minValue, maxValue);
+
+ return String.valueOf(percent.intValue());
+ }
+
+ public void renderInitialFacet(FacesContext context, UIComponent component) throws
IOException {
+ renderFacet(context, component, INITIAL_FACET);
+ }
+
+ public void renderCompleteFacet(FacesContext context, UIComponent component) throws
IOException {
+ renderFacet(context, component, COMPLETE_FACET);
+ }
+
+ private void renderFacet(FacesContext context, UIComponent component, String facet)
throws IOException {
+ UIComponent headerFacet = component.getFacet(facet);
+ if(headerFacet != null) {
+ headerFacet.encodeAll(context);
+ }
+ }
+
+
+ /**
+ * Returns parameters attr
+ *
+ * @param component
+ * @param renderer
+ * @param percent
+ * @return
+ */
+ public String getParameters(UIComponent component) {
+ String parameters = (String) component.getAttributes()
+ .get("parameters");
+ return parameters;
+ }
+
+ /**
+ * Returns context for macrosubstitution
+ *
+ * @param component
+ * @return
+ */
+ private JSLiteral getContext(UIComponent component) {
+ StringBuffer buffer = new StringBuffer();
+ String parameters = getParameters(component);
+ JSLiteral literal = null;
+ if (parameters != null) {
+ buffer.append("{").append(parameters).append("}");
+ literal = new JSLiteral(buffer.toString());
+ }
+ return literal;
+ }
+
+ /**
+ * Return true if component has children components
+ *
+ * @param component
+ * @return
+ */
+ private boolean hasChildren(UIComponent component) {
+ return (component.getChildCount() != 0);
+ }
+
+ /**
+ * Returns true if markup should rendered as simple 2 divs
+ *
+ * @param component
+ * @return
+ */
+ public boolean isSimpleMarkup(UIComponent component) {
+ if (hasChildren(component)) {
+ return false;
+ } else {
+ if (component.getAttributes().get("label") != null) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+
+
+ /**
+ * Calculates percent value according to min & max value
+ *
+ * @param value
+ * @param minValue
+ * @param maxValue
+ * @return
+ */
+ public Number calculatePercent(Number value, Number minValue,
+ Number maxValue) {
+ if (minValue.doubleValue() < value.doubleValue()
+ && value.doubleValue() < maxValue.doubleValue()) {
+ return (Number) ((value.doubleValue() - minValue.doubleValue()) * 100.0 /
(maxValue
+ .doubleValue() - minValue.doubleValue()));
+ } else if (value.doubleValue() <= minValue.doubleValue()) {
+ return 0;
+ } else if (value.doubleValue() >= maxValue.doubleValue()) {
+ return 100;
+ }
+ return 0;
+ }
+
+}
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabPanelRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit.html;
+
+import static org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.active;
+import static
org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.disabled;
+import static
org.richfaces.component.AbstractTogglePanelTitledItem.HeaderStates.inactive;
+import static org.richfaces.component.html.HtmlAccordion.PropertyKeys.height;
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+import static org.richfaces.component.util.HtmlUtil.concatStyles;
+import static org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributes;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTabPanel;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.component.AbstractTogglePanelItem;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.component.html.HtmlTab;
+import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"tabPanel.ecss"),
+ @ResourceDependency(library = "org.richfaces", name =
"TogglePanel.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"TabPanel.js")
+})
+public class TabPanelRenderer extends TogglePanelRenderer {
+
+ private static final RenderKitUtils.Attributes HEADER_ATTRIBUTES =
RenderKitUtils.attributes()
+ .generic("onclick", HtmlTab.PropertyKeys.onheaderclick.toString(),
"headerclick")
+ .generic("ondblclick",
HtmlTab.PropertyKeys.onheaderdblclick.toString(), "headerdblclick")
+ .generic("onmousedown",
HtmlTab.PropertyKeys.onheadermousedown.toString(), "headermousedown")
+ .generic("onmousemove",
HtmlTab.PropertyKeys.onheadermousemove.toString(), "headermousemove")
+ .generic("onmouseup", HtmlTab.PropertyKeys.onheadermouseup.toString(),
"headermouseup");
+
+ private static final String DIV = "div";
+ private static final String STYLE = "style";
+ private static final String CLASS = "class";
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter w, FacesContext context, UIComponent
comp) throws IOException {
+ super.doEncodeBegin(w, context, comp);
+ writeJavaScript(w, context, comp);
+
+ writeTabsLine(w, context, comp);
+ writeTabsLineSeparator(w);
+ }
+
+ private void writeTabsLineSeparator(ResponseWriter writer) throws IOException {
+ writer.write("<div class='rf-tb-hdr_brd'></div>");
+ }
+
+ private void writeTabsLine(ResponseWriter w, FacesContext context, UIComponent comp)
throws IOException {
+ w.startElement(DIV, comp);
+ w.writeAttribute(CLASS, "rf-tb-hdr-tabline-vis", null);
+
+ w.startElement("table", comp);
+ w.writeAttribute("class", "rf-tb-hdr-tabs", null);
+ w.writeAttribute("cellspacing", "0", null);
+ w.startElement("tbody", comp);
+ w.startElement("tr", comp);
+
+ writeTopTabFirstSpacer(w, comp);
+
+ for (AbstractTogglePanelItem item : ((AbstractTogglePanel)
comp).getRenderedItems()) {
+ AbstractTogglePanelTitledItem tab = (AbstractTogglePanelTitledItem) item;
+ writeTopTabHeader(context, w, tab);
+ writeTopTabSpacer(w, comp);
+ }
+
+ writeTopTabLastSpacer(w, comp);
+
+ w.endElement("tr");
+ w.endElement("tbody");
+ w.endElement("table");
+
+ writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_l rf-tb-hdn",
"\u00AB");
+ writeTopTabsControl(w, comp, "rf-tb-hdr-tablst rf-tb-hdn",
"\u2193");
+ writeTopTabsControl(w, comp, "rf-tb-hdr-scrl_r rf-tb-hdn",
"\u00BB");
+
+ w.endElement("div");
+ }
+
+ @Override
+ protected String getStyle(UIComponent component) {
+ return concatStyles(attributeAsString(component, "style"), "width:
100%;");
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return HtmlUtil.concatClasses("rf-tbp", attributeAsString(component,
"styleClass"));
+ }
+
+ private void writeTopTabHeader(FacesContext context, ResponseWriter writer,
AbstractTogglePanelTitledItem tab) throws IOException {
+ boolean isActive = tab.isActive();
+ boolean isDisabled = tab.isDisabled();
+
+ encodeTabHeader(context, tab, writer, inactive, !isActive &&
!isDisabled);
+ encodeTabHeader(context, tab, writer, active, isActive && !isDisabled);
+ encodeTabHeader(context, tab, writer, disabled, isDisabled);
+
+ }
+
+ private void encodeTabHeader(FacesContext context, AbstractTogglePanelTitledItem tab,
ResponseWriter writer,
+ AbstractTogglePanelTitledItem.HeaderStates state, Boolean
isDisplay) throws IOException {
+
+
+ writer.startElement("td", tab);
+ writer.writeAttribute("id", tab.getClientId() + ":header:" +
state.toString(), null);
+ renderPassThroughAttributes(context, tab, HEADER_ATTRIBUTES);
+ String name = "headerClass" + capitalize(state.toString());
+ writer.writeAttribute("class", concatClasses("rf-tb-hdr
rf-tb-hdr-" + state.abbreviation(),
+ attributeAsString(tab, HtmlTab.PropertyKeys.headerClass),
attributeAsString(tab, name)), null);
+ writer.writeAttribute("style", concatStyles(isDisplay ? "" :
"display : none", attributeAsString(tab,
HtmlTab.PropertyKeys.headerStyle.toString())), null);
+
+ writer.startElement("span", tab);
+ writer.writeAttribute("class", "rf-tb-lbl", null);
+
+ UIComponent headerFacet = tab.getHeaderFacet(state);
+ if (headerFacet != null && headerFacet.isRendered()) {
+ headerFacet.encodeAll(context);
+ } else {
+ Object headerText = tab.getAttributes().get("header");
+ if (headerText != null && !headerText.equals("")) {
+ writer.writeText(headerText, null);
+ }
+ }
+
+ writer.endElement("span");
+
+ writer.endElement("td");
+ }
+
+
+
+ private void writeTopTabsControl(ResponseWriter w, UIComponent comp, String styles,
String text) throws IOException {
+ w.startElement("div", comp);
+ w.writeAttribute("class", styles, null);
+ w.writeText(text, null);
+ w.endElement("div");
+ }
+
+ private void writeTopTabFirstSpacer(ResponseWriter w, UIComponent comp) throws
IOException {
+ writeTopTabSpacer(w, comp, "padding-left: 5px;",
"rf-tb-hdr-spcr");
+ }
+
+ private void writeTopTabSpacer(ResponseWriter w, UIComponent comp) throws IOException
{
+ writeTopTabSpacer(w, comp, "", "rf-tb-hdr-spcr
rf-tb-hortab-tabspcr_wdh");
+ }
+
+ private void writeTopTabLastSpacer(ResponseWriter w, UIComponent comp) throws
IOException {
+ writeTopTabSpacer(w, comp, "padding-right: 5px; width: 100%;",
"rf-tb-hdr-spcr");
+ }
+
+ private void writeTopTabSpacer(ResponseWriter w, UIComponent comp, String style,
String classStyle) throws IOException {
+ w.startElement("td", comp);
+ w.writeAttribute(STYLE, style, null);
+ w.writeAttribute(CLASS, classStyle, null);
+ w.write("<br />");
+ w.endElement("td");
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ writer.endElement(HtmlConstants.DIV_ELEM);
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.TabPanel",
+ component.getClientId(), getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ Map<String, Object> options = super.getScriptObjectOptions(context,
component);
+ options.put("isKeepHeight", !attributeAsString(component,
height).isEmpty());
+ options.remove("items");
+
+ return options;
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractTabPanel.class;
+ }
+}
+
Copied:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
(from rev 19674,
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TabRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit.html;
+
+import static org.richfaces.component.util.HtmlUtil.concatClasses;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractTogglePanelTitledItem;
+import org.richfaces.renderkit.HtmlConstants;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+@ResourceDependencies( { // TODO review
+ @ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "richfaces-event.js"),
+ @ResourceDependency(name = "richfaces-base-component.js"),
+ @ResourceDependency(library = "org.richfaces", name =
"TogglePanelItem.js"),
+ @ResourceDependency(library = "org.richfaces", name = "Tab.js")
+})
+public class TabRenderer extends TogglePanelItemRenderer {
+
+ @Override
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ super.doEncodeBegin(writer, context, component);
+
+ encodeContentBegin(component, writer);
+ }
+
+ @Override
+ protected String getStyleClass(UIComponent component) {
+ return concatClasses("rf-tb", attributeAsString(component,
"styleClass"));
+ }
+
+ @Override
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
+ encodeContentEnd(component, writer);
+
+ super.doEncodeEnd(writer, context, component);
+ }
+
+ @Override
+ protected void writeJavaScript(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
+ Object script = getScriptObject(context, component);
+ if (script == null) {
+ return;
+ }
+
+ writer.startElement(HtmlConstants.SCRIPT_ELEM, component);
+ writer.writeAttribute(HtmlConstants.TYPE_ATTR, "text/javascript",
"type");
+ writer.writeText(script, null);
+ writer.endElement(HtmlConstants.SCRIPT_ELEM);
+ }
+
+ private void encodeContentBegin(UIComponent component, ResponseWriter writer) throws
IOException {
+ writer.startElement("div", component);
+ writer.writeAttribute("class", concatClasses("rf-tb-cnt",
attributeAsString(component, "contentClass")), null);
+ writer.writeAttribute("id", component.getClientId() +
":content", null);
+
+ AbstractTogglePanelTitledItem item = (AbstractTogglePanelTitledItem) component;
+ if (!item.isActive() || item.isDisabled()) {
+ writer.writeAttribute("style", "display: none", null);
+ }
+ }
+
+ private void encodeContentEnd(UIComponent component, ResponseWriter responseWriter)
throws IOException {
+ responseWriter.endElement("div");
+ }
+
+ @Override
+ protected JSObject getScriptObject(FacesContext context, UIComponent component) {
+ return new JSObject("RichFaces.ui.Tab", component.getClientId(),
+ getScriptObjectOptions(context, component));
+ }
+
+ @Override
+ protected Map<String, Object> getScriptObjectOptions(FacesContext context,
UIComponent component) {
+ Map<String, Object> res = super.getScriptObjectOptions(context,
component);
+ res.put("disabled", ((AbstractTogglePanelTitledItem)
component).isDisabled());
+
+ return res;
+ }
+
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return AbstractTogglePanelTitledItem.class;
+ }
+}
+
Modified:
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -22,23 +22,18 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.behavior.ToggleControl;
-
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.render.ClientBehaviorRenderer;
-import javax.faces.render.FacesBehaviorRenderer;
-import javax.faces.render.RenderKitFactory;
+import org.richfaces.component.behavior.ToggleControl;
+
/**
* @author akolonitsky
*
*/
-@FacesBehaviorRenderer(
- rendererType = "org.richfaces.component.behavior.ToggleControl",
- renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT)
@ResourceDependencies({
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js") })
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -491,7 +491,7 @@
</component>
<component>
- <component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<component-class>org.richfaces.component.html.HtmlAccordionItem</component-class>
<property>
<description></description>
@@ -653,8 +653,15 @@
<property-name>onmouseup</property-name>
<property-class>java.lang.String</property-class>
</property>
-
</component>
+ <component>
+ <component-type>org.richfaces.TabPanel</component-type>
+
<component-class>org.richfaces.component.html.HtmlTabPanel</component-class>
+ </component>
+ <component>
+ <component-type>org.richfaces.TabPanelItem</component-type>
+
<component-class>org.richfaces.component.html.HtmlTab</component-class>
+ </component>
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
@@ -683,6 +690,7 @@
<renderer-type>org.richfaces.AccordionItem</renderer-type>
<renderer-class>org.richfaces.renderkit.html.AccordionItemRenderer</renderer-class>
</renderer>
+
<renderer>
<component-family>org.richfaces.Panel</component-family>
<renderer-type>org.richfaces.PanelRenderer</renderer-type>
@@ -699,8 +707,32 @@
<cdk:renders-children>false</cdk:renders-children>
</renderer-extension>
</renderer>
- </render-kit>
+ <renderer>
+ <component-family>org.richfaces.TabPanel</component-family>
+ <renderer-type>org.richfaces.TabPanel</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.TabPanelRenderer</renderer-class>
+ </renderer>
+ <renderer>
+
<component-family>org.richfaces.TogglePanelTitledItem</component-family>
+ <renderer-type>org.richfaces.Tab</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.TabRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.ProgressBar</component-family>
+ <renderer-type>org.richfaces.ProgressBarRenderer</renderer-type>
+
<renderer-class>org.richfaces.renderkit.html.ProgressBarRenderer</renderer-class>
+ <renderer-extension>
+ <cdk:renders-children>false</cdk:renders-children>
+ </renderer-extension>
+ </renderer>
+
+ <client-behavior-renderer>
+
<client-behavior-renderer-type>org.richfaces.component.behavior.ToggleControl</client-behavior-renderer-type>
+
<client-behavior-renderer-class>org.richfaces.renderkit.html.ToggleControlRenderer</client-behavior-renderer-class>
+ </client-behavior-renderer>
+ </render-kit>
+
<faces-config-extension>
<cdk:taglib>
<cdk:shortName>output</cdk:shortName>
Modified: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-27
15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -21,6 +21,13 @@
</component>
</tag>
<tag>
+ <tag-name>progressBar</tag-name>
+ <component>
+ <component-type>org.richfaces.ProgressBar</component-type>
+ <renderer-type>org.richfaces.ProgressBarRenderer</renderer-type>
+ </component>
+ </tag>
+ <tag>
<tag-name>popupPanel</tag-name>
<component>
<component-type>org.richfaces.PopupPanel</component-type>
@@ -29,6 +36,22 @@
</tag>
<tag>
+ <tag-name>tabPanel</tag-name>
+ <component>
+ <component-type>org.richfaces.TabPanel</component-type>
+ <renderer-type>org.richfaces.TabPanel</renderer-type>
+ </component>
+ </tag>
+ <tag>
+ <tag-name>tab</tag-name>
+ <component>
+ <component-type>org.richfaces.TabPanelItem</component-type>
+ <renderer-type>org.richfaces.Tab</renderer-type>
+ </component>
+ </tag>
+
+
+ <tag>
<tag-name>collapsiblePanel</tag-name>
<component>
<component-type>org.richfaces.CollapsiblePanel</component-type>
@@ -718,9 +741,8 @@
<tag>
<tag-name>accordionItem</tag-name>
<component>
-
<component-type>org.richfaces.TogglePanelTitledItem</component-type>
+ <component-type>org.richfaces.AccordionItem</component-type>
<renderer-type>org.richfaces.AccordionItem</renderer-type>
-
</component>
<attribute>
<description></description>
@@ -882,6 +904,6 @@
<name>onmouseup</name>
<type>java.lang.String</type>
</attribute>
-
</tag>
+
</facelet-taglib>
Modified:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/CollapsiblePanelItem.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -45,7 +45,7 @@
},
__state : function () {
- return this.getName() === "true" ? "expanded" :
"collapsed";
+ return this.getName() === "true" ? "exp" :
"colps";
},
__header : function (state) {
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.Tab = rf.ui.TogglePanelItem.extendClass({
+ // class name
+ name:"Tab",
+
+ /**
+ * @class AccordionItem
+ * @name AccordionItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanelItem.call(this, componentId, options);
+ this.index = options["index"];
+ this.getTogglePanel().getItems()[this.index] = this;
+
+ //TODO - optimize this
+ rf.Event.bindById(this.id + ":header:active", "click",
this.__onHeaderClick, this)
+ rf.Event.bindById(this.id + ":header:inactive", "click",
this.__onHeaderClick, this)
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+ __onHeaderClick : function (comp) {
+ this.getTogglePanel().switchToItem(this.getName());
+ },
+
+ /**
+ * @param state {string} = inactive | active | disabled
+ * in that case looking header by css class appropriate to this state
+ *
+ * @return {jQuery Object}
+ * */
+ __header : function (state) {
+ var res = $(rf.getDomElement(this.id + ":header"));
+ if (state) {
+ return $(rf.getDomElement(this.id + ":header:" + state));
+ }
+
+ return res;
+ },
+
+ /**
+ * @return {jQuery Object}
+ * */
+ __content : function () {
+ if (!this.__content_) {
+ this.__content_ = $(rf.getDomElement(this.id + ":content"));
+ }
+ return this.__content_;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __enter : function () {
+
+ this.__content().show();
+ this.__header("inactive").hide();
+ this.__header("active").show();
+
+ return this.__fireEnter();
+ },
+
+ getHeight : function (recalculate) {
+ if (recalculate || !this.__height) {
+ this.__height = $(rf.getDomElement(this.id)).outerHeight(true)
+ }
+
+ return this.__height;
+ },
+
+ /**
+ * @private
+ *
+ * used in TogglePanel
+ * */
+ __leave : function () {
+ var continueProcess = this.__fireLeave();
+ if (!continueProcess) {
+ return false;
+ }
+
+ this.__content().hide();
+ this.__header("active").hide();
+ this.__header("inactive").show();
+
+ return true;
+ },
+
+ /***************************** Private Methods
********************************************************/
+
+
+ destroy: function () {
+ var parent = this.getTogglePanel();
+ delete parent.getItems()[this.index];
+
+ rf.Event.unbindById(this.id);
+
+ //TODO - optimize
+ rf.Event.unbindById(this.id + ":header:active");
+ rf.Event.unbindById(this.id + ":header:inactive");
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TabPanel.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ rf.ui.TabPanel = rf.ui.TogglePanel.extendClass({
+ // class name
+ name:"TabPanel",
+
+ /**
+ * @class TabPanel
+ * @name TabPanel
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ rf.ui.TogglePanel.call(this, componentId, options);
+ this.items = [];
+
+ this.isKeepHeight = options["isKeepHeight"] || false
+ },
+
+ /***************************** Public Methods
****************************************************************/
+
+
+
+ /***************************** Private Methods
********************************************************/
+
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ rf.ui.TogglePanel.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close.gif)
===================================================================
(Binary files differ)
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/close_act.gif)
===================================================================
(Binary files differ)
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/ico.gif)
===================================================================
(Binary files differ)
Modified:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panel.ecss 2010-10-27
15:07:36 UTC (rev 19690)
@@ -6,7 +6,7 @@
padding:1px;
}
-.rf-p-hr{
+.rf-p-hdr{
background-color:'#{richSkin.headerBackgroundColor}';
border-color:'#{richSkin.headerBackgroundColor}';
font-size:'#{richSkin.headerSizeFont}';
Modified:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.ecss 2010-10-27
15:07:36 UTC (rev 19690)
@@ -1,4 +1,4 @@
-.rf-pp-b {
+.rf-pp-btn {
outline-style: none;
position: absolute;
clip: rect(0px 0px 1px 1px);
@@ -7,32 +7,33 @@
left: 0px;
top: 0px;
z-index: -300;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
+ opacity: 0.1;
+ filter: 'alpha(opacity = 10)';
}
-.rf-pp-sh {
- position : fixed;
- width : 100%;
- height : 100%;
- top:0px;
- left : 0px;
- background : #D0D0D0;
- opacity:0.5;
- filter : 'alpha(opacity=50)';
+.rf-pp-shade {
+ position: fixed;
+ width: 100%;
+ height: 100%;
+ top: 0px;
+ left: 0px;
+ background-color: #D0D0D0;
+ opacity: 0.5;
+ filter: 'alpha(opacity = 50)';
}
-.rf-pp-shw {
- background-color : #000000;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
+.rf-pp-shdw {
+ background-color: #000000;
+ opacity: 0.1;
+ filter: 'alpha(opacity = 10)';
}
-.rf-pp-cr {
+
+.rf-pp-cntr {
border : '1px solid #{richSkin.panelBorderColor}';
background : '#{richSkin.generalBackgroundColor}';
z-index:100;
}
-.rf-pp-h {
+.rf-pp-hdr {
background :
"url(#{resource['org.richfaces.renderkit.html.GradientA']})";
repeat-x : 'top left #{richSkin.headerBackgroundColor}';
position : relative;
@@ -40,7 +41,7 @@
cursor : move;
padding : 2px;
}
-.rf-pp-h-ct {
+.rf-pp-hdr-cnt {
overflow : hidden;
white-space : nowrap;
text-overflow: ellipsis;
@@ -51,7 +52,7 @@
padding : 2px;
padding-left : 10px;
}
-.rf-pp-h-cs {
+.rf-pp-hdr-cntrls {
position : absolute;
top : 2px;
right : 2px;
@@ -64,27 +65,27 @@
z-index:100;
}
-.rf-pp-ct-sr {
+.rf-pp-cnt-scrlr {
position : relative;
top : 0px;
left : 0px;
overflow : auto;
}
-.rf-pp-ct {
+.rf-pp-cnt {
position : relative;
padding : 10px;
color : '#{richSkin.generalTextColor}';
font-family : '#{richSkin.generalFamilyFont}';
font-size : '#{richSkin.generalSizeFont}';
}
-.rf-pp-hr {
- background : red;
- filter : 'alpha(opacity=0)';
+.rf-pp-hndlr {
opacity:0;
position : absolute;
margin : -4px;
+ filter : 'alpha(opacity = 0)';
}
-.rf-pp-hr-l {
+
+.rf-pp-hndlr-l {
width : 7px;
height : 100%;
top : 0px;
@@ -92,7 +93,7 @@
cursor : w-resize;
}
-.rf-pp-hr-r {
+.rf-pp-hndlr-r {
width : 7px;
height : 100%;
top : 0px;
@@ -100,7 +101,7 @@
cursor : w-resize;
}
-.rf-pp-if {
+.rf-pp-ifr {
position: absolute;
left: 0px;
top: 0px;
@@ -109,14 +110,14 @@
z-index: -1;
}
-.rf-pp-hr-t {
+.rf-pp-hndlr-t {
width : 100%;
height : 7px;
top : 0px;
left : 0px;
cursor : n-resize;
}
-.rf-pp-hr-b {
+.rf-pp-hndlr-b {
width : 100%;
height : 7px;
bottom : 0px;
@@ -124,28 +125,28 @@
cursor : n-resize;
}
-.rf-pp-hr-tl {
+.rf-pp-hndlr-tl {
width : 10px;
height : 10px;
top : 0px;
left : 0px;
cursor : nw-resize;
}
-.rf-pp-hr-tr {
+.rf-pp-hndlr-tr {
width : 10px;
height : 10px;
top : 0px;
right : 0px;
cursor : ne-resize;
}
-.rf-pp-hr-bl {
+.rf-pp-hndlr-bl {
width : 10px;
height : 10px;
bottom : 0px;
left : 0px;
cursor : ne-resize;
}
-.rf-pp-hr-br {
+.rf-pp-hndlr-br {
width : 10px;
height : 10px;
bottom : 0px;
Modified:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -68,6 +68,7 @@
this.cdiv = $(richfaces.getDomElement(id + "_container"));
this.contentDiv = $(richfaces.getDomElement(id + "_content"));
this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
+ this.shadeDiv = $(richfaces.getDomElement(id + "_shade"));
this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
this.borders = new Array();
@@ -215,12 +216,13 @@
},
show: function(event, opts) {
+ var element = this.cdiv;
if(!this.shown &&
this.invokeEvent("beforeshow",event,null,element)) {
this.preventFocus();
- var element = this.div;
+
if (!this.domReattached) {
- this.parent = element.parent();
+ this.parent = this.div.parent();
var domElementAttachment;
if (opts) {
@@ -243,7 +245,9 @@
if (newParent != this.parent) {
this.saveInputValues(element);
- element.insertBefore(newParent.firstChild);
+ this.shadeDiv.insertAfter(newParent.lastChild);
+ this.shadowDiv.insertAfter(newParent.lastChild);
+ this.cdiv.insertAfter(newParent.lastChild);
this.domReattached = true;
} else {
this.parent.show();
@@ -316,7 +320,7 @@
if (this.options.overlapEmbedObjects && !this.iframe) {
this.iframe = this.markerId + "IFrame";
$("<iframe src=\"javascript:''\"
frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe +
"\" " +
- "class=\"rf-pp-if\" style=\"width:" +this.options.width +
"px; height:" + this.options.height + "px;\">" +
+ "class=\"rf-pp-ifr\" style=\"width:" +this.options.width +
"px; height:" + this.options.height + "px;\">" +
"</iframe>").insertBefore($(':first-child',
this.cdiv)[0]);
eIframe = $(richfaces.getDomElement(this.iframe));
@@ -365,8 +369,8 @@
this.shadowDiv.css('opacity', this.options.shadowOpacity);
this.shadowDiv.css('filter ',
'alpha(opacity='+this.options.shadowOpacity*100 +');');
- element.css('visibility', '');
- element.css('display', 'block');
+ this.div.css('visibility', '');
+ this.div.css('display', 'block');
if (this.options.autosized) {
this.shadowDiv.css('height', this.cdiv[0].clientHeight);
this.shadowDiv.css('width', this.cdiv[0].clientWidth);
@@ -475,7 +479,7 @@
},
hide: function(event, opts) {
- var element = this.id;
+ var element = this.cdiv;
this.restoreFocus();
if (this.shown &&
this.invokeEvent("beforehide",event,null,element)) {
@@ -487,12 +491,11 @@
if (this.parent) {
if (this.domReattached) {
this.saveInputValues(element);
+ this.div.append(this.shadeDiv);
+ this.div.append(this.shadowDiv);
+ this.div.append(element);
- this.parent.append(element);
-
this.domReattached = false;
- } else {
- this.parent.hide();
}
}
@@ -510,7 +513,7 @@
}
this.shown = false;
-
+ this.invokeEvent("hide",event,null,element)
}
},
@@ -544,14 +547,14 @@
if (newSize >= this.currentMinWidth || this.options.autosized) {
if (diff.deltaWidth) {
cssHashWH.width = newSize + 'px';
- shadowHashWH.width = newSize + shadowDepth + 'px';
+ shadowHashWH.width = newSize + 'px';
contentHashWH.width = newSize - scrollerWidth + 'px';
scrollerHashWH.width = newSize - scrollerWidth + 'px';
}
} else {
if (diff.deltaWidth) {
cssHashWH.width = this.currentMinWidth + 'px';
- shadowHashWH.width = this.currentMinWidth + shadowDepth + 'px';
+ shadowHashWH.width = this.currentMinWidth + 'px';
contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
vetoes.vx = oldSize - this.currentMinWidth;
@@ -563,7 +566,7 @@
if (newSize > this.options.maxWidth) {
if (diff.deltaWidth) {
cssHashWH.width = this.currentMaxWidth + 'px';
- shadowHashWH.width = this.currentMaxWidth + shadowDepth + 'px';
+ shadowHashWH.width = this.currentMaxWidth + 'px';
contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
vetoes.vx = oldSize - this.currentMaxWidth;
@@ -599,13 +602,13 @@
if (newSize >= this.currentMinHeight || this.options.autosized) {
if (diff.deltaHeight) {
cssHashWH.height = newSize + 'px';
- shadowHashWH.height = newSize + shadowDepth + 'px';
+ shadowHashWH.height = newSize + 'px';
scrollerHashWH.height = newSize - scrollerHeight + 'px';
}
} else {
if (diff.deltaHeight) {
cssHashWH.height = this.currentMinHeight + 'px';
- shadowHashWH.height = this.currentMinHeight + shadowDepth + 'px';
+ shadowHashWH.height = this.currentMinHeight + 'px';
scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
vetoes.vy = oldSize - this.currentMinHeight;
}
@@ -616,7 +619,7 @@
if (newSize > this.options.maxHeight) {
if (diff.deltaHeight) {
cssHashWH.height = this.currentMaxHeight + 'px';
- shadowHashWH.height = this.currentMaxHeight + shadowDepth + 'px';
+ shadowHashWH.height = this.currentMaxHeight + 'px';
scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
vetoes.vy = oldSize - this.currentMaxHeight;
}
@@ -710,8 +713,8 @@
findForm: function(elt) {
var target = elt;
while (target) {
- if (!target.tagName /* document node doesn't have tagName */
- || target.tagName.toLowerCase() != "form") {
+ if (target[0] && (!target[0].tagName /* document node doesn't have
tagName */
+ || target[0].tagName.toLowerCase() != "form")) {
target = $(target).parent();
} else {
@@ -748,7 +751,7 @@
invokeEvent: function(eventName, event, value, element) {
- var eventFunction = this.options['on'+eventName];
+ var eventFunction = eval(this.options['on'+eventName]);
var result;
if (eventFunction) {
Modified:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -114,7 +114,7 @@
doDiff : function(dx, dy) {
return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, 0, -dy);
- },
+ }
});
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.ecss 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,44 @@
+.rf-pb-cnt{
+height : 13px;
+white-space : nowrap;
+width : 200px;
+}
+.rf-pb-upl{
+background-repeat : repeat-x;
+background-image :
"url(#{resource['org.richfaces.images:pbAniBg.gif']})";
+background-color : '#{richSkin.selectControlColor}';
+height : 13px;
+}
+.rf-pb-upl-dig{
+overflow : hidden; position : absolute; top : 0px; left : 0px;
+border-color : '#{richSkin.panelBorderColor}';
+}
+.rf-pb-shl{
+margin-bottom : 2px; border : 1px solid;
+background-color : '#{richSkin.controlBackgroundColor}';
+border-color : '#{richSkin.panelBorderColor}';
+}
+.rf-pb-shl-dig{
+position : relative; margin-bottom : 2px; border : 1px solid; overflow: hidden;
+border-color : '#{richSkin.panelBorderColor}';
+color : '#{richSkin.controlTextColor}';
+font-family : '#{richSkin.generalFamilyFont}';
+font-size : '#{richSkin.generalSizeFont}';
+}
+.rf-pb-rmnd{
+text-align : center; font-weight : bold; position : relative;
+background-color : '#{richSkin.controlBackgroundColor}';
+text-color : '#{richSkin.controlTextColor}';
+height : 13px;
+width : 200px;
+padding: 0px;
+}
+.rf-pb-cmpltd{
+text-align : center; font-weight : bold; background-repeat : repeat-x;
+background-color : '#{richSkin.selectControlColor}';
+text-color : '#{richSkin.controlBackgroundColor}';
+height : 13px;
+width : 200px;
+padding: 0px;
+background-image :
"url(#{resource['org.richfaces.images:pbAniBg.gif']})";
+}
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,293 @@
+//ProgressBar = {};
+//ProgressBar = Class.create();
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ // Constructor definition
+ rf.ui.ProgressBar = function(componentId, options) {
+ // call constructor of parent class
+ $super.constructor.call(this, componentId);
+ this.id = componentId;
+ this.attachToDom(this.id);
+ this.options = $.extend({}, defaultOptions, options);
+ var f = this.getForm();
+ this.formId = (f) ? f.id : null;
+ this.disabled = false;
+ this.state = this.options.state;
+ this.value = this.options.value;
+ this.minValue = this.options.minValue;
+ this.maxValue = this.options.maxValue;
+ var component = this;
+ this.options.beforedomupdate = function(event) {
+ component.onComplete(event.data);
+ }
+
+ };
+
+ // Extend component class and add protected methods from parent class to our container
+ rf.BaseComponent.extend(rf.ui.ProgressBar);
+
+ // define super class link
+ var $super = rf.ui.ProgressBar.$super;
+
+ var defaultOptions = {
+ mode: "ajax",
+ minValue: 0,
+ maxValue: 100,
+ state : "initialState"
+ };
+
+ var getForm = function () {
+ var parentForm = rf.getDomElement(this.id);
+ while (parentForm.tagName && parentForm.tagName.toLowerCase() !=
'form') {
+ parentForm = parentForm.parentNode;
+ }
+ return parentForm;
+ };
+
+ var getValue = function () {
+ return this.value;
+ };
+
+ var getParameter = function (ev, params, paramName) {
+ if (!params) {
+ params = ev;
+ }
+ if (params && params[paramName]) {
+ return params[paramName];
+ }
+ return params;
+ };
+
+ var onComplete = function (data) {
+ if (!rf.getDomElement(this.id) || this.disabled) { return; }
+ if (data) {
+ this.value = data['value'];
+ if (this.state == "progressState") {
+ if (this.value > this.getMaxValue()) {
+ this.options.enabled=false;
+ this.forceState("completeState",null);
+ return;
+ }
+ this.updateComponent(data);
+ this.renderLabel(data['markup'], data['context']);
+ } else if (this.state == "initialState" && this.value >
this.getMinValue()) {
+ this.state = "progressState";
+ this.forceState("progressState");
+ return;
+ }
+ this.poll();
+ }
+
+ };
+ var poll = function () {
+ if(this.options.enabled){
+ this.options.parameters = this.options.parameters || {};
+ this.options.parameters['percent'] = "percent";
+ this.options.parameters[this.id] = this.id;
+ var component = this;
+ window.setTimeout(function(){
+ if(component.options.onsubmit){
+ var onsubmit = eval(component.options.onsubmit)
+ var result = onsubmit.call(component);
+ if (result!=false) {
+ result = true;
+ }
+ if(result){
+ rf.ajax(component.options.pollId, null, component.options);
+ }
+ }else{
+ rf.ajax(component.options.pollId, null, component.options);
+ }
+
+ },this.options.pollinterval);
+ }
+ };
+
+ var updateComponent = function (data) {
+ this.setValue(this.value);
+ if (!data['enabled']) { this.disable(); }
+ this.updateClassName(rf.getDomElement(this.id + ":complete"),
data['completeClass']);
+ this.updateClassName(rf.getDomElement(this.id + ":remain"),
data['remainClass']);
+ this.updateClassName(rf.getDomElement(this.id), data['styleClass']);
+
+ if (this.options.pollinterval != data['interval']) {
+ this.options.pollinterval = data['interval'];
+ }
+ };
+
+ var updateClassName = function (o, newName) {
+ if (!newName) return;
+ if (o && o.className) {
+ if (o.className.indexOf(newName) < 0){
+ o.className = o.className + " " + newName;
+ }
+ }
+ };
+ var getContext = function () {
+ var context = this.context;
+ if (!context) { context = {}; }
+ context['minValue'] = (this.minValue == 0 ? "0" : this.minValue);
+ context['maxValue'] = (this.maxValue == 0 ? "0" : this.maxValue);
+ context['value'] = (this.value == 0 ? "0" : this.value);
+ if (this.progressVar) {
+ context[this.progressVar] = context['value'];
+ }
+ return context;
+ };
+
+ var getMode = function () {
+ return this.mode;
+ };
+ var getMaxValue = function () {
+ return this.maxValue;
+ };
+ var getMinValue = function () {
+ return this.minValue;
+ };
+ var isAjaxMode = function () {
+ return (this.getMode() == "ajax");
+ };
+ var calculatePercent = function(v) {
+ var min = parseFloat(this.getMinValue());
+ var max = parseFloat(this.getMaxValue());
+ var value = parseFloat(v);
+ if (value > min && value < max) {
+ return (100*(value - min))/(max - min);
+ } else if (value <= min) {
+ return 0;
+ } else if (value >= max) {
+ return 100;
+ }
+ };
+ var setValue = function (ev, val) {
+ val = this.getParameter(ev, val, "value");
+ this.value = val;
+ if (!this.isAjaxMode()) {
+ if (parseFloat(val) <= parseFloat(this.getMinValue())) {
+ this.switchState("initialState");
+ }else if (parseFloat(val) > parseFloat(this.getMaxValue())) {
+ this.switchState("completeState");
+ }else {
+ this.switchState("progressState");
+ }
+ }
+ if (!this.isAjaxMode() && this.state != "progressState") return;
+
+ if (this.markup) {
+ this.renderLabel(this.markup, this.getContext());
+ }
+ var p = this.calculatePercent(val);
+ var d = $(rf.getDomElement(this.id + ":upload"));
+ if (d != null) d.css('width', p + "%");
+
+ };
+
+ var renderLabel = function (markup, context) {
+ if (!markup || this.state != "progressState") {
+ return;
+ }
+ if (!context) {
+ context = this.getContext();
+ }
+ var html = this.interpolate(markup, context);
+ var remain = rf.getDomElement(this.id + ":remain");
+ var complete = rf.getDomElement(this.id + ":complete");
+ if(remain && complete){
+ remain.innerHTML = complete.innerHTML = html;
+ }
+
+ };
+ var interpolate = function (placeholders, context) {
+ for(var k in context) {
+ var v = context[k];
+ var regexp = new RegExp("\\{" + k + "\\}", "g");
+ placeholders = placeholders.replace(regexp, v);
+ }
+ return placeholders;
+ };
+
+ var enable = function (ev) {
+ if (!this.isAjaxMode()) {
+ this.switchState("progressState");
+ this.setValue(this.getMinValue() + 1);
+ }else if (!(this.value > this.getMaxValue())) {
+ this.disable();
+ this.poll();
+ }
+ this.disabled = false;
+ };
+ var disable = function () {
+ this.disabled = true;
+ };
+ var finish = function () {
+ if (!this.isAjaxMode()) {
+ this.switchState("completeState");
+ }else {
+ this.disable();
+ this.forceState("complete");
+ }
+ };
+ var hideAll = function () {
+ $(rf.getDomElement(this.id + ":progressState")).hide();
+ $(rf.getDomElement(this.id + ":completeState")).hide();
+ $(rf.getDomElement(this.id + ":initialState")).hide();
+ };
+ var switchState = function (state) {
+ this.state = state;
+ this.hideAll();
+ $(rf.getDomElement(this.id + ":" + state)).show();
+ };
+ var renderState = function (state) {
+ this.state = state;
+ this.hideAll();
+ $(rf.getDomElement(this.id + ":" + state)).show();
+ };
+ var forceState = function (state, oncomplete) {
+ var options = {};
+ options['parameters'] = options['parameters'] || {};
+ options['parameters']['forcePercent'] = state;
+ options['parameters'][this.id] = this.id;
+ if (oncomplete) {
+ options['oncomplete'] = oncomplete;
+ }
+ rf.ajax(this.formId, null, options);
+ };
+
+ /*
+ * Prototype definition
+ */
+ $.extend(rf.ui.ProgressBar.prototype, (function () {
+ return {
+ /*
+ * public API functions
+ */
+ name:"ProgressBar",
+ getForm: getForm,
+ getValue: getValue,
+ getParameter: getParameter,
+ onComplete: onComplete,
+ poll: poll,
+ updateComponent: updateComponent,
+ updateClassName: updateClassName,
+ getContext: getContext,
+ getMode: getMode,
+ getMaxValue: getMaxValue,
+ getMinValue: getMinValue,
+ isAjaxMode: isAjaxMode,
+ calculatePercent: calculatePercent,
+ setValue: setValue,
+ enable: enable,
+ disable: disable,
+ finish: finish,
+ hideAll: hideAll,
+ interpolate: interpolate,
+ renderLabel: renderLabel,
+ switchState: switchState,
+ renderState: renderState,
+ forceState: forceState
+
+ };
+ })());
+})(jQuery, RichFaces);
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/tabPanel.ecss 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,136 @@
+.rf-tb-hdr {
+ white-space: nowrap;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ cursor : pointer;
+ padding : 0px 5px 3px 5px;
+ vertical-align : top;
+ background-image:
"url(#{resource['org.richfaces.images:tabBg.png']})";
+ background-position: top;
+ background-repeat: repeat-x;
+ background-color: "#{richSkin.tabBackgroundColor}";
+ color: '#{richSkin.generalTextColor}';
+}
+
+
+.rf-tb-hdr-act {
+ border-bottom: 0px;
+ font-weight: bold;
+ vertical-align: top;
+ background-image:
"url(#{resource['org.richfaces.images:actTabBg.png']})";
+ background-position: top;
+ background-repeat: repeat-x;
+ background-color: "#{richSkin.additionalBackgroundColor}";
+ cursor: default;
+}
+
+.rf-tb-hdr-inact {
+}
+
+.rf-tb-hdr-dis {
+ color: "#{richSkin.tabDisabledTextColor}";
+ cursor: default;
+}
+
+.rf-tb-hdr-tabline-vis {
+ background:url("tabline_bg.gif") repeat-x scroll center top;
+ background-color: "#{richSkin.additionalBackgroundColor}";
+
+ border-color: "#{richSkin.panelBorderColor}";
+ border-style: solid;
+ border-width: 1px;
+
+ border-bottom-width: 0px;
+
+ padding-top: 2px;
+ overflow: hidden;
+ height: 25px;
+ white-space: nowrap;
+ position: relative;
+}
+
+.rf-tb-hdr-tabs {
+ border: 0px;
+ width: 100%;
+ height: 100%;
+}
+
+.rf-tb-hdr-spcr {
+ border-bottom: "1px solid #{richSkin.panelBorderColor}";
+}
+
+.rf-tb-hortab-tabspcr_wdh {
+ padding-left: 1px;
+}
+
+.rf-tb-lbl {
+ white-space: nowrap;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+}
+
+.rf-tb-hdn {
+ display: none
+}
+
+.rf-tb-hdr-scrl_l {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ left: 1px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ text-align: center;
+ font-weight: bold;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ padding-top: 6px;
+}
+
+.rf-tb-hdr-scrl_r {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ right: 17px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ text-align: center;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ font-weight: bold;
+ padding-top: 6px;
+}
+
+.rf-tb-hdr-tablst {
+ background: "url(#{resource['org.richfaces.images:actTabBg.png']}) top
repeat-x #{richSkin.additionalBackgroundColor}";
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 15px;
+ height: 25px;
+ border: "1px solid #{richSkin.panelBorderColor}";
+ font-weight: bold;
+ text-align: center;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: 14px;
+ padding-top: 2px;
+}
+
+.rf-tb-hdr_brd {
+ border: "1px solid #{richSkin.panelBorderColor}";
+ border-top: 0px;
+ height: 2px;
+ background: '#{richSkin.tabBackgroundColor}';
+}
+
+.rf-tb-cnt {
+ border: "1px solid #{richSkin.panelBorderColor}";
+ border-top: 0px;
+ font-family: '#{richSkin.generalFamilyFont}';
+ font-size: '#{richSkin.generalSizeFont}';
+ padding: 10px;
+ background: '#{richSkin.generalBackgroundColor}';
+}
+
+
Copied: branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces (from rev
19674, trunk/ui/output/ui/src/main/resources/META-INF/richfaces)
Deleted:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-26
17:10:27 UTC (rev 19674)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-27
15:07:36 UTC (rev 19690)
@@ -1,16 +0,0 @@
-org.richfaces.images\:tabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor}
-
-org.richfaces.images\:actTabBottomBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor}
-
-org.richfaces.images\:actTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=5, height=26, baseColorParam=generalBackgroundColor,
gradientColorParam=tabBackgroundColor}
-
-org.richfaces.images\:actLeftTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=26, height=5, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor, horizontal=true}
-
-org.richfaces.images\:actRightTabBg.png=org.richfaces.renderkit.html.BaseGradient\
- {width=26, height=5, baseColorParam=generalBackgroundColor,
gradientColorParam=tabBackgroundColor, horizontal=true}
-
-org.richfaces.images\:pbAniBg.gif=org.richfaces.renderkit.html.ProgressBarAnimatedBackgroundImage
\ No newline at end of file
Copied:
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
(from rev 19674,
trunk/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties)
===================================================================
---
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/main/resources/META-INF/richfaces/resource-mappings.properties 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,16 @@
+org.richfaces.images\:tabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor}
+
+org.richfaces.images\:actTabBottomBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor}
+
+org.richfaces.images\:actTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=5, height=26, baseColorParam=generalBackgroundColor,
gradientColorParam=tabBackgroundColor}
+
+org.richfaces.images\:actLeftTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=26, height=5, baseColorParam=tabBackgroundColor,
gradientColorParam=generalBackgroundColor, horizontal=true}
+
+org.richfaces.images\:actRightTabBg.png=org.richfaces.renderkit.html.BaseGradient\
+ {width=26, height=5, baseColorParam=generalBackgroundColor,
gradientColorParam=tabBackgroundColor, horizontal=true}
+
+org.richfaces.images\:pbAniBg.gif=org.richfaces.renderkit.html.ProgressBarAnimatedBackgroundImage
\ No newline at end of file
Modified: branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml 2010-10-27
15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/templates/panel.template.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -17,13 +17,13 @@
<div cdk:passThroughWithExclusions="id,value,styleClass,class"
id="#{clientId}" class="rf-p
#{component.attributes['styleClass']}">
<c:choose>
<c:when test="#{component.getFacet('header') != null and
component.getFacet('header').rendered}">
- <div id="#{clientId}_header" class="rf-p-hr
#{component.attributes['headerClass']}">
+ <div id="#{clientId}_header" class="rf-p-hdr
#{component.attributes['headerClass']}">
<!-- <cc:renderFacet name="header" />-->
<cdk:call expression="renderHeaderFacet(facesContext, component)"
/>
</div>
</c:when>
<c:when test="#{component.attributes['header']!= null and not
component.attributes['header'].equals('')}">
- <div id="#{clientId}_header" class="rf-p-hr
#{component.attributes['headerClass']}">
+ <div id="#{clientId}_header" class="rf-p-hdr
#{component.attributes['headerClass']}">
#{component.attributes['header']}
</div>
</c:when>
Modified: branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-10-27
15:01:04 UTC (rev 19689)
+++ branches/RF-7817/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -24,49 +24,49 @@
onmousedown="#{component.attributes['onmaskmousedown']}"
onmousemove="#{component.attributes['onmaskmousemove']}"
onmouseover="#{component.attributes['onmaskmouseover']}"
- onmouseout="#{component.attributes['onmaskmouseout']}"
class="rf-pp-sh">
- <button class="rf-pp-b"
id="#{clientId}FirstHref"></button>
+ onmouseout="#{component.attributes['onmaskmouseout']}"
class="rf-pp-shade">
+ <button class="rf-pp-btn"
id="#{clientId}FirstHref"></button>
</div>
</c:if>
- <div id="#{clientId}_shadow" style="position:
#{component.attributes['followByScroll'] ? 'fixed' :
'absolute'};" class="rf-pp-shw"/>
- <div id="#{clientId}_container" style="position:
#{component.attributes['followByScroll'] ? 'fixed' :
'absolute'};" cdk:passThroughWithExclusions="id style class
styleClass" class="rf-pp-cr
#{component.attributes['styleClass']}">
+ <div id="#{clientId}_shadow" style="position:
#{component.attributes['followByScroll'] ? 'fixed' :
'absolute'};" class="rf-pp-shdw"/>
+ <div id="#{clientId}_container" style="position:
#{component.attributes['followByScroll'] ? 'fixed' :
'absolute'};" cdk:passThroughWithExclusions="id style class
styleClass" class="rf-pp-cntr
#{component.attributes['styleClass']}">
<c:if test="#{component.getFacet('header')!=null and
component.getFacet('header').rendered}">
- <div id="#{clientId}_header" class="rf-pp-h
#{component.attributes['headerClass']}" >
- <div id="#{clientId}_header_content" class="rf-pp-h-ct">
+ <div id="#{clientId}_header" class="rf-pp-hdr
#{component.attributes['headerClass']}" >
+ <div id="#{clientId}_header_content" class="rf-pp-hdr-cnt">
<cdk:call expression="renderHeaderFacet(facesContext, component)"/>
</div>
</div>
</c:if>
<c:if test="#{component.attributes['header'] != null and
(component.getFacet('header')==null or
!component.getFacet('header').rendered)}">
- <div id="#{clientId}_header" class="rf-pp-h
#{component.attributes['headerClass']}" >
- <div id="#{clientId}_header_content" class="rf-pp-h-ct">
+ <div id="#{clientId}_header" class="rf-pp-hdr
#{component.attributes['headerClass']}" >
+ <div id="#{clientId}_header_content" class="rf-pp-hdr-cnt">
#{component.attributes['header']}
</div>
</div>
</c:if>
<c:if test="#{component.getFacet('controls')!=null and
component.getFacet('controls').rendered}">
- <div id="#{clientId}_header_controls" class="rf-pp-h-cs
#{component.attributes['controlsClass']}">
+ <div id="#{clientId}_header_controls" class="rf-pp-hdr-cntrls
#{component.attributes['controlsClass']}">
<cdk:call expression="renderControlsFacet(facesContext,
component)"/>
</div>
</c:if>
- <div id="#{clientId}_content_scroller"
style="#{getStyleIfTrimmed(component)}" class="rf-pp-ct-sr">
- <div id="#{clientId}_content" class="rf-pp-ct"
style="#{component.attributes['style']}">
+ <div id="#{clientId}_content_scroller"
style="#{getStyleIfTrimmed(component)}" class="rf-pp-cnt-scrlr">
+ <div id="#{clientId}_content" class="rf-pp-cnt"
style="#{component.attributes['style']}">
<cdk:call expression="renderChildren(facesContext, component)"/>
</div>
</div>
<c:if test="#{component.attributes['resizeable']}">
- <div id="#{clientId}ResizerW" class="rf-pp-hr
rf-pp-hr-l"></div>
- <div id="#{clientId}ResizerE" class="rf-pp-hr
rf-pp-hr-r"></div>
- <div id="#{clientId}ResizerN" class="rf-pp-hr
rf-pp-hr-t"></div>
+ <div id="#{clientId}ResizerW" class="rf-pp-hndlr
rf-pp-hndlr-l"></div>
+ <div id="#{clientId}ResizerE" class="rf-pp-hndlr
rf-pp-hndlr-r"></div>
+ <div id="#{clientId}ResizerN" class="rf-pp-hndlr
rf-pp-hndlr-t"></div>
- <div id="#{clientId}ResizerS" class="rf-pp-hr
rf-pp-hr-b"></div>
- <div id="#{clientId}ResizerNW" class="rf-pp-hr
rf-pp-hr-tl"></div>
- <div id="#{clientId}ResizerNE" class="rf-pp-hr
rf-pp-hr-tr"></div>
- <div id="#{clientId}ResizerSW" class="rf-pp-hr
rf-pp-hr-bl"></div>
- <div id="#{clientId}ResizerSE" class="rf-pp-hr
rf-pp-hr-br"></div>
+ <div id="#{clientId}ResizerS" class="rf-pp-hndlr
rf-pp-hndlr-b"></div>
+ <div id="#{clientId}ResizerNW" class="rf-pp-hndlr
rf-pp-hndlr-tl"></div>
+ <div id="#{clientId}ResizerNE" class="rf-pp-hndlr
rf-pp-hndlr-tr"></div>
+ <div id="#{clientId}ResizerSW" class="rf-pp-hndlr
rf-pp-hndlr-bl"></div>
+ <div id="#{clientId}ResizerSE" class="rf-pp-hndlr
rf-pp-hndlr-br"></div>
</c:if>
</div>
Copied: branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml (from
rev 19674, trunk/ui/output/ui/src/main/templates/progressBar.template.xml)
===================================================================
--- branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml
(rev 0)
+++ branches/RF-7817/ui/output/ui/src/main/templates/progressBar.template.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root
xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
+
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
+
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
+
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.ProgressBarRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.ProgressBarBaseRenderer</cdk:superclass>
+ <cdk:component-family>org.richfaces.ProgressBarRenderer</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ProgressBarRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <c:choose>
+ <c:when test="#{isAjaxMode(component)}">
+ <cdk:object type="java.lang.String" name="state"
value="#{getCurrentOrForcedState(facesContext, component)}" />
+
+ <c:if test="#{state eq 'initialState'}">
+ <div id="#{clientId}"
class="#{component.attributes['initialClass']}"
style="#{component.attributes['style']}">
+ <cdk:call expression="renderInitialFacet(facesContext,
component)"/>
+ </div>
+ </c:if>
+ <c:if test="#{state eq 'completeState'}">
+ <div id="#{clientId}"
class="#{component.attributes['finishClass']}"
style="#{component.attributes['style']}">
+ <cdk:call expression="renderCompleteFacet(facesContext,
component)"/>
+ </div>
+ </c:if>
+ <c:if test="#{state eq 'progressState'}">
+ <cdk:object type="java.lang.String" name="shellStyle"
value="#{getShellStyle(facesContext, component)}" />
+ <div cdk:passThroughWithExclusions="onclick, ondblclick, onmouseup,
onmousedown, onmousemove, onmouseover, onmouseout" id="#{clientId}"
class="rf-pb-cnt #{shellStyle} #{component.attributes['styleClass']}"
style="#{component.attributes['style']}">
+ <c:if test="#{!isSimpleMarkup(component)}">
+ <div class="rf-pb-rmnd #{component.attributes['remainClass']}"
id="#{clientId}:remain"
style="#{component.attributes['style']}"/>
+ <div class="rf-pb-upl-dig" id="#{clientId}:upload"
style="#{component.attributes['style']};
width:#{getWidth(component)}%;">
+ <div class="rf-pb-cmpltd
#{component.attributes['completeClass']}" id="#{clientId}:complete"
style="#{component.attributes['style']}"/>
+ </div>
+ </c:if>
+ <c:if test="#{isSimpleMarkup(component)}">
+ <div class="rf-pb-upl #{component.attributes['completeClass']}"
id="#{clientId}:upload" style="#{component.attributes['style']};
width:#{getWidth(component)}%;"/>
+ </c:if>
+ <script type="text/javascript">
+ #{getInitialScript(facesContext, component, 'progressState')}
+ #{getPollScript(facesContext, component)}
+ </script>
+
+ </div>
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <div id="#{clientId}" >
+ <div id="#{clientId}:initialState"
class="#{component.attributes['initialClass']}"
style="#{component.attributes['style']} display:none;">
+ <cdk:call expression="renderInitialFacet(facesContext, component)"/>
+ </div>
+ <cdk:object type="java.lang.String" name="shellStyle"
value="#{getShellStyle(facesContext, component)}" />
+ <div cdk:passThroughWithExclusions="onclick, ondblclick, onmouseup,
onmousedown, onmousemove, onmouseover, onmouseout"
id="#{clientId}:progressState" class="rf-pb-cnt #{shellStyle}
#{component.attributes['styleClass']}"
style="#{component.attributes['style']} display:none;">
+ <c:if test="#{!isSimpleMarkup(component)}">
+ <div class="rf-pb-rmnd #{component.attributes['remainClass']}"
id="#{clientId}:remain"
style="#{component.attributes['style']}"/>
+ <div class="rf-pb-upl-dig" id="#{clientId}:upload"
style="#{component.attributes['style']};
width=#{getWidth(component)}%;">
+ <div class="rf-pb-cmpltd
#{component.attributes['completeClass']}" id="#{clientId}:complete"
style="#{component.attributes['style']}"/>
+ </div>
+ </c:if>
+ <c:if test="#{isSimpleMarkup(component)}">
+ <div class="rf-pb-upl #{component.attributes['completeClass']}"
id="#{clientId}:upload" style="#{component.attributes['style']};
width=#{getWidth(component)}%;"/>
+ </c:if>
+ </div>
+ <div id="#{clientId}:completeState"
class="#{component.attributes['finishClass']}"
style="#{component.attributes['style']} display:none;">
+ <cdk:call expression="renderCompleteFacet(facesContext,
component)"/>
+ </div>
+ <cdk:object type="java.lang.String" name="state"
value="#{getCurrentState(facesContext, component)}" />
+ <script type="text/javascript">
+ #{getInitialScript(facesContext, component, state)}
+ #{getRenderStateScript(facesContext, component, state)}
+ </script>
+ </div>
+
+ </c:otherwise>
+ </c:choose>
+ </cc:implementation>
+</cdk:root>
\ No newline at end of file
Copied:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java
(from rev 19674,
trunk/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UICollapsiblePanelTest.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-27
+ */
+public class UICollapsiblePanelTest {
+
+ private UICollapsiblePanel collapsiblePanel;
+
+ @Before
+ public void setUp () {
+ collapsiblePanel = new UICollapsiblePanel();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(collapsiblePanel);
+ }
+}
+
Copied:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java
(from rev 19674,
trunk/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/component/UITogglePanelTitledItemTest.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component;
+
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import javax.faces.component.UIComponent;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since 2010-08-24
+ */
+public class UITogglePanelTitledItemTest {
+
+ private UITogglePanelTitledItem togglePanelTitledItem;
+
+ @Before
+ public void setUp () {
+ togglePanelTitledItem = new UITogglePanelTitledItem();
+ }
+
+ @Test
+ public void testSomething() {
+ Assert.assertNotNull(togglePanelTitledItem);
+ }
+}
+
Copied:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
(from rev 19674,
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/IgnoreScriptsContent.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,60 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import org.custommonkey.xmlunit.Difference;
+import org.custommonkey.xmlunit.DifferenceConstants;
+import org.custommonkey.xmlunit.DifferenceListener;
+import org.custommonkey.xmlunit.IgnoreTextAndAttributeValuesDifferenceListener;
+import org.w3c.dom.Node;
+
+import java.util.Arrays;
+
+/**
+ * @author akolonitsky
+ * @since Oct 22, 2010
+ */
+public class IgnoreScriptsContent implements DifferenceListener {
+ private static final int[] IGNORE = new int[] {
+ DifferenceConstants.HAS_DOCTYPE_DECLARATION_ID,
+ DifferenceConstants.DOCTYPE_NAME_ID,
+ DifferenceConstants.DOCTYPE_PUBLIC_ID_ID,
+ DifferenceConstants.DOCTYPE_SYSTEM_ID_ID
+ };
+
+ static {
+ Arrays.sort(IGNORE);
+ }
+
+ public int differenceFound(Difference difference) {
+ if (DifferenceConstants.TEXT_VALUE_ID == difference.getId()
+ &&
!"script".equalsIgnoreCase(difference.getTestNodeDetail().getNode().getLocalName()))
{
+
+ return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
+ }
+ return RETURN_ACCEPT_DIFFERENCE;
+ }
+
+ public void skippedComparison(Node node, Node node1) {
+
+ }
+}
Copied:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
(from rev 19674,
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuRendererTest.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit.html;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.xml.sax.SAXException;
+
+import java.io.IOException;
+
+ /**
+ * @author akolonitsky
+ * @since 2010-10-25
+ */
+public class PanelMenuRendererTest extends RendererTestBase {
+
+ @Test
+ @Ignore
+ public void testDoEncode() throws IOException, SAXException {
+ doTest("panelMenu", "panelMenu");
+ }
+
+}
+
+
+
Modified:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -130,7 +130,7 @@
assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
assertEquals("||||",
nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
HtmlElement nestedPanelContainerHeader =
page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-p-hr outpanelHeader",
nestedPanelContainerHeader.getAttribute("class"));
+ assertEquals("rf-p-hdr outpanelHeader",
nestedPanelContainerHeader.getAttribute("class"));
assertEquals("Benefits of Usin", nestedPanelContainer
.getElementById("nestedPanelContainer_body")
.getTextContent().trim().substring(0, 16));
Modified:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-10-27
15:01:04 UTC (rev 19689)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -89,30 +89,30 @@
assertNotNull(panelWithFacet);
assertEquals("visibility: hidden;",
panelWithFacet.getAttribute("style"));
HtmlElement panelShade = panelWithFacet.getElementById("panel_shade");
- assertEquals("rf-pp-sh", panelShade.getAttribute("class"));
+ assertEquals("rf-pp-shade",
panelShade.getAttribute("class"));
assertNotNull(panelShade);
HtmlElement panelShadow =
panelWithFacet.getElementById("panel_shadow");
- assertEquals("rf-pp-shw",
panelShadow.getAttribute("class"));
+ assertEquals("rf-pp-shdw",
panelShadow.getAttribute("class"));
assertNotNull(panelShadow);
HtmlElement panelContainer =
panelWithFacet.getElementById("panel_container");
assertNotNull(panelContainer);
- assertEquals("rf-pp-cr panelStyle",
panelContainer.getAttribute("class"));
+ assertEquals("rf-pp-cntr panelStyle",
panelContainer.getAttribute("class"));
HtmlElement panelScroller =
panelWithFacet.getElementById("panel_content_scroller");
assertNotNull(panelScroller);
- assertEquals("rf-pp-ct-sr",
panelScroller.getAttribute("class"));
+ assertEquals("rf-pp-cnt-scrlr",
panelScroller.getAttribute("class"));
HtmlElement panelContent =
panelWithFacet.getElementById("panel_content");
assertNotNull(panelContent);
- assertEquals("rf-pp-ct",
panelContent.getAttribute("class"));
+ assertEquals("rf-pp-cnt",
panelContent.getAttribute("class"));
assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
HtmlElement panelHeader =
panelWithFacet.getElementById("panel_header");
assertNotNull(panelHeader);
- assertEquals("rf-pp-h header",
panelHeader.getAttribute("class"));
+ assertEquals("rf-pp-hdr header",
panelHeader.getAttribute("class"));
//assertEquals("cursor: move;",
panelHeader.getAttribute("style"));
assertEquals("Write your own custom rich components with built-in
AJAX", panelHeader.getTextContent().trim());
HtmlElement panelResizer =
panelWithFacet.getElementById("panelResizerN");
assertNotNull(panelResizer);
- assertEquals("rf-pp-hr rf-pp-hr-t",
panelResizer.getAttribute("class"));
+ assertEquals("rf-pp-hndlr rf-pp-hndlr-t",
panelResizer.getAttribute("class"));
assertEquals("cursor: N-resize;",
panelResizer.getAttribute("style"));
List<HtmlElement> result = page.getElementsByName("script");
HtmlElement button = panelWithFacet.getElementById("button");
Copied:
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
(from rev 19674,
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,92 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
+import org.jboss.test.faces.htmlunit.HtmlUnitEnvironment;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.xml.sax.SAXException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URISyntaxException;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * @author akolonitsky
+ * @since Oct 22, 2010
+ */
+public abstract class RendererTestBase {
+
+ static {
+ XMLUnit.setNormalizeWhitespace(true);
+ XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
+ XMLUnit.setIgnoreWhitespace(true);
+ XMLUnit.setIgnoreComments(true);
+
+ }
+
+ protected HtmlUnitEnvironment environment;
+
+ @Before
+ public void setUp() throws URISyntaxException {
+ environment = new HtmlUnitEnvironment();
+ environment.withWebRoot(new
File(this.getClass().getResource(".").toURI()));
+ environment.start();
+ }
+
+ @After
+ public void tearDown() {
+ environment.release();
+ environment = null;
+ }
+
+ protected void doTest(String pageName, String pageElementToTest) throws IOException,
SAXException {
+ HtmlPage page = environment.getPage('/' + pageName + ".jsf");
+ HtmlElement panel = page.getElementById(pageElementToTest);
+ assertNotNull(panel);
+
+ checkXmlStructure(pageName, panel.asXml());
+ }
+
+ protected void checkXmlStructure(String pageName, String pageCode) throws
SAXException, IOException {
+ InputStream expectedPageCode = this.getClass().getResourceAsStream(pageName +
".xmlunit.xml");
+ if (expectedPageCode == null) {
+ return;
+ }
+
+ Diff xmlDiff = new Diff(new StringReader(pageCode), new
InputStreamReader(expectedPageCode));
+ xmlDiff.overrideDifferenceListener(new IgnoreScriptsContent());
+ Assert.assertTrue("XML was not similar:" + xmlDiff.toString(),
xmlDiff.similar());
+ }
+
+}
+
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org (from rev 19674,
trunk/ui/output/ui/src/test/resources/org)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces (from rev 19674,
trunk/ui/output/ui/src/test/resources/org/richfaces)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit (from rev
19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit)
Copied: branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html
(from rev 19674, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html)
Deleted:
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-26
17:10:27 UTC (rev 19674)
+++
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -1,47 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
- JBoss, Home of Professional Open Source
- Copyright ${year}, 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.
--->
-
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:pn="http://richfaces.org/output"
-
xmlns:rich="http://richfaces.org/rich">
-
- <h:head>
- <title>Richfaces PanelMenu Test</title>
- </h:head>
-
-<h:body>
- <h:form id="f" style="border:blue solid thin;">
- <pn:panelMenu id="panelMenu">
- <!-- TODO -->
- </pn:panelMenu>
- </h:form>
-</h:body>
-</html>
-
-
Copied:
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
(from rev 19674,
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xhtml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:pn="http://richfaces.org/output"
+
xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenu Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:panelMenu id="panelMenu">
+ <!-- TODO -->
+ </pn:panelMenu>
+ </h:form>
+</h:body>
+</html>
+
+
Deleted:
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
===================================================================
---
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-26
17:10:27 UTC (rev 19674)
+++
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -1,5 +0,0 @@
-<div id="panelMenu" class="rf-panelMenu">
- <script type="text/javascript">
- // Text between <script> ... </script> don't compared
- </script>
-</div>
Copied:
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
(from rev 19674,
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml)
===================================================================
---
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml
(rev 0)
+++
branches/RF-7817/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu.xmlunit.xml 2010-10-27
15:07:36 UTC (rev 19690)
@@ -0,0 +1,5 @@
+<div id="panelMenu" class="rf-panelMenu">
+ <script type="text/javascript">
+ // Text between <script> ... </script> don't compared
+ </script>
+</div>