Author: lfryc(a)redhat.com
Date: 2010-07-10 15:08:40 -0400 (Sat, 10 Jul 2010)
New Revision: 17834
Added:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JOutputPanelBean.java
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JOutputPanelBean.properties
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JMediaOutputBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
root/tests/metamer/trunk/src/main/webapp/components/a4jMediaOutput/image.xhtml
Log:
https://jira.jboss.org/browse/RFPL-466
* added a4j:outputPanel
* removed unnecessary code from a4j:poll bean
* a4j:mediaOutput fixed
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JMediaOutputBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JMediaOutputBean.java 2010-07-10
19:06:08 UTC (rev 17833)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JMediaOutputBean.java 2010-07-10
19:08:40 UTC (rev 17834)
@@ -65,6 +65,12 @@
logger.info("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UIMediaOutput.class,
getClass());
+ attributes.put("session", true);
+ attributes.put("rendered", true);
+ attributes.remove("createContent");
+ attributes.remove("element");
+ attributes.remove("value");
+ attributes.remove("mimeType");
}
/**
Copied:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JOutputPanelBean.java
(from rev 17833,
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java)
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JOutputPanelBean.java
(rev 0)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JOutputPanelBean.java 2010-07-10
19:08:40 UTC (rev 17834)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.testapp.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.component.UIOutputPanel;
+
+import org.richfaces.testapp.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:outputPanel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jOutputPanelBean")
+@SessionScoped
+public class A4JOutputPanelBean implements Serializable {
+
+ private static final long serialVersionUID = 4814439475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int counter;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UIOutputPanel.class,
getClass());
+ attributes.put("ajaxRendered", true);
+ attributes.put("layout", "block");
+ attributes.put("rendered", true);
+ attributes.put("styleClass", "");
+ }
+
+ /**
+ * Getter for attributes.
+ *
+ * @return A map containing all attributes of tested component. Name of the component
is key in the map.
+ */
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * Setter for attributes.
+ *
+ * @param attributes
+ * map containing all attributes of tested component. Name of the
component is key in the map.
+ */
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getCounter() {
+ return counter;
+ }
+
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ public String increaseCounterAction() {
+ counter++;
+ return null;
+ }
+
+}
+
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java 2010-07-10
19:06:08 UTC (rev 17833)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java 2010-07-10
19:08:40 UTC (rev 17834)
@@ -35,9 +35,9 @@
import org.slf4j.LoggerFactory;
/**
- * Managed bean for a4j:push.
+ * Managed bean for a4j:poll.
*
- * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@ManagedBean(name = "a4jPollBean")
@@ -87,16 +87,6 @@
return new Date();
}
- public void enablePoll(ActionEvent event) {
- logger.debug("enablePoll");
- attributes.put("enabled", true);
- }
-
- public void disablePoll(ActionEvent event) {
- logger.debug("disablePoll");
- attributes.put("enabled", false);
- }
-
public int getCounter() {
return counter;
}
@@ -106,7 +96,6 @@
}
public String increaseCounterAction() {
- logger.debug("increaseCounterAction");
counter++;
return null;
}
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
19:06:08 UTC (rev 17833)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
19:08:40 UTC (rev 17834)
@@ -94,6 +94,7 @@
components.put("a4jCommandButton", "A4J Command Button");
components.put("a4jLog", "A4J Log");
components.put("a4jMediaOutput", "A4J Media Output");
+ components.put("a4jOutputPanel", "A4J Output Panel");
components.put("a4jPoll", "A4J Poll");
components.put("a4jPush", "A4J Push");
components.put("commandButton", "JSF Command Button");
Added:
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JOutputPanelBean.properties
===================================================================
---
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JOutputPanelBean.properties
(rev 0)
+++
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JOutputPanelBean.properties 2010-07-10
19:08:40 UTC (rev 17834)
@@ -0,0 +1,7 @@
+attr.layout.block=block
+attr.layout.inline=inline
+attr.layout.none=none
+
+attr.styleClass.blue-background=blue-background
+attr.styleClass.gray-background=gray-background
+attr.styleClass.none=
\ No newline at end of file
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jMediaOutput/image.xhtml
===================================================================
---
root/tests/metamer/trunk/src/main/webapp/components/a4jMediaOutput/image.xhtml 2010-07-10
19:06:08 UTC (rev 17833)
+++
root/tests/metamer/trunk/src/main/webapp/components/a4jMediaOutput/image.xhtml 2010-07-10
19:08:40 UTC (rev 17834)
@@ -18,8 +18,61 @@
</ui:define>
<ui:define name="component">
- <a4j:mediaOutput id="mediaOutput"
createContent="#{a4jMediaOutputBean.paint}" value="#{mediaData}"
- element="img" cacheable="false"
session="true" mimeType="image/jpeg" />
+ <a4j:mediaOutput id="mediaOutput"
+
accesskey="#{a4jMediaOutputBean.attributes['accesskey']}"
+
align="#{a4jMediaOutputBean.attributes['align']}"
+
archive="#{a4jMediaOutputBean.attributes['archive']}"
+
border="#{a4jMediaOutputBean.attributes['border']}"
+
cacheable="#{a4jMediaOutputBean.attributes['cacheable']}"
+
charset="#{a4jMediaOutputBean.attributes['charset']}"
+
classid="#{a4jMediaOutputBean.attributes['classid']}"
+
codebase="#{a4jMediaOutputBean.attributes['codebase']}"
+
codetype="#{a4jMediaOutputBean.attributes['codetype']}"
+
converter="#{a4jMediaOutputBean.attributes['converter']}"
+
coords="#{a4jMediaOutputBean.attributes['coords']}"
+ createContent="#{a4jMediaOutputBean.paint}"
+
createContentExpression="#{a4jMediaOutputBean.attributes['createContentExpression']}"
+
declare="#{a4jMediaOutputBean.attributes['declare']}"
+
dir="#{a4jMediaOutputBean.attributes['dir']}"
+ element="img"
+
expires="#{a4jMediaOutputBean.attributes['expires']}"
+
hreflang="#{a4jMediaOutputBean.attributes['hreflang']}"
+
hspace="#{a4jMediaOutputBean.attributes['hspace']}"
+
ismap="#{a4jMediaOutputBean.attributes['ismap']}"
+
lang="#{a4jMediaOutputBean.attributes['lang']}"
+
lastmodified="#{a4jMediaOutputBean.attributes['lastmodified']}"
+
localValue="#{a4jMediaOutputBean.attributes['localValue']}"
+ mimeType="image/jpeg"
+
onblur="#{a4jMediaOutputBean.attributes['onblur']}"
+
onclick="#{a4jMediaOutputBean.attributes['onclick']}"
+
ondblclick="#{a4jMediaOutputBean.attributes['ondblclick']}"
+
onfocus="#{a4jMediaOutputBean.attributes['onfocus']}"
+
onkeydown="#{a4jMediaOutputBean.attributes['onkeydown']}"
+
onkeypress="#{a4jMediaOutputBean.attributes['onkeypress']}"
+
onkeyup="#{a4jMediaOutputBean.attributes['onkeyup']}"
+
onmousedown="#{a4jMediaOutputBean.attributes['onmousedown']}"
+
onmousemove="#{a4jMediaOutputBean.attributes['onmousemove']}"
+
onmouseout="#{a4jMediaOutputBean.attributes['onmouseout']}"
+
onmouseover="#{a4jMediaOutputBean.attributes['onmouseover']}"
+
onmouseup="#{a4jMediaOutputBean.attributes['onmouseup']}"
+
rel="#{a4jMediaOutputBean.attributes['rel']}"
+
rendered="#{a4jMediaOutputBean.attributes['rendered']}"
+
resource="#{a4jMediaOutputBean.attributes['resource']}"
+
rev="#{a4jMediaOutputBean.attributes['rev']}"
+
session="#{a4jMediaOutputBean.attributes['session']}"
+
shape="#{a4jMediaOutputBean.attributes['shape']}"
+
standby="#{a4jMediaOutputBean.attributes['standby']}"
+
style="#{a4jMediaOutputBean.attributes['style']}"
+
styleClass="#{a4jMediaOutputBean.attributes['styleClass']}"
+
tabindex="#{a4jMediaOutputBean.attributes['tabindex']}"
+
target="#{a4jMediaOutputBean.attributes['target']}"
+
title="#{a4jMediaOutputBean.attributes['title']}"
+
type="#{a4jMediaOutputBean.attributes['type']}"
+
urlAttribute="#{a4jMediaOutputBean.attributes['urlAttribute']}"
+
usermap="#{a4jMediaOutputBean.attributes['usermap']}"
+ value="#{mediaData}"
+
vspace="#{a4jMediaOutputBean.attributes['vspace']}"
+ />
</ui:define>
<ui:define name="outOfTemplateAfter">