JBoss Rich Faces SVN: r18023 - in root/commons/trunk: api and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-07-13 15:48:10 -0400 (Tue, 13 Jul 2010)
New Revision: 18023
Modified:
root/commons/trunk/api/pom.xml
root/commons/trunk/bom/pom.xml
root/commons/trunk/parent/pom.xml
root/commons/trunk/pom.xml
Log:
[maven-release-plugin] prepare release richfaces-commons-4.0.0.20100713-M1
Modified: root/commons/trunk/api/pom.xml
===================================================================
--- root/commons/trunk/api/pom.xml 2010-07-13 19:47:36 UTC (rev 18022)
+++ root/commons/trunk/api/pom.xml 2010-07-13 19:48:10 UTC (rev 18023)
@@ -21,13 +21,13 @@
<parent>
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-api</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<name>RichFaces Commons API</name>
<dependencies>
@@ -72,8 +72,8 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/api</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/api</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/api</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/tags/richfa...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/tags/richfaces...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/tags/richfaces-com...</url>
</scm>
</project>
\ No newline at end of file
Modified: root/commons/trunk/bom/pom.xml
===================================================================
--- root/commons/trunk/bom/pom.xml 2010-07-13 19:47:36 UTC (rev 18022)
+++ root/commons/trunk/bom/pom.xml 2010-07-13 19:48:10 UTC (rev 18023)
@@ -23,7 +23,7 @@
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-bom</artifactId>
<packaging>pom</packaging>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<name>RichFaces Commons BOM</name>
<parent>
@@ -62,9 +62,9 @@
</dependencyManagement>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/bom</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/bom</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/bom</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/tags/richfa...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/tags/richfaces...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/tags/richfaces-com...</url>
</scm>
</project>
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-07-13 19:47:36 UTC (rev 18022)
+++ root/commons/trunk/parent/pom.xml 2010-07-13 19:48:10 UTC (rev 18023)
@@ -21,7 +21,7 @@
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-parent</artifactId>
<packaging>pom</packaging>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<name>RichFaces Commons Parent</name>
<parent>
@@ -78,8 +78,8 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk/parent</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk/parent</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk/parent</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/tags/richfa...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/tags/richfaces...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/tags/richfaces-com...</url>
</scm>
</project>
\ No newline at end of file
Modified: root/commons/trunk/pom.xml
===================================================================
--- root/commons/trunk/pom.xml 2010-07-13 19:47:36 UTC (rev 18022)
+++ root/commons/trunk/pom.xml 2010-07-13 19:48:10 UTC (rev 18023)
@@ -28,7 +28,7 @@
<groupId>org.richfaces.commons</groupId>
<artifactId>richfaces-commons-aggregator</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<packaging>pom</packaging>
<name>Richfaces Commons Aggregator</name>
@@ -42,9 +42,9 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/root/commons/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/commons/tags/richfa...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/commons/tags/richfaces...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/commons/tags/richfaces-com...</url>
</scm>
</project>
14 years, 6 months
JBoss Rich Faces SVN: r18022 - root/commons/trunk/bom.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-07-13 15:47:36 -0400 (Tue, 13 Jul 2010)
New Revision: 18022
Modified:
root/commons/trunk/bom/pom.xml
Log:
[RichFaces Release Script] Updated intermodule version of org.richfaces.bom.version properties to: 4.0.0.20100713-M1
Modified: root/commons/trunk/bom/pom.xml
===================================================================
--- root/commons/trunk/bom/pom.xml 2010-07-13 19:46:36 UTC (rev 18021)
+++ root/commons/trunk/bom/pom.xml 2010-07-13 19:47:36 UTC (rev 18022)
@@ -39,7 +39,7 @@
<url>http://www.jboss.org/richfaces</url>
<properties>
- <org.richfaces.bom.version>4.0.0-SNAPSHOT</org.richfaces.bom.version>
+ <org.richfaces.bom.version>4.0.0.20100713-M1</org.richfaces.bom.version>
</properties>
<!-- Runtime dependency management -->
14 years, 6 months
JBoss Rich Faces SVN: r18020 - root/build/bom/tags.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-07-13 15:46:32 -0400 (Tue, 13 Jul 2010)
New Revision: 18020
Added:
root/build/bom/tags/richfaces-bom-4.0.0.20100713-M1/
Log:
[maven-scm] copy for tag richfaces-bom-4.0.0.20100713-M1
Copied: root/build/bom/tags/richfaces-bom-4.0.0.20100713-M1 (from rev 18019, root/build/bom/trunk)
14 years, 6 months
JBoss Rich Faces SVN: r18019 - root/build/bom/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-07-13 15:46:20 -0400 (Tue, 13 Jul 2010)
New Revision: 18019
Modified:
root/build/bom/trunk/pom.xml
Log:
[maven-release-plugin] prepare release richfaces-bom-4.0.0.20100713-M1
Modified: root/build/bom/trunk/pom.xml
===================================================================
--- root/build/bom/trunk/pom.xml 2010-07-13 19:23:08 UTC (rev 18018)
+++ root/build/bom/trunk/pom.xml 2010-07-13 19:46:20 UTC (rev 18019)
@@ -15,14 +15,13 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<packaging>pom</packaging>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0.20100713-M1</version>
<name>RichFaces BOM</name>
<parent>
@@ -128,11 +127,11 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/build/bom/trunk
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/build/bom/tags/rich...
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/build/bom/trunk
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/build/bom/tags/richfac...
</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/root/build/bom/trunk</url>
+ <url>http://fisheye.jboss.org/browse/richfaces/root/build/bom/tags/richfaces-b...</url>
</scm>
</project>
14 years, 6 months
JBoss Rich Faces SVN: r18018 - root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-13 15:23:08 -0400 (Tue, 13 Jul 2010)
New Revision: 18018
Modified:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
Log:
Invalid sizer code fixed
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-13 19:16:18 UTC (rev 18017)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-13 19:23:08 UTC (rev 18018)
@@ -177,7 +177,7 @@
}
$.extend(richfaces.ui.PopupPanel.Sizer.SE.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
- $.extend(richfaces.ui.PopupPanel.Sizer.prototype.SE, {
+ $.extend(richfaces.ui.PopupPanel.Sizer.SE.prototype, {
name: "richfaces.ui.PopupPanel.Sizer.SE",
14 years, 6 months
JBoss Rich Faces SVN: r18017 - in root/ui/output/trunk/panels/ui/src: main/java/org/richfaces/renderkit/html and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-13 15:16:18 -0400 (Tue, 13 Jul 2010)
New Revision: 18017
Added:
root/ui/output/trunk/panels/ui/src/test/resources/popupPanelTest.xhtml
Removed:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/panels.taglib.xml
root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
Modified:
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/pn.taglib.xml
root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
Log:
Fresh panel fixes:
- Checkstyle problems
- Renamed CDK attribute
- Added null check in setParent(...) method
- Unit test failures
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanelItem.java 2010-07-13 19:16:18 UTC (rev 18017)
@@ -48,7 +48,7 @@
@Override
public void setParent(UIComponent parent) {
- if (!(parent instanceof AbstractTogglePanel)) {
+ if (parent != null && !(parent instanceof AbstractTogglePanel)) {
throw new IllegalArgumentException("Parent of TogglePanelItem can be only TogglePanel.");
}
super.setParent(parent);
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 19:16:18 UTC (rev 18017)
@@ -189,23 +189,23 @@
}
public void setResizeable(boolean resizeable) {
- getStateHelper().put(PropertyKeys.resizeable, resizeable);
- }
+ getStateHelper().put(PropertyKeys.resizeable, resizeable);
+ }
- public boolean isTrimOverlayedElements() {
- return (Boolean) getStateHelper().eval(
- PropertyKeys.trimOverlayedElements, false);
- }
+ public boolean isTrimOverlayedElements() {
+ return (Boolean) getStateHelper().eval(
+ PropertyKeys.trimOverlayedElements, false);
+ }
- public void setTrimOverlayedElements(boolean trimOverlayedElements) {
- getStateHelper().put(PropertyKeys.trimOverlayedElements,
- trimOverlayedElements);
- }
+ public void setTrimOverlayedElements(boolean trimOverlayedElements) {
+ getStateHelper().put(PropertyKeys.trimOverlayedElements,
+ trimOverlayedElements);
+ }
- public String getDomElementAttachment() {
- return (String) getStateHelper()
- .eval(PropertyKeys.domElementAttachment);
- }
+ public String getDomElementAttachment() {
+ return (String) getStateHelper()
+ .eval(PropertyKeys.domElementAttachment);
+ }
public void setDomElementAttachment(String domElementAttachment) {
getStateHelper().put(PropertyKeys.domElementAttachment, domElementAttachment);
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 19:16:18 UTC (rev 18017)
@@ -152,8 +152,8 @@
}
public String getStyleIfTrimmed(UIComponent panel){
- if(panel.getAttributes().get("trimOverlayedElements").equals(Boolean.TRUE)) {
- return "position: relative, z-index : 0";
+ if (panel.getAttributes().get("trimOverlayedElements").equals(Boolean.TRUE)) {
+ return "position: relative, z-index : 0";
}
return "";
}
Deleted: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/panels.taglib.xml
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/panels.taglib.xml 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/panels.taglib.xml 2010-07-13 19:16:18 UTC (rev 18017)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" version="2.0" id="a4j">
- <namespace>http://richfaces.org/panels</namespace>
- <tag>
- <tag-name>panel</tag-name>
- <component>
- <component-type>org.richfaces.Panel</component-type>
- <renderer-type>org.richfaces.PanelRenderer</renderer-type>
- </component>
- </tag>
-
- <tag>
- <tag-name>popupPanel</tag-name>
- <component>
- <component-type>org.richfaces.PopupPanel</component-type>
- <renderer-type>org.richfaces.PopupPanelRenderer</renderer-type>
- </component>
- </tag>
-</facelet-taglib>
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/pn.taglib.xml 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/pn.taglib.xml 2010-07-13 19:16:18 UTC (rev 18017)
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" version="2.0" id="pn">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+ version="2.0" id="pn">
<namespace>http://richfaces.org/panels</namespace>
<tag>
@@ -17,7 +18,7 @@
<component>
<component-type>org.richfaces.panels.DivPanel</component-type>
<renderer-type>org.richfaces.panels.DivPanelRenderer</renderer-type>
-
+
</component>
<attribute>
<description></description>
@@ -280,8 +281,7 @@
<description>
<p class="changed_added_2_0">If present, this attribute refers
to the value of one of the exposed attached objects within the
- composite component inside of which this tag is nested.</p>
- </description>
+ composite component inside of which this tag is nested.</p> </description>
<name>for</name>
<required>false</required>
<type>java.lang.String</type>
@@ -293,7 +293,7 @@
<component>
<component-type>org.richfaces.panels.TogglePanelItem</component-type>
<renderer-type>org.richfaces.panels.TogglePanelItemRenderer</renderer-type>
-
+
</component>
<attribute>
<description></description>
@@ -395,4 +395,19 @@
</tag>
+ <tag>
+ <tag-name>panel</tag-name>
+ <component>
+ <component-type>org.richfaces.Panel</component-type>
+ <renderer-type>org.richfaces.PanelRenderer</renderer-type>
+ </component>
+ </tag>
+
+ <tag>
+ <tag-name>popupPanel</tag-name>
+ <component>
+ <component-type>org.richfaces.PopupPanel</component-type>
+ <renderer-type>org.richfaces.PopupPanelRenderer</renderer-type>
+ </component>
+ </tag>
</facelet-taglib>
Modified: root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 19:16:18 UTC (rev 18017)
@@ -28,7 +28,7 @@
</c:if>
<div id="#{clientId}_shadow" class="mp_shadow"/>
- <div id="#{clientId}_container" cdk:passThruWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
+ <div id="#{clientId}_container" cdk:passThroughWithExclusions="id style class styleClass" class="mp_container #{component.attributes['styleClass']}">
<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
<div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
@@ -43,7 +43,7 @@
</div>
</c:if>
- <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="mp_content_scroller}">
+ <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="mp_content_scroller">
<div id="#{clientId}_content" class="mp_content" style="#{component.attributes['style']}">
<cdk:call expression="renderChildren(facesContext, component)"/>
</div>
Modified: root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 19:16:18 UTC (rev 18017)
@@ -19,11 +19,10 @@
* 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;
+package org.richfaces.renderkit.html;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
@@ -38,8 +37,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.richfaces.component.UIPanel;
-import org.richfaces.component.UIPopupPanel;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
@@ -117,7 +114,7 @@
assertEquals("mp_container panelStyle", panelContainer.getAttribute("class"));
HtmlElement panelScroller = panelWithFacet.getElementById("panel_content_scroller");
assertNotNull(panelScroller);
- assertEquals("mp_content_scroller ", panelScroller.getAttribute("class"));
+ assertEquals("mp_content_scroller", panelScroller.getAttribute("class"));
HtmlElement panelContent = panelWithFacet.getElementById("panel_content");
assertNotNull(panelContent);
assertEquals("mp_content", panelContent.getAttribute("class"));
@@ -127,10 +124,7 @@
assertNotNull(panelHeader);
assertEquals("mp_header header", panelHeader.getAttribute("class"));
assertEquals("cursor: move;", panelHeader.getAttribute("style"));
- assertEquals("Write your own custom rich components with built-in AJAX\n\t\t\tModal", panelHeader.getTextContent().trim());
- HtmlElement panelHeaderControls = panelWithFacet.getElementById("panel_header_controls");
- assertNotNull(panelHeaderControls);
- assertEquals("mp_header_controls control", panelHeaderControls.getAttribute("class"));
+ assertEquals("Write your own custom rich components with built-in AJAX", panelHeader.getTextContent().trim());
HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
assertNotNull(panelResizer);
assertEquals("mp_handler mp_handler_top", panelResizer.getAttribute("class"));
Copied: root/ui/output/trunk/panels/ui/src/test/resources/popupPanelTest.xhtml (from rev 18015, root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml)
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/popupPanelTest.xhtml (rev 0)
+++ root/ui/output/trunk/panels/ui/src/test/resources/popupPanelTest.xhtml 2010-07-13 19:16:18 UTC (rev 18017)
@@ -0,0 +1,59 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!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:rich="http://richfaces.org/panels">
+
+ <h:head>
+ <title>Richfaces ExtendedDataTable Test</title>
+ </h:head>
+
+ <h:body>
+ <rich:popupPanel styleClass="panelStyle" headerClass="header" controlsClass="control"
+
+
+ id="panel"
+ >
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX
+ </f:facet>
+ <h:form>
+ <h:panelGroup layout="block"
+ style="width:500px,height:400px;">
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These
+ capabilities help to avoid a routine process of a
+ component creation. The component factory works like
+ a well-oiled machine allowing the creation of
+ first-class rich components with built-in Ajax
+ functionality even more easily than the creation of
+ simpler components by means of the traditional
+ coding approach.
+
+
+ <h:inputText value="aaa" />
+ <a href="#"
+ onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
+ setSize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
+ resize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
+ move
+ </a>
+
+ <a href="#"
+ onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
+ moveTo
+ </a>
+ </h:panelGroup>
+ </h:form>
+ </rich:popupPanel>
+ </h:body>
+</html>
Deleted: root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
===================================================================
--- root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 19:08:44 UTC (rev 18016)
+++ root/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 19:16:18 UTC (rev 18017)
@@ -1,62 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!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:rich="http://richfaces.org/rich">
-
- <h:head>
- <title>Richfaces ExtendedDataTable Test</title>
- </h:head>
-
- <h:body>
- <rich:popupPanel styleClass="panelStyle" headerClass="header" controlsClass="control"
-
-
- id="panel"
- >
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX
- </f:facet>
- <f:facet name="controls">
- <h:outputText value="Modal" />
- </f:facet>
- <h:form>
- <h:panelGroup layout="block"
- style="width:500px,height:400px;">
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These
- capabilities help to avoid a routine process of a
- component creation. The component factory works like
- a well-oiled machine allowing the creation of
- first-class rich components with built-in Ajax
- functionality even more easily than the creation of
- simpler components by means of the traditional
- coding approach.
-
-
- <h:inputText value="aaa" />
- <a href="#"
- onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
- setSize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
- resize
- </a>
- <a href="#"
- onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
- move
- </a>
-
- <a href="#"
- onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
- moveTo
- </a>
- </h:panelGroup>
- </h:form>
- </rich:popupPanel>
- </h:body>
-</html>
14 years, 6 months
JBoss Rich Faces SVN: r18016 - in branches/development/iterators: ui/core/trunk/ui/src/main/java/org/richfaces/component and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-07-13 15:08:44 -0400 (Tue, 13 Jul 2010)
New Revision: 18016
Added:
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js
Removed:
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/css/
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/images/
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss
branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/script/
Modified:
branches/development/iterators/
branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java
branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
branches/development/iterators/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java
branches/development/iterators/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
branches/development/iterators/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
branches/development/iterators/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
Log:
Merged revisions 18004,18006-18015 via svnmerge from
https://svn.jboss.org/repos/richfaces/root
.......
r18004 | amarkhel | 2010-07-13 11:25:47 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18006 | amarkhel | 2010-07-13 11:28:03 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18007 | amarkhel | 2010-07-13 11:28:20 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18008 | amarkhel | 2010-07-13 11:28:39 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18009 | amarkhel | 2010-07-13 11:30:02 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18010 | amarkhel | 2010-07-13 11:30:55 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18011 | amarkhel | 2010-07-13 11:31:23 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18012 | nbelaevski | 2010-07-13 11:37:09 -0700 (Tue, 13 Jul 2010) | 1 line
Fixed duplicate ID exception caused by queuing feature
.......
r18013 | amarkhel | 2010-07-13 11:41:20 -0700 (Tue, 13 Jul 2010) | 1 line
.......
r18014 | nbelaevski | 2010-07-13 11:46:48 -0700 (Tue, 13 Jul 2010) | 1 line
TODOs committed
.......
r18015 | amarkhel | 2010-07-13 11:48:50 -0700 (Tue, 13 Jul 2010) | 1 line
.......
Property changes on: branches/development/iterators
___________________________________________________________________
Name: svnmerge-integrated
- /root:1-18002
+ /root:1-18015
Modified: branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java
===================================================================
--- branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueuePreRenderViewListener.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -21,8 +21,6 @@
*/
package org.richfaces.component;
-import java.util.List;
-
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -40,8 +38,6 @@
*/
public class QueuePreRenderViewListener implements SystemEventListener {
- private static final String HEAD = "head";
-
private static final String QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE = "org.richfaces.QueueResourceComponentRenderer";
public boolean isListenerForSource(Object source) {
@@ -51,30 +47,19 @@
public void processEvent(SystemEvent event) throws AbortProcessingException {
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot viewRoot = context.getViewRoot();
- List<UIComponent> resources = viewRoot.getComponentResources(context, HEAD);
boolean queueEnabled = ContextInitParameters.isQueueEnabled(context);
-
- boolean resourceExists = false;
- for (UIComponent resourceComponent : resources) {
- if (QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE.equals(resourceComponent.getRendererType()) &&
- UIOutput.COMPONENT_FAMILY.equals(resourceComponent.getFamily())) {
-
- if (!queueEnabled) {
- viewRoot.removeComponentResource(context, resourceComponent);
- }
-
- resourceExists = true;
- break;
- }
- }
-
- if (!resourceExists && queueEnabled) {
+ if (queueEnabled) {
Application application = context.getApplication();
UIComponent queueResourceComponent = application.createComponent(context,
UIOutput.COMPONENT_TYPE, QUEUE_RESOURCE_COMPONENT_RENDERER_TYPE);
+ //fix for JSF duplicate ID exception
+ queueResourceComponent.setId(QueueRegistry.QUEUE_SCRIPT_ID);
+
viewRoot.addComponentResource(context, queueResourceComponent);
+ } else {
+ //queue can be switched off at application level, not a page level, so no need to remove it if it is switched off
}
}
Modified: branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java
===================================================================
--- branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/component/QueueRegistry.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -37,7 +37,7 @@
*/
public final class QueueRegistry {
- public static final String QUEUE_SCRIPT_CLIENT_ID = "org.richfaces.queue";
+ public static final String QUEUE_SCRIPT_ID = "_org_richfaces_queue";
private static final Logger LOGGER = RichfacesLogger.COMPONENTS.getLogger();
Modified: branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java
===================================================================
--- branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/core/trunk/ui/src/main/java/org/richfaces/renderkit/html/QueueResourceComponentRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -80,8 +80,7 @@
ResponseWriter writer = context.getResponseWriter();
writer.startElement(HTML.SCRIPT_ELEM, component);
- writer.writeAttribute(HTML.ID_ATTRIBUTE,
- context.getExternalContext().encodeNamespace(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID), null);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context), null);
writer.writeAttribute(HTML.TYPE_ATTR, HTML.JAVASCRIPT_TYPE, null);
writer.writeText(FUNCTION_NAME, null);
Modified: branches/development/iterators/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java
===================================================================
--- branches/development/iterators/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/core/trunk/ui/src/test/java/org/richfaces/component/QueueRendererTest.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -159,7 +159,7 @@
}
private String extractQueueScript(HtmlPage page) {
- HtmlElement scriptElement = page.getElementById(QueueRegistry.QUEUE_SCRIPT_CLIENT_ID);
+ HtmlElement scriptElement = page.getElementById(QueueRegistry.QUEUE_SCRIPT_ID);
if (scriptElement != null) {
return getTextContent(scriptElement);
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -32,11 +32,14 @@
*/
public abstract class AbstractDivPanel extends UIOutput {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_TYPE = "org.richfaces.panels.DivPanel";
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_FAMILY = "org.richfaces.panels.DivPanel";
protected AbstractDivPanel() {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
setRendererType("org.richfaces.panels.DivPanelRenderer");
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,8 +22,8 @@
package org.richfaces.component;
-import org.richfaces.event.SelectedItemChangeEvent;
-import org.richfaces.event.SelectedItemChangeListener;
+import java.util.Iterator;
+import java.util.List;
import javax.el.ELException;
import javax.el.MethodExpression;
@@ -44,17 +44,20 @@
import javax.faces.event.PreValidateEvent;
import javax.faces.event.ValueChangeListener;
import javax.faces.validator.Validator;
-import java.util.Iterator;
-import java.util.List;
+import org.richfaces.event.SelectedItemChangeEvent;
+import org.richfaces.event.SelectedItemChangeListener;
+
/**
* @author akolonitsky
* @version 1.0
*/
public abstract class AbstractTogglePanel extends AbstractDivPanel implements EditableValueHolder {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanel";
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_FAMILY = "org.richfaces.panels.TogglePanel";
private String submittedSelectedItem = null;
@@ -140,10 +143,12 @@
}
public MethodBinding getValidator() {
+ //TODO nick - Errors shouldn't ne thrown
throw new UnknownError();
}
public void setValidator(MethodBinding validatorBinding) {
+ //TODO nick - Errors shouldn't ne thrown
throw new UnknownError();
}
@@ -343,6 +348,7 @@
return;
}
+ //TODO nick - selectedItem attribute?
ValueExpression ve = getValueExpression("value");
if (ve == null) {
return;
@@ -443,6 +449,7 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
+ //TODO nick - immediate?
if (event instanceof SelectedItemChangeEvent && isBypassUpdates()) {
FacesContext.getCurrentInstance().renderResponse();
}
@@ -460,6 +467,7 @@
}
private boolean isSelectedItem(UIComponent kid) {
+ //TODO nick - selectedItem should be cached in local variable
String value = getSelectedItem();
if (value == null) {
value = getSubmittedSelectedItem();
@@ -470,10 +478,12 @@
public String getFirstItem() {
checkChildCount(getChildCount());
+ //TODO nick - children can be rendered or not
return getChildName(getChildren().get(0));
}
private static void checkChildCount(int childCount) {
+ //TODO nick - remove this check
if (childCount < 1) {
throw new IllegalStateException("TogglePanel must have at least one TogglePanelItem.");
}
@@ -486,6 +496,7 @@
checkChildCount(getChildCount());
List<UIComponent> children = getChildren();
+ //TODO nick - return child itself
int index = getChildIndex(name, children);
if (index == -1) {
return null;
@@ -525,6 +536,7 @@
}
private static String getChildName(UIComponent item) {
+ //TODO nick - panel can include UIParam children - remove this exception
if (!(item instanceof AbstractTogglePanelItem)) {
throw new IllegalStateException("TogglePanel can contain only TogglePanelItem as child.");
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -4,6 +4,8 @@
* @author akolonitsky
* @since Jun 15, 2010
*/
+//TODO nick - rename into SwitchType or PanelSwitchType
+//TODO nick - move to API
public enum Method {
/**
* value for tab change method for - client-side tabs.
@@ -19,4 +21,6 @@
* value for tab change method - ajax tabs
*/
ajax
+
+ //TODO nick - add DEFAULT constant
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -28,6 +28,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - remove
public class UIDivPanel extends AbstractDivPanel {
public static final String COMPONENT_TYPE = "org.richfaces.panels.DivPanel";
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -27,6 +27,7 @@
* JSF component class
*
*/
+//TODO nick - remove
public class UIPanel extends UIComponentBase {
private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -41,7 +41,7 @@
public static final String COMPONENT_FAMILY = "org.richfaces.PopupPanel";
protected enum PropertyKeys {
- width, height, zIndex, minHeight, minWidth, maxHeight, maxWidth, top, left, moveable, autosized, modal, domElementAttachment, controlsClass, show, headerClass, keepVisualState, overlapEmbedObjects, resizeable, shadowDepth, shadowOpacity, style, styleClass, visualOptions
+ width, height, zIndex, trimOverlayedElements, minHeight, minWidth, maxHeight, maxWidth, top, left, moveable, autosized, modal, domElementAttachment, controlsClass, show, headerClass, keepVisualState, overlapEmbedObjects, resizeable, shadowDepth, shadowOpacity, style, styleClass, visualOptions
}
public Map<String, Object> getHandledVisualOptions() {
@@ -55,6 +55,7 @@
return result;
}
+ //TODO nick - CDK should generate all these properties' code
public String getVisualOptions() {
return (String) getStateHelper().eval(PropertyKeys.visualOptions);
}
@@ -188,21 +189,24 @@
}
public void setResizeable(boolean resizeable) {
- getStateHelper().put(PropertyKeys.resizeable, resizeable);
- }
+ getStateHelper().put(PropertyKeys.resizeable, resizeable);
+ }
- /*
- * public boolean isTrimOverlayedElements() { return (Boolean)
- * getStateHelper().eval(PropertyKeys.trimOverlayedElements, false); }
- *
- * public void setTrimOverlayedElements(boolean trimOverlayedElements) {
- * getStateHelper().put(PropertyKeys.trimOverlayedElements, trimOverlayedElements); }
- */
+ public boolean isTrimOverlayedElements() {
+ return (Boolean) getStateHelper().eval(
+ PropertyKeys.trimOverlayedElements, false);
+ }
- public String getDomElementAttachment() {
- return (String) getStateHelper().eval(PropertyKeys.domElementAttachment);
- }
+ public void setTrimOverlayedElements(boolean trimOverlayedElements) {
+ getStateHelper().put(PropertyKeys.trimOverlayedElements,
+ trimOverlayedElements);
+ }
+ public String getDomElementAttachment() {
+ return (String) getStateHelper()
+ .eval(PropertyKeys.domElementAttachment);
+ }
+
public void setDomElementAttachment(String domElementAttachment) {
getStateHelper().put(PropertyKeys.domElementAttachment, domElementAttachment);
}
@@ -252,6 +256,7 @@
getStateHelper().put(PropertyKeys.shadowOpacity, shadowOpacity);
}
+ //TODO nick - this should part of renderer
private Map<String, Object> prepareVisualOptions(Object value) {
if (null == value) {
return new HashMap<String, Object>();
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -28,6 +28,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - no behaviors support!
public class UITogglePanel extends AbstractTogglePanel {
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanel";
@@ -108,6 +109,7 @@
}
public MethodExpression getSelectedItemChangeListener() {
+ //TODO nick - get, not eval
return (MethodExpression) getStateHelper().eval(PropertyKeys.selectedItemChangeListener);
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -26,6 +26,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - no behaviors support!
public class UITogglePanelItem extends AbstractTogglePanelItem {
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanelItem";
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,14 +22,14 @@
package org.richfaces.component.behavior;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorContext;
+
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractTogglePanel;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.ClientBehaviorContext;
-
/**
* @author akolonitsky
*
@@ -62,6 +62,7 @@
}
public String getForPanel() {
+ //TODO nick - get, not eval
return (String) getStateHelper().eval(PropertyKeys.forPanel);
}
@@ -69,6 +70,7 @@
getStateHelper().put(PropertyKeys.forPanel, selector);
}
+ //TODO nick - argument type is incorrect
public void setDisableDefault(String disableDefault) {
getStateHelper().put(PropertyKeys.disableDefault, disableDefault);
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -26,8 +26,8 @@
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.MethodNotFoundException;
+import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
-import javax.faces.component.StateHolder;
import javax.faces.event.AbortProcessingException;
/**
@@ -43,8 +43,10 @@
* @since -4712-01-01
*
*/
+//TODO nick - good candidate for utility class
public class MethodExpressionSelectedItemChangeListener implements SelectedItemChangeListener, StateHolder {
+ //TODO nick - classes should be generified too
private static final Class[] SELECTED_ITEM_CHANGE_LISTENER_ZERO_ARG_SIG = new Class[] {};
// ------------------------------------------------------ Instance Variables
@@ -156,6 +158,7 @@
throw new NullPointerException();
}
+ //TODO nick - use javax.faces.component.UIComponentBase.saveAttachedState(FacesContext, Object)
return new Object[] {methodExpressionOneArg, methodExpressionZeroArg };
}
@@ -173,6 +176,7 @@
return;
}
+ //TODO nick - use javax.faces.component.UIComponentBase.restoreAttachedState(FacesContext, Object)
methodExpressionOneArg = (MethodExpression) ((Object[]) state)[0];
methodExpressionZeroArg = (MethodExpression) ((Object[]) state)[1];
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -34,6 +34,8 @@
* @version 1.0
* @since -4712-01-01
*/
+//TODO nick - move to API
+//TODO nick - serialVersionUUID is missing
public class SelectedItemChangeEvent extends FacesEvent {
private final String oldItem;
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -36,6 +36,7 @@
* @since -4712-01-01
*
*/
+//TODO nick - move to API
public interface SelectedItemChangeListener extends FacesListener {
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,20 +22,22 @@
package org.richfaces.renderkit.html;
-import static org.ajax4jsf.renderkit.RendererUtils.*;
-import org.ajax4jsf.renderkit.RendererBase;
-import org.richfaces.component.AbstractDivPanel;
+import java.io.IOException;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.Map;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.AbstractDivPanel;
+
/**
* @author akolonitsky
*
*/
+//TODO nick - use Renderer instead of RendererBase
public class DivPanelRenderer extends RendererBase {
public static final String[] ATTRIBUTES = new String[] {
@@ -67,6 +69,7 @@
Map<String, Object> componentAttributes = component.getAttributes();
for (String attrName : attributes) {
Object attrValue = componentAttributes.get(attrName);
+ //TODO nick - ???
if (!"null".equalsIgnoreCase(String.valueOf(attrValue))) {
writer.writeAttribute(attrName, attrValue, attrName); // TODO Use RendererUtils
}
@@ -85,6 +88,7 @@
protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
Object script = getScriptObject(context, component);
if (script != null) {
+ //TODO nick - how does script relate to DIV?
writer.startElement(HTML.SCRIPT_ELEM, component);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", "type");
writer.writeText(script, null);
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -34,6 +34,7 @@
* @author amarkhel
* @since Jun 14, 2010
*/
+//TODO nick - JSF have concept of library, it should be used instead of '/' in resource names
@ResourceDependency(name = "css/panel.ecss")
public class PanelBaseRenderer extends RendererBase {
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -4,8 +4,8 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
-import java.util.Map.Entry;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -17,6 +17,7 @@
import org.ajax4jsf.renderkit.RendererBase;
import org.richfaces.component.UIPopupPanel;
+//TODO nick - JSF have concept of library, it should be used instead of '/' in resource names
@ResourceDependencies( { @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "script/popupPanel.js"),
@ResourceDependency(name = "script/popupPanelBorders.js"), @ResourceDependency(name = "script/popupPanelSizer.js"),
@@ -29,6 +30,8 @@
private static final String HEADER_FACET = "header";
private static final int SIZE = 10;
private static final String STATE_OPTION_SUFFIX = "StateOption_";
+
+ //TODO nick - use enums
private static final Set<String> ALLOWED_ATTACHMENT_OPTIONS = new HashSet<String>();
static {
ALLOWED_ATTACHMENT_OPTIONS.add("body");
@@ -131,6 +134,7 @@
if (panel.isShow()) {
result.append("RichFaces.ui.PopupPanel.showPopupPanel('" + panel.getClientId(context) + "', {");
+ //TODO nick - use ScriptUtils.toScript
Iterator<Map.Entry<String, Object>> it = ((Map<String, Object>) panel.getHandledVisualOptions()).entrySet()
.iterator();
while (it.hasNext()) {
@@ -147,8 +151,17 @@
return result.toString();
}
+ public String getStyleIfTrimmed(UIComponent panel){
+ if(panel.getAttributes().get("trimOverlayedElements").equals(Boolean.TRUE)) {
+ return "position: relative, z-index : 0";
+ }
+ return "";
+ }
+
private void writeOption(StringBuilder builder, String attribbute, Object value, UIComponent component,
boolean isString) {
+
+ //TODO nick - use ScriptUtils.toScript
if (component.getAttributes().get(attribbute) != null) {
builder.append(attribbute + ":");
if (isString) {
@@ -168,6 +181,7 @@
result.append("new RichFaces.ui.PopupPanel('");
result.append(panel.getClientId());
result.append("',{");
+ //TODO nick - use RendererUtils.addToScriptHash(Map<String, Object>, String, Object)
writeOption(result, "width", panel.getWidth(), component, false);
writeOption(result, "height", panel.getHeight(), component, false);
writeOption(result, "minWidth", panel.getMinWidth(), component, false);
@@ -192,6 +206,7 @@
writeOption(result, "show", panel.isShow(), component, false);
writeOption(result, "autosized", panel.isAutosized(), component, false);
writeOption(result, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), component, false);
+ //TODO nick - what is deleted here?
result.delete(result.length() - 1, result.length());
if (component.getAttributes().get("visualOptions") != null) {
result.append(writeVisualOptions(context, panel));
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,25 +22,25 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSObject;
-import org.ajax4jsf.renderkit.AjaxEventOptions;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.richfaces.component.AbstractTogglePanel;
-import org.richfaces.component.AbstractTogglePanelItem;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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 java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import static org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.ajax4jsf.renderkit.AjaxEventOptions;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.component.AbstractTogglePanelItem;
/**
* @author akolonitsky
@@ -80,6 +80,7 @@
if (panelItem != null) {
context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
+ //TODO nick - this should be done on encode, not on decode
addOnCompleteParam(newValue, panel);
}
}
@@ -153,6 +154,7 @@
} else {
switch (item.getSwitchType()) {
+ //TODO nick - non-rendered items shouldn't be processed
case client:
hidePanelItem(item);
@@ -170,6 +172,7 @@
break;
case server:
+ //TODO nick - why nothing?
break;
default:
@@ -181,6 +184,7 @@
}
private static void hidePanelItem(UIComponent item) {
+ //TODO nick - attributes shouldn't be overwritten
item.getAttributes().put(HTML.STYLE_ATTRIBUTE, "display:none");
}
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,18 +22,6 @@
package org.richfaces.taglib;
-import javax.el.ValueExpression;
-import javax.faces.application.Resource;
-import org.richfaces.component.AbstractTogglePanel;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import org.richfaces.event.SelectedItemChangeEvent;
-import org.richfaces.event.SelectedItemChangeListener;
-
-import javax.faces.view.AttachedObjectHandler;
-import javax.faces.view.EditableValueHolderAttachedObjectHandler;
-import javax.faces.view.facelets.*;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Array;
@@ -43,6 +31,26 @@
import java.util.List;
import java.util.Map;
+import javax.el.ValueExpression;
+import javax.faces.application.Resource;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.EditableValueHolderAttachedObjectHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
+
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.event.SelectedItemChangeEvent;
+import org.richfaces.event.SelectedItemChangeListener;
+
+//TODO nick - what does "-4712-01-01" mean?
/**
*
* @author akolonitsky
@@ -51,6 +59,7 @@
*/
public final class SelectedItemChangeListenerHandler extends TagHandler implements EditableValueHolderAttachedObjectHandler {
+ //TODO nick - take names from primitives
private static final String[] PRIMITIVE_NAMES = new String[] {"boolean",
"byte", "char", "double", "float", "int", "long", "short", "void" };
@@ -132,6 +141,8 @@
if (parent instanceof AbstractTogglePanel) {
applyAttachedObject(ctx.getFacesContext(), parent);
} else if (parent.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY)) {
+ //TODO nick - javax.faces.component.UIComponent.isCompositeComponent(UIComponent)
+
// Allow the composite component to know about the target component.
getAttachedObjectHandlers(parent).add(this);
} else {
@@ -143,10 +154,12 @@
ValueExpression b = null;
if (this.binding != null) {
FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+ //TODO nick - b is already instance of listener - add it directly without LazySelectedItemChangeListener
b = this.binding.getValueExpression(ctx, SelectedItemChangeListener.class);
}
AbstractTogglePanel evh = (AbstractTogglePanel) parent;
+ //TODO nick - this should be done via API interface
evh.addSelectedItemChangeListener(new LazySelectedItemChangeListener(this.listenerType, b));
}
@@ -160,6 +173,7 @@
return getAttachedObjectHandlers(component, true);
}
+ //TODO nick - see org.richfaces.view.facelets.html.TagHandlerUtils
@SuppressWarnings({"unchecked"})
public static List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent component,
boolean create) {
@@ -183,8 +197,11 @@
if (null == name || "".equals(name)) {
return null;
}
+
+ //TODO nick - primitive class won't be necessary listener
Class c = forNamePrimitive(name);
if (c == null) {
+ //TODO nick - standard syntax for array classes is different + what about arrays of > 1 dims?
if (name.endsWith("[]")) {
String nc = name.substring(0, name.length() - 2);
c = Class.forName(nc, false, Thread.currentThread().getContextClassLoader());
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -22,11 +22,6 @@
package org.richfaces.taglib;
-import org.richfaces.component.AbstractTogglePanel;
-
-import org.richfaces.event.MethodExpressionSelectedItemChangeListener;
-import org.richfaces.event.SelectedItemChangeEvent;
-
import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.FaceletContext;
@@ -36,6 +31,10 @@
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.event.MethodExpressionSelectedItemChangeListener;
+import org.richfaces.event.SelectedItemChangeEvent;
+
/**
* @author akolonitsky
* @version 1.0
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css)
Deleted: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss 2010-07-13 19:08:44 UTC (rev 18016)
@@ -1,29 +0,0 @@
-.rf-panel{
- background-color:'#{richSkin.generalBackgroundColor}';
- color:'#{richSkin.panelBorderColor}';
- border-width:1px;
- border-style:solid;
- padding:1px;
-}
-
-.rf-panel-header{
- background-color:'#{richSkin.headerBackgroundColor}';
- border-color:'#{richSkin.headerBackgroundColor}';
- font-size:'#{richSkin.headerSizeFont}';
- color:'#{richSkin.headerTextColor}';
- font-weight:'#{richSkin.headerWeightFont}';
- font-family:'#{richSkin.headerFamilyFont}';
- padding:2px;
- border-width:1px;
- border-style:solid;
- background-position:top left;
- background-repeat:repeat-x;
- background-image:"url(#{resource['org.richfaces.renderkit.html.GradientA']})";
-}
-
-.rf-panel-body{
- font-size:'#{richSkin.generalSizeFont}';
- color:'#{richSkin.generalTextColor}';
- font-family:'#{richSkin.generalFamilyFont}';
- padding:10px;
-}
\ No newline at end of file
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss)
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss (rev 0)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/panel.ecss 2010-07-13 19:08:44 UTC (rev 18016)
@@ -0,0 +1,29 @@
+.rf-panel{
+ background-color:'#{richSkin.generalBackgroundColor}';
+ color:'#{richSkin.panelBorderColor}';
+ border-width:1px;
+ border-style:solid;
+ padding:1px;
+}
+
+.rf-panel-header{
+ background-color:'#{richSkin.headerBackgroundColor}';
+ border-color:'#{richSkin.headerBackgroundColor}';
+ font-size:'#{richSkin.headerSizeFont}';
+ color:'#{richSkin.headerTextColor}';
+ font-weight:'#{richSkin.headerWeightFont}';
+ font-family:'#{richSkin.headerFamilyFont}';
+ padding:2px;
+ border-width:1px;
+ border-style:solid;
+ background-position:top left;
+ background-repeat:repeat-x;
+ background-image:"url(#{resource['org.richfaces.renderkit.html.GradientA']})";
+}
+
+.rf-panel-body{
+ font-size:'#{richSkin.generalSizeFont}';
+ color:'#{richSkin.generalTextColor}';
+ font-family:'#{richSkin.generalFamilyFont}';
+ padding:10px;
+}
\ No newline at end of file
Deleted: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss 2010-07-13 19:08:44 UTC (rev 18016)
@@ -1,163 +0,0 @@
-.mp-button {
- outline-style: none;
- position: absolute;
- clip: rect(0px 0px 1px 1px);
- height: 0px;
- width: 0px;
- left: 0px;
- top: 0px;
- z-index: -300;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
-}
-
-.mp_shade {
- position : fixed;
- width : 100%;
- height : 100%;
- top:0px;
- left : 0px;
- background : #D0D0D0;
- opacity:0.5;
- filter : 'alpha(opacity=50)';
-}
-.mp_iframe {
- position : absolute;
- width : 100%;
- height : 100%;
- top:0px;
- left : 0px;
- opacity:0.3;
- filter : 'alpha(opacity=30)';
-}
-.mp_shadow {
- position : fixed;
- background-color : #000000;
- opacity:0.1;
- filter : 'alpha(opacity=10)';
-}
-.mp_container {
- position : fixed;
- border : '1px solid #{richSkin.panelBorderColor}';
- background : '#{richSkin.generalBackgroundColor}';
- z-index:100;
-}
-.mp_header {
- background : "url(#{resource['org.richfaces.renderkit.html.GradientA']})";
- repeat-x : 'top left #{richSkin.headerBackgroundColor}';
- position : relative;
- padding-left : 10px;
- cursor : move;
- padding : 2px;
-}
-.mp_header_content {
- overflow : hidden;
- white-space : nowrap;
- text-overflow: ellipsis;
- font-weight : '#{richSkin.headerWeightFont}';
- color : '#{richSkin.headerTextColor}';
- font-family : '#{richSkin.headerFamilyFont}';
- font-size : '#{richSkin.headerSizeFont}';
- padding : 2px;
- padding-left : 10px;
-}
-.mp_header_controls {
- position : absolute;
- top : 2px;
- right : 2px;
- white-space : nowrap;
- cursor : default;
- font-weight : '#{richSkin.headerWeightFont}';
- color : '#{richSkin.headerTextColor}';
- font-family : '#{richSkin.headerFamilyFont}';
- font-size : '#{richSkin.headerSizeFont}';
-}
-
-.mp_content_scroller {
- position : relative;
- top : 0px;
- left : 0px;
- overflow : auto;
-}
-.mp_content {
- position : relative;
- padding : 10px;
- color : '#{richSkin.generalTextColor}';
- font-family : '#{richSkin.generalFamilyFont}';
- font-size : '#{richSkin.generalSizeFont}';
-}
-.mp_handler {
- background : red;
- filter : 'alpha(opacity=0)';
- opacity:0;
- position : absolute;
- margin : -4px;
-}
-.mp_handler_left {
- width : 7px;
- height : 100%;
- top : 0px;
- left : 0px;
- cursor : w-resize;
-}
-
-.mp_handler_right {
- width : 7px;
- height : 100%;
- top : 0px;
- right : 0px;
- cursor : w-resize;
-}
-
-.mp-iframe {
- position: absolute;
- left: 0px;
- top: 0px;
- background-color: white;
- overflow-y: hidden;
- z-index: -1;
-}
-
-.mp_handler_top {
- width : 100%;
- height : 7px;
- top : 0px;
- left : 0px;
- cursor : n-resize;
-}
-.mp_handler_bottom {
- width : 100%;
- height : 7px;
- bottom : 0px;
- left : 0px;
- cursor : n-resize;
-}
-
-.mp_handler_top_left {
- width : 10px;
- height : 10px;
- top : 0px;
- left : 0px;
- cursor : nw-resize;
-}
-.mp_handler_top_right {
- width : 10px;
- height : 10px;
- top : 0px;
- right : 0px;
- cursor : ne-resize;
-}
-.mp_handler_bottom_left {
- width : 10px;
- height : 10px;
- bottom : 0px;
- left : 0px;
- cursor : ne-resize;
-}
-.mp_handler_bottom_right {
- width : 10px;
- height : 10px;
- bottom : 0px;
- right : 0px;
- cursor : nw-resize;
-}
\ No newline at end of file
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss)
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss (rev 0)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss 2010-07-13 19:08:44 UTC (rev 18016)
@@ -0,0 +1,163 @@
+.mp-button {
+ outline-style: none;
+ position: absolute;
+ clip: rect(0px 0px 1px 1px);
+ height: 0px;
+ width: 0px;
+ left: 0px;
+ top: 0px;
+ z-index: -300;
+ opacity:0.1;
+ filter : 'alpha(opacity=10)';
+}
+
+.mp_shade {
+ position : fixed;
+ width : 100%;
+ height : 100%;
+ top:0px;
+ left : 0px;
+ background : #D0D0D0;
+ opacity:0.5;
+ filter : 'alpha(opacity=50)';
+}
+.mp_iframe {
+ position : absolute;
+ width : 100%;
+ height : 100%;
+ top:0px;
+ left : 0px;
+ opacity:0.3;
+ filter : 'alpha(opacity=30)';
+}
+.mp_shadow {
+ position : fixed;
+ background-color : #000000;
+ opacity:0.1;
+ filter : 'alpha(opacity=10)';
+}
+.mp_container {
+ position : fixed;
+ border : '1px solid #{richSkin.panelBorderColor}';
+ background : '#{richSkin.generalBackgroundColor}';
+ z-index:100;
+}
+.mp_header {
+ background : "url(#{resource['org.richfaces.renderkit.html.GradientA']})";
+ repeat-x : 'top left #{richSkin.headerBackgroundColor}';
+ position : relative;
+ padding-left : 10px;
+ cursor : move;
+ padding : 2px;
+}
+.mp_header_content {
+ overflow : hidden;
+ white-space : nowrap;
+ text-overflow: ellipsis;
+ font-weight : '#{richSkin.headerWeightFont}';
+ color : '#{richSkin.headerTextColor}';
+ font-family : '#{richSkin.headerFamilyFont}';
+ font-size : '#{richSkin.headerSizeFont}';
+ padding : 2px;
+ padding-left : 10px;
+}
+.mp_header_controls {
+ position : absolute;
+ top : 2px;
+ right : 2px;
+ white-space : nowrap;
+ cursor : default;
+ font-weight : '#{richSkin.headerWeightFont}';
+ color : '#{richSkin.headerTextColor}';
+ font-family : '#{richSkin.headerFamilyFont}';
+ font-size : '#{richSkin.headerSizeFont}';
+}
+
+.mp_content_scroller {
+ position : relative;
+ top : 0px;
+ left : 0px;
+ overflow : auto;
+}
+.mp_content {
+ position : relative;
+ padding : 10px;
+ color : '#{richSkin.generalTextColor}';
+ font-family : '#{richSkin.generalFamilyFont}';
+ font-size : '#{richSkin.generalSizeFont}';
+}
+.mp_handler {
+ background : red;
+ filter : 'alpha(opacity=0)';
+ opacity:0;
+ position : absolute;
+ margin : -4px;
+}
+.mp_handler_left {
+ width : 7px;
+ height : 100%;
+ top : 0px;
+ left : 0px;
+ cursor : w-resize;
+}
+
+.mp_handler_right {
+ width : 7px;
+ height : 100%;
+ top : 0px;
+ right : 0px;
+ cursor : w-resize;
+}
+
+.mp-iframe {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ background-color: white;
+ overflow-y: hidden;
+ z-index: -1;
+}
+
+.mp_handler_top {
+ width : 100%;
+ height : 7px;
+ top : 0px;
+ left : 0px;
+ cursor : n-resize;
+}
+.mp_handler_bottom {
+ width : 100%;
+ height : 7px;
+ bottom : 0px;
+ left : 0px;
+ cursor : n-resize;
+}
+
+.mp_handler_top_left {
+ width : 10px;
+ height : 10px;
+ top : 0px;
+ left : 0px;
+ cursor : nw-resize;
+}
+.mp_handler_top_right {
+ width : 10px;
+ height : 10px;
+ top : 0px;
+ right : 0px;
+ cursor : ne-resize;
+}
+.mp_handler_bottom_left {
+ width : 10px;
+ height : 10px;
+ bottom : 0px;
+ left : 0px;
+ cursor : ne-resize;
+}
+.mp_handler_bottom_right {
+ width : 10px;
+ height : 10px;
+ bottom : 0px;
+ right : 0px;
+ cursor : nw-resize;
+}
\ No newline at end of file
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js)
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js (rev 0)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanel.js 2010-07-13 19:08:44 UTC (rev 18016)
@@ -0,0 +1,699 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+ var selectionEventHandler = function(event){
+ event.stopPropagation();
+ event.preventDefault();
+ };
+
+ var disableSelection = function (element)
+ {
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ jQuery(element).bind( 'selectstart', selectionEventHandler);
+ }
+ else //All other (ie: Opera)
+ {
+ jQuery(element).bind( 'mousedown', selectionEventHandler);
+ }
+ }
+
+ var enableSelection = function (element)
+ {
+ if (typeof element.onselectstart!="undefined") //IE
+ {
+ jQuery(element).unbind( 'selectstart', selectionEventHandler);
+ }
+ else if (typeof element.style.MozUserSelect!="undefined") //Firefox
+ {
+ jQuery(element).css('MozUserSelect','');
+ }
+ else //All other (ie: Opera)
+ {
+ jQuery(element).unbind( 'mousedown', selectionEventHandler);
+ }
+ }
+
+ richfaces.ui.PopupPanel = function(id, options) {
+
+ $super.constructor.call(this,id);
+ this.markerId = id;
+ $p.attachToDom.call(this, id);
+ id = "#" + id;
+ this.options = options;
+
+ this.id = $(id);
+ this.minWidth = this.getMinimumSize(this.options.minWidth);
+ this.minHeight = this.getMinimumSize(this.options.minHeight);
+ this.maxWidth = this.options.maxWidth;
+ this.maxHeight = this.options.maxHeight;
+ this.options = options;
+
+ this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
+
+ this.div = id;
+ this.cdiv = id + "_container";
+ this.contentDiv = id + "_content";
+ this.shadowDiv = id + "_shadow";
+ this.scrollerDiv = id + "_content_scroller"
+
+ this.borders = new Array();
+
+ if (this.options.resizeable) {
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerS", this, "S-resize", richfaces.ui.PopupPanel.Sizer.S));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerW", this, "W-resize", richfaces.ui.PopupPanel.Sizer.W));
+
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNW", this, "NW-resize", richfaces.ui.PopupPanel.Sizer.NW));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerNE", this, "NE-resize", richfaces.ui.PopupPanel.Sizer.NE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSE", this, "SE-resize", richfaces.ui.PopupPanel.Sizer.SE));
+ this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
+ }
+
+ if (this.options.moveable && $(id + "_header")) {
+ this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
+ } else{
+ $(id + "_header").css('cursor', 'default');
+ }
+
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel);
+ var $p = richfaces.BaseComponent.extend(richfaces.BaseComponent,richfaces.ui.PopupPanel, {});
+ var $super = richfaces.ui.PopupPanel.$super;
+ $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
+
+ return {
+
+ name: "RichFaces.ui.PopupPanel",
+ saveInputValues: function(element) {
+ /* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal was closed and opened again */
+ if ($.browser.msie /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2 */) {
+ $('input[type=checkbox], input[type=radio]', element).each(function(index) {
+ $(this).defaultChecked = $(this).checked;
+ });
+ }
+ },
+
+ width: function() {
+ return this.getContentElement()[0].clientWidth;//TODO
+ },
+
+ height: function() {
+ return this.getContentElement()[0].clientHeight;//TODO
+ },
+
+ getLeft : function (){
+ return $(this.cdiv).css('left');
+ },
+
+ getTop : function (){
+ return $(this.cdiv).css('top');
+ },
+
+ getInitialSize : function(){
+ if(this.options.autosized){
+ return 15;
+ } else{
+ return $(this.div + "_header_content").height();
+ }
+ },
+
+ getContentElement: function() {
+ if (!this._contentElement) {
+ this._contentElement = $(this.cdiv);
+ }
+
+ return this._contentElement;
+ },
+ getSizeElement : function() {
+ return document.body;
+ },
+
+ getMinimumSize : function(size) {
+ return Math.max(size, 2*this.getInitialSize() + 2);
+ },
+ destroy: function() {
+
+ this._contentElement = null;
+
+ this.parent = null;
+ if (this.header) {
+ this.header.destroy();
+ this.header=null;
+ }
+
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].destroy();
+ }
+ this.borders = null;
+
+ if (this.domReattached) {
+ var element = this.id;
+ var parent = $(element).parent();
+ if (parent) {
+ parent.remove(element);
+ }
+ }
+ this.markerId = null;
+ this.options = null;
+
+ this.id = null;
+
+ this.div = null;
+ this.cdiv = null;
+ this.contentDiv = null;
+ this.shadowDiv = null;
+ this.scrollerDiv = null;
+ this.userOptions = null;
+ this.eIframe= null;
+
+ },
+
+ initIframe : function() {
+ if (this.contentWindow) {
+ $(this.contentWindow.document.body).css("margin", "0px 0px 0px 0px");
+ } else {
+ //TODO opera etc.
+
+ }
+
+ if("transparent" == $(document.body).css("background-color")) {
+ $(this).css('filter', "alpha(opacity=0)");
+ $(this).css('opacity', "0");
+ }
+ },
+
+ setLeft: function(pos) {
+ if(!isNaN(pos)){
+ $(this.cdiv).css('left', pos + "px");
+ var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
+ $(this.shadowDiv).css('left', pos + depth + "px");
+ }
+ },
+
+ setTop: function(pos) {
+ if(!isNaN(pos)){
+ $(this.cdiv).css('top', pos + "px");
+ var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
+ $(this.shadowDiv).css('top', pos + depth +"px");
+ }
+ },
+
+ show: function(event, opts) {
+ if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
+
+ var element = this.id;
+
+ if (!this.domReattached) {
+ this.parent = $(element).parent();
+
+ var domElementAttachment;
+ if (opts) {
+ domElementAttachment = opts.domElementAttachment;
+ }
+
+ if (!domElementAttachment) {
+ domElementAttachment = this.options.domElementAttachment;
+ }
+
+ var newParent;
+ if ('parent' == domElementAttachment) {
+ newParent = this.parent;
+ } else if ('form' == domElementAttachment) {
+ newParent = this.findForm(element) || document.body;
+ } else {
+ //default - body
+ newParent = document.body;
+ }
+
+ if (newParent != this.parent) {
+ this.saveInputValues(element);
+ element.insertBefore(newParent.firstChild);
+ this.domReattached = true;
+ } else {
+ $(this.parent).show();
+ }
+ }
+
+ var forms = $("form", element);
+
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ var popup = this;
+ $(forms[i]).bind( "submit", {popup:popup}, this.setStateInput);
+ }
+ }
+
+
+
+ var options = {};
+ this.userOptions = {};
+ if (!element.mpSet) {
+ $.extend(options, this.options);
+ }
+
+ if (opts) {
+ $.extend(options, opts);
+ $.extend(this.userOptions, opts);
+ }
+
+ this.currentMinHeight = this.getMinimumSize((options.minHeight || options.minHeight == 0) ? options.minHeight : this.minHeight);
+ this.currentMinWidth = this.getMinimumSize((options.minWidth || options.minWidth == 0) ? options.minWidth : this.minWidth);
+
+ var eContentElt = this.getContentElement();
+
+ if (!this.options.autosized) {
+ if (options.width && options.width == -1)
+ options.width = 600;
+ if (options.height && options.height == -1)
+ options.height = 400;
+ } else{
+ //options.width = $(this.div+"_headerSpan").width() +20;
+ }
+
+ if (options.width && options.width != -1) {
+ if (this.currentMinWidth > options.width) {
+ options.width = this.currentMinWidth;
+ }
+ if (options.width > this.maxWidth) {
+ options.width = this.maxWidth;
+ }
+ $(eContentElt).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ $(this.shadowDiv).css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
+ $(this.scrollerDiv).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+
+
+ }
+
+ if (options.height && options.height != -1) {
+ if (this.currentMinHeight > options.height) {
+ options.height = this.currentMinHeight;
+ }
+ if (options.height > this.maxHeight) {
+ options.height = this.maxHeight;
+ }
+ $(eContentElt).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+ $(this.shadowDiv).css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
+ var headerHeight = $(this.div +"_header")[0].clientHeight;
+ $(this.scrollerDiv).css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
+
+
+ }
+ var eIframe;
+ if (this.options.overlapEmbedObjects && !this.iframe) {
+ this.iframe = this.markerId + "IFrame";
+ $("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
+ "class=\"mp-iframe\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
+ "</iframe>").insertBefore($(':first-child', $(this.cdiv))[0]);
+
+ eIframe = jQuery("#"+this.iframe);
+
+ $(eIframe).bind('load', this.initIframe);
+ this.eIframe = eIframe;
+ }
+ element.mpSet = true;
+
+ var eDiv = $(this.div);
+
+ if (options.left) {
+ var _left;
+ if (options.left != "auto") {
+ _left = parseInt(options.left, 10);
+ } else {
+ var cw = this.getSizeElement().clientWidth;
+ var _width = this.width();
+ if (cw >= _width) {
+ _left = (cw - _width) / 2;
+ } else {
+ _left = 0;
+ }
+ }
+
+ this.setLeft(Math.round(_left));
+ }
+
+ if (options.top) {
+ var _top;
+ if (options.top != "auto") {
+ _top = parseInt(options.top, 10);
+ } else {
+ var cw = this.getSizeElement().clientHeight;
+ var _height = this.height();
+ if (cw >= _height) {
+ _top = (cw - _height) / 2;
+ } else {
+ _top = 0;
+ }
+ }
+
+ this.setTop(Math.round(_top));
+ }
+
+ var opacity = options.shadowOpacity ? options.shadowOpacity : 0.1;
+ $(this.shadowDiv).css('opacity', opacity);
+ $(this.shadowDiv).css('filter ', 'alpha(opacity='+opacity*100 +');');
+ $(element).css('visibility', '');
+ $(element).css('display', 'block');
+ var event = {};
+ event.parameters = opts || {};
+ this.shown = true;
+ this.invokeEvent("show",event,null,element);
+ }
+ },
+
+ startDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].hide();
+ }
+ disableSelection(document.body);
+ },
+
+ endDrag: function(border) {
+ for (var k = 0; k < this.borders.length; k++ ) {
+ this.borders[k].show();
+ this.borders[k].doPosition();
+ }
+ enableSelection(document.body);
+ },
+
+ hide: function(event, opts) {
+ var element = this.id;
+ if (this.shown && this.invokeEvent("beforehide",event,null,element)) {
+
+ this.currentMinHeight = undefined;
+ this.currentMinWidth = undefined;
+
+ $(this.id).hide();
+
+ if (this.parent) {
+ if (this.domReattached) {
+ this.saveInputValues(element);
+
+ this.parent.append(element);
+
+ this.domReattached = false;
+ } else {
+ $(this.parent).hide();
+ }
+ }
+
+ var event = {};
+ event.parameters = opts || {};
+ if (this.options && this.options.onhide) {
+ this.options.onhide(event);
+ }
+
+ var forms = $("form", element);
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ $(forms[i]).unbind( "submit", this.setStateInput);
+ }
+ }
+
+ this.shown = false;
+
+ }
+ },
+
+ getStyle: function(elt, name) {
+ return parseInt($(elt).css(name).replace("px", ""), 10);
+ },
+
+ doResizeOrMove: function(diff) {
+ var vetoes = {};
+ var shadowHash = {};
+ var cssHash = {};
+ var cssHashWH = {};
+ var shadowHashWH = {};
+ var contentHashWH = {};
+ var scrollerHashWH = {};
+
+ var vetoeChange = false;
+ var newSize;
+ var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ var scrollerHeight = 22;
+ var scrollerWidth = 0;
+ var eContentElt = this.getContentElement();
+
+ newSize = this.getStyle(eContentElt, "width");
+
+ var oldSize = newSize;
+ newSize += diff.deltaWidth || 0;
+
+
+
+ if (newSize >= this.currentMinWidth || this.options.autosized) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = newSize + 'px';
+ shadowHashWH.width = newSize + shadowDepth + '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';
+ contentHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMinWidth - scrollerWidth + 'px';
+ vetoes.vx = oldSize - this.currentMinWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (newSize >= this.options.maxWidth) {
+ if (diff.deltaWidth) {
+ cssHashWH.width = this.currentMaxWidth + 'px';
+ shadowHashWH.width = this.currentMaxWidth + shadowDepth + 'px';
+ contentHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ scrollerHashWH.width = this.currentMaxWidth - scrollerWidth + 'px';
+ vetoes.vx = oldSize - this.currentMaxWidth;
+ }
+
+ vetoes.x = true;
+ }
+
+ if (vetoes.vx && diff.deltaX) {
+ diff.deltaX = -vetoes.vx;
+ }
+
+ var eCdiv = $(this.cdiv);
+
+ if (diff.deltaX && (vetoes.vx || !vetoes.x)) {
+ if (vetoes.vx) {
+ diff.deltaX = vetoes.vx;
+ }
+ var newPos;
+
+ newPos = this.getStyle(eCdiv, "left");
+ newPos += diff.deltaX;
+ cssHash.left = newPos + 'px';
+
+ shadowHash.left = newPos + shadowDepth + "px";
+ }
+
+ newSize = this.getStyle(eContentElt, "height")
+
+ var oldSize = newSize;
+ newSize += diff.deltaHeight || 0;
+
+ if (newSize >= this.currentMinHeight || this.options.autosized) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = newSize + 'px';
+ shadowHashWH.height = newSize + shadowDepth + 'px';
+ scrollerHashWH.height = newSize - scrollerHeight + 'px';
+ }
+ } else {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMinHeight + 'px';
+ shadowHashWH.height = this.currentMinHeight + shadowDepth + 'px';
+ scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
+ vetoes.vy = oldSize - this.currentMinHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (newSize >= this.options.maxHeight) {
+ if (diff.deltaHeight) {
+ cssHashWH.height = this.currentMaxHeight + 'px';
+ shadowHashWH.height = this.currentMaxHeight + shadowDepth + 'px';
+ scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
+ vetoes.vy = oldSize - this.currentMaxHeight;
+ }
+
+ vetoes.y = true;
+ }
+
+ if (vetoes.vy && diff.deltaY) {
+ diff.deltaY = -vetoes.vy;
+ }
+
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+
+ }
+ if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
+ if (vetoes.vy) {
+ diff.deltaY = vetoes.vy;
+ }
+ var newPos;
+
+ newPos = this.getStyle(eCdiv, "top");
+ newPos += diff.deltaY;
+ cssHash.top = newPos + 'px';
+ shadowHash.top = newPos + shadowDepth + "px";
+ }
+ $(eContentElt).css(cssHashWH);
+ $(this.scrollerDiv).css(scrollerHashWH);
+ if(this.eIframe)$(this.eIframe).css(scrollerHashWH);
+ $(this.shadowDiv).css(shadowHashWH);
+
+ $(eCdiv).css(cssHash);
+ $(this.shadowDiv).css(shadowHash);
+ //if(this.eIframe)$(this.eIframe).css(cssHash);
+ $.extend(this.userOptions, cssHash);
+ $.extend(this.userOptions, cssHashWH);
+ var w = this.width();
+ var h = this.height();
+
+ this.reductionData = null;
+
+ if (w <= 2*this.getInitialSize()) {
+ this.reductionData = {};
+ this.reductionData.w = w;
+ }
+
+ if (h <= 2*this.getInitialSize()) {
+ if (!this.reductionData) {
+ this.reductionData = {};
+ }
+
+ this.reductionData.h = h;
+ }
+
+ if (this.header) {
+ this.header.doPosition();
+ }
+
+ return vetoes;
+ },
+
+ setSize : function (width, height){
+ var w = width - this.width() ;
+ var h = height -this.height();
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, w, h);
+ this.doResizeOrMove(diff);
+ },
+
+ moveTo : function (top, left){
+ var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
+ $(this.cdiv).css('top', top);
+ $(this.cdiv).css('left', left);
+ $(this.shadowDiv).css('top', top + shadowDepth);
+ $(this.shadowDiv).css('left', left + shadowDepth);
+ },
+
+ move : function (dx, dy){
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(dx,dy, 0, 0);
+ this.doResizeOrMove(diff);
+ },
+
+ resize : function (dx, dy){
+ var diff = new richfaces.ui.PopupPanel.Sizer.Diff(0,0, dx, dy);
+ this.doResizeOrMove(diff);
+ },
+
+ findForm: function(elt) {
+ var target = elt;
+ while (target) {
+ if (!target.tagName /* document node doesn't have tagName */
+ || target.tagName.toLowerCase() != "form") {
+
+ target = $(target).parent();
+ } else {
+ break;
+ }
+ }
+
+ return target;
+ },
+
+ setStateInput: function(event) {
+ // Concret input but not entire form is a target element for onsubmit in FF
+ var popup = event.data.popup;
+ target = $(popup.findForm(event.currentTarget));
+
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "OpenedState";
+ input.name = popup.markerId + "OpenedState";
+ input.value = popup.shown ? "true" : "false";
+ target.append(input);
+
+ $.each(popup.userOptions, function(key, value) {
+ input = document.createElement("input");
+ input.type = "hidden";
+ input.id = popup.markerId + "StateOption_" + key;
+ input.name = popup.markerId + "StateOption_" + key;
+ input.value = value;
+ target.append(input);
+ });
+
+ return true;
+ },
+
+ invokeEvent: function(eventName, event, value, element) {
+
+ var eventFunction = this.options['on'+eventName];
+ var result;
+
+ if (eventFunction) {
+ var eventObj;
+ if (event) {
+ eventObj = event;
+ }
+ else if(document.createEventObject) {
+ eventObj = document.createEventObject();
+ }
+ else if( document.createEvent ) {
+ eventObj = document.createEvent('Events');
+ eventObj.initEvent( eventName, true, false );
+ }
+
+ eventObj.rich = {component:this};
+ eventObj.rich.value = value;
+
+ try {
+ result = eventFunction.call(element, eventObj);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+
+ if (result!=false) {
+ result = true;
+ }
+ return result;
+ }
+
+
+ }
+
+ })());
+ $.extend(richfaces.ui.PopupPanel, {
+
+ showPopupPanel : function (id, opts, event) {
+
+ $(document).ready(richfaces.$(id).show());
+ },
+
+ hidePopupPanel : function (id, opts, event) {
+ $(document).ready(richfaces.$(id).hide());
+ }
+ });
+
+})(jQuery, window.RichFaces);
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js)
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js (rev 0)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelBorders.js 2010-07-13 19:08:44 UTC (rev 18016)
@@ -0,0 +1,174 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.PopupPanel.Border = function(id, modalPanel, cursor, sizer) {
+
+ $super.constructor.call(this,id);
+
+ var element = jQuery(id);
+ jQuery(element).css('cursor',cursor);
+ var border = this;
+ jQuery(this.id).bind( 'mousedown', {border:border},this.startDrag);
+
+ this.modalPanel = modalPanel;
+ this.sizer = sizer;
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Border);
+ var $super = richfaces.ui.PopupPanel.Border.$super;
+
+ $.extend(richfaces.ui.PopupPanel.Border.prototype, (function (options) {
+
+ return {
+
+ name: "RichFaces.ui.PopupPanel.Border",
+
+ destroy: function()
+ {
+ if (this.doingDrag)
+ {
+ jQuery(document).unbind( 'mousemove', this.doDrag);
+ jQuery(document).unbind( 'mouseup', this.endDrag);
+ }
+
+ jQuery(this.id).unbind( 'mousedown', this.startDrag);
+ this.modalPanel=null;
+ },
+
+ show: function() {
+ jQuery(this.id).show();
+ },
+
+ hide: function() {
+ jQuery(this.id).hide();
+ },
+
+ startDrag: function(event) {
+ var border = event.data.border;
+ border.doingDrag = true;
+
+ border.dragX = event.clientX;
+ border.dragY = event.clientY;
+ jQuery(document).bind( 'mousemove',{border:border}, border.doDrag);
+ jQuery(document).bind( 'mouseup',{border:border}, border.endDrag);
+
+ //var eCursorDiv = jQuery(border.modalPanel.cDiv);
+ //jQuery(eCursorDiv).css('cursor', jQuery(border.id).css('cursor'));
+ //jQuery(eCursorDiv).css('zIndex', 10);
+
+ border.modalPanel.startDrag(border);
+
+ border.onselectStartHandler = document.onselectstart;
+ document.onselectstart = function() { return false; }
+ },
+
+ getWindowSize : function() {
+ var myWidth = 0, myHeight = 0;
+ if( typeof( window.innerWidth ) == 'number' ) {
+ myWidth = window.innerWidth;
+ myHeight = window.innerHeight;
+ } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
+ myWidth = document.documentElement.clientWidth;
+ myHeight = document.documentElement.clientHeight;
+ } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
+ myWidth = document.body.clientWidth;
+ myHeight = document.body.clientHeight;
+ }
+ return {"width":myWidth,"height":myHeight};
+ },
+
+ doDrag: function(event) {
+ var border = event.data.border;
+ if (!border.doingDrag) {
+ return ;
+ }
+
+ var evtX = event.clientX;
+ var evtY = event.clientY;
+
+ var winSize = border.getWindowSize();
+
+ if (evtX < 0) {
+ evtX = 0;
+ } else if (evtX >= winSize.width) {
+ evtX = winSize.width - 1;
+ }
+
+ if (evtY < 0) {
+ evtY = 0;
+ } else if (evtY >= winSize.height) {
+ evtY = winSize.height - 1;
+ }
+
+ var dx = evtX - border.dragX;
+ var dy = evtY - border.dragY;
+
+ if (dx != 0 || dy != 0) {
+
+ var id = border.id;
+
+ var diff = border.sizer.prototype.doDiff(dx, dy);//TODO
+ var doResize;
+
+ var element = jQuery(border.modalPanel.cdiv);
+
+ if (diff.deltaWidth || diff.deltaHeight) {
+ doResize = border.modalPanel.invokeEvent("resize",event,null,element);
+ } else if (diff.deltaX || diff.deltaY) {
+ doResize = border.modalPanel.invokeEvent("move",event,null,element);
+ }
+
+ var vetoes;
+
+ if (doResize) {
+ vetoes = border.modalPanel.doResizeOrMove(diff);
+ }
+
+ if(vetoes){
+ if (!vetoes.x) {
+ border.dragX = evtX;
+ } else {
+ if (!diff.deltaX) {
+ border.dragX -= vetoes.vx || 0;
+ } else {
+ border.dragX += vetoes.vx || 0;
+ }
+ }
+
+ if (!vetoes.y) {
+ border.dragY = evtY;
+ } else {
+ if (!diff.deltaY) {
+ border.dragY -= vetoes.vy || 0;
+ } else {
+ border.dragY += vetoes.vy || 0;
+ }
+ }
+ }
+ }
+ },
+
+ endDrag: function(event) {
+ var border = event.data.border;
+ border.doingDrag = undefined;
+
+ jQuery(document).unbind( 'mousemove', border.doDrag);
+ jQuery(document).unbind( 'mouseup', border.endDrag);
+
+ border.modalPanel.endDrag(border);
+
+ border.modalPanel.doResizeOrMove(richfaces.ui.PopupPanel.Sizer.Diff.EMPTY);
+
+ document.onselectstart = border.onselectStartHandler;
+ border.onselectStartHandler = null;
+ },
+
+ doPosition: function() {
+ this.sizer.prototype.doPosition(this.modalPanel, jQuery(this.id)); //TODO remove prototype
+ }
+ }
+
+ })());
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Copied: branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js (from rev 18015, root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js)
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js (rev 0)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/script/popupPanelSizer.js 2010-07-13 19:08:44 UTC (rev 18016)
@@ -0,0 +1,279 @@
+(function ($, richfaces) {
+
+ richfaces.ui = richfaces.ui || {};
+
+ richfaces.ui.PopupPanel.Sizer = function(id, modalPanel, cursor, sizer) {
+
+ $super.constructor.call(this,id);
+
+ };
+
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent, richfaces.ui.PopupPanel.Sizer);
+ var $super = richfaces.ui.PopupPanel.Sizer.$super;
+ $.extend(richfaces.ui.PopupPanel.Sizer.prototype, (function (options) {
+ return {
+
+ name: "richfaces.ui.PopupPanel.Sizer",
+
+ doSetupSize: function (modalPanel, elt) {
+ var width = 0;
+ var height = 0;
+
+ var reductionData = modalPanel.reductionData;
+
+ if (reductionData) {
+ if (reductionData.w) {
+ width = reductionData.w / 2;
+ }
+
+ if (reductionData.h) {
+ height = reductionData.h / 2;
+ }
+ }
+
+ if (width > 0) {
+ if (elt.clientWidth > width) {
+ if (!elt.reducedWidth) {
+ elt.reducedWidth = jQuery(elt).css('width');
+ }
+ jQuery(elt).css('width', width + 'px');
+ } else if (width < 4 && elt.reducedWidth == 4 + 'px') {
+ jQuery(elt).css('width', width + 'px');
+ }
+ } else {
+ if (elt.reducedWidth) {
+ jQuery(elt).css('width', elt.reducedWidth);
+ elt.reducedWidth = undefined;
+ }
+ }
+
+ if (height > 0) {
+ if (elt.clientHeight > height) {
+ if (!elt.reducedHeight) {
+ elt.reducedHeight = jQuery(elt).css('height');
+ }
+ elt.style.height = height + 'px';
+ } else if (height < 4 && elt.reducedHeight == 4 + 'px') {
+ jQuery(elt).css('height', height + 'px');
+ }
+ } else {
+ if (elt.reducedHeight) {
+ jQuery(elt).css('height', elt.reducedHeight);
+ elt.reducedHeight = undefined;
+ }
+ }
+ },
+
+ doSetupPosition: function (modalPanel, elt, left, top) {
+ if(!isNaN(left) && !isNaN(top)){
+ jQuery(elt).css('left', left + 'px');
+ jQuery(elt).css('top', top + 'px');
+ }
+ },
+
+ doPosition: function (modalPanel, elt) {
+
+ },
+
+ doDiff: function (dx, dy) {
+
+ }
+ }
+
+ })());
+ richfaces.ui.PopupPanel.Sizer.Diff = function(dX, dY, dWidth, dHeight) {
+
+ this.deltaX = dX;
+ this.deltaY = dY;
+
+ this.deltaWidth = dWidth;
+ this.deltaHeight = dHeight;
+
+ };
+
+ richfaces.ui.PopupPanel.Sizer.Diff.EMPTY = function(){
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, 0, 0);
+ },
+
+ richfaces.ui.PopupPanel.Sizer.N = function(){
+
+ }
+
+ $.extend(richfaces.ui.PopupPanel.Sizer.N.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.N.prototype, {
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.N",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('width',popupPanel.width() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, 0, -dy);
+ },
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.NW = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.NW.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.NW.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.NW",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, dy, -dx, -dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.NE = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.NE.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.NE.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.NE",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, dy, dx, -dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.E = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.E.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.E.prototype, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.E",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('height', popupPanel.height() + 'px');
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, dx, 0);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.SE = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.SE.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.prototype.SE, {
+
+ name: "richfaces.ui.PopupPanel.Sizer.SE",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth,
+ popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, dx, dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.S = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.S.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.S.prototype,{
+
+ name: "richfaces.ui.PopupPanel.Sizer.S",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('width', popupPanel.width() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(0, 0, 0, dy);
+ }
+
+ });
+
+
+ richfaces.ui.PopupPanel.Sizer.SW = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.SW.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.SW.prototype,{
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.SW",
+
+ doPosition : function (popupPanel, elt) {
+ this.doSetupSize(popupPanel, elt);
+ this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, 0, -dx, dy);
+ }
+
+ });
+
+ richfaces.ui.PopupPanel.Sizer.W = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.W.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.W.prototype,{
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.W",
+
+ doPosition : function (popupPanel, elt) {
+ jQuery(elt).css('height', popupPanel.height() + 'px');
+ this.doSetupPosition(popupPanel, elt, 0, 0);
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, 0, -dx, 0);
+ }
+
+
+ });
+
+
+ richfaces.ui.PopupPanel.Sizer.Header = function(){
+
+ }
+ $.extend(richfaces.ui.PopupPanel.Sizer.Header.prototype, richfaces.ui.PopupPanel.Sizer.prototype);
+ $.extend(richfaces.ui.PopupPanel.Sizer.Header.prototype, {
+
+
+ name: "richfaces.ui.PopupPanel.Sizer.Header",
+
+ doPosition : function (popupPanel, elt) {
+
+ },
+
+ doDiff : function(dx, dy) {
+ return new richfaces.ui.PopupPanel.Sizer.Diff(dx, dy, 0, 0);
+ }
+
+
+ });
+
+
+})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/main/templates/popupPanel.template.xml 2010-07-13 19:08:44 UTC (rev 18016)
@@ -16,7 +16,6 @@
<cc:implementation>
<cdk:call expression="checkOptions(facesContext, component)" />
<div id="#{clientId}" style="visibility: hidden;">
- <button class="mp-button" id="#{clientId}FirstHref"></button>
<c:if test="#{component.attributes['modal']}">
<div id="#{clientId}_shade" onclick="#{component.attributes['onmaskclick']}"
ondblclick="#{component.attributes['onmaskdblclick']}"
@@ -29,27 +28,22 @@
</c:if>
<div id="#{clientId}_shadow" class="mp_shadow"/>
- <div id="#{clientId}_container" cdk:passThroughWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
- <div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
+ <div id="#{clientId}_container" cdk:passThruWithExclusions="id,style,class,styleClass" class="mp_container #{component.attributes['styleClass']}">
+
<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
+ <div id="#{clientId}_header" class="mp_header #{component.attributes['headerClass']}" >
<div id="#{clientId}_header_content" class="mp_header_content">
- <c:if test="#{component.attributes['autosized']}">
- <span id="#{clientId}_headerSpan">
<cdk:call expression="renderHeaderFacet(facesContext, component)"/>
- </span>
- </c:if>
- <c:if test="#{!component.attributes['autosized']}">
- <cdk:call expression="renderHeaderFacet(facesContext, component)"/>
- </c:if>
</div>
+ </div>
</c:if>
<c:if test="#{component.getFacet('controls')!=null and component.getFacet('controls').rendered}">
<div id="#{clientId}_header_controls" class="mp_header_controls #{component.attributes['controlsClass']}">
<cdk:call expression="renderControlsFacet(facesContext, component)"/>
</div>
</c:if>
- </div>
- <div id="#{clientId}_content_scroller" class="mp_content_scroller #{component.attributes['scrollerClass']}">
+
+ <div id="#{clientId}_content_scroller" style="#{getStyleIfTrimmed(component)}" class="mp_content_scroller}">
<div id="#{clientId}_content" class="mp_content" style="#{component.attributes['style']}">
<cdk:call expression="renderChildren(facesContext, component)"/>
</div>
@@ -68,9 +62,6 @@
</div>
-
-
-<button class="mp-button" id="#{clientId}LastHref"></button>
</div>
<cdk:object type="java.lang.String" name="script" value="#{buildScript(facesContext, component)}" />
<cdk:object type="java.lang.String" name="showScript" value="#{buildShowScript(facesContext, component)}" />
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-07-13 19:08:44 UTC (rev 18016)
@@ -19,7 +19,7 @@
* 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;
+package org.richfaces.renderkit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -27,6 +27,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.List;
import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;
@@ -66,7 +67,7 @@
private FacesRequest startFacesRequest() throws IOException {
FacesRequest facesRequest = environment.createFacesRequest("http://localhost/popupPanelTest.jsf");
- facesRequest.withViewId("/popupPanelTest.jsf");
+ facesRequest.withViewId("/panelTest.jsf");
facesRequest.start();
FacesContext facesContext = FacesContext.getCurrentInstance();
ViewHandler vh = facesContext.getApplication().getViewHandler();
@@ -80,17 +81,17 @@
*
* @throws IOException
*/
- @Test
+ /* @Test
public final void testGetComponentClass() throws IOException {
- /*FacesRequest facesRequest = startFacesRequest();
+ FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
UIPopupPanel component = (UIPopupPanel) facesContext.getViewRoot().findComponent("panel");
PopupPanelRenderer renderer = (PopupPanelRenderer) FacesContext.getCurrentInstance()
.getRenderKit().getRenderer(component.getFamily(), component.getRendererType());
assertEquals(UIPopupPanel.class, renderer.getComponentClass());
- facesRequest.release();*/
+ facesRequest.release();
return ;
- }
+ }*/
/**
* Test method for
@@ -99,61 +100,42 @@
*
* @throws IOException
*/
- /*@Test
+ @Test
public final void testDoEncode() throws IOException {
- HtmlPage page = environment.getPage("/panelTest.jsf");
- HtmlElement panelWithFacet = page.getElementById("panelWithFacet");
- assertEquals("rf-panel panel", panelWithFacet.getAttribute("class"));
- assertEquals("Write your own custom rich components with built-in AJAX support", panelWithFacet.getElementById("panelWithFacet_header").getTextContent().trim());
- assertEquals("The CDK includes", panelWithFacet.getElementById("panelWithFacet_body")
+ HtmlPage page = environment.getPage("/popupPanelTest.jsf");
+ HtmlElement panelWithFacet = page.getElementById("panel");
+ assertNotNull(panelWithFacet);
+ assertEquals("visibility: hidden;", panelWithFacet.getAttribute("style"));
+ HtmlElement panelShade = panelWithFacet.getElementById("panel_shade");
+ assertEquals("mp_shade", panelShade.getAttribute("class"));
+ assertNotNull(panelShade);
+ HtmlElement panelShadow = panelWithFacet.getElementById("panel_shadow");
+ assertEquals("mp_shadow", panelShadow.getAttribute("class"));
+ assertNotNull(panelShadow);
+ HtmlElement panelContainer = panelWithFacet.getElementById("panel_container");
+ assertNotNull(panelContainer);
+ assertEquals("mp_container panelStyle", panelContainer.getAttribute("class"));
+ HtmlElement panelScroller = panelWithFacet.getElementById("panel_content_scroller");
+ assertNotNull(panelScroller);
+ assertEquals("mp_content_scroller ", panelScroller.getAttribute("class"));
+ HtmlElement panelContent = panelWithFacet.getElementById("panel_content");
+ assertNotNull(panelContent);
+ assertEquals("mp_content", panelContent.getAttribute("class"));
+ assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
- HtmlElement simplePanel = page.getElementById("simplePanel");
- assertEquals("rf-panel ", simplePanel.getAttribute("class"));
- try{
- simplePanel.getElementById("simplePanel_header");
- }catch(Exception e){
- assertTrue(true);
- }
- assertEquals("RichFaces is a l", simplePanel
- .getElementById("simplePanel_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement simplePanelBody = page.getElementById("simplePanel_body");
- assertEquals("rf-panel-body rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
- HtmlElement simplePanel2 = page.getElementById("simplePanelWithTextHeader");
- assertEquals("rf-panel ", simplePanel2.getAttribute("class"));
- assertNotNull(simplePanel2.getElementById("simplePanelWithTextHeader_header"));
- assertEquals("rich-laguna-panel-no-header", simplePanel2.getElementById("simplePanelWithTextHeader_header").getTextContent().trim());
- assertEquals("RichFaces is a l", simplePanel2
- .getElementById("simplePanelWithTextHeader_body")
- .getTextContent().trim().substring(0, 16));
-
- HtmlElement nestedPanelContainer = page.getElementById("nestedPanelContainer");
- assertEquals("rf-panel ", nestedPanelContainer.getAttribute("class"));
- assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
- assertEquals("||||", nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
- HtmlElement nestedPanelContainerHeader = page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-panel-header outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
- assertEquals("Benefits of Usin", nestedPanelContainer
- .getElementById("nestedPanelContainer_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel1 = nestedPanelContainer.getElementById("nestedPanel1");
- assertEquals("rf-panel ", nestedPanel1.getAttribute("class"));
- HtmlElement nestedPanel1Body = page.getElementById("nestedPanel1_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel1Body.getAttribute("class"));
- assertNotNull(nestedPanel1.getElementById("nestedPanel1_header"));
- assertEquals("For Application Developers", nestedPanel1.getElementById("nestedPanel1_header").getTextContent().trim());
- assertEquals("Production quali", nestedPanel1
- .getElementById("nestedPanel1_body")
- .getTextContent().trim().substring(0, 16));
- HtmlElement nestedPanel2 = nestedPanelContainer.getElementById("nestedPanel2");
- assertEquals("rf-panel ", nestedPanel2.getAttribute("class"));
- HtmlElement nestedPanel2Body = page.getElementById("nestedPanel2_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel2Body.getAttribute("class"));
- assertNotNull(nestedPanel2.getElementById("nestedPanel2_header"));
- assertEquals("For Component Developers", nestedPanel2.getElementById("nestedPanel2_header").getTextContent().trim());
- assertEquals("Ajax4jsf is Open", nestedPanel2
- .getElementById("nestedPanel2_body")
- .getTextContent().trim().substring(0, 16));
- }*/
+ HtmlElement panelHeader = panelWithFacet.getElementById("panel_header");
+ assertNotNull(panelHeader);
+ assertEquals("mp_header header", panelHeader.getAttribute("class"));
+ assertEquals("cursor: move;", panelHeader.getAttribute("style"));
+ assertEquals("Write your own custom rich components with built-in AJAX\n\t\t\tModal", panelHeader.getTextContent().trim());
+ HtmlElement panelHeaderControls = panelWithFacet.getElementById("panel_header_controls");
+ assertNotNull(panelHeaderControls);
+ assertEquals("mp_header_controls control", panelHeaderControls.getAttribute("class"));
+ HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
+ assertNotNull(panelResizer);
+ assertEquals("mp_handler mp_handler_top", panelResizer.getAttribute("class"));
+ assertEquals("cursor: N-resize;", panelResizer.getAttribute("style"));
+ List<HtmlElement> result = page.getElementsByName("script");
+ }
}
\ No newline at end of file
Modified: branches/development/iterators/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml
===================================================================
--- branches/development/iterators/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 18:48:50 UTC (rev 18015)
+++ branches/development/iterators/ui/output/trunk/panels/ui/src/test/resources/popupPanelText.xhtml 2010-07-13 19:08:44 UTC (rev 18016)
@@ -5,78 +5,58 @@
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:a4j="http://richfaces.org/a4j"
- xmlns:panel="http://richfaces.org/panels"
xmlns:rich="http://richfaces.org/rich">
-<!--
-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.
--->
<h:head>
<title>Richfaces ExtendedDataTable Test</title>
</h:head>
<h:body>
+ <rich:popupPanel styleClass="panelStyle" headerClass="header" controlsClass="control"
+
+
+ id="panel"
+ >
+ <f:facet name="header">
+ Write your own custom rich components with built-in AJAX
+ </f:facet>
+ <f:facet name="controls">
+ <h:outputText value="Modal" />
+ </f:facet>
+ <h:form>
+ <h:panelGroup layout="block"
+ style="width:500px,height:400px;">
+ The CDK includes a code-generation facility and a
+ templating facility using a JSP-like syntax. These
+ capabilities help to avoid a routine process of a
+ component creation. The component factory works like
+ a well-oiled machine allowing the creation of
+ first-class rich components with built-in Ajax
+ functionality even more easily than the creation of
+ simpler components by means of the traditional
+ coding approach.
- <panel:popupPanel domElementAttachment="body" visualOptions="{left:400px;}" moveable="true" overlapEmbedObjects="true" keepVisualState="true" onmaskclick="alert('1')" width="600" height="400" id="panel" left="500px" top="300px">
- <f:facet name="header">
- Write your own custom rich components with built-in AJAX
- </f:facet>
- <h:form>
- <h:panelGroup layout="block" style="width:500px,height:400px;">
- The CDK includes a code-generation facility and a
- templating facility using a JSP-like syntax. These capabilities help
- to avoid a routine process of a component creation. The component factory
- works like a well-oiled machine allowing the creation of first-class
- rich components with built-in Ajax functionality even more easily than
- the creation of simpler components by means of the traditional coding
- approach.
- <a4j:commandLink value="Hide">
-
- <rich:componentControl target="panel" operation="hide" event="click">
- </rich:componentControl>
- </a4j:commandLink>
+ <h:inputText value="aaa" />
+ <a href="#"
+ onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
+ setSize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
+ resize
+ </a>
+ <a href="#"
+ onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
+ move
+ </a>
-<h:inputText value="aaa"/>
-<a href="#" onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">setSize
- </a>
- <a href="#" onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">resize
- </a>
- <a href="#" onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">move
- </a>
-
- <a href="#" onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">moveTo
- </a>
- </h:panelGroup>
- </h:form>
- </panel:popupPanel>
-
- <a4j:commandLink value="Show">
-
- <rich:componentControl target="panel" operation="show" event="click">
- </rich:componentControl>
- </a4j:commandLink>
-
+ <a href="#"
+ onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
+ moveTo
+ </a>
+ </h:panelGroup>
+ </h:form>
+ </rich:popupPanel>
</h:body>
-</html>
\ No newline at end of file
+</html>
14 years, 6 months
JBoss Rich Faces SVN: r18015 - root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-07-13 14:48:50 -0400 (Tue, 13 Jul 2010)
New Revision: 18015
Modified:
root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss
Log:
Modified: root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss 2010-07-13 18:46:48 UTC (rev 18014)
+++ root/ui/output/trunk/panels/ui/src/main/resources/META-INF/resources/css/popupPanel.ecss 2010-07-13 18:48:50 UTC (rev 18015)
@@ -62,24 +62,17 @@
padding-left : 10px;
}
.mp_header_controls {
- background : "url(#{resource['images/close_act.gif']}) no-repeat center";
- width : 16px;
- height : 16px;
position : absolute;
- top : 8px;
- right : 8px;
+ top : 2px;
+ right : 2px;
white-space : nowrap;
cursor : default;
+ font-weight : '#{richSkin.headerWeightFont}';
+ color : '#{richSkin.headerTextColor}';
+ font-family : '#{richSkin.headerFamilyFont}';
+ font-size : '#{richSkin.headerSizeFont}';
}
-.mp_header_icon {
- background : "url(#{resource['images/edit.gif']}) no-repeat center";
- width : 16px;
- height : 16px;
- margin-right : 5px;
- vertical-align : middle;
- display : inline-block;
- text-align : middle;
-}
+
.mp_content_scroller {
position : relative;
top : 0px;
14 years, 6 months
JBoss Rich Faces SVN: r18014 - in root/ui/output/trunk/panels/ui/src/main/java/org/richfaces: component/behavior and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-07-13 14:46:48 -0400 (Tue, 13 Jul 2010)
New Revision: 18014
Modified:
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java
root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java
Log:
TODOs committed
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractDivPanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -32,11 +32,14 @@
*/
public abstract class AbstractDivPanel extends UIOutput {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_TYPE = "org.richfaces.panels.DivPanel";
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_FAMILY = "org.richfaces.panels.DivPanel";
protected AbstractDivPanel() {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
setRendererType("org.richfaces.panels.DivPanelRenderer");
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,8 +22,8 @@
package org.richfaces.component;
-import org.richfaces.event.SelectedItemChangeEvent;
-import org.richfaces.event.SelectedItemChangeListener;
+import java.util.Iterator;
+import java.util.List;
import javax.el.ELException;
import javax.el.MethodExpression;
@@ -44,17 +44,20 @@
import javax.faces.event.PreValidateEvent;
import javax.faces.event.ValueChangeListener;
import javax.faces.validator.Validator;
-import java.util.Iterator;
-import java.util.List;
+import org.richfaces.event.SelectedItemChangeEvent;
+import org.richfaces.event.SelectedItemChangeListener;
+
/**
* @author akolonitsky
* @version 1.0
*/
public abstract class AbstractTogglePanel extends AbstractDivPanel implements EditableValueHolder {
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanel";
+ //TODO nick - http://community.jboss.org/docs/DOC-13693
public static final String COMPONENT_FAMILY = "org.richfaces.panels.TogglePanel";
private String submittedSelectedItem = null;
@@ -140,10 +143,12 @@
}
public MethodBinding getValidator() {
+ //TODO nick - Errors shouldn't ne thrown
throw new UnknownError();
}
public void setValidator(MethodBinding validatorBinding) {
+ //TODO nick - Errors shouldn't ne thrown
throw new UnknownError();
}
@@ -343,6 +348,7 @@
return;
}
+ //TODO nick - selectedItem attribute?
ValueExpression ve = getValueExpression("value");
if (ve == null) {
return;
@@ -443,6 +449,7 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
+ //TODO nick - immediate?
if (event instanceof SelectedItemChangeEvent && isBypassUpdates()) {
FacesContext.getCurrentInstance().renderResponse();
}
@@ -460,6 +467,7 @@
}
private boolean isSelectedItem(UIComponent kid) {
+ //TODO nick - selectedItem should be cached in local variable
String value = getSelectedItem();
if (value == null) {
value = getSubmittedSelectedItem();
@@ -470,10 +478,12 @@
public String getFirstItem() {
checkChildCount(getChildCount());
+ //TODO nick - children can be rendered or not
return getChildName(getChildren().get(0));
}
private static void checkChildCount(int childCount) {
+ //TODO nick - remove this check
if (childCount < 1) {
throw new IllegalStateException("TogglePanel must have at least one TogglePanelItem.");
}
@@ -486,6 +496,7 @@
checkChildCount(getChildCount());
List<UIComponent> children = getChildren();
+ //TODO nick - return child itself
int index = getChildIndex(name, children);
if (index == -1) {
return null;
@@ -525,6 +536,7 @@
}
private static String getChildName(UIComponent item) {
+ //TODO nick - panel can include UIParam children - remove this exception
if (!(item instanceof AbstractTogglePanelItem)) {
throw new IllegalStateException("TogglePanel can contain only TogglePanelItem as child.");
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/Method.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -4,6 +4,8 @@
* @author akolonitsky
* @since Jun 15, 2010
*/
+//TODO nick - rename into SwitchType or PanelSwitchType
+//TODO nick - move to API
public enum Method {
/**
* value for tab change method for - client-side tabs.
@@ -19,4 +21,6 @@
* value for tab change method - ajax tabs
*/
ajax
+
+ //TODO nick - add DEFAULT constant
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIDivPanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -28,6 +28,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - remove
public class UIDivPanel extends AbstractDivPanel {
public static final String COMPONENT_TYPE = "org.richfaces.panels.DivPanel";
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -27,6 +27,7 @@
* JSF component class
*
*/
+//TODO nick - remove
public class UIPanel extends UIComponentBase {
private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UIPopupPanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -55,6 +55,7 @@
return result;
}
+ //TODO nick - CDK should generate all these properties' code
public String getVisualOptions() {
return (String) getStateHelper().eval(PropertyKeys.visualOptions);
}
@@ -255,6 +256,7 @@
getStateHelper().put(PropertyKeys.shadowOpacity, shadowOpacity);
}
+ //TODO nick - this should part of renderer
private Map<String, Object> prepareVisualOptions(Object value) {
if (null == value) {
return new HashMap<String, Object>();
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanel.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -28,6 +28,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - no behaviors support!
public class UITogglePanel extends AbstractTogglePanel {
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanel";
@@ -108,6 +109,7 @@
}
public MethodExpression getSelectedItemChangeListener() {
+ //TODO nick - get, not eval
return (MethodExpression) getStateHelper().eval(PropertyKeys.selectedItemChangeListener);
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/UITogglePanelItem.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -26,6 +26,7 @@
* @author akolonitsky
* @since -4712-01-01
*/
+//TODO nick - no behaviors support!
public class UITogglePanelItem extends AbstractTogglePanelItem {
public static final String COMPONENT_TYPE = "org.richfaces.panels.TogglePanelItem";
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/component/behavior/ToggleControl.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,14 +22,14 @@
package org.richfaces.component.behavior;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorContext;
+
import org.ajax4jsf.component.behavior.ClientBehavior;
import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.AbstractTogglePanel;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.ClientBehaviorContext;
-
/**
* @author akolonitsky
*
@@ -62,6 +62,7 @@
}
public String getForPanel() {
+ //TODO nick - get, not eval
return (String) getStateHelper().eval(PropertyKeys.forPanel);
}
@@ -69,6 +70,7 @@
getStateHelper().put(PropertyKeys.forPanel, selector);
}
+ //TODO nick - argument type is incorrect
public void setDisableDefault(String disableDefault) {
getStateHelper().put(PropertyKeys.disableDefault, disableDefault);
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/MethodExpressionSelectedItemChangeListener.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -26,8 +26,8 @@
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.MethodNotFoundException;
+import javax.faces.component.StateHolder;
import javax.faces.context.FacesContext;
-import javax.faces.component.StateHolder;
import javax.faces.event.AbortProcessingException;
/**
@@ -43,8 +43,10 @@
* @since -4712-01-01
*
*/
+//TODO nick - good candidate for utility class
public class MethodExpressionSelectedItemChangeListener implements SelectedItemChangeListener, StateHolder {
+ //TODO nick - classes should be generified too
private static final Class[] SELECTED_ITEM_CHANGE_LISTENER_ZERO_ARG_SIG = new Class[] {};
// ------------------------------------------------------ Instance Variables
@@ -156,6 +158,7 @@
throw new NullPointerException();
}
+ //TODO nick - use javax.faces.component.UIComponentBase.saveAttachedState(FacesContext, Object)
return new Object[] {methodExpressionOneArg, methodExpressionZeroArg };
}
@@ -173,6 +176,7 @@
return;
}
+ //TODO nick - use javax.faces.component.UIComponentBase.restoreAttachedState(FacesContext, Object)
methodExpressionOneArg = (MethodExpression) ((Object[]) state)[0];
methodExpressionZeroArg = (MethodExpression) ((Object[]) state)[1];
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeEvent.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -34,6 +34,8 @@
* @version 1.0
* @since -4712-01-01
*/
+//TODO nick - move to API
+//TODO nick - serialVersionUUID is missing
public class SelectedItemChangeEvent extends FacesEvent {
private final String oldItem;
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/event/SelectedItemChangeListener.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -36,6 +36,7 @@
* @since -4712-01-01
*
*/
+//TODO nick - move to API
public interface SelectedItemChangeListener extends FacesListener {
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/DivPanelRenderer.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,20 +22,22 @@
package org.richfaces.renderkit.html;
-import static org.ajax4jsf.renderkit.RendererUtils.*;
-import org.ajax4jsf.renderkit.RendererBase;
-import org.richfaces.component.AbstractDivPanel;
+import java.io.IOException;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.Map;
+import org.ajax4jsf.renderkit.RendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.AbstractDivPanel;
+
/**
* @author akolonitsky
*
*/
+//TODO nick - use Renderer instead of RendererBase
public class DivPanelRenderer extends RendererBase {
public static final String[] ATTRIBUTES = new String[] {
@@ -67,6 +69,7 @@
Map<String, Object> componentAttributes = component.getAttributes();
for (String attrName : attributes) {
Object attrValue = componentAttributes.get(attrName);
+ //TODO nick - ???
if (!"null".equalsIgnoreCase(String.valueOf(attrValue))) {
writer.writeAttribute(attrName, attrValue, attrName); // TODO Use RendererUtils
}
@@ -85,6 +88,7 @@
protected void writeJavaScript(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
Object script = getScriptObject(context, component);
if (script != null) {
+ //TODO nick - how does script relate to DIV?
writer.startElement(HTML.SCRIPT_ELEM, component);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", "type");
writer.writeText(script, null);
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -34,6 +34,7 @@
* @author amarkhel
* @since Jun 14, 2010
*/
+//TODO nick - JSF have concept of library, it should be used instead of '/' in resource names
@ResourceDependency(name = "css/panel.ecss")
public class PanelBaseRenderer extends RendererBase {
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -4,8 +4,8 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
-import java.util.Map.Entry;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@@ -17,6 +17,7 @@
import org.ajax4jsf.renderkit.RendererBase;
import org.richfaces.component.UIPopupPanel;
+//TODO nick - JSF have concept of library, it should be used instead of '/' in resource names
@ResourceDependencies( { @ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-base-component.js"), @ResourceDependency(name = "script/popupPanel.js"),
@ResourceDependency(name = "script/popupPanelBorders.js"), @ResourceDependency(name = "script/popupPanelSizer.js"),
@@ -29,6 +30,8 @@
private static final String HEADER_FACET = "header";
private static final int SIZE = 10;
private static final String STATE_OPTION_SUFFIX = "StateOption_";
+
+ //TODO nick - use enums
private static final Set<String> ALLOWED_ATTACHMENT_OPTIONS = new HashSet<String>();
static {
ALLOWED_ATTACHMENT_OPTIONS.add("body");
@@ -131,6 +134,7 @@
if (panel.isShow()) {
result.append("RichFaces.ui.PopupPanel.showPopupPanel('" + panel.getClientId(context) + "', {");
+ //TODO nick - use ScriptUtils.toScript
Iterator<Map.Entry<String, Object>> it = ((Map<String, Object>) panel.getHandledVisualOptions()).entrySet()
.iterator();
while (it.hasNext()) {
@@ -156,6 +160,8 @@
private void writeOption(StringBuilder builder, String attribbute, Object value, UIComponent component,
boolean isString) {
+
+ //TODO nick - use ScriptUtils.toScript
if (component.getAttributes().get(attribbute) != null) {
builder.append(attribbute + ":");
if (isString) {
@@ -175,6 +181,7 @@
result.append("new RichFaces.ui.PopupPanel('");
result.append(panel.getClientId());
result.append("',{");
+ //TODO nick - use RendererUtils.addToScriptHash(Map<String, Object>, String, Object)
writeOption(result, "width", panel.getWidth(), component, false);
writeOption(result, "height", panel.getHeight(), component, false);
writeOption(result, "minWidth", panel.getMinWidth(), component, false);
@@ -199,6 +206,7 @@
writeOption(result, "show", panel.isShow(), component, false);
writeOption(result, "autosized", panel.isAutosized(), component, false);
writeOption(result, "overlapEmbedObjects", panel.isOverlapEmbedObjects(), component, false);
+ //TODO nick - what is deleted here?
result.delete(result.length() - 1, result.length());
if (component.getAttributes().get("visualOptions") != null) {
result.append(writeVisualOptions(context, panel));
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,25 +22,25 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSObject;
-import org.ajax4jsf.renderkit.AjaxEventOptions;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.richfaces.component.AbstractTogglePanel;
-import org.richfaces.component.AbstractTogglePanelItem;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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 java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import static org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.ajax4jsf.renderkit.AjaxEventOptions;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.component.AbstractTogglePanelItem;
/**
* @author akolonitsky
@@ -80,6 +80,7 @@
if (panelItem != null) {
context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
+ //TODO nick - this should be done on encode, not on decode
addOnCompleteParam(newValue, panel);
}
}
@@ -153,6 +154,7 @@
} else {
switch (item.getSwitchType()) {
+ //TODO nick - non-rendered items shouldn't be processed
case client:
hidePanelItem(item);
@@ -170,6 +172,7 @@
break;
case server:
+ //TODO nick - why nothing?
break;
default:
@@ -181,6 +184,7 @@
}
private static void hidePanelItem(UIComponent item) {
+ //TODO nick - attributes shouldn't be overwritten
item.getAttributes().put(HTML.STYLE_ATTRIBUTE, "display:none");
}
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/SelectedItemChangeListenerHandler.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,18 +22,6 @@
package org.richfaces.taglib;
-import javax.el.ValueExpression;
-import javax.faces.application.Resource;
-import org.richfaces.component.AbstractTogglePanel;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import org.richfaces.event.SelectedItemChangeEvent;
-import org.richfaces.event.SelectedItemChangeListener;
-
-import javax.faces.view.AttachedObjectHandler;
-import javax.faces.view.EditableValueHolderAttachedObjectHandler;
-import javax.faces.view.facelets.*;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Array;
@@ -43,6 +31,26 @@
import java.util.List;
import java.util.Map;
+import javax.el.ValueExpression;
+import javax.faces.application.Resource;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.EditableValueHolderAttachedObjectHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
+
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.event.SelectedItemChangeEvent;
+import org.richfaces.event.SelectedItemChangeListener;
+
+//TODO nick - what does "-4712-01-01" mean?
/**
*
* @author akolonitsky
@@ -51,6 +59,7 @@
*/
public final class SelectedItemChangeListenerHandler extends TagHandler implements EditableValueHolderAttachedObjectHandler {
+ //TODO nick - take names from primitives
private static final String[] PRIMITIVE_NAMES = new String[] {"boolean",
"byte", "char", "double", "float", "int", "long", "short", "void" };
@@ -132,6 +141,8 @@
if (parent instanceof AbstractTogglePanel) {
applyAttachedObject(ctx.getFacesContext(), parent);
} else if (parent.getAttributes().containsKey(Resource.COMPONENT_RESOURCE_KEY)) {
+ //TODO nick - javax.faces.component.UIComponent.isCompositeComponent(UIComponent)
+
// Allow the composite component to know about the target component.
getAttachedObjectHandlers(parent).add(this);
} else {
@@ -143,10 +154,12 @@
ValueExpression b = null;
if (this.binding != null) {
FaceletContext ctx = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+ //TODO nick - b is already instance of listener - add it directly without LazySelectedItemChangeListener
b = this.binding.getValueExpression(ctx, SelectedItemChangeListener.class);
}
AbstractTogglePanel evh = (AbstractTogglePanel) parent;
+ //TODO nick - this should be done via API interface
evh.addSelectedItemChangeListener(new LazySelectedItemChangeListener(this.listenerType, b));
}
@@ -160,6 +173,7 @@
return getAttachedObjectHandlers(component, true);
}
+ //TODO nick - see org.richfaces.view.facelets.html.TagHandlerUtils
@SuppressWarnings({"unchecked"})
public static List<AttachedObjectHandler> getAttachedObjectHandlers(UIComponent component,
boolean create) {
@@ -183,8 +197,11 @@
if (null == name || "".equals(name)) {
return null;
}
+
+ //TODO nick - primitive class won't be necessary listener
Class c = forNamePrimitive(name);
if (c == null) {
+ //TODO nick - standard syntax for array classes is different + what about arrays of > 1 dims?
if (name.endsWith("[]")) {
String nc = name.substring(0, name.length() - 2);
c = Class.forName(nc, false, Thread.currentThread().getContextClassLoader());
Modified: root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java
===================================================================
--- root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java 2010-07-13 18:41:20 UTC (rev 18013)
+++ root/ui/output/trunk/panels/ui/src/main/java/org/richfaces/taglib/TogglePanelTagHandler.java 2010-07-13 18:46:48 UTC (rev 18014)
@@ -22,11 +22,6 @@
package org.richfaces.taglib;
-import org.richfaces.component.AbstractTogglePanel;
-
-import org.richfaces.event.MethodExpressionSelectedItemChangeListener;
-import org.richfaces.event.SelectedItemChangeEvent;
-
import javax.faces.view.facelets.ComponentConfig;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.FaceletContext;
@@ -36,6 +31,10 @@
import javax.faces.view.facelets.MetadataTarget;
import javax.faces.view.facelets.TagAttribute;
+import org.richfaces.component.AbstractTogglePanel;
+import org.richfaces.event.MethodExpressionSelectedItemChangeListener;
+import org.richfaces.event.SelectedItemChangeEvent;
+
/**
* @author akolonitsky
* @version 1.0
14 years, 6 months