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>