Author: nbelaevski
Date: 2010-12-15 18:03:53 -0500 (Wed, 15 Dec 2010)
New Revision: 20597
Added:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java
Removed:
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
Log:
UIPanel refactoring & added missing attributes
Copied: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java (from
rev 20595, trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java)
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java
(rev 0)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanel.java 2010-12-15
23:03:53 UTC (rev 20597)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
+
+/**
+ * JSF component class
+ *
+ */
+@JsfComponent(tag = @Tag(type = TagType.Facelets),
+ renderer = @JsfRenderer(type = "org.richfaces.PanelRenderer"),
+ attributes = {"core-props.xml", "events-props.xml"}
+)
+public abstract class AbstractPanel extends UIComponentBase {
+
+ private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+}
Deleted: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-12-15
23:02:43 UTC (rev 20596)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanel.java 2010-12-15
23:03:53 UTC (rev 20597)
@@ -1,49 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import javax.faces.component.UIComponentBase;
-
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.JsfRenderer;
-import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.cdk.annotations.TagType;
-
-/**
- * JSF component class
- *
- */
-@JsfComponent(tag = @Tag(type = TagType.Facelets),
- renderer = @JsfRenderer(type = "org.richfaces.PanelRenderer")
- )
-public class UIPanel extends UIComponentBase {
- private static final String COMPONENT_FAMILY = "org.richfaces.Panel";
-
- public boolean getRendersChildren() {
- return true;
- }
-
- @Override
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-}
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java
===================================================================
---
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-12-15
23:02:43 UTC (rev 20596)
+++
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelBaseRenderer.java 2010-12-15
23:03:53 UTC (rev 20597)
@@ -21,7 +21,7 @@
package org.richfaces.renderkit.html;
-import org.richfaces.component.UIPanel;
+import org.richfaces.component.AbstractPanel;
import org.richfaces.renderkit.RendererBase;
import javax.faces.application.ResourceDependency;
@@ -46,6 +46,6 @@
@Override
protected Class<? extends UIComponent> getComponentClass() {
- return UIPanel.class;
+ return AbstractPanel.class;
}
}
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
---
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-12-15
23:02:43 UTC (rev 20596)
+++
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-12-15
23:03:53 UTC (rev 20597)
@@ -37,7 +37,7 @@
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.richfaces.component.UIPanel;
+import org.richfaces.component.AbstractPanel;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
@@ -83,10 +83,10 @@
public final void testGetComponentClass() throws IOException {
FacesRequest facesRequest = startFacesRequest();
FacesContext facesContext = FacesContext.getCurrentInstance();
- UIPanel component = (UIPanel)
facesContext.getViewRoot().findComponent("panelWithFacet");
+ AbstractPanel component = (AbstractPanel)
facesContext.getViewRoot().findComponent("panelWithFacet");
PanelRenderer renderer = (PanelRenderer) FacesContext.getCurrentInstance()
.getRenderKit().getRenderer(component.getFamily(),
component.getRendererType());
- assertEquals(UIPanel.class, renderer.getComponentClass());
+ assertEquals(AbstractPanel.class, renderer.getComponentClass());
facesRequest.release();
}
Show replies by date