Author: ppitonak(a)redhat.com
Date: 2011-05-03 07:12:59 -0400 (Tue, 03 May 2011)
New Revision: 22460
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JActionListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAttachQueueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandButtonBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandLinkBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JJSFunctionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JLogBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JOutputPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JParamBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPollBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JQueueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRegionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRepeatBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JStatusBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAutocompleteBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsiblePanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableTogglerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataGridBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataScrollerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragIndicatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragSourceBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichExtendedDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichFileUploadBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichHashParamBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceInputBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSliderBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSpinnerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichJQueryBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichListBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuSeparatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPopupPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichProgressBarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichSelectBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToggleControlBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java
Removed:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JActionListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRepeatBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAutocompleteBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataScrollerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichGraphValidatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichHashParamBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichListBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuSeparatorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessagesBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPopupPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelItemBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarGroupBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichValidatorBean.java
Modified:
modules/tests/metamer/trunk/application/pom.xml
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/AbstractNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNodeImpl.java
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java
Log:
beans refactored - moved to subpackages
Modified: modules/tests/metamer/trunk/application/pom.xml
===================================================================
--- modules/tests/metamer/trunk/application/pom.xml 2011-05-01 20:52:05 UTC (rev 22459)
+++ modules/tests/metamer/trunk/application/pom.xml 2011-05-03 11:12:59 UTC (rev 22460)
@@ -171,17 +171,6 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <!-- disable default (inherited) attach-souces execution, use war sources
instead -->
- <execution>
- <id>attach-sources</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<attachClasses>true</attachClasses>
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JActionListenerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JActionListenerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JActionListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.NoneScoped;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.ActionListener;
-
-/**
- * Managed bean for a4j:ajax.
- *
- * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jActionListenerBean")
-@NoneScoped
-public class A4JActionListenerBean {
-
- public static final class ActionListenerImpl implements ActionListener {
-
- public void processAction(ActionEvent event) throws AbortProcessingException {
- addFacesMessage("Implementation of ActionListener created and called:
" + this);
- }
- }
-
- private static final class BoundActionListener implements ActionListener {
-
- public void processAction(ActionEvent event) throws AbortProcessingException {
- addFacesMessage("Bound listener called");
- }
- }
- private ActionListener actionListener = new BoundActionListener();
-
- private static void addFacesMessage(String messageText) {
- FacesContext context = FacesContext.getCurrentInstance();
- context.addMessage(null, new FacesMessage(messageText));
- }
-
- public void handleActionMethod(ActionEvent event) throws AbortProcessingException {
- addFacesMessage("Method expression listener called");
- }
-
- public void handleActionMethodComposite(ActionEvent event) throws
AbortProcessingException {
- addFacesMessage("Method expression listener called from composite
component");
- }
-
- public ActionListener getActionListener() {
- return actionListener;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.FacesException;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.AjaxBehaviorEvent;
-import javax.faces.model.SelectItem;
-
-import org.ajax4jsf.component.behavior.AjaxBehavior;
-import org.richfaces.tests.metamer.Attribute;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:ajax.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jAjaxBean")
-@ViewScoped
-public class A4JAjaxBean implements Serializable {
-
- private static final long serialVersionUID = -546567867L;
- private static final int ACTION_STRING_LENGTH = 6;
- private static Logger logger;
- private Attributes attributes;
- private String input;
- private List<String> cars;
- private String car;
- private boolean boolVal;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getBehaviorAttributesFromFacesConfig(AjaxBehavior.class,
getClass());
-
- // the 'event' attribute for behavior tag must be a literal
- attributes.remove("event");
-
- attributes.setAttribute("render", "output1, output2");
- attributes.setAttribute("execute", "@form");
-
- // FIXME not found attribute
- Attribute listenerAttr = new Attribute("listener");
- List<SelectItem> selectOptions = new ArrayList<SelectItem>();
- selectOptions.add(new SelectItem("doubleStringListener",
"doubleStringListener"));
- selectOptions.add(new SelectItem("first6CharsListener",
"first6CharsListener"));
- selectOptions.add(new SelectItem("toUpperCaseListener",
"toUpperCaseListener"));
- selectOptions.add(new SelectItem("causeErrorListener",
"causeErrorListener"));
- selectOptions.add(new SelectItem(null, "null"));
- listenerAttr.setSelectOptions(selectOptions);
- attributes.put(listenerAttr.getName(), listenerAttr);
-
- cars = new ArrayList<String>();
- cars.add("Ferrari");
- cars.add("Lexus");
- car = "Ferrari";
- }
-
- /**
- * 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;
- }
-
- /**
- * Getter for input.
- * @return content of the input field on the page
- */
- public String getInput() {
- return input;
- }
-
- /**
- * Setter for input.
- * @param input new content of the input field on the page
- */
- public void setInput(String input) {
- this.input = input;
- }
-
- public String getCar() {
- return car;
- }
-
- public void setCar(String car) {
- this.car = car;
- }
-
- public List<String> getCars() {
- return cars;
- }
-
- public void setCars(List<String> cars) {
- this.cars = cars;
- }
-
- public boolean isBoolVal() {
- return boolVal;
- }
-
- public void setBoolVal(boolean boolVal) {
- this.boolVal = boolVal;
- }
-
- /**
- * An action listener that takes the first six characters from input and stores it to
input.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void first6CharsListener(AjaxBehaviorEvent event) {
- if (input == null) {
- input = "";
- } else {
- int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
- input = (String) input.subSequence(0, endIndex);
- }
- }
-
- /**
- * An action listener that takes user's input, doubles it and stores it to
input.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void doubleStringListener(AjaxBehaviorEvent event) {
- if (input == null) {
- input = "";
- } else {
- input = input.concat(input);
- }
- }
-
- /**
- * An action listener that takes user's input, converts it to upper case and
stores it to input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void toUpperCaseListener(AjaxBehaviorEvent event) {
- if (input == null) {
- input = "";
- } else {
- input = input.toUpperCase();
- }
- }
-
- /**
- * An action listener causing error. Suitable for testing onerror attribute.
- * @param event an event representing the activation of a user interface component
(not used)
- */
- public void causeErrorListener(AjaxBehaviorEvent event) {
- throw new FacesException("Ajax request caused an error. This is intentional
behavior.");
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIAttachQueue;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:attachQueue.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jAttachQueueBean")
-@ViewScoped
-public class A4JAttachQueueBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private Attributes attributes2;
- private String text1;
- private String text2;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- // initialize attributes
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAttachQueue.class, getClass());
- initializeAttributes(attributes);
- attributes.setAttribute("requestDelay", 500);
-
- attributes2 =
Attributes.getComponentAttributesFromFacesConfig(UIAttachQueue.class, getClass());
- initializeAttributes(attributes2);
- attributes2.setAttribute("requestDelay", 1500);
- }
-
- private void initializeAttributes(Attributes attributes) {
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Attributes getAttributes2() {
- return attributes2;
- }
-
- public void setAttributes2(Attributes attributes2) {
- this.attributes2 = attributes2;
- }
-
- public String getText1() {
- return text1;
- }
-
- public void setText1(String text1) {
- this.text1 = text1;
- }
-
- public String getText2() {
- return text2;
- }
-
- public void setText2(String text2) {
- this.text2 = text2;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ActionEvent;
-
-import org.richfaces.component.UICommandButton;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:commandButton.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jButtonBean")
-@ViewScoped
-public class A4JCommandButtonBean implements Serializable {
-
- private static final long serialVersionUID = -2556026843426776944L;
- private static final int ACTION_STRING_LENGTH = 6;
- private static Logger logger;
- private Attributes attributes;
- private String input;
- private String input2;
- private String input3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UICommandButton.class, getClass());
-
- attributes.setAttribute("action", "first6CharsAction");
- attributes.setAttribute("actionListener",
"toUpperCaseActionListener");
- attributes.setAttribute("disabled", false);
- attributes.get("disabled").setType(Boolean.class);
- attributes.setAttribute("render", "output1 output2
output3");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("value", "command button");
- }
-
- /**
- * 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;
- }
-
- /**
- * Getter for input.
- *
- * @return value entered by a user
- */
- public String getInput() {
- return input;
- }
-
- /**
- * Getter for input2.
- *
- * @return value entered by a user modified by selected action
- */
- public String getInput2() {
- return input2;
- }
-
- /**
- * Getter for input3.
- *
- * @return value entered by a user modified by selected action listener
- */
- public String getInput3() {
- return input3;
- }
-
- /**
- * Setter for input.
- *
- * @param input
- * value which user entered into text input on the page
- */
- public void setInput(String input) {
- this.input = input;
- }
-
- /**
- * An action that takes the first six characters from input and stores it to input2.
- *
- * @return null since no navigation should be performed
- */
- public String first6CharsAction() {
- if (input == null) {
- return "";
- } else {
- int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
- input2 = (String) input.subSequence(0, endIndex);
- return null;
- }
- }
-
- /**
- * An action that takes user's input, doubles it and stores it to input2.
- *
- * @return null since no navigation should be performed
- */
- public String doubleStringAction() {
- if (input == null) {
- input2 = "";
- } else {
- input2 = input.concat(input);
- }
-
- return null;
- }
-
- /**
- * An action that takes user's input, converts it to upper case and stores it to
input2.
- *
- * @return null since no navigation should be performed
- */
- public String toUpperCaseAction() {
- if (input == null) {
- return "";
- } else {
- input2 = input.toUpperCase();
- return null;
- }
- }
-
- /**
- * An action listener that takes the first six characters from input and stores it to
input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void first6CharsActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
- input3 = (String) input.subSequence(0, endIndex);
- }
- }
-
- /**
- * An action listener that takes user's input, doubles it and stores it to
input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void doubleStringActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- input3 = input.concat(input);
- }
- }
-
- /**
- * An action listener that takes user's input, converts it to upper case and
stores it to input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void toUpperCaseActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- input3 = input.toUpperCase();
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ActionEvent;
-
-import org.richfaces.component.UICommandLink;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:commandLink.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jLinkBean")
-@ViewScoped
-public class A4JCommandLinkBean implements Serializable {
-
- private static final long serialVersionUID = -2556076843426776944L;
- private static final int ACTION_STRING_LENGTH = 6;
- private static Logger logger;
- private Attributes attributes;
- private String input;
- private String input2;
- private String input3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UICommandLink.class, getClass());
-
- attributes.setAttribute("value", "command link");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("action", "first6CharsAction");
- attributes.setAttribute("actionListener",
"toUpperCaseActionListener");
- attributes.setAttribute("render", "output1 output2
output3");
-
- }
-
- /**
- * 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;
- }
-
- /**
- * Getter for input.
- *
- * @return value entered by a user
- */
- public String getInput() {
- return input;
- }
-
- /**
- * Getter for input2.
- *
- * @return value entered by a user modified by selected action
- */
- public String getInput2() {
- return input2;
- }
-
- /**
- * Getter for input3.
- *
- * @return value entered by a user modified by selected action listener
- */
- public String getInput3() {
- return input3;
- }
-
- /**
- * Setter for input.
- *
- * @param input
- * value which user entered into text input on the page
- */
- public void setInput(String input) {
- this.input = input;
- }
-
- /**
- * An action that takes the first six characters from input and stores it to input2.
- *
- * @return null since no navigation should be performed
- */
- public String first6CharsAction() {
- if (input == null) {
- return "";
- } else {
- int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
- input2 = (String) input.subSequence(0, endIndex);
- return null;
- }
- }
-
- /**
- * An action that takes user's input, doubles it and stores it to input2.
- *
- * @return null since no navigation should be performed
- */
- public String doubleStringAction() {
- if (input == null) {
- input2 = "";
- } else {
- input2 = input.concat(input);
- }
-
- return null;
- }
-
- /**
- * An action that takes user's input, converts it to upper case and stores it to
input2.
- *
- * @return null since no navigation should be performed
- */
- public String toUpperCaseAction() {
- if (input == null) {
- return "";
- } else {
- input2 = input.toUpperCase();
- return null;
- }
- }
-
- /**
- * An action listener that takes the first six characters from input and stores it to
input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void first6CharsActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
- input3 = (String) input.subSequence(0, endIndex);
- }
- }
-
- /**
- * An action listener that takes user's input, doubles it and stores it to
input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void doubleStringActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- input3 = input.concat(input);
- }
- }
-
- /**
- * An action listener that takes user's input, converts it to upper case and
stores it to input3.
- *
- * @param event
- * an event representing the activation of a user interface component (not
used)
- */
- public void toUpperCaseActionListener(ActionEvent event) {
- if (input == null) {
- input3 = "";
- } else {
- input3 = input.toUpperCase();
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ActionEvent;
-
-import org.richfaces.component.UIFunction;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:jsFunction.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jJSFunctionBean")
-// should not be view-scoped (see
https://jira.jboss.org/browse/RF-9287)
-@ViewScoped
-public class A4JJSFunctionBean implements Serializable {
-
- private static final long serialVersionUID = 48333649809L;
- private static Logger logger;
- private Attributes attributes;
- private int year;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
- year = Integer.parseInt(new SimpleDateFormat("yyyy").format(new
Date()));
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIFunction.class,
getClass());
-
- attributes.setAttribute("name", "metamerFunction");
- attributes.setAttribute("render", "time1, time2, year");
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public int getYear() {
- return year;
- }
-
- public void setYear(int year) {
- this.year = year;
- }
-
- public String increaseYearAction() {
- year++;
- return null;
- }
-
- public String decreaseYearAction() {
- year--;
- return null;
- }
-
- public void increaseYearActionListener(ActionEvent event) {
- year++;
- }
-
- public void decreaseYearActionListener(ActionEvent event) {
- year--;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIAjaxLog;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:log.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jLogBean")
-@ViewScoped
-public class A4JLogBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String name;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- name = "John";
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIAjaxLog.class,
getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("level", "debug");
- }
-
- /**
- * 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;
- }
-
- /**
- * Getter for name.
- * @return content of the input field on the page
- */
- public String getName() {
- return name;
- }
-
- /**
- * Setter for name.
- * @param name new content of the input field on the page
- */
- public void setName(String name) {
- this.name = name;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
-import javax.imageio.ImageIO;
-
-import org.richfaces.component.UIMediaOutput;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:mediaOutput.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jMediaOutputBean")
-@RequestScoped
-public class A4JMediaOutputBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIMediaOutput.class, getClass());
-
- attributes.setAttribute("session", true);
- attributes.setAttribute("rendered", true);
- attributes.remove("createContent");
- attributes.remove("element");
- attributes.remove("value");
- attributes.remove("mimeType");
- attributes.remove("uriAttribute");
- }
-
- /**
- * 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 void paint(OutputStream out, Object data) throws IOException {
- if (data instanceof MediaData) {
- MediaData paintData = (MediaData) data;
- BufferedImage img = new BufferedImage(paintData.getWidth(),
paintData.getHeight(), BufferedImage.TYPE_INT_RGB);
- Graphics2D graphics2D = img.createGraphics();
- graphics2D.clearRect(0, 0, paintData.getWidth(), paintData.getHeight());
-
- graphics2D.setColor(Color.YELLOW);
- graphics2D.fillRect(0, 0, paintData.width / 2, paintData.height / 2);
-
- graphics2D.setColor(Color.RED);
- graphics2D.fillRect(paintData.width / 2, 0, paintData.width / 2,
paintData.height / 2);
-
- graphics2D.setColor(Color.BLUE);
- graphics2D.fillRect(0, paintData.height / 2, paintData.width / 2,
paintData.height / 2);
-
- graphics2D.setColor(Color.GREEN);
- graphics2D.fillRect(paintData.width / 2, paintData.height / 2,
paintData.width / 2, paintData.height / 2);
-
- ImageIO.write(img, "png", out);
- }
- }
-
- private void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[2048];
- int read;
-
- while ((read = in.read(buffer)) != -1) {
- out.write(buffer, 0, read);
- }
- }
-
- public void paintFlash(OutputStream out, Object data) throws IOException {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
-
- if (loader == null) {
- loader = getClass().getClassLoader();
- }
-
- InputStream stream =
loader.getResourceAsStream("resources/flash/text.swf");
-
- if (stream != null) {
- try {
- copy(stream, out);
- } finally {
- stream.close();
- }
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIOutputPanel;
-import org.richfaces.tests.metamer.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")
-@ViewScoped
-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.getComponentAttributesFromFacesConfig(UIOutputPanel.class, getClass());
-
- attributes.setAttribute("ajaxRendered", true);
- attributes.setAttribute("layout", "block");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("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;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.UIParameter;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:param.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jParamBean")
-@ViewScoped
-public class A4JParamBean implements Serializable {
-
- private static final long serialVersionUID = -23993426776944L;
- private static Logger logger;
- private Attributes attributes;
- private String parameter;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIParameter.class,
getClass());
-
- attributes.setAttribute("name", "param");
- attributes.setAttribute("noEscape", true);
- attributes.get("noEscape").setType(Boolean.class);
- attributes.setAttribute("value", "screen.width");
- }
-
- /**
- * 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 String getParameter() {
- return parameter;
- }
-
- public void setParameter(String parameter) {
- this.parameter = parameter;
- }
-
- public String getRequestParameter() {
- Map<String, String> requestParameterMap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- return
requestParameterMap.get(attributes.get("name").getValue().toString());
- }
-
- public String reset() {
- parameter = null;
- return null;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ActionEvent;
-
-import org.richfaces.component.UIPoll;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:poll.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jPollBean")
-@ViewScoped
-public class A4JPollBean implements Serializable {
-
- private static final long serialVersionUID = 4810889475400649809L;
- 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.getComponentAttributesFromFacesConfig(UIPoll.class,
getClass());
-
- attributes.setAttribute("enabled", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("interval", 2500);
- attributes.setAttribute("action", "increaseCounterAction");
- attributes.setAttribute("actionListener",
"increaseCounterActionListener");
- }
-
- /**
- * 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 Date getDate() {
- return new Date();
- }
-
- public int getCounter() {
- return counter;
- }
-
- public void setCounter(int counter) {
- this.counter = counter;
- }
-
- public String increaseCounterAction() {
- counter++;
- return null;
- }
-
- public String decreaseCounterAction() {
- counter--;
- return null;
- }
-
- public void increaseCounterActionListener(ActionEvent event) {
- counter++;
- }
-
- public void decreaseCounterActionListener(ActionEvent event) {
- counter--;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-import org.richfaces.application.push.MessageException;
-import org.richfaces.application.push.TopicKey;
-
-import org.richfaces.application.push.TopicsContext;
-import org.richfaces.component.UIPush;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.Message;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:push.
- *
- * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jPushBean")
-@SessionScoped
-public class A4JPushBean implements Serializable {
-
- private static final long serialVersionUID = 4810889475400649809L;
- private static Logger logger;
- private transient TopicsContext topicsContext;
- private Attributes attributes;
- private String username;
- private String message;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- topicsContext = TopicsContext.lookup();
-
- attributes = Attributes.getComponentAttributesFromClass(UIPush.class,
getClass());
-// attributes.setAttribute("interval", 1000);
-// attributes.setAttribute("action",
"increaseCounterAction");
-// attributes.setAttribute("actionListener",
"increaseCounterActionListener");
-// attributes.setAttribute("rendered", true);
-// attributes.setAttribute("enabled", true);
-//
-// // will be set on page and cannot be changed
-// attributes.remove("eventProducer");
- }
-
- /**
- * 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 String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public void setTopicsContext(TopicsContext topicsContext) {
- this.topicsContext = topicsContext;
- }
-
- private TopicsContext getTopicsContext() {
- if (topicsContext == null) {
- topicsContext = TopicsContext.lookup();
- }
- return topicsContext;
- }
-
- public void send() {
- try {
- logger.info("sending message \"" + message + "\" by
user " + username);
- Message msg = new Message(message, username, new Date().toString());
- getTopicsContext().publish(new TopicKey("metamer",
"xxx"), msg);
- } catch (MessageException messageException) {
- logger.error("Could not send message \"" + message +
"\" by user " + username + ".", messageException);
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIQueue;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:queue.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jQueueBean")
-@ViewScoped
-public class A4JQueueBean implements Serializable {
-
- private static final long serialVersionUID = 486866943531809L;
- private static Logger logger;
- private Attributes attributes;
- private String text;
- private A4JQueueBean globalQueue;
- private A4JQueueBean formQueue1;
- private A4JQueueBean formQueue2;
- private boolean introduceDelay;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- // initialize attributes
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIQueue.class,
getClass());
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("requestDelay", 750);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public A4JQueueBean getGlobalQueue() {
- if (globalQueue == null) {
- globalQueue = new A4JQueueBean();
- globalQueue.init();
- globalQueue.attributes.setAttribute("requestDelay", 10000);
- }
- return globalQueue;
- }
-
- public A4JQueueBean getFormQueue1() {
- if (formQueue1 == null) {
- formQueue1 = new A4JQueueBean();
- formQueue1.init();
- formQueue1.attributes.setAttribute("requestDelay", 500);
- }
- return formQueue1;
- }
-
- public A4JQueueBean getFormQueue2() {
- if (formQueue2 == null) {
- formQueue2 = new A4JQueueBean();
- formQueue2.init();
- formQueue2.attributes.setAttribute("requestDelay", 2000);
- }
- return formQueue2;
- }
-
- public A4JQueueBean[] getFormQueues() {
- return new A4JQueueBean[]{getFormQueue1(), getFormQueue2()};
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- if (introduceDelay) {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- throw new IllegalStateException(e);
- }
- }
- this.text = text;
- }
-
- public boolean isIntroduceDelay() {
- return introduceDelay;
- }
-
- public void setIntroduceDelay(boolean introduceDelay) {
- this.introduceDelay = introduceDelay;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-import javax.faces.event.AjaxBehaviorEvent;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-
-import org.richfaces.component.UIRegion;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Employee;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:region.
- *
- * @author Exadel, Nick Belaevski, <a
href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jRegionBean")
-@SessionScoped
-public class A4JRegionBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static final SelectItem[] AVAILABLE_EXECUTE_OPTIONS = new SelectItem[]{new
SelectItem(null, "default"),
- new SelectItem("@all"), new SelectItem("@form"), new
SelectItem("@region"), new SelectItem("@this"),
- new SelectItem("outerValueInput", "Outer"), new
SelectItem("regionValueInput", "Region"),
- new SelectItem("nestedRegionValueInput", "Nested region"),
- new SelectItem("decorationValueInput", "Decoration"), new
SelectItem("insertionValueInput", "Insertion")};
- private static Logger logger;
- // for page simple.xhtml
- private Attributes attributes;
- private Employee user1;
- private Employee user2;
- // for page nested.xhtml
- private String execute;
- private String nestedExecute;
- private String outerExecute;
- private String decorationExecute;
- private String decorationValue;
- private String insertionExecute;
- private String outerValue;
- private String regionValue;
- private String nestedRegionValue;
- private String lastExecutedButtonValue;
- private String insertionValue;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- user1 = new Employee();
- user2 = new Employee();
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIRegion.class,
getClass());
- attributes.setAttribute("rendered", true);
- }
-
- // getters and setters for page simple.xhtml
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Employee getUser1() {
- return user1;
- }
-
- public void setUser1(Employee user1) {
- this.user1 = user1;
- }
-
- public Employee getUser2() {
- return user2;
- }
-
- public void setUser2(Employee user2) {
- this.user2 = user2;
- }
-
- // getters and setters for page nested.xhtml
- public SelectItem[] getExecuteOptions() {
- return AVAILABLE_EXECUTE_OPTIONS;
- }
-
- public String getOuterValue() {
- return outerValue;
- }
-
- public void setOuterValue(String outerValue) {
- this.outerValue = outerValue;
- }
-
- public String getRegionValue() {
- return regionValue;
- }
-
- public void setRegionValue(String value) {
- this.regionValue = value;
- }
-
- public String getNestedRegionValue() {
- return nestedRegionValue;
- }
-
- public void setNestedRegionValue(String nestedValue) {
- this.nestedRegionValue = nestedValue;
- }
-
- public String getExecute() {
- return execute;
- }
-
- public void setExecute(String execute) {
- this.execute = execute;
- }
-
- public String getNestedExecute() {
- return nestedExecute;
- }
-
- public void setNestedExecute(String nestedExecute) {
- this.nestedExecute = nestedExecute;
- }
-
- public String getOuterExecute() {
- return outerExecute;
- }
-
- public void setOuterExecute(String outerExecute) {
- this.outerExecute = outerExecute;
- }
-
- public String getInsertionExecute() {
- return insertionExecute;
- }
-
- public void setInsertionExecute(String insertionExecute) {
- this.insertionExecute = insertionExecute;
- }
-
- public String getInsertionValue() {
- return insertionValue;
- }
-
- public void setInsertionValue(String insertionValue) {
- this.insertionValue = insertionValue;
- }
-
- public String getDecorationExecute() {
- return decorationExecute;
- }
-
- public void setDecorationExecute(String decorationExecute) {
- this.decorationExecute = decorationExecute;
- }
-
- public String getDecorationValue() {
- return decorationValue;
- }
-
- public void setDecorationValue(String decorationValue) {
- this.decorationValue = decorationValue;
- }
-
- public void handleBehavior(AjaxBehaviorEvent event) {
- lastExecutedButtonValue = (String)
event.getComponent().getAttributes().get("value");
- }
-
- public String getLastExecutedButtonValue() {
- return lastExecutedButtonValue;
- }
-
- public void handleDefaultsValueChange(ValueChangeEvent event) {
- String newValue = (String) event.getNewValue();
-
- setOuterExecute(newValue);
- setExecute(newValue);
- setDecorationExecute(newValue);
- setInsertionExecute(newValue);
- setNestedExecute(newValue);
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRepeatBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRepeatBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRepeatBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIRepeat;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:repeat.
- *
- * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jRepeatBean")
-@ViewScoped
-public class A4JRepeatBean implements Serializable {
-
- private static final long serialVersionUID = 4864439475400649809L;
- private static final int MATRIX_DIMENSION = 4;
- private static Logger logger;
- private Attributes attributes;
- private List<Data> dataList;
- private Data selectedDataItem = null;
- private List<MatrixRow> matrixRows;
-
- public static final class MatrixCell implements Serializable {
-
- private static final long serialVersionUID = -5911659561854593681L;
- private int value = 0;
-
- public int getValue() {
- return value;
- }
-
- public void setValue(int value) {
- this.value = value;
- }
-
- public void clearValueAction() {
- setValue(0);
- }
-
- public void increaseValueAction() {
- value++;
- }
-
- public void decreaseValueAction() {
- value--;
- }
- }
-
- public static final class MatrixRow implements Serializable {
-
- private static final long serialVersionUID = -5051037819565283283L;
- private List<MatrixCell> cells = new ArrayList<MatrixCell>();
-
- public List<MatrixCell> getCells() {
- return cells;
- }
-
- public void addCell(MatrixCell cell) {
- cells.add(cell);
- }
- }
-
- public static final class Data implements Serializable {
-
- private static final long serialVersionUID = -1461777632529492912L;
- private String text;
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
- }
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- // initialize model for page simple.xhtml
- dataList = new ArrayList<Data>();
- for (int i = 0; i < 20; i++) {
- Data data = new Data();
- data.setText(MessageFormat.format("Item {0}", i));
- dataList.add(data);
- }
-
- // initialize model for page matrix.xhtml
- matrixRows = new ArrayList<MatrixRow>();
- for (int i = 0; i < MATRIX_DIMENSION; i++) {
- MatrixRow matrixRow = new MatrixRow();
-
- for (int j = 0; j < MATRIX_DIMENSION; j++) {
- MatrixCell matrixCell = new MatrixCell();
- matrixRow.addCell(matrixCell);
- }
-
- matrixRows.add(matrixRow);
- }
-
- // initialize attributes
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIRepeat.class,
getClass());
- attributes.setAttribute("rendered", true);
- // TODO has to be tested in other way
- attributes.remove("componentState");
- attributes.remove("iterationState");
- attributes.remove("iterationStatusVar");
- attributes.remove("rowKeyVar");
- attributes.remove("rowKeyConverter");
- attributes.remove("value");
- attributes.remove("stateVar");
- attributes.remove("var");
-
- // should be hidden
- attributes.remove("relativeRowIndex");
- attributes.remove("rowAvailable");
- attributes.remove("rowCount");
- attributes.remove("rowData");
- attributes.remove("rowIndex");
- attributes.remove("rowKey");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- /**
- * @return the data
- */
- public List<Data> getDataList() {
- return dataList;
- }
-
- /**
- * @return the selectedDataItem
- */
- public Data getSelectedDataItem() {
- return selectedDataItem;
- }
-
- /**
- * @param selectedDataItem the selectedDataItem to set
- */
- public void setSelectedDataItem(Data selectedDataItem) {
- this.selectedDataItem = selectedDataItem;
- }
-
- public List<MatrixRow> getMatrixRows() {
- return matrixRows;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIStatus;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for a4j:status.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "a4jStatusBean")
-@ViewScoped
-public class A4JStatusBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String facetStartValue = "START";
- private String facetStopValue = "STOP";
- private String facetErrorValue = "ERROR";
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIStatus.class,
getClass());
- attributes.setAttribute("rendered", true);
-
- // hidden attributes
- attributes.remove("converter");
- attributes.remove("localValue");
- attributes.remove("value");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getFacetStartValue() {
- return facetStartValue;
- }
-
- public void setFacetStartValue(String facetStartValue) {
- this.facetStartValue = facetStartValue;
- }
-
- public String getFacetStopValue() {
- return facetStopValue;
- }
-
- public void setFacetStopValue(String facetStopValue) {
- this.facetStopValue = facetStopValue;
- }
-
- public String getFacetErrorValue() {
- return facetErrorValue;
- }
-
- public void setFacetErrorValue(String facetErrorValue) {
- this.facetErrorValue = facetErrorValue;
- }
-
- /**
- * Action that creates a 2-second delay.
- *
- * @throws InterruptedException
- * if any thread has interrupted the current thread. The interrupted
status of the current thread is
- * cleared when this exception is thrown.
- */
- public void delay() throws InterruptedException {
- Thread.sleep(2000);
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIAccordion;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:accordion.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richAccordionBean")
-@ViewScoped
-public class RichAccordionBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIAccordion.class,
getClass());
-
- attributes.setAttribute("activeItem", "item1");
- attributes.setAttribute("rendered", true);
-
- // will be tested in another way
- attributes.remove("converter");
- attributes.remove("itemChangeListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIAccordionItem;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:accordionItem.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richAccordionItemBean")
-@ViewScoped
-public class RichAccordionItemBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAccordionItem.class, getClass());
-
- attributes.setAttribute("header", "Item 1");
- attributes.setAttribute("name", "item1");
- attributes.setAttribute("rendered", true);
-
- // TODO will be tested in another way
- attributes.remove("converter");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAutocompleteBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAutocompleteBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAutocompleteBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.SessionScoped;
-
-import org.richfaces.component.UIAutocomplete;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Capital;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:autocomplete.
- *
http://community.jboss.org/wiki/richfacesautocompletecomponentbehavior
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richAutocompleteBean")
-// cannot be view-scoped (see
https://jira.jboss.org/browse/RF-9287)
-@SessionScoped
-public class RichAutocompleteBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private Attributes ajaxAttributes;
- @ManagedProperty(value = "#{model.capitals}")
- private List<Capital> capitals;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAutocomplete.class, getClass());
- attributes.setAttribute("converterMessage", "converter
message");
- attributes.setAttribute("mode", "ajax");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("tokens", ", ");
- attributes.setAttribute("validatorMessage", "validator
message");
-
- ajaxAttributes = Attributes.getEmptyAttributes(getClass());
- ajaxAttributes.setAttribute("render", "output");
- ajaxAttributes.setAttribute("execute", "autocomplete");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Attributes getAjaxAttributes() {
- return ajaxAttributes;
- }
-
- public void setAjaxAttributes(Attributes ajaxAttributes) {
- this.ajaxAttributes = ajaxAttributes;
- }
-
- public List<String> autocomplete(String prefix) {
- ArrayList<String> result = new ArrayList<String>();
- if (prefix != null && prefix.length() > 0) {
- Iterator<Capital> iterator = capitals.iterator();
- while (iterator.hasNext()) {
- Capital elem = ((Capital) iterator.next());
- if ((elem.getState() != null &&
elem.getState().toLowerCase().indexOf(prefix.toLowerCase()) == 0)
- || "".equals(prefix)) {
- result.add(elem.getState());
- }
- }
- } else {
- for (Capital capital : capitals) {
- result.add(capital.getState());
- }
- }
- return result;
- }
-
- public void setCapitals(List<Capital> capitals) {
- this.capitals = capitals;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
-
-import javax.annotation.PostConstruct;
-import javax.faces.application.FacesMessage;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.validator.ValidatorException;
-import javax.validation.constraints.Future;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Past;
-
-import org.richfaces.component.UICalendar;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:calendar.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richCalendarBean")
-@ViewScoped
-public class RichCalendarBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private Date date = new Date();
- private TimeZone timeZone = TimeZone.getTimeZone("UTC");
- private Date date1;
- private Date date2;
- private Date date3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UICalendar.class,
getClass());
-
- attributes.setAttribute("datePattern", "MMM d, yyyy HH:mm");
- attributes.setAttribute("direction", "bottomRight");
- attributes.setAttribute("jointPoint", "bottomLeft");
- attributes.setAttribute("popup", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("requiredMessage", "value is
required");
- attributes.setAttribute("showApplyButton", true);
- attributes.setAttribute("showHeader", true);
- attributes.setAttribute("showFooter", true);
- attributes.setAttribute("showInput", true);
- attributes.setAttribute("showWeeksBar", true);
- attributes.setAttribute("showWeekDaysBar", true);
-
- // TODO has to be tested in another way
- attributes.remove("converter");
- attributes.remove("dataModel");
- attributes.remove("validator");
- attributes.remove("valueChangeListener");
- attributes.remove("timeZone");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- this.date = date;
- }
-
- public TimeZone getTimeZone() {
- return timeZone;
- }
-
- public void setTimeZone(TimeZone timeZone) {
- this.timeZone = timeZone;
- }
-
- @Past
- @NotNull
- public Date getDate1() {
- return date1;
- }
-
- public void setDate1(Date date1) {
- this.date1 = date1;
- }
-
- @Future
- @NotNull
- public Date getDate2() {
- return date2;
- }
-
- public void setDate2(Date date2) {
- this.date2 = date2;
- }
-
- public Date getDate3() {
- return date3;
- }
-
- public void setDate3(Date date3) {
- this.date3 = date3;
- }
-
- /**
- * A value change listener that logs to the page old and new value.
- *
- * @param event
- * an event representing the activation of a user interface component
- */
- public void valueChangeListener(ValueChangeEvent event) {
- SimpleDateFormat sdf = new
SimpleDateFormat(attributes.get("datePattern").getValue().toString());
- sdf.setTimeZone(timeZone);
-
- String oldDate = "null";
- String newDate = "null";
-
- if (event.getOldValue() != null) {
- oldDate = sdf.format((Date) event.getOldValue());
- }
- if (event.getNewValue() != null) {
- newDate = sdf.format((Date) event.getNewValue());
- }
-
- RichBean.logToPage("* value changed: " + oldDate + " -> "
+ newDate);
- }
-
- public void validateDate(FacesContext context, UIComponent component, Object value)
throws ValidatorException {
- if (value == null) {
- return;
- }
-
- Calendar cal = Calendar.getInstance();
- cal.setTime((Date) value);
- int componentYear = cal.get(Calendar.YEAR);
-
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date
too far in the past.",
- "Select a date from year 1991 or newer.");
-
- if (componentYear < 1991) {
- FacesContext.getCurrentInstance().addMessage("form:calendar",
message);
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UICollapsiblePanel;
-import org.richfaces.event.PanelToggleEvent;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:collapsiblePanel.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richCollapsiblePanelBean")
-@ViewScoped
-public class RichCollapsiblePanelBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsiblePanel.class, getClass());
-
- attributes.setAttribute("expanded", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("header", "collapsible panel
header");
-
- // will be tested in another way
- attributes.remove("converter");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public void toggleListener(PanelToggleEvent event) {
- RichBean.logToPage("* panel " + (event.getExpanded() ?
"expanded" : "collapsed"));
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UICollapsibleSubTable;
-import org.richfaces.component.UIDataTableBase;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.ColumnSortingMap;
-import org.richfaces.tests.metamer.model.Employee;
-import org.richfaces.tests.metamer.model.Employee.Sex;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:collapsibleSubTable.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richSubTableBean")
-@ViewScoped
-public class RichCollapsibleSubTableBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- // FIXME: @ManagedProperty(value = "#{model.employees}")
- private List<Employee> employees = Model.unmarshallEmployees();
- private List<List<Employee>> lists;
- private transient UICollapsibleSubTable binding;
- // true = model, false = empty table
- private boolean state;
- // facets
- private Map<String, String> facets = new HashMap<String, String>();
- // sorting
- private ColumnSortingMap sorting = new ColumnSortingMap() {
-
- private static final long serialVersionUID = 1L;
-
- protected UIDataTableBase getBinding() {
- return binding;
- }
-
- protected Attributes getAttributes() {
- return attributes;
- }
- };
- // filtering
- private Map<String, Object> filtering = new HashMap<String, Object>();
- // expanded
- private Map<List<Employee>, Boolean> expanded = new
HashMap<List<Employee>, Boolean>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class,
getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("rows", 5);
-
- // TODO these attributes have to be tested in another way
- attributes.remove("expanded");
- attributes.remove("columns");
- attributes.remove("selection");
- attributes.remove("filterVar");
- attributes.remove("iterationStatusVar");
- attributes.remove("componentState");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
- attributes.remove("var");
- attributes.remove("value");
-
- List<Employee> men = new ArrayList<Employee>();
- List<Employee> women = new ArrayList<Employee>();
-
- for (Employee e : employees) {
- if (e.getSex() == Sex.MALE) {
- men.add(e);
- } else {
- women.add(e);
- }
- }
-
- lists = new ArrayList<List<Employee>>();
- lists.add(men);
- lists.add(women);
-
- expanded.put(men, true);
- expanded.put(women, true);
-
- state = true;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<Employee> getEmployees() {
- return employees;
- }
-
- public void setEmployees(List<Employee> employees) {
- this.employees = employees;
- }
-
- public List<List<Employee>> getLists() {
- return lists;
- }
-
- public void setLists(List<List<Employee>> lists) {
- this.lists = lists;
- }
-
- public boolean isState() {
- return state;
- }
-
- public void setState(boolean state) {
- this.state = state;
- }
-
- public Map<String, String> getFacets() {
- return facets;
- }
-
- public UICollapsibleSubTable getBinding() {
- return binding;
- }
-
- public void setBinding(UICollapsibleSubTable binding) {
- this.binding = binding;
- }
-
- public ColumnSortingMap getSorting() {
- return sorting;
- }
-
- public Map<String, Object> getFiltering() {
- return filtering;
- }
-
- public Map<List<Employee>, Boolean> getExpanded() {
- return expanded;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UICollapsibleSubTableToggleControl;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Employee;
-import org.richfaces.tests.metamer.model.Employee.Sex;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:collapsibleSubTableToggler.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name="richSubTableTogglerBean")
-@ViewScoped
-public class RichCollapsibleSubTableTogglerBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- // FIXME: @ManagedProperty(value = "#{model.employees}")
- private List<Employee> employees = Model.unmarshallEmployees();
- private List<List<Employee>> lists;
- // true = model, false = empty table
- private boolean state;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTableToggleControl.class,
getClass());
- attributes.setAttribute("event", "click");
- attributes.setAttribute("rendered", true);
- // TODO these attributes have to be tested in another way
- attributes.remove("for");
-
- List<Employee> men = new ArrayList<Employee>();
- List<Employee> women = new ArrayList<Employee>();
-
- for (Employee e : employees) {
- if (e.getSex() == Sex.MALE) {
- men.add(e);
- } else {
- women.add(e);
- }
- }
-
- lists = new ArrayList<List<Employee>>();
- lists.add(men);
- lists.add(women);
-
- state = true;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<Employee> getEmployees() {
- return employees;
- }
-
- public void setEmployees(List<Employee> employees) {
- this.employees = employees;
- }
-
- public List<List<Employee>> getLists() {
- return lists;
- }
-
- public void setLists(List<List<Employee>> lists) {
- this.lists = lists;
- }
-
- public boolean isState() {
- return state;
- }
-
- public void setState(boolean state) {
- this.state = state;
- }
-
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.SortOrder;
-import org.richfaces.component.UIColumn;
-import org.richfaces.model.Filter;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Capital;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:column
- *
- * @author <a href="mailto:pjha@redhat.com">Prabhat Jha</a>, <a
href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richColumnBean")
-@ViewScoped
-public class RichColumnBean implements Serializable {
-
- public static final Comparator<Capital> STATE_NAME_LENGTH_COMPARATOR = new
Comparator<Capital>() {
- @Override
- public int compare(Capital o1, Capital o2) {
- return o1.getState().length() - o2.getState().length();
- }
- };
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
-
- private Attributes attributes;
- private String stateNameToFilter;
- private SortOrder sortOrder = SortOrder.ascending;
-
- private Filter<Capital> stateFilter = new StateFilter();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIColumn.class,
getClass());
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("colspan", 2);
- attributes.setAttribute("rowspan", 2);
- attributes.setAttribute("breakRowBefore", true);
-
- // attributes which needs to be tested another way
- attributes.remove("filter");
- attributes.remove("filterValue");
- attributes.remove("filterExpression");
- attributes.remove("comparator");
- attributes.remove("sortBy");
- attributes.remove("sortOrder");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Comparator<Capital> getStateNameLengthComparator() {
- return STATE_NAME_LENGTH_COMPARATOR;
- }
-
- public Filter<Capital> getStateNameFilter() {
- return stateFilter;
- }
-
- public String getStateNameToFilter() {
- return stateNameToFilter;
- }
-
- public void setStateNameToFilter(String stateNameToFilter) {
- this.stateNameToFilter = stateNameToFilter;
- }
-
- public SortOrder[] getSortOrders() {
- return SortOrder.values();
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- this.sortOrder = sortOrder;
- }
-
- public SortOrder getSortOrder() {
- return sortOrder;
- }
-
- private class StateFilter implements Filter<Capital>, Serializable {
- private static final long serialVersionUID = 1L;
-
- public boolean accept(Capital c) {
- return c.getState().toLowerCase()
- .contains(stateNameToFilter == null ? "" :
stateNameToFilter.toLowerCase());
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-
-import org.richfaces.component.UIColumnGroup;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:columnGroup.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richColumnGroupBean")
-@SessionScoped
-public class RichColumnGroupBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private int page = 1;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIColumnGroup.class, getClass());
-
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public int getPage() {
- return page;
- }
-
- public void setPage(int page) {
- this.page = page;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.behavior.ComponentControlBehavior;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:componentControl.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richComponentControlBean")
-@ViewScoped
-public class RichComponentControlBean implements Serializable {
-
- private static final long serialVersionUID = 4476643239809L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getBehaviorAttributesFromFacesConfig(ComponentControlBehavior.class,
getClass());
-
- attributes.setAttribute("operation", "previous");
- attributes.setAttribute("target", "scroller");
-
- // The 'event' attribute for behavior tag must be a literal
- attributes.remove("event");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIDataGrid;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:dataGrid.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDataGridBean")
-@ViewScoped
-public class RichDataGridBean implements Serializable {
-
- private static final long serialVersionUID = 4814439475400649809L;
- private static Logger logger;
- private Attributes attributes;
- // true = model, false = empty table
- private boolean state = true;
- private int page = 1;
- private Map<String, String> facets = new HashMap<String, String>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIDataGrid.class,
getClass());
-
- attributes.setAttribute("columns", 3);
- attributes.setAttribute("rendered", true);
-
- // attributes defined directly in page
- attributes.remove("value");
- attributes.remove("var");
-
- // TODO attributes which needs to be tested in another way
- attributes.remove("iterationStatusVar");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
-
- // facets initial values
- facets.put("noData", "There is no data.");
- facets.put("caption", "Caption");
- facets.put("header", "Header");
- facets.put("footer", "Footer");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public boolean isState() {
- return state;
- }
-
- public void setState(boolean state) {
- this.state = state;
- }
-
- public int getPage() {
- return page;
- }
-
- public void setPage(int page) {
- this.page = page;
- }
-
- public Map<String, String> getFacets() {
- return facets;
- }
-
- public void setFacets(Map<String, String> facets) {
- this.facets = facets;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataScrollerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataScrollerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataScrollerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIDataScroller;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:dataScroller.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDataScrollerBean")
-@ViewScoped
-public class RichDataScrollerBean implements Serializable {
-
- private static final long serialVersionUID = 122475400649809L;
- private static Logger logger;
- private Attributes attributes;
- private boolean state = true;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDataScroller.class, getClass());
-
- attributes.setAttribute("boundaryControls", "show");
- attributes.setAttribute("fastControls", "show");
- attributes.setAttribute("stepControls", "show");
- attributes.setAttribute("fastStep", 1);
- attributes.setAttribute("lastPageMode", "short");
- attributes.setAttribute("maxPages", 10);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("render", "richDataTable");
- attributes.setAttribute("page", 1);
- attributes.setAttribute("renderIfSinglePage", true);
- attributes.setAttribute("for", "richDataTable");
-
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- /**
- * Getter for state.
- * @return true if non-empty data model should be used in table
- */
- public boolean isState() {
- return state;
- }
-
- /**
- * Setter for state.
- * @param state true if non-empty data model should be used in table
- */
- public void setState(boolean state) {
- this.state = state;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,193 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.ajax4jsf.model.DataComponentState;
-import org.richfaces.component.UIDataTable;
-import org.richfaces.component.UIDataTableBase;
-import org.richfaces.model.Filter;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.ColumnSortingMap;
-import org.richfaces.tests.metamer.model.Employee;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:dataTable.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDataTableBean")
-@ViewScoped
-public class RichDataTableBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private transient UIDataTable binding;
- private DataComponentState dataTableState;
- private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
- private int page = 1;
- // true = model, false = empty table
- private boolean state = true;
- // sorting
- private ColumnSortingMap sorting = new CustomColumnSortingMap();
- // filtering
- private Map<String, Object> filtering = new HashMap<String, Object>();
- // facets
- private Map<String, String> facets = new HashMap<String, String>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIDataTable.class,
getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("rows", 10);
-
- // facets initial values
- facets.put("noData", "There is no data.");
- facets.put("caption", "Caption");
- facets.put("header", "Header");
- facets.put("footer", "Footer");
- facets.put("columnStateHeader", "State Header");
- facets.put("columnStateFooter", "State Footer");
- facets.put("columnCapitalHeader", "Capital Header");
- facets.put("columnCapitalFooter", "Capital Footer");
-
- // attributes already in page
- attributes.remove("value");
- attributes.remove("var");
-
- // TODO needs to be tested another way
- attributes.remove("filterVar");
- attributes.remove("iterationStatusVar");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
- }
-
- public void setBinding(UIDataTable binding) {
- this.binding = binding;
- }
-
- public UIDataTable getBinding() {
- return binding;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public int getPage() {
- return page;
- }
-
- public void setPage(int page) {
- this.page = page;
- }
-
- public Map<Object, Integer> getStateMap() {
- return stateMap;
- }
-
- public void setStateMap(Map<Object, Integer> stateMap) {
- this.stateMap = stateMap;
- }
-
- public DataComponentState getDataTableState() {
- return dataTableState;
- }
-
- public void setDataTableState(DataComponentState dataTableState) {
- this.dataTableState = dataTableState;
- }
-
- public boolean isState() {
- return state;
- }
-
- public void setState(boolean state) {
- this.state = state;
- }
-
- public Date getDate() {
- return new Date();
- }
-
- public Map<String, String> getFacets() {
- return facets;
- }
-
- public ColumnSortingMap getSorting() {
- return sorting;
- }
-
- public Map<String, Object> getFiltering() {
- return filtering;
- }
-
- public Filter<?> getFilterSexImpl() {
- return new Filter<Employee>() {
-
- public boolean accept(Employee e) {
- String sex = (String) getFiltering().get("sex");
- if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
- || sex.equalsIgnoreCase(e.getSex().toString())) {
- return true;
- }
- return false;
- }
- };
- }
-
- private class CustomColumnSortingMap extends ColumnSortingMap {
-
- private static final long serialVersionUID = 1L;
-
- protected UIDataTableBase getBinding() {
- return binding;
- }
-
- protected Attributes getAttributes() {
- return attributes;
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIDragIndicator;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDragIndicatorBean")
-@ViewScoped
-public class RichDragIndicatorBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDragIndicator.class, getClass());
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIDragSource;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.drag.DragValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDragSourceBean")
-@ViewScoped
-public class RichDragSourceBean implements Serializable {
-
- private static final int DRAG_VALUES = 3;
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- private List<DragValue> dragValues = new ArrayList<DragValue>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIDragSource.class,
getClass());
-
- attributes.setAttribute("dragIndicator", "indicator");
- attributes.setAttribute("type", "drg1");
- attributes.setAttribute("rendered", true);
-
- attributes.remove("dragValue");
- attributes.remove("event");
-
-
- for (int i = 0; i < DRAG_VALUES; i++) {
- dragValues.add(new DragValue(i + 1));
- }
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<DragValue> getDragValues() {
- return dragValues;
- }
-
- public void setDragValues(List<DragValue> dragValues) {
- this.dragValues = dragValues;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import org.richfaces.component.UIDropDownMenu;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:dropDownMenu.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDropDownMenuBean")
-@ViewScoped
-public class RichDropDownMenuBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String current;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDropDownMenu.class, getClass());
-
- attributes.setAttribute("mode", "ajax");
- attributes.setAttribute("rendered", true);
-
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getCurrent() {
- return this.current;
- }
-
- public void setCurrent(String current) {
- this.current = current;
- }
-
- public String doNew() {
- this.current = "New";
- return null;
- }
-
- public String doOpen() {
- this.current = "Open";
- return null;
- }
-
- public String doClose() {
- this.current = "Close";
- return null;
- }
-
- public String doSave() {
- this.current = "Save";
- return null;
- }
-
- public String doSaveAll() {
- this.current = "Save All";
- return null;
- }
-
- public String doExit() {
- this.current = "Exit";
- return null;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.RequestScoped;
-
-import org.richfaces.event.DropEvent;
-import org.richfaces.tests.metamer.model.drag.DragValue;
-import org.richfaces.tests.metamer.model.drag.DropValue;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@RequestScoped
-@ManagedBean(name = "richDropListenerBean")
-public class RichDropListenerBean {
-
- private DropEvent dropEvent;
-
- @ManagedProperty("#{richDropTargetBean}")
- private RichDropTargetBean richDropTargetBean;
-
- public void processDragging(DropEvent dropEvent) {
- RichBean.logToPage("* dropListener");
-
- DragValue dragValue = (DragValue) dropEvent.getDragValue();
- DropValue dropValue = (DropValue) dropEvent.getDropValue();
-
- this.dropEvent = dropEvent;
-
- richDropTargetBean.increaseDropValue();
- if (dropEvent.getComponent().getClientId().endsWith("1")) {
- richDropTargetBean.getDroppedValues1().put(dropValue, dragValue);
- } else {
- richDropTargetBean.getDroppedValues2().put(dropValue, dragValue);
- }
- }
-
- public DropEvent getDropEvent() {
- return dropEvent;
- }
-
- public RichDropTargetBean getRichDropTargetBean() {
- return richDropTargetBean;
- }
-
- public void setRichDropTargetBean(RichDropTargetBean richDropBehaviorBean) {
- this.richDropTargetBean = richDropBehaviorBean;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIDropTarget;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.drag.DragValue;
-import org.richfaces.tests.metamer.model.drag.DropValue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richDropTargetBean")
-@ViewScoped
-public class RichDropTargetBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- private Map<DropValue, DragValue> droppedValues1 = new
LinkedHashMap<DropValue, DragValue>();
- private Map<DropValue, DragValue> droppedValues2 = new
LinkedHashMap<DropValue, DragValue>();
- private DropValue dropValue;
- private int dropValueCounter = 1;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class,
getClass());
-
- attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppable1 droppable2");
- attributes.setAttribute("rendered", true);
-
- attributes.remove("actionExpression");
- attributes.remove("action");
- attributes.remove("actionListener");
- attributes.remove("dropListener");
- attributes.remove("dropValue");
-
- increaseDropValue();
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Map<DropValue, DragValue> getDroppedValues1() {
- return droppedValues1;
- }
-
- public Map<DropValue, DragValue> getDroppedValues2() {
- return droppedValues2;
- }
-
- public void increaseDropValue() {
- dropValue = new DropValue(dropValueCounter++);
- }
-
- public DropValue getDropValue() {
- return dropValue;
- }
-
- public List<Entry<DropValue, DragValue>> getDroppedEntries1() {
- List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues1.entrySet());
- Collections.reverse(list);
- return list;
- }
-
- public List<Entry<DropValue, DragValue>> getDroppedEntries2() {
- List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues2.entrySet());
- Collections.reverse(list);
- return list;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TreeSet;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.ajax4jsf.model.DataComponentState;
-import org.richfaces.component.UIDataTableBase;
-import org.richfaces.component.UIExtendedDataTable;
-import org.richfaces.model.Filter;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.ColumnSortingMap;
-import org.richfaces.tests.metamer.model.Employee;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:extendedDataTable.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richExtendedDataTableBean")
-@ViewScoped
-public class RichExtendedDataTableBean implements Serializable {
-
- private static final long serialVersionUID = 1L;
- private static Logger logger;
- private Attributes attributes;
- private transient DataComponentState dataTableState;
- private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
- private int page = 1;
- // true = model, false = empty table
- private boolean state = true;
- // sorting
- private ColumnSortingMap sorting = new ColumnSortingMap() {
-
- private static final long serialVersionUID = 1L;
-
- protected UIDataTableBase getBinding() {
- return binding;
- }
-
- protected Attributes getAttributes() {
- return attributes;
- }
- };
- // filtering
- private Map<String, Object> filtering = new HashMap<String, Object>();
- // facets
- private Map<String, String> facets = new HashMap<String, String>();
- private transient UIExtendedDataTable binding;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIExtendedDataTable.class, getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("rows", 30);
- attributes.setAttribute("styleClass",
"extended-data-table");
- attributes.setAttribute("style", null);
-
- // setup types
- attributes.get("selection").setType(TreeSet.class);
- attributes.get("selection").setMemberType(Integer.class);
-
- // attributes which are already in page
- attributes.remove("value");
- attributes.remove("var");
-
- // TODO attributes which needs to be tested another way
- attributes.remove("filterVar");
- attributes.remove("iterationStatusVar");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
-
- // facets initial values
- facets.put("noData", "There is no data.");
- facets.put("header", "Header");
- facets.put("footer", "Footer");
- facets.put("columnStateHeader", "State Header");
- facets.put("columnStateFooter", "State Footer");
- facets.put("columnCapitalHeader", "Capital Header");
- facets.put("columnCapitalFooter", "Capital Footer");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public UIExtendedDataTable getBinding() {
- return binding;
- }
-
- public void setBinding(UIExtendedDataTable binding) {
- this.binding = binding;
- }
-
- /**
- * Getter for page.
- *
- * @return page number that will be used by data scroller
- */
- public int getPage() {
- return page;
- }
-
- /**
- * Setter for page.
- *
- * @param page
- * page number that will be used by data scroller
- */
- public void setPage(int page) {
- this.page = page;
- }
-
- public Map<Object, Integer> getStateMap() {
- return stateMap;
- }
-
- public void setStateMap(Map<Object, Integer> stateMap) {
- this.stateMap = stateMap;
- }
-
- public DataComponentState getDataTableState() {
- return dataTableState;
- }
-
- public void setDataTableState(DataComponentState dataTableState) {
- this.dataTableState = dataTableState;
- }
-
- /**
- * Getter for state.
- *
- * @return true if data should be displayed in table
- */
- public boolean isState() {
- return state;
- }
-
- /**
- * Setter for state.
- *
- * @param state
- * true if data should be displayed in table
- */
- public void setState(boolean state) {
- this.state = state;
- }
-
- public Filter<?> getFilterSexImpl() {
- return new Filter<Employee>() {
-
- public boolean accept(Employee e) {
- String sex = (String) getFiltering().get("sex");
- if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
- || sex.equalsIgnoreCase(e.getSex().toString())) {
- return true;
- }
- return false;
- }
- };
- }
-
- public Map<String, String> getFacets() {
- return facets;
- }
-
- public ColumnSortingMap getSorting() {
- return sorting;
- }
-
- public Map<String, Object> getFiltering() {
- return filtering;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIFileUpload;
-import org.richfaces.model.UploadedFile;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.richfaces.event.FileUploadEvent;
-
-/**
- * Managed bean for rich:fileUpload.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richFileUploadBean")
-@ViewScoped
-public class RichFileUploadBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private List<UploadedFile> files;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
- files = new ArrayList<UploadedFile>();
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIFileUpload.class,
getClass());
-
- attributes.setAttribute("addLabel", "Add ...");
- attributes.setAttribute("clearAllLabel", "Clear All");
- attributes.setAttribute("clearLabel", "Clear");
- attributes.setAttribute("deleteLabel", "Delete");
- attributes.setAttribute("noDuplicate", false);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("uploadLabel", "Upload");
-
- // will be tested in another way
- attributes.remove("validator");
- attributes.remove("fileUploadListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<UploadedFile> getItems() {
- return files;
- }
-
- public void listener(FileUploadEvent event) {
- UploadedFile file = event.getUploadedFile();
-
- if (file != null) {
- files.add(file);
- }
- }
-
- public String clearUploadedData() {
- files.clear();
- return null;
- }
-
- public boolean isRenderButton() {
- return files.size() > 0;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichGraphValidatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichGraphValidatorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichGraphValidatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.application.FacesMessage;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.context.FacesContext;
-import javax.validation.constraints.AssertTrue;
-import javax.validation.constraints.Size;
-import javax.validation.groups.Default;
-
-import org.richfaces.component.UIGraphValidator;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.validation.groups.ValidationGroup1;
-import org.richfaces.tests.metamer.validation.groups.ValidationGroup2;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed Bean for rich:graphValidator
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-@ManagedBean(name="richGraphValidatorBean")
-@ViewScoped
-public class RichGraphValidatorBean implements Serializable, Cloneable {
-
- /** Generated UID */
- private static final long serialVersionUID = -960575870621302059L;
- private static Logger logger;
- private Attributes attributes;
-
- @Size(min = 5, max = 15, message = "Wrong size for password")
- private String password;
- @Size(min = 5, max = 15, message = "Wrong size for password")
- private String passwordConfirm;
-
- @PostConstruct
- public void init(){
- logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIGraphValidator.class, getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("type",
"org.richfaces.BeanValidator");
- }
-
- @AssertTrue(message = "Different passwords entered! [Default Group]")
- public boolean isPasswordsEquals() {
- return password.equals(passwordConfirm);
- }
-
- @AssertTrue(message = "Different passwords entered! [G1]",
groups={ValidationGroup1.class})
- public boolean isRovnakeHesla() {
- return password.equals(passwordConfirm);
- }
-
- @AssertTrue(message = "Different passwords entered! [G2 + Default Group]",
groups = {ValidationGroup2.class,Default.class})
- public boolean isPokusUspesny() {
- return password.equals(passwordConfirm);
- }
-
- public void storeNewPassword() {
- FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully
changed!", "Succesfully changed!"));
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getPasswordConfirm() {
- return passwordConfirm;
- }
-
- public void setPasswordConfirm(String passwordConfirm) {
- this.passwordConfirm = passwordConfirm;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichHashParamBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichHashParamBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichHashParamBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIHashParameter;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:hashParam.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richHashParamBean")
-@ViewScoped
-public class RichHashParamBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIHashParameter.class, getClass());
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-import org.hibernate.validator.constraints.NotEmpty;
-
-import org.richfaces.component.UIInplaceInput;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:inplaceInput.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richInplaceInputBean")
-@ViewScoped
-public class RichInplaceInputBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String value1;
- private String value2;
- private String value3;
- private String value4;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIInplaceInput.class, getClass());
-
- attributes.setAttribute("defaultLabel", "Click here to
edit");
- attributes.setAttribute("editEvent", "click");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("requiredMessage", "value is
required");
- attributes.setAttribute("saveOnBlur", true);
- attributes.setAttribute("value", "RichFaces 4");
-
- // TODO has to be tested in another way
- attributes.remove("converter");
- attributes.remove("converterMessage");
- attributes.remove("validator");
- attributes.remove("validatorMessage");
- attributes.remove("valueChangeListener");
-
- // TODO remove as soon as RF-10411 is fixed
- attributes.setAttribute("style", null);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- @NotEmpty
- public String getValue1() {
- return value1;
- }
-
- public void setValue1(String value1) {
- this.value1 = value1;
- }
-
- @Pattern(regexp = "[a-z].*")
- public String getValue2() {
- return value2;
- }
-
- public void setValue2(String value2) {
- this.value2 = value2;
- }
-
- @Size(min = 3, max = 6)
- public String getValue3() {
- return value3;
- }
-
- public void setValue3(String value3) {
- this.value3 = value3;
- }
-
- public String getValue4() {
- return value4;
- }
-
- public void setValue4(String value4) {
- this.value4 = value4;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-import org.hibernate.validator.constraints.NotEmpty;
-
-import org.richfaces.component.UIInplaceSelect;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Capital;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:inplaceSelect.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richInplaceSelectBean")
-@ViewScoped
-public class RichInplaceSelectBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- // FIXME: @ManagedProperty(value = "#{model.capitals}")
- private List<Capital> capitals = Model.unmarshallCapitals();
- private List<SelectItem> capitalsOptions = null;
- private List<SelectItem> validationOptions = null;
- private String value1;
- private String value2;
- private String value3;
- private String value4;
- private String value5;
- private String requiredMessage = "value is required";
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- capitalsOptions = new ArrayList<SelectItem>();
- validationOptions = new ArrayList<SelectItem>();
- for (Capital capital : capitals) {
- capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
- validationOptions.add(new SelectItem(capital.getState(),
capital.getState()));
- }
- validationOptions.add(new SelectItem("@@", "@@"));
- validationOptions.add(new SelectItem("", ""));
- validationOptions.add(new SelectItem("RichFaces",
"RichFaces"));
- validationOptions.add(new SelectItem("richfaces",
"richfaces"));
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIInplaceSelect.class, getClass());
-
- attributes.setAttribute("defaultLabel", "Click here to
edit");
- attributes.setAttribute("editEvent", "click");
- attributes.setAttribute("listHeight", "200px");
- attributes.setAttribute("listWidth", "200px");
- attributes.setAttribute("openOnEdit", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("saveOnBlur", true);
- attributes.setAttribute("saveOnSelect", true);
-
- // TODO has to be tested in another way
- attributes.remove("converter");
- attributes.remove("converterMessage");
- attributes.remove("required");
- attributes.remove("requiredMessage");
- attributes.remove("validator");
- attributes.remove("validatorMessage");
- attributes.remove("valueChangeListener");
-
- // TODO remove as soon as RF-10411 is resolved
- attributes.setAttribute("changedStateClass", null);
- attributes.setAttribute("disabledStateClass", null);
- attributes.setAttribute("editStateClass", null);
- attributes.setAttribute("readyStateClass", null);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public void setCapitals(List<Capital> capitals) {
- this.capitals = capitals;
- }
-
- public List<SelectItem> getCapitalsOptions() {
- return capitalsOptions;
- }
-
- public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
- this.capitalsOptions = capitalsOptions;
- }
-
- public List<SelectItem> getValidationOptions() {
- return validationOptions;
- }
-
- public void setValidationOptions(List<SelectItem> validationOptions) {
- this.validationOptions = validationOptions;
- }
-
- @NotEmpty
- public String getValue1() {
- return value1;
- }
-
- public void setValue1(String value1) {
- this.value1 = value1;
- }
-
- @Pattern(regexp = "[a-z].*")
- public String getValue2() {
- return value2;
- }
-
- public void setValue2(String value2) {
- this.value2 = value2;
- }
-
- @Size(min = 3, max = 6)
- public String getValue3() {
- return value3;
- }
-
- public void setValue3(String value3) {
- this.value3 = value3;
- }
-
- public String getValue4() {
- return value4;
- }
-
- public void setValue4(String value4) {
- this.value4 = value4;
- }
-
- public String getValue5() {
- return value5;
- }
-
- public void setValue5(String value5) {
- this.value5 = value5;
- }
-
- public String getRequiredMessage() {
- return requiredMessage;
- }
-
- public void setRequiredMessage(String requiredMessage) {
- this.requiredMessage = requiredMessage;
- }
-
- public void listener(ValueChangeEvent event) {
- RichBean.logToPage("* value changed: " + event.getOldValue() + "
-> " + event.getNewValue());
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-
-import org.richfaces.component.html.HtmlInputNumberSlider;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:inputNumberSlider.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richInputNumberSliderBean")
-@ViewScoped
-public class RichInputNumberSliderBean implements Serializable {
-
- private static final long serialVersionUID = 595154649809L;
- private static Logger logger;
- private Attributes attributes;
- private int value1;
- private int value2;
- private int value3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(HtmlInputNumberSlider.class,
getClass());
-
- attributes.setAttribute("enableManualInput", true);
- attributes.setAttribute("inputSize", 3);
- attributes.setAttribute("maxlength", 10);
- attributes.setAttribute("maxValue", 10);
- attributes.setAttribute("minValue", -10);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("requiredMessage", "value is
required");
- attributes.setAttribute("showBoundaryValues", true);
- attributes.setAttribute("showInput", true);
- attributes.setAttribute("step", 1);
- attributes.setAttribute("value", 2);
-
- // will be tested in another way
- attributes.remove("valueChangeListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- @Min(2)
- public int getValue1() {
- return value1;
- }
-
- public void setValue1(int value1) {
- this.value1 = value1;
- }
-
- @Max(2)
- public int getValue2() {
- return value2;
- }
-
- public void setValue2(int value2) {
- this.value2 = value2;
- }
-
- public int getValue3() {
- return value3;
- }
-
- public void setValue3(int value3) {
- this.value3 = value3;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-
-import org.richfaces.component.html.HtmlInputNumberSpinner;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:inputNumberSpinner.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richInputNumberSpinnerBean")
-@ViewScoped
-public class RichInputNumberSpinnerBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private int value1;
- private int value2;
- private int value3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(HtmlInputNumberSpinner.class,
getClass());
-
- attributes.setAttribute("enableManualInput", true);
- attributes.setAttribute("maxValue", 10);
- attributes.setAttribute("minValue", -10);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("requiredMessage", "value is
required");
- attributes.setAttribute("step", 1);
- attributes.setAttribute("value", 2);
-
- // will be tested in another way
- attributes.remove("valueChangeListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- @Min(2)
- public int getValue1() {
- return value1;
- }
-
- public void setValue1(int value1) {
- this.value1 = value1;
- }
-
- @Max(2)
- public int getValue2() {
- return value2;
- }
-
- public void setValue2(int value2) {
- this.value2 = value2;
- }
-
- public int getValue3() {
- return value3;
- }
-
- public void setValue3(int value3) {
- this.value3 = value3;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIJQuery;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:jQuery.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>,
Nick Belaevski
- * @version $Revision$
- */
-@ManagedBean(name = "richJQueryBean")
-@ViewScoped
-public class RichJQueryBean implements Serializable {
-
- private static final long serialVersionUID = 111475400649809L;
- private static Logger logger;
- private Attributes attributes;
- private List<String> componentsDataList;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- componentsDataList = new ArrayList<String>();
- addComponent();
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIJQuery.class,
getClass());
-
- attributes.setAttribute("event", "click");
- attributes.setAttribute("name", "bubu");
- attributes.setAttribute("query", "alert('immediate
attachment')");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("selector", "#jQueryTestButton");
- attributes.setAttribute("timing", "immediate");
-
- // TODO must be tested in other way
- attributes.remove("name");
-
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<String> getComponentsDataList() {
- return componentsDataList;
- }
-
- public void addComponent() {
- componentsDataList.add(UUID.randomUUID().toString());
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichListBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichListBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichListBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIList;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:list.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richListBean")
-@ViewScoped
-public class RichListBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIList.class,
getClass());
-
- attributes.setAttribute("type", "ordered");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("rows", 20);
-
- // TODO has to be tested in other way
- attributes.remove("iterationStatusVar");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
- attributes.remove("value");
- attributes.remove("var");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import org.richfaces.component.UIMenuGroup;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:menuGroup.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richMenuGroupBean")
-@ViewScoped
-public class RichMenuGroupBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIMenuGroup.class,
getClass());
-
- attributes.setAttribute("label", "Save As...");
- attributes.setAttribute("rendered", true);
-
- attributes.remove("converter");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuItemBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuItemBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import org.richfaces.component.UIMenuItem;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:menuItem.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richMenuItemBean")
-@ViewScoped
-public class RichMenuItemBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIMenuItem.class,
getClass());
-
- attributes.setAttribute("icon",
"/resources/images/icons/create_doc.gif");
- attributes.setAttribute("label", "New");
- attributes.setAttribute("mode", "ajax");
- attributes.setAttribute("rendered", true);
-
- attributes.remove("action");
- attributes.remove("actionListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuSeparatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuSeparatorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuSeparatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIMenuSeparator;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:menuSeparator.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean
-@ViewScoped
-public class RichMenuSeparatorBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIMenuSeparator.class, getClass());
-
- attributes.setAttribute("rendered", true);
-
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIRichMessage;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Simple bean for rich:message component example.
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richMessageBean")
-@ViewScoped
-public class RichMessageBean implements Serializable {
-
- /** Generated UID */
- private static final long serialVersionUID = -5058242586244822846L;
- private static Logger logger;
- private Attributes attributes;
- private String simpleInput1;
- private String simpleInput2;
-
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIRichMessage.class, getClass());
-
- // setting up incorrect values to fire-up validator
- simpleInput1 = "-5";
- simpleInput2 = "-5";
-
- // to get working this component example correctly is required that for
- // property has been initialized
- attributes.setAttribute("for", "simpleInput1");
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("showSummary", true);
- attributes.setAttribute("ajaxRendered", true); // make sense for
a4j:commandButton submit
-
- // workaround for missing attribute def from rich.taglib.xml
- // to get it in list of attrs in metamer
- attributes.setAttribute("dir", null); // direction
- attributes.setAttribute("lang", null);
- attributes.setAttribute("onclick", null);
- attributes.setAttribute("ondblclick", null);
- attributes.setAttribute("onkeydown", null);
- attributes.setAttribute("onkeypress", null);
- attributes.setAttribute("onkeyup", null);
- attributes.setAttribute("onmousedown", null);
- attributes.setAttribute("onmousemove", null);
- attributes.setAttribute("onmouseout", null);
- attributes.setAttribute("onmouseover", null);
- attributes.setAttribute("onmouseup", null);
- attributes.setAttribute("style", null);
- attributes.setAttribute("styleClass", null);
- attributes.setAttribute("title", null);
-
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public String getSimpleInput2() {
- return simpleInput2;
- }
-
- public void setSimpleInput2(String simpleInput2) {
- this.simpleInput2 = simpleInput2;
- }
-
- public String getSimpleInput1() {
- return simpleInput1;
- }
-
- public void setSimpleInput1(String simpleInput1) {
- this.simpleInput1 = simpleInput1;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessagesBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessagesBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessagesBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.application.FacesMessage;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
-import org.richfaces.component.UIRichMessages;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Simple bean for rich:messages component example.
- *
- * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richMessagesBean")
-@ViewScoped
-public class RichMessagesBean implements Serializable {
-
- /** Generated UID */
- private static final long serialVersionUID = 4893769498631480379L;
- // id for input element to bound some FacesMessage to it
- private static final String INPUT1_ID = "form:simpleInput1";
- private static final String INPUT2_ID = "form:simpleInput2";
-
- private static Logger logger;
- private Attributes attributes;
-
- private String simpleInput1;
- private String simpleInput2;
-
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.info("initializing bean " + getClass().getName());
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIRichMessages.class, getClass());
-
- simpleInput1 = "10";
- simpleInput2 = "10";
-
- attributes.setAttribute("ajaxRendered", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("for", "simpleInput1");
- attributes.setAttribute("showSummary", true);
-
- // add attributes with missing appropriate annotation
- attributes.setAttribute("lang", null);
- attributes.setAttribute("dir", null);
- attributes.setAttribute("style", null);
- attributes.setAttribute("styleClass", null);
- attributes.setAttribute("title", null);
-
- attributes.setAttribute("onclick", null);
- attributes.setAttribute("ondblclick", null);
- attributes.setAttribute("onkeydown", null);
- attributes.setAttribute("onkeypress", null);
- attributes.setAttribute("onkeyup", null);
- attributes.setAttribute("onmousedown", null);
- attributes.setAttribute("onmousemove", null);
- attributes.setAttribute("onmouseup", null);
- attributes.setAttribute("onmouseout", null);
- attributes.setAttribute("onmouseover", null);
-
- }
-
- public void generateFacesError(ActionEvent event) {
-
- logger.info(" ### Just called generateFacesError()");
-
- FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_ERROR,
- "Generated error message without binding to any component
(global)",
- "Generated error message without binding to any component
(global)"));
-
- FacesContext.getCurrentInstance().addMessage(null,
- new FacesMessage(FacesMessage.SEVERITY_WARN,
- "Generated warning message without binding to any component
(global)",
- "Generated warning message without binding to any component
(global)"));
-
- // Message bound to component on page
- FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message
for Input 1",
- "Generated error message for Input 1"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
- new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message
for Input 1",
- "Generated warning message for Input 1"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
- new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message
for Input 2",
- "Generated error message for Input 2"));
-
- FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
- new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message
for Input 2",
- "Generated warning message for Input 2"));
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getSimpleInput1() {
- return simpleInput1;
- }
-
- public void setSimpleInput1(String simpleInput1) {
- this.simpleInput1 = simpleInput1;
- }
-
- public String getSimpleInput2() {
- return simpleInput2;
- }
-
- public void setSimpleInput2(String simpleInput2) {
- this.simpleInput2 = simpleInput2;
- }
-
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIPanel;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:panel.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richPanelBean")
-@ViewScoped
-public class RichPanelBean implements Serializable {
-
- private static final long serialVersionUID = 48122475400649801L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanel.class,
getClass());
-
- attributes.setAttribute("rendered", true);
-
- // FIXME these attributes were not found automatically
- attributes.setAttribute("bodyClass", null);
- attributes.setAttribute("header", null);
- attributes.setAttribute("headerClass", null);
- attributes.setAttribute("onclick", null);
- attributes.setAttribute("ondblclick", null);
- attributes.setAttribute("onkeydown", null);
- attributes.setAttribute("onkeypress", null);
- attributes.setAttribute("onkeyup", null);
- attributes.setAttribute("onmousedown", null);
- attributes.setAttribute("onmousemove", null);
- attributes.setAttribute("onmouseout", null);
- attributes.setAttribute("onmouseover", null);
- attributes.setAttribute("onmouseup", null);
- attributes.setAttribute("style", null);
- attributes.setAttribute("styleClass", null);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIPanelMenu;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:panelMenu.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richPanelMenuBean")
-@ViewScoped
-public class RichPanelMenuBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- private String activeItem;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenu.class,
getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("style", "width: 200px;");
-
- // will be tested in another way
- attributes.remove("itemChangeListener");
- attributes.remove("converter");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- /**
- * An item change listener that logs to the page old and new value.
- *
- * @param event
- * an event representing the activation of a user interface component
- */
- public void itemChangeListener(ItemChangeEvent event) {
- activeItem = event.getNewItemName();
- RichBean.logToPage("* item changed: " + (event.getOldItem() == null ?
null : event.getOldItem().getId())
- + " -> " + event.getNewItem().getId());
- }
-
- public String getActiveItem() {
- return activeItem;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIPanelMenuGroup;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:panelMenu.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richPanelMenuGroupBean")
-@ViewScoped
-public class RichPanelMenuGroupBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private Map<String, Boolean> expanded = new HashMap<String, Boolean>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuGroup.class, getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("selectable", true);
- attributes.setAttribute("mode", "ajax");
-
- // already defined in source directly
- attributes.remove("name");
- attributes.remove("label");
- attributes.remove("changeExpandListener");
- attributes.remove("action");
- attributes.remove("actionListener");
-
- // expanded needs to be set separately
- attributes.remove("expanded");
- expanded.put("group2", true);
- expanded.put("group23", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public Map<String, Boolean> getExpanded() {
- return expanded;
- }
-
- public void changeExpandListener(Object event) {
- RichBean.logToPage("* group expanded");
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIPanelMenuItem;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:panelMenu.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richPanelMenuItemBean")
-@ViewScoped
-public class RichPanelMenuItemBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuItem.class, getClass());
-
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("selectable", true);
-
- // already defined in source directly
- attributes.remove("action");
- attributes.remove("actionListener");
- attributes.remove("name");
- attributes.remove("label");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPopupPanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPopupPanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPopupPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIPopupPanel;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:popupPanel.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richPopupPanelBean")
-@ViewScoped
-public class RichPopupPanelBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String value1;
- private String value2;
- private String value3;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIPopupPanel.class,
getClass());
-
- attributes.setAttribute("header", "popup panel header");
- attributes.setAttribute("height", 300);
- attributes.setAttribute("left", "auto");
- attributes.setAttribute("maxHeight", 500);
- attributes.setAttribute("maxWidth", 500);
- attributes.setAttribute("minHeight", 300);
- attributes.setAttribute("minWidth", 300);
- attributes.setAttribute("moveable", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("resizeable", true);
- attributes.setAttribute("top", "auto");
- attributes.setAttribute("trimOverlayedElements", true);
- attributes.setAttribute("width", 500);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getValue1() {
- return value1;
- }
-
- public void setValue1(String value1) {
- this.value1 = value1;
- }
-
- public String getValue2() {
- return value2;
- }
-
- public void setValue2(String value2) {
- this.value2 = value2;
- }
-
- public String getValue3() {
- return value3;
- }
-
- public void setValue3(String value3) {
- this.value3 = value3;
- }
-
- public String save() {
- logger.warn("1: " + value1);
- logger.warn("2: " + value2);
- logger.warn("3: " + value3);
- return null;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIProgressBar;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:progressBar.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richProgressBarBean")
-@ViewScoped
-public class RichProgressBarBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private boolean buttonRendered = true;
- private Long startTime;
- private boolean initialFacetRendered = true;
- private boolean finishFacetRendered = true;
- private boolean childrenRendered = false;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIProgressBar.class, getClass());
-
- attributes.setAttribute("maxValue", 100);
- attributes.setAttribute("minValue", 0);
- attributes.setAttribute("interval", 500);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("value", -1);
-
- // attributes tested in another way
- attributes.remove("mode");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String startProcess() {
- attributes.setAttribute("enabled", true);
- buttonRendered = false;
- setStartTime(new Date().getTime());
- return null;
- }
-
- public Long getCurrentValue() {
- if (Boolean.TRUE.equals(attributes.get("enabled").getValue())) {
- Long current = (new Date().getTime() - startTime) / 500;
- if (current >= 100) {
- buttonRendered = true;
- } else if (current.equals(0L)) {
- return 1L;
- }
- return (new Date().getTime() - startTime) / 500;
- }
- if (startTime == null) {
- return -1L;
- } else {
- return 101L;
- }
- }
-
- public Long getStartTime() {
- return startTime;
- }
-
- public void setStartTime(Long startTime) {
- this.startTime = startTime;
- }
-
- public boolean isButtonRendered() {
- return buttonRendered;
- }
-
- public void setButtonRendered(boolean buttonRendered) {
- this.buttonRendered = buttonRendered;
- }
-
- public boolean isFinishFacetRendered() {
- return finishFacetRendered;
- }
-
- public void setFinishFacetRendered(boolean finishFacetRendered) {
- this.finishFacetRendered = finishFacetRendered;
- }
-
- public boolean isInitialFacetRendered() {
- return initialFacetRendered;
- }
-
- public void setInitialFacetRendered(boolean initialFacetRendered) {
- this.initialFacetRendered = initialFacetRendered;
- }
-
- public boolean isChildrenRendered() {
- return childrenRendered;
- }
-
- public void setChildrenRendered(boolean childrenRendered) {
- this.childrenRendered = childrenRendered;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ValueChangeEvent;
-import javax.faces.model.SelectItem;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
-import org.hibernate.validator.constraints.NotEmpty;
-
-import org.richfaces.component.UISelect;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.Capital;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:select.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richSelectBean")
-@ViewScoped
-public class RichSelectBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-// temporary fix because of a bug in MyFaces
-// @ManagedProperty(value = "#{model.capitals}")
- private List<Capital> capitals;
- private List<SelectItem> capitalsOptions = null;
- private List<SelectItem> validationOptions = null;
- private String value1;
- private String value2;
- private String value3;
- private String value4;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- capitalsOptions = new ArrayList<SelectItem>();
- validationOptions = new ArrayList<SelectItem>();
-// temporary fix because of a bug in MyFaces
-// for (Capital capital : capitals) {
- for (Capital capital : Model.unmarshallCapitals()) {
- capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
- validationOptions.add(new SelectItem(capital.getState(),
capital.getState()));
- }
- validationOptions.add(new SelectItem("@@", "@@"));
- validationOptions.add(new SelectItem("", ""));
- validationOptions.add(new SelectItem("RichFaces",
"RichFaces"));
- validationOptions.add(new SelectItem("richfaces",
"richfaces"));
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UISelect.class,
getClass());
-
- attributes.setAttribute("defaultLabel", "Click here to
edit");
- attributes.setAttribute("enableManualInput", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("showButton", true);
-
- // TODO has to be tested in another way
- attributes.remove("converter");
- attributes.remove("converterMessage");
- attributes.remove("required");
- attributes.remove("requiredMessage");
- attributes.remove("validator");
- attributes.remove("validatorMessage");
-
- attributes.remove("valueChangeListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public void setCapitals(List<Capital> capitals) {
- this.capitals = capitals;
- }
-
- public List<SelectItem> getCapitalsOptions() {
- return capitalsOptions;
- }
-
- public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
- this.capitalsOptions = capitalsOptions;
- }
-
- public List<SelectItem> getValidationOptions() {
- return validationOptions;
- }
-
- public void setValidationOptions(List<SelectItem> validationOptions) {
- this.validationOptions = validationOptions;
- }
-
- @NotEmpty
- public String getValue1() {
- return value1;
- }
-
- public void setValue1(String value1) {
- this.value1 = value1;
- }
-
- @Pattern(regexp = "[a-z].*")
- public String getValue2() {
- return value2;
- }
-
- public void setValue2(String value2) {
- this.value2 = value2;
- }
-
- @Size(min = 3, max = 6)
- public String getValue3() {
- return value3;
- }
-
- public void setValue3(String value3) {
- this.value3 = value3;
- }
-
- public String getValue4() {
- return value4;
- }
-
- public void setValue4(String value4) {
- this.value4 = value4;
- }
-
- public void listener(ValueChangeEvent event) {
- RichBean.logToPage("* value changed: " + event.getOldValue() + "
-> " + event.getNewValue());
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITab;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:tab.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTabBean")
-@ViewScoped
-public class RichTabBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UITab.class,
getClass());
-
- attributes.setAttribute("header", "tab1 header");
- attributes.setAttribute("name", "tab1");
- attributes.setAttribute("rendered", true);
-
- // will be tested in another way
- attributes.remove("converter");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import org.richfaces.component.UITabPanel;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import java.io.Serializable;
-
-/**
- * Managed bean for rich:tabPanel.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTabPanelBean")
-@ViewScoped
-public class RichTabPanelBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UITabPanel.class,
getClass());
-
- attributes.setAttribute("activeItem", "tab1");
- attributes.setAttribute("rendered", true);
-
- // will be tested in another way
- attributes.remove("converter");
- attributes.remove("itemChangeListener");
-
- // remove as soon as
https://issues.jboss.org/browse/RF-10588 is fixed
- attributes.setAttribute("bypassUpdates", null);
- attributes.get("bypassUpdates").setType(Boolean.class);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import org.richfaces.component.behavior.ToggleControl;
-
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:toggleControl.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richToggleControlBean")
-@ViewScoped
-public class RichToggleControlBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getBehaviorAttributesFromFacesConfig(ToggleControl.class,
getClass());
-
- attributes.setAttribute("targetPanel", "panel1");
- attributes.setAttribute("targetItem", "item1");
-
- // TODO following attributes have to be tested in another way
- attributes.remove("disableDefault");
- attributes.remove("event"); // has to be literal
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITogglePanel;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:togglePanel.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTogglePanelBean")
-@ViewScoped
-public class RichTogglePanelBean implements Serializable {
-
- private static final long serialVersionUID = 67812341568562249L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UITogglePanel.class, getClass());
-
- attributes.setAttribute("activeItem", "item1");
- attributes.setAttribute("rendered", true);
-
- // will to be tested in another way
- attributes.remove("converter");
- attributes.remove("itemChangeListener");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelItemBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelItemBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITogglePanelItem;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:togglePanelItem.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTogglePanelItemBean")
-@ViewScoped
-public class RichTogglePanelItemBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UITogglePanelItem.class, getClass());
-
- attributes.setAttribute("name", "item1");
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIToolbar;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:toolbar.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richToolbarBean")
-@ViewScoped
-public class RichToolbarBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UIToolbar.class,
getClass());
-
- attributes.setAttribute("height", 28);
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarGroupBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarGroupBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UIToolbarGroup;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:toolbar.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richToolbarGroupBean")
-@ViewScoped
-public class RichToolbarGroupBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UIToolbarGroup.class, getClass());
-
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITooltip;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:list.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTooltipBean")
-@ViewScoped
-public class RichTooltipBean implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private static Logger logger;
- private Attributes attributes;
-
- private int counter = 0;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UITooltip.class,
getClass());
-
-
- // set defaults
- attributes.setAttribute("attached", true);
- attributes.setAttribute("rendered", true);
- attributes.setAttribute("followMouse", true);
- attributes.setAttribute("layout", "inline");
- attributes.setAttribute("mode", "client");
- attributes.setAttribute("showEvent", "mouseenter");
- attributes.setAttribute("hideEvent", "mouseleave");
- attributes.setAttribute("target", "form:panel");
-
- // attributes that needs to be tested in other way
- attributes.remove("converter");
-
- // intentionally hidden attributes
- attributes.remove("localValue");
- attributes.remove("value");
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public int getCounter() {
- return counter++;
- }
-
- public Date getTooltipDate() {
- return new Date();
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.event.ComponentSystemEvent;
-
-import org.richfaces.component.UITree;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.tree.CompactDisc;
-import org.richfaces.tests.metamer.model.tree.CompactDiscXmlDescriptor;
-import org.richfaces.tests.metamer.model.tree.Company;
-import org.richfaces.tests.metamer.model.tree.Country;
-import org.richfaces.tests.metamer.model.tree.NamedNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTreeBean")
-@ViewScoped
-public class RichTreeBean implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- private static Logger logger;
- private Attributes attributes;
- private List<NamedNode> root = new ArrayList<NamedNode>();
- private Collection<? extends Serializable> selection;
-
- // FIXME: @ManagedProperty(value = "#{model}")
- // private Model model;
-
- private Map<String, Country> countriesCache = new HashMap<String,
Country>();
- private Map<String, Company> companiesCache = new HashMap<String,
Company>();
-
- private boolean testLoadingFacet = false;
- private boolean delayedRender = false;
-
- private Map<NamedNode, Boolean> expanded = new HashMap<NamedNode,
Boolean>();
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes = Attributes.getComponentAttributesFromFacesConfig(UITree.class,
getClass());
- attributes.get("rendered").setValue(true);
- attributes.get("toggleType").setValue("ajax");
- attributes.get("selectionType").setValue("ajax");
-
- // attributes which needs to be tested another way
- attributes.remove("selectionChangeListener");
- attributes.remove("toggleListener");
- attributes.remove("value");
- attributes.remove("var");
- attributes.remove("rowKeyVar");
- attributes.remove("stateVar");
- attributes.remove("nodeType");
-
- for (CompactDiscXmlDescriptor descriptor : Model.unmarshallCompactDiscs()) {
- createCompactDisc(descriptor);
- }
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- private CompactDisc createCompactDisc(CompactDiscXmlDescriptor descriptor) {
- final Company company = findOrCreateCompany(descriptor);
-
- CompactDisc cd = new CompactDisc(descriptor.getTitle(), descriptor.getArtist(),
company, descriptor.getPrice(),
- descriptor.getYear());
- company.getCds().add(cd);
- expanded.put(cd, false);
- return cd;
- }
-
- private Company findOrCreateCompany(CompactDiscXmlDescriptor descriptor) {
- final Country country = findOrCreateCountry(descriptor);
-
- String companyName = descriptor.getCompany();
- Company company = companiesCache.get(companyName);
- if (company == null) {
- company = new Company();
- company.setName(companyName);
- company.setParent(country);
- country.getCompanies().add(company);
- companiesCache.put(companyName, company);
- expanded.put(company, false);
- }
- return company;
- }
-
- private Country findOrCreateCountry(CompactDiscXmlDescriptor descriptor) {
- String countryName = descriptor.getCountry();
- Country country = countriesCache.get(countryName);
- if (country == null) {
- country = new Country();
- country.setName(countryName);
- countriesCache.put(countryName, country);
- expanded.put(country, false);
- root.add(country);
- }
- return country;
- }
-
- public List<NamedNode> getRoot() {
-
- return root;
- }
-
- public Collection<? extends Serializable> getSelection() {
- return selection;
- }
-
- public void setSelection(Collection<? extends Serializable> selection) {
- this.selection = selection;
- }
-
- public boolean isTestLoadingFacet() {
- return testLoadingFacet;
- }
-
- public void setTestLoadingFacet(boolean testLoadingFacet) {
- this.testLoadingFacet = testLoadingFacet;
- }
-
- public boolean isDelayedRender() {
- return delayedRender;
- }
-
- public void setDelayedRender(boolean delayedRender) {
- this.delayedRender = delayedRender;
- }
-
- public void preRenderView(ComponentSystemEvent event) {
- if (delayedRender) {
- try {
- Thread.sleep(1000);
- } catch (Exception e) {
- throw new IllegalStateException();
- }
- }
- }
-
- public Map<NamedNode, Boolean> getExpanded() {
- return expanded;
- }
-
- public void expandAll() {
- for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
- entry.setValue(true);
- }
- }
-
- public void collapseAll() {
- for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
- entry.setValue(false);
- }
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
-
-import org.richfaces.event.TreeSelectionChangeEvent;
-import org.richfaces.event.TreeToggleEvent;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTreeListenerBean")
-@RequestScoped
-public class RichTreeListenerBean {
-
- private TreeSelectionChangeEvent treeSelectionChangeEvent;
- private TreeToggleEvent treeToggleEvent;
-
- public void processSelectionChange(TreeSelectionChangeEvent event) {
- this.treeSelectionChangeEvent = event;
- RichBean.logToPage("* selection change listener invoked");
- }
-
- public void processToggle(TreeToggleEvent event) {
- this.treeToggleEvent = event;
- RichBean.logToPage("* tree toggle listener invoked");
- }
-
- public TreeSelectionChangeEvent getTreeSelectionChangeEvent() {
- return treeSelectionChangeEvent;
- }
-
- public TreeToggleEvent getTreeToggleEvent() {
- return treeToggleEvent;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITreeModelAdaptor;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTreeModelAdaptorBean")
-@ViewScoped
-public class RichTreeModelAdaptorBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes attributes;
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UITreeModelAdaptor.class, getClass());
- attributes.setAttribute("rendered", true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.annotation.PostConstruct;
-import javax.el.ELContext;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.UITreeModelRecursiveAdaptor;
-import org.richfaces.tests.metamer.Attributes;
-import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNode;
-import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNodeImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTreeModelRecursiveAdaptorBean")
-@ViewScoped
-public class RichTreeModelRecursiveAdaptorBean implements Serializable {
-
-
- private static final long serialVersionUID = 1L;
- private static Logger logger;
- private static List<RecursiveNode> rootNodes;
-
- private Attributes attributes;
- private AtomicReference<Boolean> leafChildrenNullable = new
AtomicReference<Boolean>(true);
- private boolean useMapModel;
- private Map<String, Boolean> expanded = new TreeMap<String, Boolean>();
- private boolean rootNodesInitialized = false;
-
- /*
- * Nodes which was loaded lazily in the current request
- */
- private Set<String> lazyInitializedNodes = new LinkedHashSet<String>();
-
- public Set<String> getLazyInitializedNodes() {
- return lazyInitializedNodes;
- }
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getComponentAttributesFromFacesConfig(UITreeModelRecursiveAdaptor.class,
getClass());
-
- attributes.get("rendered").setValue(true);
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public List<RecursiveNode> getRootNodes() {
- if (!rootNodesInitialized) {
- rootNodes = RecursiveNodeImpl.createChildren(true, "", 1, false);
- }
- return rootNodes;
- }
-
- public boolean isLeafChildrenNullable() {
- return leafChildrenNullable.get();
- }
-
- public void setLeafChildrenNullable(boolean leafChildrenNullable) {
- this.leafChildrenNullable.set(leafChildrenNullable);
- }
-
- public boolean isUseMapModel() {
- return useMapModel;
- }
-
- public void setUseMapModel(boolean useMapModel) {
- this.useMapModel = useMapModel;
- }
-
- public Map<String, Boolean> getExpanded() {
- return expanded;
- }
-
- public static List<RecursiveNode> getRootNodesStatically() {
- return rootNodes;
- }
-
- public static RichTreeModelRecursiveAdaptorBean getFacesContext() {
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- return (RichTreeModelRecursiveAdaptorBean)
elContext.getELResolver().getValue(elContext, null,
"richTreeModelRecursiveAdaptorBean");
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.UITreeNode;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richTreeNodeBean")
-@ViewScoped
-public class RichTreeNodeBean implements Serializable {
-
- private static final long serialVersionUID = 4008175400649809L;
- private static Logger logger;
- private Attributes[] attributes = new Attributes[3];
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- for (int i = 0; i < attributes.length; i++) {
- attributes[i] =
Attributes.getComponentAttributesFromFacesConfig(UITreeNode.class, getClass());
- attributes[i].get("rendered").setValue(true);
-
- // attributes which needs to be tested another way
- attributes[i].remove("type");
- attributes[i].remove("expanded");
- }
- }
-
- public Attributes[] getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes[] attributes) {
- this.attributes = attributes;
- }
-}
Deleted:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichValidatorBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichValidatorBean.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichValidatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * JBoss, Home of Professional Open Source
- * Copyright 2010-2011, 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.tests.metamer.bean;
-
-import java.io.Serializable;
-
-import javax.annotation.PostConstruct;
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-import org.richfaces.component.behavior.ClientValidatorImpl;
-import org.richfaces.tests.metamer.Attributes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Managed bean for rich:validator.
- *
- * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
- * @version $Revision$
- */
-@ManagedBean(name = "richValidatorBean")
-@ViewScoped
-public class RichValidatorBean implements Serializable {
-
- private static final long serialVersionUID = -1L;
- private static Logger logger;
- private Attributes attributes;
- private String stringValue = "RichFaces";
-
- /**
- * Initializes the managed bean.
- */
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- logger.debug("initializing bean " + getClass().getName());
-
- attributes =
Attributes.getBehaviorAttributesFromFacesConfig(ClientValidatorImpl.class, getClass());
- }
-
- public Attributes getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Attributes attributes) {
- this.attributes = attributes;
- }
-
- public String getStringValue() {
- return stringValue;
- }
-
- public void setStringValue(String stringValue) {
- this.stringValue = stringValue;
- }
-}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JActionListenerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JActionListenerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JActionListenerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JActionListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.NoneScoped;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+
+/**
+ * Managed bean for a4j:ajax.
+ *
+ * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jActionListenerBean")
+@NoneScoped
+public class A4JActionListenerBean {
+
+ public static final class ActionListenerImpl implements ActionListener {
+
+ public void processAction(ActionEvent event) throws AbortProcessingException {
+ addFacesMessage("Implementation of ActionListener created and called:
" + this);
+ }
+ }
+
+ private static final class BoundActionListener implements ActionListener {
+
+ public void processAction(ActionEvent event) throws AbortProcessingException {
+ addFacesMessage("Bound listener called");
+ }
+ }
+ private ActionListener actionListener = new BoundActionListener();
+
+ private static void addFacesMessage(String messageText) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ context.addMessage(null, new FacesMessage(messageText));
+ }
+
+ public void handleActionMethod(ActionEvent event) throws AbortProcessingException {
+ addFacesMessage("Method expression listener called");
+ }
+
+ public void handleActionMethodComposite(ActionEvent event) throws
AbortProcessingException {
+ addFacesMessage("Method expression listener called from composite
component");
+ }
+
+ public ActionListener getActionListener() {
+ return actionListener;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAjaxBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAjaxBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.FacesException;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.model.SelectItem;
+
+import org.ajax4jsf.component.behavior.AjaxBehavior;
+import org.richfaces.tests.metamer.Attribute;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:ajax.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jAjaxBean")
+@ViewScoped
+public class A4JAjaxBean implements Serializable {
+
+ private static final long serialVersionUID = -546567867L;
+ private static final int ACTION_STRING_LENGTH = 6;
+ private static Logger logger;
+ private Attributes attributes;
+ private String input;
+ private List<String> cars;
+ private String car;
+ private boolean boolVal;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getBehaviorAttributesFromFacesConfig(AjaxBehavior.class,
getClass());
+
+ // the 'event' attribute for behavior tag must be a literal
+ attributes.remove("event");
+
+ attributes.setAttribute("render", "output1, output2");
+ attributes.setAttribute("execute", "@form");
+
+ // FIXME not found attribute
+ Attribute listenerAttr = new Attribute("listener");
+ List<SelectItem> selectOptions = new ArrayList<SelectItem>();
+ selectOptions.add(new SelectItem("doubleStringListener",
"doubleStringListener"));
+ selectOptions.add(new SelectItem("first6CharsListener",
"first6CharsListener"));
+ selectOptions.add(new SelectItem("toUpperCaseListener",
"toUpperCaseListener"));
+ selectOptions.add(new SelectItem("causeErrorListener",
"causeErrorListener"));
+ selectOptions.add(new SelectItem(null, "null"));
+ listenerAttr.setSelectOptions(selectOptions);
+ attributes.put(listenerAttr.getName(), listenerAttr);
+
+ cars = new ArrayList<String>();
+ cars.add("Ferrari");
+ cars.add("Lexus");
+ car = "Ferrari";
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Getter for input.
+ * @return content of the input field on the page
+ */
+ public String getInput() {
+ return input;
+ }
+
+ /**
+ * Setter for input.
+ * @param input new content of the input field on the page
+ */
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+ public String getCar() {
+ return car;
+ }
+
+ public void setCar(String car) {
+ this.car = car;
+ }
+
+ public List<String> getCars() {
+ return cars;
+ }
+
+ public void setCars(List<String> cars) {
+ this.cars = cars;
+ }
+
+ public boolean isBoolVal() {
+ return boolVal;
+ }
+
+ public void setBoolVal(boolean boolVal) {
+ this.boolVal = boolVal;
+ }
+
+ /**
+ * An action listener that takes the first six characters from input and stores it to
input.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void first6CharsListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input = (String) input.subSequence(0, endIndex);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, doubles it and stores it to
input.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void doubleStringListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ input = input.concat(input);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, converts it to upper case and
stores it to input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void toUpperCaseListener(AjaxBehaviorEvent event) {
+ if (input == null) {
+ input = "";
+ } else {
+ input = input.toUpperCase();
+ }
+ }
+
+ /**
+ * An action listener causing error. Suitable for testing onerror attribute.
+ * @param event an event representing the activation of a user interface component
(not used)
+ */
+ public void causeErrorListener(AjaxBehaviorEvent event) {
+ throw new FacesException("Ajax request caused an error. This is intentional
behavior.");
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAttachQueueBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAttachQueueBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JAttachQueueBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIAttachQueue;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:attachQueue.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jAttachQueueBean")
+@ViewScoped
+public class A4JAttachQueueBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private Attributes attributes2;
+ private String text1;
+ private String text2;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ // initialize attributes
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAttachQueue.class, getClass());
+ initializeAttributes(attributes);
+ attributes.setAttribute("requestDelay", 500);
+
+ attributes2 =
Attributes.getComponentAttributesFromFacesConfig(UIAttachQueue.class, getClass());
+ initializeAttributes(attributes2);
+ attributes2.setAttribute("requestDelay", 1500);
+ }
+
+ private void initializeAttributes(Attributes attributes) {
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Attributes getAttributes2() {
+ return attributes2;
+ }
+
+ public void setAttributes2(Attributes attributes2) {
+ this.attributes2 = attributes2;
+ }
+
+ public String getText1() {
+ return text1;
+ }
+
+ public void setText1(String text1) {
+ this.text1 = text1;
+ }
+
+ public String getText2() {
+ return text2;
+ }
+
+ public void setText2(String text2) {
+ this.text2 = text2;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandButtonBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandButtonBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandButtonBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandButtonBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.UICommandButton;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:commandButton.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jButtonBean")
+@ViewScoped
+public class A4JCommandButtonBean implements Serializable {
+
+ private static final long serialVersionUID = -2556026843426776944L;
+ private static final int ACTION_STRING_LENGTH = 6;
+ private static Logger logger;
+ private Attributes attributes;
+ private String input;
+ private String input2;
+ private String input3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UICommandButton.class, getClass());
+
+ attributes.setAttribute("action", "first6CharsAction");
+ attributes.setAttribute("actionListener",
"toUpperCaseActionListener");
+ attributes.setAttribute("disabled", false);
+ attributes.get("disabled").setType(Boolean.class);
+ attributes.setAttribute("render", "output1 output2
output3");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("value", "command button");
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Getter for input.
+ *
+ * @return value entered by a user
+ */
+ public String getInput() {
+ return input;
+ }
+
+ /**
+ * Getter for input2.
+ *
+ * @return value entered by a user modified by selected action
+ */
+ public String getInput2() {
+ return input2;
+ }
+
+ /**
+ * Getter for input3.
+ *
+ * @return value entered by a user modified by selected action listener
+ */
+ public String getInput3() {
+ return input3;
+ }
+
+ /**
+ * Setter for input.
+ *
+ * @param input
+ * value which user entered into text input on the page
+ */
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+ /**
+ * An action that takes the first six characters from input and stores it to input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String first6CharsAction() {
+ if (input == null) {
+ return "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input2 = (String) input.subSequence(0, endIndex);
+ return null;
+ }
+ }
+
+ /**
+ * An action that takes user's input, doubles it and stores it to input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String doubleStringAction() {
+ if (input == null) {
+ input2 = "";
+ } else {
+ input2 = input.concat(input);
+ }
+
+ return null;
+ }
+
+ /**
+ * An action that takes user's input, converts it to upper case and stores it to
input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String toUpperCaseAction() {
+ if (input == null) {
+ return "";
+ } else {
+ input2 = input.toUpperCase();
+ return null;
+ }
+ }
+
+ /**
+ * An action listener that takes the first six characters from input and stores it to
input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void first6CharsActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input3 = (String) input.subSequence(0, endIndex);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, doubles it and stores it to
input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void doubleStringActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ input3 = input.concat(input);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, converts it to upper case and
stores it to input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void toUpperCaseActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ input3 = input.toUpperCase();
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandLinkBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JCommandLinkBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandLinkBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JCommandLinkBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.UICommandLink;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:commandLink.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jLinkBean")
+@ViewScoped
+public class A4JCommandLinkBean implements Serializable {
+
+ private static final long serialVersionUID = -2556076843426776944L;
+ private static final int ACTION_STRING_LENGTH = 6;
+ private static Logger logger;
+ private Attributes attributes;
+ private String input;
+ private String input2;
+ private String input3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UICommandLink.class, getClass());
+
+ attributes.setAttribute("value", "command link");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("action", "first6CharsAction");
+ attributes.setAttribute("actionListener",
"toUpperCaseActionListener");
+ attributes.setAttribute("render", "output1 output2
output3");
+
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Getter for input.
+ *
+ * @return value entered by a user
+ */
+ public String getInput() {
+ return input;
+ }
+
+ /**
+ * Getter for input2.
+ *
+ * @return value entered by a user modified by selected action
+ */
+ public String getInput2() {
+ return input2;
+ }
+
+ /**
+ * Getter for input3.
+ *
+ * @return value entered by a user modified by selected action listener
+ */
+ public String getInput3() {
+ return input3;
+ }
+
+ /**
+ * Setter for input.
+ *
+ * @param input
+ * value which user entered into text input on the page
+ */
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+ /**
+ * An action that takes the first six characters from input and stores it to input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String first6CharsAction() {
+ if (input == null) {
+ return "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input2 = (String) input.subSequence(0, endIndex);
+ return null;
+ }
+ }
+
+ /**
+ * An action that takes user's input, doubles it and stores it to input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String doubleStringAction() {
+ if (input == null) {
+ input2 = "";
+ } else {
+ input2 = input.concat(input);
+ }
+
+ return null;
+ }
+
+ /**
+ * An action that takes user's input, converts it to upper case and stores it to
input2.
+ *
+ * @return null since no navigation should be performed
+ */
+ public String toUpperCaseAction() {
+ if (input == null) {
+ return "";
+ } else {
+ input2 = input.toUpperCase();
+ return null;
+ }
+ }
+
+ /**
+ * An action listener that takes the first six characters from input and stores it to
input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void first6CharsActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ int endIndex = input.length() > ACTION_STRING_LENGTH ?
ACTION_STRING_LENGTH : input.length();
+ input3 = (String) input.subSequence(0, endIndex);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, doubles it and stores it to
input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void doubleStringActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ input3 = input.concat(input);
+ }
+ }
+
+ /**
+ * An action listener that takes user's input, converts it to upper case and
stores it to input3.
+ *
+ * @param event
+ * an event representing the activation of a user interface component (not
used)
+ */
+ public void toUpperCaseActionListener(ActionEvent event) {
+ if (input == null) {
+ input3 = "";
+ } else {
+ input3 = input.toUpperCase();
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JJSFunctionBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JJSFunctionBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JJSFunctionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.UIFunction;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:jsFunction.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jJSFunctionBean")
+// should not be view-scoped (see
https://jira.jboss.org/browse/RF-9287)
+@ViewScoped
+public class A4JJSFunctionBean implements Serializable {
+
+ private static final long serialVersionUID = 48333649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int year;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+ year = Integer.parseInt(new SimpleDateFormat("yyyy").format(new
Date()));
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIFunction.class,
getClass());
+
+ attributes.setAttribute("name", "metamerFunction");
+ attributes.setAttribute("render", "time1, time2, year");
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+
+ public String increaseYearAction() {
+ year++;
+ return null;
+ }
+
+ public String decreaseYearAction() {
+ year--;
+ return null;
+ }
+
+ public void increaseYearActionListener(ActionEvent event) {
+ year++;
+ }
+
+ public void decreaseYearActionListener(ActionEvent event) {
+ year--;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JLogBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JLogBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JLogBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JLogBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIAjaxLog;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:log.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jLogBean")
+@ViewScoped
+public class A4JLogBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String name;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ name = "John";
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIAjaxLog.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("level", "debug");
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * Getter for name.
+ * @return content of the input field on the page
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Setter for name.
+ * @param name new content of the input field on the page
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JMediaOutputBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JMediaOutputBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+import javax.imageio.ImageIO;
+
+import org.richfaces.component.UIMediaOutput;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.MediaData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:mediaOutput.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jMediaOutputBean")
+@RequestScoped
+public class A4JMediaOutputBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIMediaOutput.class, getClass());
+
+ attributes.setAttribute("session", true);
+ attributes.setAttribute("rendered", true);
+ attributes.remove("createContent");
+ attributes.remove("element");
+ attributes.remove("value");
+ attributes.remove("mimeType");
+ attributes.remove("uriAttribute");
+ }
+
+ /**
+ * 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 void paint(OutputStream out, Object data) throws IOException {
+ if (data instanceof MediaData) {
+ MediaData paintData = (MediaData) data;
+ BufferedImage img = new BufferedImage(paintData.getWidth(),
paintData.getHeight(), BufferedImage.TYPE_INT_RGB);
+ Graphics2D graphics2D = img.createGraphics();
+ graphics2D.clearRect(0, 0, paintData.getWidth(), paintData.getHeight());
+
+ graphics2D.setColor(Color.YELLOW);
+ graphics2D.fillRect(0, 0, paintData.getWidth() / 2, paintData.getHeight() /
2);
+
+ graphics2D.setColor(Color.RED);
+ graphics2D.fillRect(paintData.getWidth() / 2, 0, paintData.getWidth() / 2,
paintData.getHeight() / 2);
+
+ graphics2D.setColor(Color.BLUE);
+ graphics2D.fillRect(0, paintData.getWidth() / 2, paintData.getWidth() / 2,
paintData.getHeight() / 2);
+
+ graphics2D.setColor(Color.GREEN);
+ graphics2D.fillRect(paintData.getWidth() / 2, paintData.getHeight() / 2,
paintData.getWidth() / 2, paintData.getHeight() / 2);
+
+ ImageIO.write(img, "png", out);
+ }
+ }
+
+ private void copy(InputStream in, OutputStream out) throws IOException {
+ byte[] buffer = new byte[2048];
+ int read;
+
+ while ((read = in.read(buffer)) != -1) {
+ out.write(buffer, 0, read);
+ }
+ }
+
+ public void paintFlash(OutputStream out, Object data) throws IOException {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ if (loader == null) {
+ loader = getClass().getClassLoader();
+ }
+
+ InputStream stream =
loader.getResourceAsStream("resources/flash/text.swf");
+
+ if (stream != null) {
+ try {
+ copy(stream, out);
+ } finally {
+ stream.close();
+ }
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JOutputPanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JOutputPanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JOutputPanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JOutputPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIOutputPanel;
+import org.richfaces.tests.metamer.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")
+@ViewScoped
+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.getComponentAttributesFromFacesConfig(UIOutputPanel.class, getClass());
+
+ attributes.setAttribute("ajaxRendered", true);
+ attributes.setAttribute("layout", "block");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("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;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JParamBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JParamBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JParamBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JParamBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.UIParameter;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:param.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jParamBean")
+@ViewScoped
+public class A4JParamBean implements Serializable {
+
+ private static final long serialVersionUID = -23993426776944L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String parameter;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIParameter.class,
getClass());
+
+ attributes.setAttribute("name", "param");
+ attributes.setAttribute("noEscape", true);
+ attributes.get("noEscape").setType(Boolean.class);
+ attributes.setAttribute("value", "screen.width");
+ }
+
+ /**
+ * 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 String getParameter() {
+ return parameter;
+ }
+
+ public void setParameter(String parameter) {
+ this.parameter = parameter;
+ }
+
+ public String getRequestParameter() {
+ Map<String, String> requestParameterMap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ return
requestParameterMap.get(attributes.get("name").getValue().toString());
+ }
+
+ public String reset() {
+ parameter = null;
+ return null;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPollBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPollBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPollBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.UIPoll;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:poll.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jPollBean")
+@ViewScoped
+public class A4JPollBean implements Serializable {
+
+ private static final long serialVersionUID = 4810889475400649809L;
+ 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.getComponentAttributesFromFacesConfig(UIPoll.class,
getClass());
+
+ attributes.setAttribute("enabled", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("interval", 2500);
+ attributes.setAttribute("action", "increaseCounterAction");
+ attributes.setAttribute("actionListener",
"increaseCounterActionListener");
+ }
+
+ /**
+ * 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 Date getDate() {
+ return new Date();
+ }
+
+ public int getCounter() {
+ return counter;
+ }
+
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ public String increaseCounterAction() {
+ counter++;
+ return null;
+ }
+
+ public String decreaseCounterAction() {
+ counter--;
+ return null;
+ }
+
+ public void increaseCounterActionListener(ActionEvent event) {
+ counter++;
+ }
+
+ public void decreaseCounterActionListener(ActionEvent event) {
+ counter--;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JPushBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import org.richfaces.application.push.MessageException;
+import org.richfaces.application.push.TopicKey;
+
+import org.richfaces.application.push.TopicsContext;
+import org.richfaces.component.UIPush;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.Message;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:push.
+ *
+ * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jPushBean")
+@SessionScoped
+public class A4JPushBean implements Serializable {
+
+ private static final long serialVersionUID = 4810889475400649809L;
+ private static Logger logger;
+ private transient TopicsContext topicsContext;
+ private Attributes attributes;
+ private String username;
+ private String message;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ topicsContext = TopicsContext.lookup();
+
+ attributes = Attributes.getComponentAttributesFromClass(UIPush.class,
getClass());
+// attributes.setAttribute("interval", 1000);
+// attributes.setAttribute("action",
"increaseCounterAction");
+// attributes.setAttribute("actionListener",
"increaseCounterActionListener");
+// attributes.setAttribute("rendered", true);
+// attributes.setAttribute("enabled", true);
+//
+// // will be set on page and cannot be changed
+// attributes.remove("eventProducer");
+ }
+
+ /**
+ * 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 String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public void setTopicsContext(TopicsContext topicsContext) {
+ this.topicsContext = topicsContext;
+ }
+
+ private TopicsContext getTopicsContext() {
+ if (topicsContext == null) {
+ topicsContext = TopicsContext.lookup();
+ }
+ return topicsContext;
+ }
+
+ public void send() {
+ try {
+ logger.info("sending message \"" + message + "\" by
user " + username);
+ Message msg = new Message(message, username, new Date().toString());
+ getTopicsContext().publish(new TopicKey("metamer",
"xxx"), msg);
+ } catch (MessageException messageException) {
+ logger.error("Could not send message \"" + message +
"\" by user " + username + ".", messageException);
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JQueueBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JQueueBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JQueueBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIQueue;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:queue.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jQueueBean")
+@ViewScoped
+public class A4JQueueBean implements Serializable {
+
+ private static final long serialVersionUID = 486866943531809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String text;
+ private A4JQueueBean globalQueue;
+ private A4JQueueBean formQueue1;
+ private A4JQueueBean formQueue2;
+ private boolean introduceDelay;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ // initialize attributes
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIQueue.class,
getClass());
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("requestDelay", 750);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public A4JQueueBean getGlobalQueue() {
+ if (globalQueue == null) {
+ globalQueue = new A4JQueueBean();
+ globalQueue.init();
+ globalQueue.attributes.setAttribute("requestDelay", 10000);
+ }
+ return globalQueue;
+ }
+
+ public A4JQueueBean getFormQueue1() {
+ if (formQueue1 == null) {
+ formQueue1 = new A4JQueueBean();
+ formQueue1.init();
+ formQueue1.attributes.setAttribute("requestDelay", 500);
+ }
+ return formQueue1;
+ }
+
+ public A4JQueueBean getFormQueue2() {
+ if (formQueue2 == null) {
+ formQueue2 = new A4JQueueBean();
+ formQueue2.init();
+ formQueue2.attributes.setAttribute("requestDelay", 2000);
+ }
+ return formQueue2;
+ }
+
+ public A4JQueueBean[] getFormQueues() {
+ return new A4JQueueBean[]{getFormQueue1(), getFormQueue2()};
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ if (introduceDelay) {
+ try {
+ Thread.sleep(5000);
+ } catch (InterruptedException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ this.text = text;
+ }
+
+ public boolean isIntroduceDelay() {
+ return introduceDelay;
+ }
+
+ public void setIntroduceDelay(boolean introduceDelay) {
+ this.introduceDelay = introduceDelay;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRegionBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRegionBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRegionBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRegionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+
+import org.richfaces.component.UIRegion;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Employee;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:region.
+ *
+ * @author Exadel, Nick Belaevski, <a
href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jRegionBean")
+@SessionScoped
+public class A4JRegionBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static final SelectItem[] AVAILABLE_EXECUTE_OPTIONS = new SelectItem[]{new
SelectItem(null, "default"),
+ new SelectItem("@all"), new SelectItem("@form"), new
SelectItem("@region"), new SelectItem("@this"),
+ new SelectItem("outerValueInput", "Outer"), new
SelectItem("regionValueInput", "Region"),
+ new SelectItem("nestedRegionValueInput", "Nested region"),
+ new SelectItem("decorationValueInput", "Decoration"), new
SelectItem("insertionValueInput", "Insertion")};
+ private static Logger logger;
+ // for page simple.xhtml
+ private Attributes attributes;
+ private Employee user1;
+ private Employee user2;
+ // for page nested.xhtml
+ private String execute;
+ private String nestedExecute;
+ private String outerExecute;
+ private String decorationExecute;
+ private String decorationValue;
+ private String insertionExecute;
+ private String outerValue;
+ private String regionValue;
+ private String nestedRegionValue;
+ private String lastExecutedButtonValue;
+ private String insertionValue;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ user1 = new Employee();
+ user2 = new Employee();
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIRegion.class,
getClass());
+ attributes.setAttribute("rendered", true);
+ }
+
+ // getters and setters for page simple.xhtml
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Employee getUser1() {
+ return user1;
+ }
+
+ public void setUser1(Employee user1) {
+ this.user1 = user1;
+ }
+
+ public Employee getUser2() {
+ return user2;
+ }
+
+ public void setUser2(Employee user2) {
+ this.user2 = user2;
+ }
+
+ // getters and setters for page nested.xhtml
+ public SelectItem[] getExecuteOptions() {
+ return AVAILABLE_EXECUTE_OPTIONS;
+ }
+
+ public String getOuterValue() {
+ return outerValue;
+ }
+
+ public void setOuterValue(String outerValue) {
+ this.outerValue = outerValue;
+ }
+
+ public String getRegionValue() {
+ return regionValue;
+ }
+
+ public void setRegionValue(String value) {
+ this.regionValue = value;
+ }
+
+ public String getNestedRegionValue() {
+ return nestedRegionValue;
+ }
+
+ public void setNestedRegionValue(String nestedValue) {
+ this.nestedRegionValue = nestedValue;
+ }
+
+ public String getExecute() {
+ return execute;
+ }
+
+ public void setExecute(String execute) {
+ this.execute = execute;
+ }
+
+ public String getNestedExecute() {
+ return nestedExecute;
+ }
+
+ public void setNestedExecute(String nestedExecute) {
+ this.nestedExecute = nestedExecute;
+ }
+
+ public String getOuterExecute() {
+ return outerExecute;
+ }
+
+ public void setOuterExecute(String outerExecute) {
+ this.outerExecute = outerExecute;
+ }
+
+ public String getInsertionExecute() {
+ return insertionExecute;
+ }
+
+ public void setInsertionExecute(String insertionExecute) {
+ this.insertionExecute = insertionExecute;
+ }
+
+ public String getInsertionValue() {
+ return insertionValue;
+ }
+
+ public void setInsertionValue(String insertionValue) {
+ this.insertionValue = insertionValue;
+ }
+
+ public String getDecorationExecute() {
+ return decorationExecute;
+ }
+
+ public void setDecorationExecute(String decorationExecute) {
+ this.decorationExecute = decorationExecute;
+ }
+
+ public String getDecorationValue() {
+ return decorationValue;
+ }
+
+ public void setDecorationValue(String decorationValue) {
+ this.decorationValue = decorationValue;
+ }
+
+ public void handleBehavior(AjaxBehaviorEvent event) {
+ lastExecutedButtonValue = (String)
event.getComponent().getAttributes().get("value");
+ }
+
+ public String getLastExecutedButtonValue() {
+ return lastExecutedButtonValue;
+ }
+
+ public void handleDefaultsValueChange(ValueChangeEvent event) {
+ String newValue = (String) event.getNewValue();
+
+ setOuterExecute(newValue);
+ setExecute(newValue);
+ setDecorationExecute(newValue);
+ setInsertionExecute(newValue);
+ setNestedExecute(newValue);
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRepeatBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JRepeatBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRepeatBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JRepeatBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIRepeat;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:repeat.
+ *
+ * @author Nick Belaevski, <a href="mailto:ppitonak@redhat.com">Pavol
Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jRepeatBean")
+@ViewScoped
+public class A4JRepeatBean implements Serializable {
+
+ private static final long serialVersionUID = 4864439475400649809L;
+ private static final int MATRIX_DIMENSION = 4;
+ private static Logger logger;
+ private Attributes attributes;
+ private List<Data> dataList;
+ private Data selectedDataItem = null;
+ private List<MatrixRow> matrixRows;
+
+ public static final class MatrixCell implements Serializable {
+
+ private static final long serialVersionUID = -5911659561854593681L;
+ private int value = 0;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ public void clearValueAction() {
+ setValue(0);
+ }
+
+ public void increaseValueAction() {
+ value++;
+ }
+
+ public void decreaseValueAction() {
+ value--;
+ }
+ }
+
+ public static final class MatrixRow implements Serializable {
+
+ private static final long serialVersionUID = -5051037819565283283L;
+ private List<MatrixCell> cells = new ArrayList<MatrixCell>();
+
+ public List<MatrixCell> getCells() {
+ return cells;
+ }
+
+ public void addCell(MatrixCell cell) {
+ cells.add(cell);
+ }
+ }
+
+ public static final class Data implements Serializable {
+
+ private static final long serialVersionUID = -1461777632529492912L;
+ private String text;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+ }
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ // initialize model for page simple.xhtml
+ dataList = new ArrayList<Data>();
+ for (int i = 0; i < 20; i++) {
+ Data data = new Data();
+ data.setText(MessageFormat.format("Item {0}", i));
+ dataList.add(data);
+ }
+
+ // initialize model for page matrix.xhtml
+ matrixRows = new ArrayList<MatrixRow>();
+ for (int i = 0; i < MATRIX_DIMENSION; i++) {
+ MatrixRow matrixRow = new MatrixRow();
+
+ for (int j = 0; j < MATRIX_DIMENSION; j++) {
+ MatrixCell matrixCell = new MatrixCell();
+ matrixRow.addCell(matrixCell);
+ }
+
+ matrixRows.add(matrixRow);
+ }
+
+ // initialize attributes
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIRepeat.class,
getClass());
+ attributes.setAttribute("rendered", true);
+ // TODO has to be tested in other way
+ attributes.remove("componentState");
+ attributes.remove("iterationState");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowKeyVar");
+ attributes.remove("rowKeyConverter");
+ attributes.remove("value");
+ attributes.remove("stateVar");
+ attributes.remove("var");
+
+ // should be hidden
+ attributes.remove("relativeRowIndex");
+ attributes.remove("rowAvailable");
+ attributes.remove("rowCount");
+ attributes.remove("rowData");
+ attributes.remove("rowIndex");
+ attributes.remove("rowKey");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * @return the data
+ */
+ public List<Data> getDataList() {
+ return dataList;
+ }
+
+ /**
+ * @return the selectedDataItem
+ */
+ public Data getSelectedDataItem() {
+ return selectedDataItem;
+ }
+
+ /**
+ * @param selectedDataItem the selectedDataItem to set
+ */
+ public void setSelectedDataItem(Data selectedDataItem) {
+ this.selectedDataItem = selectedDataItem;
+ }
+
+ public List<MatrixRow> getMatrixRows() {
+ return matrixRows;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JStatusBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JStatusBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/a4j/A4JStatusBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.a4j;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIStatus;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:status.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "a4jStatusBean")
+@ViewScoped
+public class A4JStatusBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String facetStartValue = "START";
+ private String facetStopValue = "STOP";
+ private String facetErrorValue = "ERROR";
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIStatus.class,
getClass());
+ attributes.setAttribute("rendered", true);
+
+ // hidden attributes
+ attributes.remove("converter");
+ attributes.remove("localValue");
+ attributes.remove("value");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getFacetStartValue() {
+ return facetStartValue;
+ }
+
+ public void setFacetStartValue(String facetStartValue) {
+ this.facetStartValue = facetStartValue;
+ }
+
+ public String getFacetStopValue() {
+ return facetStopValue;
+ }
+
+ public void setFacetStopValue(String facetStopValue) {
+ this.facetStopValue = facetStopValue;
+ }
+
+ public String getFacetErrorValue() {
+ return facetErrorValue;
+ }
+
+ public void setFacetErrorValue(String facetErrorValue) {
+ this.facetErrorValue = facetErrorValue;
+ }
+
+ /**
+ * Action that creates a 2-second delay.
+ *
+ * @throws InterruptedException
+ * if any thread has interrupted the current thread. The interrupted
status of the current thread is
+ * cleared when this exception is thrown.
+ */
+ public void delay() throws InterruptedException {
+ Thread.sleep(2000);
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIAccordion;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:accordion.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richAccordionBean")
+@ViewScoped
+public class RichAccordionBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIAccordion.class,
getClass());
+
+ attributes.setAttribute("activeItem", "item1");
+ attributes.setAttribute("rendered", true);
+
+ // will be tested in another way
+ attributes.remove("converter");
+ attributes.remove("itemChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionItemBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAccordionItemBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionItemBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAccordionItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIAccordionItem;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:accordionItem.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richAccordionItemBean")
+@ViewScoped
+public class RichAccordionItemBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAccordionItem.class, getClass());
+
+ attributes.setAttribute("header", "Item 1");
+ attributes.setAttribute("name", "item1");
+ attributes.setAttribute("rendered", true);
+
+ // TODO will be tested in another way
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAutocompleteBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichAutocompleteBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAutocompleteBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichAutocompleteBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+
+import org.richfaces.component.UIAutocomplete;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:autocomplete.
+ *
http://community.jboss.org/wiki/richfacesautocompletecomponentbehavior
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richAutocompleteBean")
+// cannot be view-scoped (see
https://jira.jboss.org/browse/RF-9287)
+@SessionScoped
+public class RichAutocompleteBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private Attributes ajaxAttributes;
+ @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIAutocomplete.class, getClass());
+ attributes.setAttribute("converterMessage", "converter
message");
+ attributes.setAttribute("mode", "ajax");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("tokens", ", ");
+ attributes.setAttribute("validatorMessage", "validator
message");
+
+ ajaxAttributes = Attributes.getEmptyAttributes(getClass());
+ ajaxAttributes.setAttribute("render", "output");
+ ajaxAttributes.setAttribute("execute", "autocomplete");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Attributes getAjaxAttributes() {
+ return ajaxAttributes;
+ }
+
+ public void setAjaxAttributes(Attributes ajaxAttributes) {
+ this.ajaxAttributes = ajaxAttributes;
+ }
+
+ public List<String> autocomplete(String prefix) {
+ ArrayList<String> result = new ArrayList<String>();
+ if (prefix != null && prefix.length() > 0) {
+ Iterator<Capital> iterator = capitals.iterator();
+ while (iterator.hasNext()) {
+ Capital elem = ((Capital) iterator.next());
+ if ((elem.getState() != null &&
elem.getState().toLowerCase().indexOf(prefix.toLowerCase()) == 0)
+ || "".equals(prefix)) {
+ result.add(elem.getState());
+ }
+ }
+ } else {
+ for (Capital capital : capitals) {
+ result.add(capital.getState());
+ }
+ }
+ return result;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCalendarBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCalendarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+
+import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.validator.ValidatorException;
+import javax.validation.constraints.Future;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Past;
+
+import org.richfaces.component.UICalendar;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:calendar.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richCalendarBean")
+@ViewScoped
+public class RichCalendarBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private Date date = new Date();
+ private TimeZone timeZone = TimeZone.getTimeZone("UTC");
+ private Date date1;
+ private Date date2;
+ private Date date3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UICalendar.class,
getClass());
+
+ attributes.setAttribute("datePattern", "MMM d, yyyy HH:mm");
+ attributes.setAttribute("direction", "bottomRight");
+ attributes.setAttribute("jointPoint", "bottomLeft");
+ attributes.setAttribute("popup", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("requiredMessage", "value is
required");
+ attributes.setAttribute("showApplyButton", true);
+ attributes.setAttribute("showHeader", true);
+ attributes.setAttribute("showFooter", true);
+ attributes.setAttribute("showInput", true);
+ attributes.setAttribute("showWeeksBar", true);
+ attributes.setAttribute("showWeekDaysBar", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("dataModel");
+ attributes.remove("validator");
+ attributes.remove("valueChangeListener");
+ attributes.remove("timeZone");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public TimeZone getTimeZone() {
+ return timeZone;
+ }
+
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ @Past
+ @NotNull
+ public Date getDate1() {
+ return date1;
+ }
+
+ public void setDate1(Date date1) {
+ this.date1 = date1;
+ }
+
+ @Future
+ @NotNull
+ public Date getDate2() {
+ return date2;
+ }
+
+ public void setDate2(Date date2) {
+ this.date2 = date2;
+ }
+
+ public Date getDate3() {
+ return date3;
+ }
+
+ public void setDate3(Date date3) {
+ this.date3 = date3;
+ }
+
+ /**
+ * A value change listener that logs to the page old and new value.
+ *
+ * @param event
+ * an event representing the activation of a user interface component
+ */
+ public void valueChangeListener(ValueChangeEvent event) {
+ SimpleDateFormat sdf = new
SimpleDateFormat(attributes.get("datePattern").getValue().toString());
+ sdf.setTimeZone(timeZone);
+
+ String oldDate = "null";
+ String newDate = "null";
+
+ if (event.getOldValue() != null) {
+ oldDate = sdf.format((Date) event.getOldValue());
+ }
+ if (event.getNewValue() != null) {
+ newDate = sdf.format((Date) event.getNewValue());
+ }
+
+ RichBean.logToPage("* value changed: " + oldDate + " -> "
+ newDate);
+ }
+
+ public void validateDate(FacesContext context, UIComponent component, Object value)
throws ValidatorException {
+ if (value == null) {
+ return;
+ }
+
+ Calendar cal = Calendar.getInstance();
+ cal.setTime((Date) value);
+ int componentYear = cal.get(Calendar.YEAR);
+
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Date
too far in the past.",
+ "Select a date from year 1991 or newer.");
+
+ if (componentYear < 1991) {
+ FacesContext.getCurrentInstance().addMessage("form:calendar",
message);
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsiblePanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsiblePanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsiblePanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UICollapsiblePanel;
+import org.richfaces.event.PanelToggleEvent;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:collapsiblePanel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richCollapsiblePanelBean")
+@ViewScoped
+public class RichCollapsiblePanelBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsiblePanel.class, getClass());
+
+ attributes.setAttribute("expanded", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("header", "collapsible panel
header");
+
+ // will be tested in another way
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void toggleListener(PanelToggleEvent event) {
+ RichBean.logToPage("* panel " + (event.getExpanded() ?
"expanded" : "collapsed"));
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UICollapsibleSubTable;
+import org.richfaces.component.UIDataTableBase;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.ColumnSortingMap;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.model.Employee;
+import org.richfaces.tests.metamer.model.Employee.Sex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:collapsibleSubTable.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richSubTableBean")
+@ViewScoped
+public class RichCollapsibleSubTableBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ // FIXME: @ManagedProperty(value = "#{model.employees}")
+ private List<Employee> employees = Model.unmarshallEmployees();
+ private List<List<Employee>> lists;
+ private transient UICollapsibleSubTable binding;
+ // true = model, false = empty table
+ private boolean state;
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+ // sorting
+ private ColumnSortingMap sorting = new ColumnSortingMap() {
+
+ private static final long serialVersionUID = 1L;
+
+ protected UIDataTableBase getBinding() {
+ return binding;
+ }
+
+ protected Attributes getAttributes() {
+ return attributes;
+ }
+ };
+ // filtering
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+ // expanded
+ private Map<List<Employee>, Boolean> expanded = new
HashMap<List<Employee>, Boolean>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 5);
+
+ // TODO these attributes have to be tested in another way
+ attributes.remove("expanded");
+ attributes.remove("columns");
+ attributes.remove("selection");
+ attributes.remove("filterVar");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("componentState");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+ attributes.remove("var");
+ attributes.remove("value");
+
+ List<Employee> men = new ArrayList<Employee>();
+ List<Employee> women = new ArrayList<Employee>();
+
+ for (Employee e : employees) {
+ if (e.getSex() == Sex.MALE) {
+ men.add(e);
+ } else {
+ women.add(e);
+ }
+ }
+
+ lists = new ArrayList<List<Employee>>();
+ lists.add(men);
+ lists.add(women);
+
+ expanded.put(men, true);
+ expanded.put(women, true);
+
+ state = true;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(List<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public List<List<Employee>> getLists() {
+ return lists;
+ }
+
+ public void setLists(List<List<Employee>> lists) {
+ this.lists = lists;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
+ public UICollapsibleSubTable getBinding() {
+ return binding;
+ }
+
+ public void setBinding(UICollapsibleSubTable binding) {
+ this.binding = binding;
+ }
+
+ public ColumnSortingMap getSorting() {
+ return sorting;
+ }
+
+ public Map<String, Object> getFiltering() {
+ return filtering;
+ }
+
+ public Map<List<Employee>, Boolean> getExpanded() {
+ return expanded;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableTogglerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableTogglerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableTogglerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichCollapsibleSubTableTogglerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UICollapsibleSubTableToggleControl;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.model.Employee;
+import org.richfaces.tests.metamer.model.Employee.Sex;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:collapsibleSubTableToggler.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name="richSubTableTogglerBean")
+@ViewScoped
+public class RichCollapsibleSubTableTogglerBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ // FIXME: @ManagedProperty(value = "#{model.employees}")
+ private List<Employee> employees = Model.unmarshallEmployees();
+ private List<List<Employee>> lists;
+ // true = model, false = empty table
+ private boolean state;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTableToggleControl.class,
getClass());
+ attributes.setAttribute("event", "click");
+ attributes.setAttribute("rendered", true);
+ // TODO these attributes have to be tested in another way
+ attributes.remove("for");
+
+ List<Employee> men = new ArrayList<Employee>();
+ List<Employee> women = new ArrayList<Employee>();
+
+ for (Employee e : employees) {
+ if (e.getSex() == Sex.MALE) {
+ men.add(e);
+ } else {
+ women.add(e);
+ }
+ }
+
+ lists = new ArrayList<List<Employee>>();
+ lists.add(men);
+ lists.add(women);
+
+ state = true;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<Employee> getEmployees() {
+ return employees;
+ }
+
+ public void setEmployees(List<Employee> employees) {
+ this.employees = employees;
+ }
+
+ public List<List<Employee>> getLists() {
+ return lists;
+ }
+
+ public void setLists(List<List<Employee>> lists) {
+ this.lists = lists;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.Comparator;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.SortOrder;
+import org.richfaces.component.UIColumn;
+import org.richfaces.model.Filter;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:column
+ *
+ * @author <a href="mailto:pjha@redhat.com">Prabhat Jha</a>, <a
href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richColumnBean")
+@ViewScoped
+public class RichColumnBean implements Serializable {
+
+ public static final Comparator<Capital> STATE_NAME_LENGTH_COMPARATOR = new
Comparator<Capital>() {
+ @Override
+ public int compare(Capital o1, Capital o2) {
+ return o1.getState().length() - o2.getState().length();
+ }
+ };
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+
+ private Attributes attributes;
+ private String stateNameToFilter;
+ private SortOrder sortOrder = SortOrder.ascending;
+
+ private Filter<Capital> stateFilter = new StateFilter();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIColumn.class,
getClass());
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("colspan", 2);
+ attributes.setAttribute("rowspan", 2);
+ attributes.setAttribute("breakRowBefore", true);
+
+ // attributes which needs to be tested another way
+ attributes.remove("filter");
+ attributes.remove("filterValue");
+ attributes.remove("filterExpression");
+ attributes.remove("comparator");
+ attributes.remove("sortBy");
+ attributes.remove("sortOrder");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Comparator<Capital> getStateNameLengthComparator() {
+ return STATE_NAME_LENGTH_COMPARATOR;
+ }
+
+ public Filter<Capital> getStateNameFilter() {
+ return stateFilter;
+ }
+
+ public String getStateNameToFilter() {
+ return stateNameToFilter;
+ }
+
+ public void setStateNameToFilter(String stateNameToFilter) {
+ this.stateNameToFilter = stateNameToFilter;
+ }
+
+ public SortOrder[] getSortOrders() {
+ return SortOrder.values();
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ private class StateFilter implements Filter<Capital>, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public boolean accept(Capital c) {
+ return c.getState().toLowerCase()
+ .contains(stateNameToFilter == null ? "" :
stateNameToFilter.toLowerCase());
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnGroupBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichColumnGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+
+import org.richfaces.component.UIColumnGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:columnGroup.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richColumnGroupBean")
+@SessionScoped
+public class RichColumnGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int page = 1;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIColumnGroup.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public void setPage(int page) {
+ this.page = page;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichComponentControlBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichComponentControlBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.behavior.ComponentControlBehavior;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:componentControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richComponentControlBean")
+@ViewScoped
+public class RichComponentControlBean implements Serializable {
+
+ private static final long serialVersionUID = 4476643239809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getBehaviorAttributesFromFacesConfig(ComponentControlBehavior.class,
getClass());
+
+ attributes.setAttribute("operation", "previous");
+ attributes.setAttribute("target", "scroller");
+
+ // The 'event' attribute for behavior tag must be a literal
+ attributes.remove("event");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataGridBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataGridBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataGridBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataGridBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDataGrid;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:dataGrid.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDataGridBean")
+@ViewScoped
+public class RichDataGridBean implements Serializable {
+
+ private static final long serialVersionUID = 4814439475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ // true = model, false = empty table
+ private boolean state = true;
+ private int page = 1;
+ private Map<String, String> facets = new HashMap<String, String>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIDataGrid.class,
getClass());
+
+ attributes.setAttribute("columns", 3);
+ attributes.setAttribute("rendered", true);
+
+ // attributes defined directly in page
+ attributes.remove("value");
+ attributes.remove("var");
+
+ // TODO attributes which needs to be tested in another way
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("footer", "Footer");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public void setPage(int page) {
+ this.page = page;
+ }
+
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
+ public void setFacets(Map<String, String> facets) {
+ this.facets = facets;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataScrollerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataScrollerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataScrollerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataScrollerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDataScroller;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:dataScroller.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDataScrollerBean")
+@ViewScoped
+public class RichDataScrollerBean implements Serializable {
+
+ private static final long serialVersionUID = 122475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private boolean state = true;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDataScroller.class, getClass());
+
+ attributes.setAttribute("boundaryControls", "show");
+ attributes.setAttribute("fastControls", "show");
+ attributes.setAttribute("stepControls", "show");
+ attributes.setAttribute("fastStep", 1);
+ attributes.setAttribute("lastPageMode", "short");
+ attributes.setAttribute("maxPages", 10);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("render", "richDataTable");
+ attributes.setAttribute("page", 1);
+ attributes.setAttribute("renderIfSinglePage", true);
+ attributes.setAttribute("for", "richDataTable");
+
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * Getter for state.
+ * @return true if non-empty data model should be used in table
+ */
+ public boolean isState() {
+ return state;
+ }
+
+ /**
+ * Setter for state.
+ * @param state true if non-empty data model should be used in table
+ */
+ public void setState(boolean state) {
+ this.state = state;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataTableBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataTableBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDataTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.ajax4jsf.model.DataComponentState;
+import org.richfaces.component.UIDataTable;
+import org.richfaces.component.UIDataTableBase;
+import org.richfaces.model.Filter;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.ColumnSortingMap;
+import org.richfaces.tests.metamer.model.Employee;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:dataTable.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDataTableBean")
+@ViewScoped
+public class RichDataTableBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private transient UIDataTable binding;
+ private DataComponentState dataTableState;
+ private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
+ private int page = 1;
+ // true = model, false = empty table
+ private boolean state = true;
+ // sorting
+ private ColumnSortingMap sorting = new CustomColumnSortingMap();
+ // filtering
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIDataTable.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 10);
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("footer", "Footer");
+ facets.put("columnStateHeader", "State Header");
+ facets.put("columnStateFooter", "State Footer");
+ facets.put("columnCapitalHeader", "Capital Header");
+ facets.put("columnCapitalFooter", "Capital Footer");
+
+ // attributes already in page
+ attributes.remove("value");
+ attributes.remove("var");
+
+ // TODO needs to be tested another way
+ attributes.remove("filterVar");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+ }
+
+ public void setBinding(UIDataTable binding) {
+ this.binding = binding;
+ }
+
+ public UIDataTable getBinding() {
+ return binding;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public void setPage(int page) {
+ this.page = page;
+ }
+
+ public Map<Object, Integer> getStateMap() {
+ return stateMap;
+ }
+
+ public void setStateMap(Map<Object, Integer> stateMap) {
+ this.stateMap = stateMap;
+ }
+
+ public DataComponentState getDataTableState() {
+ return dataTableState;
+ }
+
+ public void setDataTableState(DataComponentState dataTableState) {
+ this.dataTableState = dataTableState;
+ }
+
+ public boolean isState() {
+ return state;
+ }
+
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public Date getDate() {
+ return new Date();
+ }
+
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
+ public ColumnSortingMap getSorting() {
+ return sorting;
+ }
+
+ public Map<String, Object> getFiltering() {
+ return filtering;
+ }
+
+ public Filter<?> getFilterSexImpl() {
+ return new Filter<Employee>() {
+
+ public boolean accept(Employee e) {
+ String sex = (String) getFiltering().get("sex");
+ if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
+ || sex.equalsIgnoreCase(e.getSex().toString())) {
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+ private class CustomColumnSortingMap extends ColumnSortingMap {
+
+ private static final long serialVersionUID = 1L;
+
+ protected UIDataTableBase getBinding() {
+ return binding;
+ }
+
+ protected Attributes getAttributes() {
+ return attributes;
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragIndicatorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragIndicatorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragIndicatorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragIndicatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDragIndicator;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDragIndicatorBean")
+@ViewScoped
+public class RichDragIndicatorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDragIndicator.class, getClass());
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragSourceBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDragSourceBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragSourceBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDragSourceBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDragSource;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDragSourceBean")
+@ViewScoped
+public class RichDragSourceBean implements Serializable {
+
+ private static final int DRAG_VALUES = 3;
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private List<DragValue> dragValues = new ArrayList<DragValue>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIDragSource.class,
getClass());
+
+ attributes.setAttribute("dragIndicator", "indicator");
+ attributes.setAttribute("type", "drg1");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("dragValue");
+ attributes.remove("event");
+
+
+ for (int i = 0; i < DRAG_VALUES; i++) {
+ dragValues.add(new DragValue(i + 1));
+ }
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<DragValue> getDragValues() {
+ return dragValues;
+ }
+
+ public void setDragValues(List<DragValue> dragValues) {
+ this.dragValues = dragValues;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropDownMenuBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropDownMenuBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.UIDropDownMenu;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:dropDownMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDropDownMenuBean")
+@ViewScoped
+public class RichDropDownMenuBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String current;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIDropDownMenu.class, getClass());
+
+ attributes.setAttribute("mode", "ajax");
+ attributes.setAttribute("rendered", true);
+
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getCurrent() {
+ return this.current;
+ }
+
+ public void setCurrent(String current) {
+ this.current = current;
+ }
+
+ public String doNew() {
+ this.current = "New";
+ return null;
+ }
+
+ public String doOpen() {
+ this.current = "Open";
+ return null;
+ }
+
+ public String doClose() {
+ this.current = "Close";
+ return null;
+ }
+
+ public String doSave() {
+ this.current = "Save";
+ return null;
+ }
+
+ public String doSaveAll() {
+ this.current = "Save All";
+ return null;
+ }
+
+ public String doExit() {
+ this.current = "Exit";
+ return null;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropListenerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropListenerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.event.DropEvent;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@RequestScoped
+@ManagedBean(name = "richDropListenerBean")
+public class RichDropListenerBean {
+
+ private DropEvent dropEvent;
+
+ @ManagedProperty("#{richDropTargetBean}")
+ private RichDropTargetBean richDropTargetBean;
+
+ public void processDragging(DropEvent dropEvent) {
+ RichBean.logToPage("* dropListener");
+
+ DragValue dragValue = (DragValue) dropEvent.getDragValue();
+ DropValue dropValue = (DropValue) dropEvent.getDropValue();
+
+ this.dropEvent = dropEvent;
+
+ richDropTargetBean.increaseDropValue();
+ if (dropEvent.getComponent().getClientId().endsWith("1")) {
+ richDropTargetBean.getDroppedValues1().put(dropValue, dragValue);
+ } else {
+ richDropTargetBean.getDroppedValues2().put(dropValue, dragValue);
+ }
+ }
+
+ public DropEvent getDropEvent() {
+ return dropEvent;
+ }
+
+ public RichDropTargetBean getRichDropTargetBean() {
+ return richDropTargetBean;
+ }
+
+ public void setRichDropTargetBean(RichDropTargetBean richDropBehaviorBean) {
+ this.richDropTargetBean = richDropBehaviorBean;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropTargetBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropTargetBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichDropTargetBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIDropTarget;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.drag.DragValue;
+import org.richfaces.tests.metamer.model.drag.DropValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richDropTargetBean")
+@ViewScoped
+public class RichDropTargetBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private Map<DropValue, DragValue> droppedValues1 = new
LinkedHashMap<DropValue, DragValue>();
+ private Map<DropValue, DragValue> droppedValues2 = new
LinkedHashMap<DropValue, DragValue>();
+ private DropValue dropValue;
+ private int dropValueCounter = 1;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class,
getClass());
+
+ attributes.setAttribute("acceptedTypes", "drg1, drg2");
+ attributes.setAttribute("render", "droppable1 droppable2");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("actionExpression");
+ attributes.remove("action");
+ attributes.remove("actionListener");
+ attributes.remove("dropListener");
+ attributes.remove("dropValue");
+
+ increaseDropValue();
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<DropValue, DragValue> getDroppedValues1() {
+ return droppedValues1;
+ }
+
+ public Map<DropValue, DragValue> getDroppedValues2() {
+ return droppedValues2;
+ }
+
+ public void increaseDropValue() {
+ dropValue = new DropValue(dropValueCounter++);
+ }
+
+ public DropValue getDropValue() {
+ return dropValue;
+ }
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries1() {
+ List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues1.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries2() {
+ List<Entry<DropValue, DragValue>> list = new
LinkedList<Entry<DropValue, DragValue>>(droppedValues2.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichExtendedDataTableBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichExtendedDataTableBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichExtendedDataTableBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeSet;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.ajax4jsf.model.DataComponentState;
+import org.richfaces.component.UIDataTableBase;
+import org.richfaces.component.UIExtendedDataTable;
+import org.richfaces.model.Filter;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.ColumnSortingMap;
+import org.richfaces.tests.metamer.model.Employee;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:extendedDataTable.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richExtendedDataTableBean")
+@ViewScoped
+public class RichExtendedDataTableBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private transient DataComponentState dataTableState;
+ private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
+ private int page = 1;
+ // true = model, false = empty table
+ private boolean state = true;
+ // sorting
+ private ColumnSortingMap sorting = new ColumnSortingMap() {
+
+ private static final long serialVersionUID = 1L;
+
+ protected UIDataTableBase getBinding() {
+ return binding;
+ }
+
+ protected Attributes getAttributes() {
+ return attributes;
+ }
+ };
+ // filtering
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+ private transient UIExtendedDataTable binding;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIExtendedDataTable.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 30);
+ attributes.setAttribute("styleClass",
"extended-data-table");
+ attributes.setAttribute("style", null);
+
+ // setup types
+ attributes.get("selection").setType(TreeSet.class);
+ attributes.get("selection").setMemberType(Integer.class);
+
+ // attributes which are already in page
+ attributes.remove("value");
+ attributes.remove("var");
+
+ // TODO attributes which needs to be tested another way
+ attributes.remove("filterVar");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("header", "Header");
+ facets.put("footer", "Footer");
+ facets.put("columnStateHeader", "State Header");
+ facets.put("columnStateFooter", "State Footer");
+ facets.put("columnCapitalHeader", "Capital Header");
+ facets.put("columnCapitalFooter", "Capital Footer");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public UIExtendedDataTable getBinding() {
+ return binding;
+ }
+
+ public void setBinding(UIExtendedDataTable binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Getter for page.
+ *
+ * @return page number that will be used by data scroller
+ */
+ public int getPage() {
+ return page;
+ }
+
+ /**
+ * Setter for page.
+ *
+ * @param page
+ * page number that will be used by data scroller
+ */
+ public void setPage(int page) {
+ this.page = page;
+ }
+
+ public Map<Object, Integer> getStateMap() {
+ return stateMap;
+ }
+
+ public void setStateMap(Map<Object, Integer> stateMap) {
+ this.stateMap = stateMap;
+ }
+
+ public DataComponentState getDataTableState() {
+ return dataTableState;
+ }
+
+ public void setDataTableState(DataComponentState dataTableState) {
+ this.dataTableState = dataTableState;
+ }
+
+ /**
+ * Getter for state.
+ *
+ * @return true if data should be displayed in table
+ */
+ public boolean isState() {
+ return state;
+ }
+
+ /**
+ * Setter for state.
+ *
+ * @param state
+ * true if data should be displayed in table
+ */
+ public void setState(boolean state) {
+ this.state = state;
+ }
+
+ public Filter<?> getFilterSexImpl() {
+ return new Filter<Employee>() {
+
+ public boolean accept(Employee e) {
+ String sex = (String) getFiltering().get("sex");
+ if (sex == null || sex.length() == 0 ||
sex.equalsIgnoreCase("all")
+ || sex.equalsIgnoreCase(e.getSex().toString())) {
+ return true;
+ }
+ return false;
+ }
+ };
+ }
+
+ public Map<String, String> getFacets() {
+ return facets;
+ }
+
+ public ColumnSortingMap getSorting() {
+ return sorting;
+ }
+
+ public Map<String, Object> getFiltering() {
+ return filtering;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichFileUploadBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichFileUploadBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichFileUploadBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIFileUpload;
+import org.richfaces.model.UploadedFile;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.richfaces.event.FileUploadEvent;
+
+/**
+ * Managed bean for rich:fileUpload.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richFileUploadBean")
+@ViewScoped
+public class RichFileUploadBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private List<UploadedFile> files;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+ files = new ArrayList<UploadedFile>();
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIFileUpload.class,
getClass());
+
+ attributes.setAttribute("addLabel", "Add ...");
+ attributes.setAttribute("clearAllLabel", "Clear All");
+ attributes.setAttribute("clearLabel", "Clear");
+ attributes.setAttribute("deleteLabel", "Delete");
+ attributes.setAttribute("noDuplicate", false);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("uploadLabel", "Upload");
+
+ // will be tested in another way
+ attributes.remove("validator");
+ attributes.remove("fileUploadListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<UploadedFile> getItems() {
+ return files;
+ }
+
+ public void listener(FileUploadEvent event) {
+ UploadedFile file = event.getUploadedFile();
+
+ if (file != null) {
+ files.add(file);
+ }
+ }
+
+ public String clearUploadedData() {
+ files.clear();
+ return null;
+ }
+
+ public boolean isRenderButton() {
+ return files.size() > 0;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichGraphValidatorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichGraphValidatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
+import javax.validation.constraints.AssertTrue;
+import javax.validation.constraints.Size;
+import javax.validation.groups.Default;
+
+import org.richfaces.component.UIGraphValidator;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.validation.groups.ValidationGroup1;
+import org.richfaces.tests.metamer.validation.groups.ValidationGroup2;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed Bean for rich:graphValidator
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@ManagedBean(name="richGraphValidatorBean")
+@ViewScoped
+public class RichGraphValidatorBean implements Serializable, Cloneable {
+
+ /** Generated UID */
+ private static final long serialVersionUID = -960575870621302059L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ @Size(min = 5, max = 15, message = "Wrong size for password")
+ private String password;
+ @Size(min = 5, max = 15, message = "Wrong size for password")
+ private String passwordConfirm;
+
+ @PostConstruct
+ public void init(){
+ logger = LoggerFactory.getLogger(getClass());
+ logger.info("initializing bean " + getClass().getName());
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIGraphValidator.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("type",
"org.richfaces.BeanValidator");
+ }
+
+ @AssertTrue(message = "Different passwords entered! [Default Group]")
+ public boolean isPasswordsEquals() {
+ return password.equals(passwordConfirm);
+ }
+
+ @AssertTrue(message = "Different passwords entered! [G1]",
groups={ValidationGroup1.class})
+ public boolean isRovnakeHesla() {
+ return password.equals(passwordConfirm);
+ }
+
+ @AssertTrue(message = "Different passwords entered! [G2 + Default Group]",
groups = {ValidationGroup2.class,Default.class})
+ public boolean isPokusUspesny() {
+ return password.equals(passwordConfirm);
+ }
+
+ public void storeNewPassword() {
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_INFO, "Succesfully
changed!", "Succesfully changed!"));
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getPasswordConfirm() {
+ return passwordConfirm;
+ }
+
+ public void setPasswordConfirm(String passwordConfirm) {
+ this.passwordConfirm = passwordConfirm;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichHashParamBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichHashParamBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichHashParamBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichHashParamBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIHashParameter;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:hashParam.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richHashParamBean")
+@ViewScoped
+public class RichHashParamBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIHashParameter.class, getClass());
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceInputBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceInputBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceInputBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import org.hibernate.validator.constraints.NotEmpty;
+
+import org.richfaces.component.UIInplaceInput;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inplaceInput.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richInplaceInputBean")
+@ViewScoped
+public class RichInplaceInputBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String value1;
+ private String value2;
+ private String value3;
+ private String value4;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIInplaceInput.class, getClass());
+
+ attributes.setAttribute("defaultLabel", "Click here to
edit");
+ attributes.setAttribute("editEvent", "click");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("requiredMessage", "value is
required");
+ attributes.setAttribute("saveOnBlur", true);
+ attributes.setAttribute("value", "RichFaces 4");
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("converterMessage");
+ attributes.remove("validator");
+ attributes.remove("validatorMessage");
+ attributes.remove("valueChangeListener");
+
+ // TODO remove as soon as RF-10411 is fixed
+ attributes.setAttribute("style", null);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ @NotEmpty
+ public String getValue1() {
+ return value1;
+ }
+
+ public void setValue1(String value1) {
+ this.value1 = value1;
+ }
+
+ @Pattern(regexp = "[a-z].*")
+ public String getValue2() {
+ return value2;
+ }
+
+ public void setValue2(String value2) {
+ this.value2 = value2;
+ }
+
+ @Size(min = 3, max = 6)
+ public String getValue3() {
+ return value3;
+ }
+
+ public void setValue3(String value3) {
+ this.value3 = value3;
+ }
+
+ public String getValue4() {
+ return value4;
+ }
+
+ public void setValue4(String value4) {
+ this.value4 = value4;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceSelectBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceSelectBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInplaceSelectBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import org.hibernate.validator.constraints.NotEmpty;
+
+import org.richfaces.component.UIInplaceSelect;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inplaceSelect.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richInplaceSelectBean")
+@ViewScoped
+public class RichInplaceSelectBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ // FIXME: @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals = Model.unmarshallCapitals();
+ private List<SelectItem> capitalsOptions = null;
+ private List<SelectItem> validationOptions = null;
+ private String value1;
+ private String value2;
+ private String value3;
+ private String value4;
+ private String value5;
+ private String requiredMessage = "value is required";
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ capitalsOptions = new ArrayList<SelectItem>();
+ validationOptions = new ArrayList<SelectItem>();
+ for (Capital capital : capitals) {
+ capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
+ validationOptions.add(new SelectItem(capital.getState(),
capital.getState()));
+ }
+ validationOptions.add(new SelectItem("@@", "@@"));
+ validationOptions.add(new SelectItem("", ""));
+ validationOptions.add(new SelectItem("RichFaces",
"RichFaces"));
+ validationOptions.add(new SelectItem("richfaces",
"richfaces"));
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIInplaceSelect.class, getClass());
+
+ attributes.setAttribute("defaultLabel", "Click here to
edit");
+ attributes.setAttribute("editEvent", "click");
+ attributes.setAttribute("listHeight", "200px");
+ attributes.setAttribute("listWidth", "200px");
+ attributes.setAttribute("openOnEdit", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("saveOnBlur", true);
+ attributes.setAttribute("saveOnSelect", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("converterMessage");
+ attributes.remove("required");
+ attributes.remove("requiredMessage");
+ attributes.remove("validator");
+ attributes.remove("validatorMessage");
+ attributes.remove("valueChangeListener");
+
+ // TODO remove as soon as RF-10411 is resolved
+ attributes.setAttribute("changedStateClass", null);
+ attributes.setAttribute("disabledStateClass", null);
+ attributes.setAttribute("editStateClass", null);
+ attributes.setAttribute("readyStateClass", null);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+
+ public List<SelectItem> getCapitalsOptions() {
+ return capitalsOptions;
+ }
+
+ public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
+ this.capitalsOptions = capitalsOptions;
+ }
+
+ public List<SelectItem> getValidationOptions() {
+ return validationOptions;
+ }
+
+ public void setValidationOptions(List<SelectItem> validationOptions) {
+ this.validationOptions = validationOptions;
+ }
+
+ @NotEmpty
+ public String getValue1() {
+ return value1;
+ }
+
+ public void setValue1(String value1) {
+ this.value1 = value1;
+ }
+
+ @Pattern(regexp = "[a-z].*")
+ public String getValue2() {
+ return value2;
+ }
+
+ public void setValue2(String value2) {
+ this.value2 = value2;
+ }
+
+ @Size(min = 3, max = 6)
+ public String getValue3() {
+ return value3;
+ }
+
+ public void setValue3(String value3) {
+ this.value3 = value3;
+ }
+
+ public String getValue4() {
+ return value4;
+ }
+
+ public void setValue4(String value4) {
+ this.value4 = value4;
+ }
+
+ public String getValue5() {
+ return value5;
+ }
+
+ public void setValue5(String value5) {
+ this.value5 = value5;
+ }
+
+ public String getRequiredMessage() {
+ return requiredMessage;
+ }
+
+ public void setRequiredMessage(String requiredMessage) {
+ this.requiredMessage = requiredMessage;
+ }
+
+ public void listener(ValueChangeEvent event) {
+ RichBean.logToPage("* value changed: " + event.getOldValue() + "
-> " + event.getNewValue());
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSliderBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSliderBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSliderBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSliderBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+import org.richfaces.component.html.HtmlInputNumberSlider;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inputNumberSlider.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richInputNumberSliderBean")
+@ViewScoped
+public class RichInputNumberSliderBean implements Serializable {
+
+ private static final long serialVersionUID = 595154649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int value1;
+ private int value2;
+ private int value3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(HtmlInputNumberSlider.class,
getClass());
+
+ attributes.setAttribute("enableManualInput", true);
+ attributes.setAttribute("inputSize", 3);
+ attributes.setAttribute("maxlength", 10);
+ attributes.setAttribute("maxValue", 10);
+ attributes.setAttribute("minValue", -10);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("requiredMessage", "value is
required");
+ attributes.setAttribute("showBoundaryValues", true);
+ attributes.setAttribute("showInput", true);
+ attributes.setAttribute("step", 1);
+ attributes.setAttribute("value", 2);
+
+ // will be tested in another way
+ attributes.remove("valueChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ @Min(2)
+ public int getValue1() {
+ return value1;
+ }
+
+ public void setValue1(int value1) {
+ this.value1 = value1;
+ }
+
+ @Max(2)
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+ public int getValue3() {
+ return value3;
+ }
+
+ public void setValue3(int value3) {
+ this.value3 = value3;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSpinnerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInputNumberSpinnerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSpinnerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichInputNumberSpinnerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+import org.richfaces.component.html.HtmlInputNumberSpinner;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:inputNumberSpinner.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richInputNumberSpinnerBean")
+@ViewScoped
+public class RichInputNumberSpinnerBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private int value1;
+ private int value2;
+ private int value3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(HtmlInputNumberSpinner.class,
getClass());
+
+ attributes.setAttribute("enableManualInput", true);
+ attributes.setAttribute("maxValue", 10);
+ attributes.setAttribute("minValue", -10);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("requiredMessage", "value is
required");
+ attributes.setAttribute("step", 1);
+ attributes.setAttribute("value", 2);
+
+ // will be tested in another way
+ attributes.remove("valueChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ @Min(2)
+ public int getValue1() {
+ return value1;
+ }
+
+ public void setValue1(int value1) {
+ this.value1 = value1;
+ }
+
+ @Max(2)
+ public int getValue2() {
+ return value2;
+ }
+
+ public void setValue2(int value2) {
+ this.value2 = value2;
+ }
+
+ public int getValue3() {
+ return value3;
+ }
+
+ public void setValue3(int value3) {
+ this.value3 = value3;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichJQueryBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichJQueryBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichJQueryBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichJQueryBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIJQuery;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:jQuery.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>,
Nick Belaevski
+ * @version $Revision$
+ */
+@ManagedBean(name = "richJQueryBean")
+@ViewScoped
+public class RichJQueryBean implements Serializable {
+
+ private static final long serialVersionUID = 111475400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private List<String> componentsDataList;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ componentsDataList = new ArrayList<String>();
+ addComponent();
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIJQuery.class,
getClass());
+
+ attributes.setAttribute("event", "click");
+ attributes.setAttribute("name", "bubu");
+ attributes.setAttribute("query", "alert('immediate
attachment')");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("selector", "#jQueryTestButton");
+ attributes.setAttribute("timing", "immediate");
+
+ // TODO must be tested in other way
+ attributes.remove("name");
+
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<String> getComponentsDataList() {
+ return componentsDataList;
+ }
+
+ public void addComponent() {
+ componentsDataList.add(UUID.randomUUID().toString());
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichListBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichListBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichListBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichListBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIList;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:list.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richListBean")
+@ViewScoped
+public class RichListBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIList.class,
getClass());
+
+ attributes.setAttribute("type", "ordered");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("rows", 20);
+
+ // TODO has to be tested in other way
+ attributes.remove("iterationStatusVar");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+ attributes.remove("value");
+ attributes.remove("var");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuGroupBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.UIMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:menuGroup.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMenuGroupBean")
+@ViewScoped
+public class RichMenuGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIMenuGroup.class,
getClass());
+
+ attributes.setAttribute("label", "Save As...");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuItemBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuItemBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuItemBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.UIMenuItem;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:menuItem.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMenuItemBean")
+@ViewScoped
+public class RichMenuItemBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIMenuItem.class,
getClass());
+
+ attributes.setAttribute("icon",
"/resources/images/icons/create_doc.gif");
+ attributes.setAttribute("label", "New");
+ attributes.setAttribute("mode", "ajax");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("action");
+ attributes.remove("actionListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuSeparatorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuSeparatorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuSeparatorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMenuSeparatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIMenuSeparator;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:menuSeparator.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean
+@ViewScoped
+public class RichMenuSeparatorBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIMenuSeparator.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessageBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessageBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIRichMessage;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple bean for rich:message component example.
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMessageBean")
+@ViewScoped
+public class RichMessageBean implements Serializable {
+
+ /** Generated UID */
+ private static final long serialVersionUID = -5058242586244822846L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String simpleInput1;
+ private String simpleInput2;
+
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.info("initializing bean " + getClass().getName());
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIRichMessage.class, getClass());
+
+ // setting up incorrect values to fire-up validator
+ simpleInput1 = "-5";
+ simpleInput2 = "-5";
+
+ // to get working this component example correctly is required that for
+ // property has been initialized
+ attributes.setAttribute("for", "simpleInput1");
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("showSummary", true);
+ attributes.setAttribute("ajaxRendered", true); // make sense for
a4j:commandButton submit
+
+ // workaround for missing attribute def from rich.taglib.xml
+ // to get it in list of attrs in metamer
+ attributes.setAttribute("dir", null); // direction
+ attributes.setAttribute("lang", null);
+ attributes.setAttribute("onclick", null);
+ attributes.setAttribute("ondblclick", null);
+ attributes.setAttribute("onkeydown", null);
+ attributes.setAttribute("onkeypress", null);
+ attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onmousedown", null);
+ attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmouseout", null);
+ attributes.setAttribute("onmouseover", null);
+ attributes.setAttribute("onmouseup", null);
+ attributes.setAttribute("style", null);
+ attributes.setAttribute("styleClass", null);
+ attributes.setAttribute("title", null);
+
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public String getSimpleInput2() {
+ return simpleInput2;
+ }
+
+ public void setSimpleInput2(String simpleInput2) {
+ this.simpleInput2 = simpleInput2;
+ }
+
+ public String getSimpleInput1() {
+ return simpleInput1;
+ }
+
+ public void setSimpleInput1(String simpleInput1) {
+ this.simpleInput1 = simpleInput1;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMessagesBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichMessagesBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.application.FacesMessage;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.UIRichMessages;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Simple bean for rich:messages component example.
+ *
+ * @author <a href="mailto:jjamrich@redhat.com">Jan Jamrich</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMessagesBean")
+@ViewScoped
+public class RichMessagesBean implements Serializable {
+
+ /** Generated UID */
+ private static final long serialVersionUID = 4893769498631480379L;
+ // id for input element to bound some FacesMessage to it
+ private static final String INPUT1_ID = "form:simpleInput1";
+ private static final String INPUT2_ID = "form:simpleInput2";
+
+ private static Logger logger;
+ private Attributes attributes;
+
+ private String simpleInput1;
+ private String simpleInput2;
+
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.info("initializing bean " + getClass().getName());
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIRichMessages.class, getClass());
+
+ simpleInput1 = "10";
+ simpleInput2 = "10";
+
+ attributes.setAttribute("ajaxRendered", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("for", "simpleInput1");
+ attributes.setAttribute("showSummary", true);
+
+ // add attributes with missing appropriate annotation
+ attributes.setAttribute("lang", null);
+ attributes.setAttribute("dir", null);
+ attributes.setAttribute("style", null);
+ attributes.setAttribute("styleClass", null);
+ attributes.setAttribute("title", null);
+
+ attributes.setAttribute("onclick", null);
+ attributes.setAttribute("ondblclick", null);
+ attributes.setAttribute("onkeydown", null);
+ attributes.setAttribute("onkeypress", null);
+ attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onmousedown", null);
+ attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmouseup", null);
+ attributes.setAttribute("onmouseout", null);
+ attributes.setAttribute("onmouseover", null);
+
+ }
+
+ public void generateFacesError(ActionEvent event) {
+
+ logger.info(" ### Just called generateFacesError()");
+
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ "Generated error message without binding to any component
(global)",
+ "Generated error message without binding to any component
(global)"));
+
+ FacesContext.getCurrentInstance().addMessage(null,
+ new FacesMessage(FacesMessage.SEVERITY_WARN,
+ "Generated warning message without binding to any component
(global)",
+ "Generated warning message without binding to any component
(global)"));
+
+ // Message bound to component on page
+ FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message
for Input 1",
+ "Generated error message for Input 1"));
+
+ FacesContext.getCurrentInstance().addMessage(INPUT1_ID,
+ new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message
for Input 1",
+ "Generated warning message for Input 1"));
+
+ FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
+ new FacesMessage(FacesMessage.SEVERITY_ERROR, "Generated error message
for Input 2",
+ "Generated error message for Input 2"));
+
+ FacesContext.getCurrentInstance().addMessage(INPUT2_ID,
+ new FacesMessage(FacesMessage.SEVERITY_WARN, "Generated warning message
for Input 2",
+ "Generated warning message for Input 2"));
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getSimpleInput1() {
+ return simpleInput1;
+ }
+
+ public void setSimpleInput1(String simpleInput1) {
+ this.simpleInput1 = simpleInput1;
+ }
+
+ public String getSimpleInput2() {
+ return simpleInput2;
+ }
+
+ public void setSimpleInput2(String simpleInput2) {
+ this.simpleInput2 = simpleInput2;
+ }
+
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIPanel;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelBean")
+@ViewScoped
+public class RichPanelBean implements Serializable {
+
+ private static final long serialVersionUID = 48122475400649801L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanel.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ // FIXME these attributes were not found automatically
+ attributes.setAttribute("bodyClass", null);
+ attributes.setAttribute("header", null);
+ attributes.setAttribute("headerClass", null);
+ attributes.setAttribute("onclick", null);
+ attributes.setAttribute("ondblclick", null);
+ attributes.setAttribute("onkeydown", null);
+ attributes.setAttribute("onkeypress", null);
+ attributes.setAttribute("onkeyup", null);
+ attributes.setAttribute("onmousedown", null);
+ attributes.setAttribute("onmousemove", null);
+ attributes.setAttribute("onmouseout", null);
+ attributes.setAttribute("onmouseover", null);
+ attributes.setAttribute("onmouseup", null);
+ attributes.setAttribute("style", null);
+ attributes.setAttribute("styleClass", null);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panelMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelMenuBean")
+@ViewScoped
+public class RichPanelMenuBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ private String activeItem;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPanelMenu.class,
getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("style", "width: 200px;");
+
+ // will be tested in another way
+ attributes.remove("itemChangeListener");
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ /**
+ * An item change listener that logs to the page old and new value.
+ *
+ * @param event
+ * an event representing the activation of a user interface component
+ */
+ public void itemChangeListener(ItemChangeEvent event) {
+ activeItem = event.getNewItemName();
+ RichBean.logToPage("* item changed: " + (event.getOldItem() == null ?
null : event.getOldItem().getId())
+ + " -> " + event.getNewItem().getId());
+ }
+
+ public String getActiveItem() {
+ return activeItem;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuGroupBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIPanelMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panelMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelMenuGroupBean")
+@ViewScoped
+public class RichPanelMenuGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private Map<String, Boolean> expanded = new HashMap<String, Boolean>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuGroup.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("selectable", true);
+ attributes.setAttribute("mode", "ajax");
+
+ // already defined in source directly
+ attributes.remove("name");
+ attributes.remove("label");
+ attributes.remove("changeExpandListener");
+ attributes.remove("action");
+ attributes.remove("actionListener");
+
+ // expanded needs to be set separately
+ attributes.remove("expanded");
+ expanded.put("group2", true);
+ expanded.put("group23", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public Map<String, Boolean> getExpanded() {
+ return expanded;
+ }
+
+ public void changeExpandListener(Object event) {
+ RichBean.logToPage("* group expanded");
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuItemBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuItemBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPanelMenuItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIPanelMenuItem;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panelMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelMenuItemBean")
+@ViewScoped
+public class RichPanelMenuItemBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuItem.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("selectable", true);
+
+ // already defined in source directly
+ attributes.remove("action");
+ attributes.remove("actionListener");
+ attributes.remove("name");
+ attributes.remove("label");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPopupPanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPopupPanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPopupPanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichPopupPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIPopupPanel;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:popupPanel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPopupPanelBean")
+@ViewScoped
+public class RichPopupPanelBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String value1;
+ private String value2;
+ private String value3;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIPopupPanel.class,
getClass());
+
+ attributes.setAttribute("header", "popup panel header");
+ attributes.setAttribute("height", 300);
+ attributes.setAttribute("left", "auto");
+ attributes.setAttribute("maxHeight", 500);
+ attributes.setAttribute("maxWidth", 500);
+ attributes.setAttribute("minHeight", 300);
+ attributes.setAttribute("minWidth", 300);
+ attributes.setAttribute("moveable", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("resizeable", true);
+ attributes.setAttribute("top", "auto");
+ attributes.setAttribute("trimOverlayedElements", true);
+ attributes.setAttribute("width", 500);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getValue1() {
+ return value1;
+ }
+
+ public void setValue1(String value1) {
+ this.value1 = value1;
+ }
+
+ public String getValue2() {
+ return value2;
+ }
+
+ public void setValue2(String value2) {
+ this.value2 = value2;
+ }
+
+ public String getValue3() {
+ return value3;
+ }
+
+ public void setValue3(String value3) {
+ this.value3 = value3;
+ }
+
+ public String save() {
+ logger.warn("1: " + value1);
+ logger.warn("2: " + value2);
+ logger.warn("3: " + value3);
+ return null;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichProgressBarBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichProgressBarBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichProgressBarBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichProgressBarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIProgressBar;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:progressBar.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richProgressBarBean")
+@ViewScoped
+public class RichProgressBarBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private boolean buttonRendered = true;
+ private Long startTime;
+ private boolean initialFacetRendered = true;
+ private boolean finishFacetRendered = true;
+ private boolean childrenRendered = false;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIProgressBar.class, getClass());
+
+ attributes.setAttribute("maxValue", 100);
+ attributes.setAttribute("minValue", 0);
+ attributes.setAttribute("interval", 500);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("value", -1);
+
+ // attributes tested in another way
+ attributes.remove("mode");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String startProcess() {
+ attributes.setAttribute("enabled", true);
+ buttonRendered = false;
+ setStartTime(new Date().getTime());
+ return null;
+ }
+
+ public Long getCurrentValue() {
+ if (Boolean.TRUE.equals(attributes.get("enabled").getValue())) {
+ Long current = (new Date().getTime() - startTime) / 500;
+ if (current >= 100) {
+ buttonRendered = true;
+ } else if (current.equals(0L)) {
+ return 1L;
+ }
+ return (new Date().getTime() - startTime) / 500;
+ }
+ if (startTime == null) {
+ return -1L;
+ } else {
+ return 101L;
+ }
+ }
+
+ public Long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Long startTime) {
+ this.startTime = startTime;
+ }
+
+ public boolean isButtonRendered() {
+ return buttonRendered;
+ }
+
+ public void setButtonRendered(boolean buttonRendered) {
+ this.buttonRendered = buttonRendered;
+ }
+
+ public boolean isFinishFacetRendered() {
+ return finishFacetRendered;
+ }
+
+ public void setFinishFacetRendered(boolean finishFacetRendered) {
+ this.finishFacetRendered = finishFacetRendered;
+ }
+
+ public boolean isInitialFacetRendered() {
+ return initialFacetRendered;
+ }
+
+ public void setInitialFacetRendered(boolean initialFacetRendered) {
+ this.initialFacetRendered = initialFacetRendered;
+ }
+
+ public boolean isChildrenRendered() {
+ return childrenRendered;
+ }
+
+ public void setChildrenRendered(boolean childrenRendered) {
+ this.childrenRendered = childrenRendered;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichSelectBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichSelectBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichSelectBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import org.hibernate.validator.constraints.NotEmpty;
+
+import org.richfaces.component.UISelect;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.bean.RichBean;
+import org.richfaces.tests.metamer.model.Capital;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:select.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richSelectBean")
+@ViewScoped
+public class RichSelectBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+// temporary fix because of a bug in MyFaces
+// @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals;
+ private List<SelectItem> capitalsOptions = null;
+ private List<SelectItem> validationOptions = null;
+ private String value1;
+ private String value2;
+ private String value3;
+ private String value4;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ capitalsOptions = new ArrayList<SelectItem>();
+ validationOptions = new ArrayList<SelectItem>();
+// temporary fix because of a bug in MyFaces
+// for (Capital capital : capitals) {
+ for (Capital capital : Model.unmarshallCapitals()) {
+ capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
+ validationOptions.add(new SelectItem(capital.getState(),
capital.getState()));
+ }
+ validationOptions.add(new SelectItem("@@", "@@"));
+ validationOptions.add(new SelectItem("", ""));
+ validationOptions.add(new SelectItem("RichFaces",
"RichFaces"));
+ validationOptions.add(new SelectItem("richfaces",
"richfaces"));
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UISelect.class,
getClass());
+
+ attributes.setAttribute("defaultLabel", "Click here to
edit");
+ attributes.setAttribute("enableManualInput", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("showButton", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("converterMessage");
+ attributes.remove("required");
+ attributes.remove("requiredMessage");
+ attributes.remove("validator");
+ attributes.remove("validatorMessage");
+
+ attributes.remove("valueChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void setCapitals(List<Capital> capitals) {
+ this.capitals = capitals;
+ }
+
+ public List<SelectItem> getCapitalsOptions() {
+ return capitalsOptions;
+ }
+
+ public void setCapitalsOptions(List<SelectItem> capitalsOptions) {
+ this.capitalsOptions = capitalsOptions;
+ }
+
+ public List<SelectItem> getValidationOptions() {
+ return validationOptions;
+ }
+
+ public void setValidationOptions(List<SelectItem> validationOptions) {
+ this.validationOptions = validationOptions;
+ }
+
+ @NotEmpty
+ public String getValue1() {
+ return value1;
+ }
+
+ public void setValue1(String value1) {
+ this.value1 = value1;
+ }
+
+ @Pattern(regexp = "[a-z].*")
+ public String getValue2() {
+ return value2;
+ }
+
+ public void setValue2(String value2) {
+ this.value2 = value2;
+ }
+
+ @Size(min = 3, max = 6)
+ public String getValue3() {
+ return value3;
+ }
+
+ public void setValue3(String value3) {
+ this.value3 = value3;
+ }
+
+ public String getValue4() {
+ return value4;
+ }
+
+ public void setValue4(String value4) {
+ this.value4 = value4;
+ }
+
+ public void listener(ValueChangeEvent event) {
+ RichBean.logToPage("* value changed: " + event.getOldValue() + "
-> " + event.getNewValue());
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITab;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:tab.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTabBean")
+@ViewScoped
+public class RichTabBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UITab.class,
getClass());
+
+ attributes.setAttribute("header", "tab1 header");
+ attributes.setAttribute("name", "tab1");
+ attributes.setAttribute("rendered", true);
+
+ // will be tested in another way
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTabPanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTabPanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import org.richfaces.component.UITabPanel;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import java.io.Serializable;
+
+/**
+ * Managed bean for rich:tabPanel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTabPanelBean")
+@ViewScoped
+public class RichTabPanelBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UITabPanel.class,
getClass());
+
+ attributes.setAttribute("activeItem", "tab1");
+ attributes.setAttribute("rendered", true);
+
+ // will be tested in another way
+ attributes.remove("converter");
+ attributes.remove("itemChangeListener");
+
+ // remove as soon as
https://issues.jboss.org/browse/RF-10588 is fixed
+ attributes.setAttribute("bypassUpdates", null);
+ attributes.get("bypassUpdates").setType(Boolean.class);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToggleControlBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToggleControlBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToggleControlBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToggleControlBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.behavior.ToggleControl;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:toggleControl.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richToggleControlBean")
+@ViewScoped
+public class RichToggleControlBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getBehaviorAttributesFromFacesConfig(ToggleControl.class,
getClass());
+
+ attributes.setAttribute("targetPanel", "panel1");
+ attributes.setAttribute("targetItem", "item1");
+
+ // TODO following attributes have to be tested in another way
+ attributes.remove("disableDefault");
+ attributes.remove("event"); // has to be literal
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITogglePanel;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:togglePanel.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTogglePanelBean")
+@ViewScoped
+public class RichTogglePanelBean implements Serializable {
+
+ private static final long serialVersionUID = 67812341568562249L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UITogglePanel.class, getClass());
+
+ attributes.setAttribute("activeItem", "item1");
+ attributes.setAttribute("rendered", true);
+
+ // will to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("itemChangeListener");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelItemBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTogglePanelItemBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelItemBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTogglePanelItemBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITogglePanelItem;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:togglePanelItem.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTogglePanelItemBean")
+@ViewScoped
+public class RichTogglePanelItemBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UITogglePanelItem.class, getClass());
+
+ attributes.setAttribute("name", "item1");
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIToolbar;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:toolbar.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richToolbarBean")
+@ViewScoped
+public class RichToolbarBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UIToolbar.class,
getClass());
+
+ attributes.setAttribute("height", 28);
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarGroupBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichToolbarGroupBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarGroupBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichToolbarGroupBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UIToolbarGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:toolbar.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richToolbarGroupBean")
+@ViewScoped
+public class RichToolbarGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UIToolbarGroup.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTooltipBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITooltip;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:list.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTooltipBean")
+@ViewScoped
+public class RichTooltipBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Logger logger;
+ private Attributes attributes;
+
+ private int counter = 0;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UITooltip.class,
getClass());
+
+
+ // set defaults
+ attributes.setAttribute("attached", true);
+ attributes.setAttribute("rendered", true);
+ attributes.setAttribute("followMouse", true);
+ attributes.setAttribute("layout", "inline");
+ attributes.setAttribute("mode", "client");
+ attributes.setAttribute("showEvent", "mouseenter");
+ attributes.setAttribute("hideEvent", "mouseleave");
+ attributes.setAttribute("target", "form:panel");
+
+ // attributes that needs to be tested in other way
+ attributes.remove("converter");
+
+ // intentionally hidden attributes
+ attributes.remove("localValue");
+ attributes.remove("value");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public int getCounter() {
+ return counter++;
+ }
+
+ public Date getTooltipDate() {
+ return new Date();
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.event.ComponentSystemEvent;
+
+import org.richfaces.component.UITree;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.bean.Model;
+import org.richfaces.tests.metamer.model.tree.CompactDisc;
+import org.richfaces.tests.metamer.model.tree.CompactDiscXmlDescriptor;
+import org.richfaces.tests.metamer.model.tree.Company;
+import org.richfaces.tests.metamer.model.tree.Country;
+import org.richfaces.tests.metamer.model.tree.NamedNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeBean")
+@ViewScoped
+public class RichTreeBean implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private static Logger logger;
+ private Attributes attributes;
+ private List<NamedNode> root = new ArrayList<NamedNode>();
+ private Collection<? extends Serializable> selection;
+
+ // FIXME: @ManagedProperty(value = "#{model}")
+ // private Model model;
+
+ private Map<String, Country> countriesCache = new HashMap<String,
Country>();
+ private Map<String, Company> companiesCache = new HashMap<String,
Company>();
+
+ private boolean testLoadingFacet = false;
+ private boolean delayedRender = false;
+
+ private Map<NamedNode, Boolean> expanded = new HashMap<NamedNode,
Boolean>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromFacesConfig(UITree.class,
getClass());
+ attributes.get("rendered").setValue(true);
+ attributes.get("toggleType").setValue("ajax");
+ attributes.get("selectionType").setValue("ajax");
+
+ // attributes which needs to be tested another way
+ attributes.remove("selectionChangeListener");
+ attributes.remove("toggleListener");
+ attributes.remove("value");
+ attributes.remove("var");
+ attributes.remove("rowKeyVar");
+ attributes.remove("stateVar");
+ attributes.remove("nodeType");
+
+ for (CompactDiscXmlDescriptor descriptor : Model.unmarshallCompactDiscs()) {
+ createCompactDisc(descriptor);
+ }
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ private CompactDisc createCompactDisc(CompactDiscXmlDescriptor descriptor) {
+ final Company company = findOrCreateCompany(descriptor);
+
+ CompactDisc cd = new CompactDisc(descriptor.getTitle(), descriptor.getArtist(),
company, descriptor.getPrice(),
+ descriptor.getYear());
+ company.getCds().add(cd);
+ expanded.put(cd, false);
+ return cd;
+ }
+
+ private Company findOrCreateCompany(CompactDiscXmlDescriptor descriptor) {
+ final Country country = findOrCreateCountry(descriptor);
+
+ String companyName = descriptor.getCompany();
+ Company company = companiesCache.get(companyName);
+ if (company == null) {
+ company = new Company();
+ company.setName(companyName);
+ company.setParent(country);
+ country.getCompanies().add(company);
+ companiesCache.put(companyName, company);
+ expanded.put(company, false);
+ }
+ return company;
+ }
+
+ private Country findOrCreateCountry(CompactDiscXmlDescriptor descriptor) {
+ String countryName = descriptor.getCountry();
+ Country country = countriesCache.get(countryName);
+ if (country == null) {
+ country = new Country();
+ country.setName(countryName);
+ countriesCache.put(countryName, country);
+ expanded.put(country, false);
+ root.add(country);
+ }
+ return country;
+ }
+
+ public List<NamedNode> getRoot() {
+
+ return root;
+ }
+
+ public Collection<? extends Serializable> getSelection() {
+ return selection;
+ }
+
+ public void setSelection(Collection<? extends Serializable> selection) {
+ this.selection = selection;
+ }
+
+ public boolean isTestLoadingFacet() {
+ return testLoadingFacet;
+ }
+
+ public void setTestLoadingFacet(boolean testLoadingFacet) {
+ this.testLoadingFacet = testLoadingFacet;
+ }
+
+ public boolean isDelayedRender() {
+ return delayedRender;
+ }
+
+ public void setDelayedRender(boolean delayedRender) {
+ this.delayedRender = delayedRender;
+ }
+
+ public void preRenderView(ComponentSystemEvent event) {
+ if (delayedRender) {
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ public Map<NamedNode, Boolean> getExpanded() {
+ return expanded;
+ }
+
+ public void expandAll() {
+ for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
+ entry.setValue(true);
+ }
+ }
+
+ public void collapseAll() {
+ for (Entry<NamedNode, Boolean> entry : expanded.entrySet()) {
+ entry.setValue(false);
+ }
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeListenerBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeListenerBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeListenerBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.event.TreeSelectionChangeEvent;
+import org.richfaces.event.TreeToggleEvent;
+import org.richfaces.tests.metamer.bean.RichBean;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeListenerBean")
+@RequestScoped
+public class RichTreeListenerBean {
+
+ private TreeSelectionChangeEvent treeSelectionChangeEvent;
+ private TreeToggleEvent treeToggleEvent;
+
+ public void processSelectionChange(TreeSelectionChangeEvent event) {
+ this.treeSelectionChangeEvent = event;
+ RichBean.logToPage("* selection change listener invoked");
+ }
+
+ public void processToggle(TreeToggleEvent event) {
+ this.treeToggleEvent = event;
+ RichBean.logToPage("* tree toggle listener invoked");
+ }
+
+ public TreeSelectionChangeEvent getTreeSelectionChangeEvent() {
+ return treeSelectionChangeEvent;
+ }
+
+ public TreeToggleEvent getTreeToggleEvent() {
+ return treeToggleEvent;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelAdaptorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelAdaptorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelAdaptorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITreeModelAdaptor;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeModelAdaptorBean")
+@ViewScoped
+public class RichTreeModelAdaptorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UITreeModelAdaptor.class, getClass());
+ attributes.setAttribute("rendered", true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelRecursiveAdaptorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelRecursiveAdaptorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeModelRecursiveAdaptorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.annotation.PostConstruct;
+import javax.el.ELContext;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.UITreeModelRecursiveAdaptor;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNode;
+import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNodeImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeModelRecursiveAdaptorBean")
+@ViewScoped
+public class RichTreeModelRecursiveAdaptorBean implements Serializable {
+
+
+ private static final long serialVersionUID = 1L;
+ private static Logger logger;
+ private static List<RecursiveNode> rootNodes;
+
+ private Attributes attributes;
+ private AtomicReference<Boolean> leafChildrenNullable = new
AtomicReference<Boolean>(true);
+ private boolean useMapModel;
+ private Map<String, Boolean> expanded = new TreeMap<String, Boolean>();
+ private boolean rootNodesInitialized = false;
+
+ /*
+ * Nodes which was loaded lazily in the current request
+ */
+ private Set<String> lazyInitializedNodes = new LinkedHashSet<String>();
+
+ public Set<String> getLazyInitializedNodes() {
+ return lazyInitializedNodes;
+ }
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getComponentAttributesFromFacesConfig(UITreeModelRecursiveAdaptor.class,
getClass());
+
+ attributes.get("rendered").setValue(true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<RecursiveNode> getRootNodes() {
+ if (!rootNodesInitialized) {
+ rootNodes = RecursiveNodeImpl.createChildren(true, "", 1, false);
+ }
+ return rootNodes;
+ }
+
+ public boolean isLeafChildrenNullable() {
+ return leafChildrenNullable.get();
+ }
+
+ public void setLeafChildrenNullable(boolean leafChildrenNullable) {
+ this.leafChildrenNullable.set(leafChildrenNullable);
+ }
+
+ public boolean isUseMapModel() {
+ return useMapModel;
+ }
+
+ public void setUseMapModel(boolean useMapModel) {
+ this.useMapModel = useMapModel;
+ }
+
+ public Map<String, Boolean> getExpanded() {
+ return expanded;
+ }
+
+ public static List<RecursiveNode> getRootNodesStatically() {
+ return rootNodes;
+ }
+
+ public static RichTreeModelRecursiveAdaptorBean getFacesContext() {
+ ELContext elContext = FacesContext.getCurrentInstance().getELContext();
+ return (RichTreeModelRecursiveAdaptorBean)
elContext.getELResolver().getValue(elContext, null,
"richTreeModelRecursiveAdaptorBean");
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeNodeBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeNodeBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichTreeNodeBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITreeNode;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeNodeBean")
+@ViewScoped
+public class RichTreeNodeBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes[] attributes = new Attributes[3];
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i] =
Attributes.getComponentAttributesFromFacesConfig(UITreeNode.class, getClass());
+ attributes[i].get("rendered").setValue(true);
+
+ // attributes which needs to be tested another way
+ attributes[i].remove("type");
+ attributes[i].remove("expanded");
+ }
+ }
+
+ public Attributes[] getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes[] attributes) {
+ this.attributes = attributes;
+ }
+}
Copied:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java
(from rev 22459,
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichValidatorBean.java)
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/rich/RichValidatorBean.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.tests.metamer.bean.rich;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.behavior.ClientValidatorImpl;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:validator.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richValidatorBean")
+@ViewScoped
+public class RichValidatorBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ private String stringValue = "RichFaces";
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes =
Attributes.getBehaviorAttributesFromFacesConfig(ClientValidatorImpl.class, getClass());
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public String getStringValue() {
+ return stringValue;
+ }
+
+ public void setStringValue(String stringValue) {
+ this.stringValue = stringValue;
+ }
+}
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/listener/TopicsInitializer.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -30,7 +30,6 @@
import javax.faces.event.SystemEventListener;
import javax.servlet.http.HttpServletRequest;
-import org.richfaces.application.push.EventAbortedException;
import org.richfaces.application.push.Session;
import org.richfaces.application.push.SessionPreSubscriptionEvent;
import org.richfaces.application.push.SessionSubscriptionEvent;
@@ -67,7 +66,7 @@
topic.addTopicListener(new SessionTopicListener() {
- public void processUnsubscriptionEvent(SessionUnsubscriptionEvent event)
throws EventAbortedException {
+ public void processUnsubscriptionEvent(SessionUnsubscriptionEvent event) {
logger.info("unsubscibe from JMS topic");
TopicKey topicKey = event.getTopicKey();
Session session = event.getSession();
@@ -75,7 +74,7 @@
topicKey.getTopicAddress()));
}
- public void processSubscriptionEvent(SessionSubscriptionEvent event) throws
EventAbortedException {
+ public void processSubscriptionEvent(SessionSubscriptionEvent event) {
logger.info("subscibe to JMS topic");
TopicKey topicKey = event.getTopicKey();
Session session = event.getSession();
@@ -87,7 +86,7 @@
topicKey.getTopicAddress(), hsr.getRemoteAddr()));
}
- public void processPreSubscriptionEvent(SessionPreSubscriptionEvent event)
throws EventAbortedException {
+ public void processPreSubscriptionEvent(SessionPreSubscriptionEvent event) {
logger.info("presubscription to JMS topic");
ExternalContext externalContext =
FacesContext.getCurrentInstance().getExternalContext();
}
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/AbstractNode.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/AbstractNode.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/AbstractNode.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+import org.richfaces.tests.metamer.bean.rich.RichTreeModelRecursiveAdaptorBean;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/KeyConverter.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -29,7 +29,7 @@
import javax.faces.convert.FacesConverter;
import org.apache.commons.lang.CharUtils;
-import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+import org.richfaces.tests.metamer.bean.rich.RichTreeModelRecursiveAdaptorBean;
import com.google.common.base.Strings;
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNodeImpl.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNodeImpl.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNodeImpl.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -30,7 +30,7 @@
import java.util.Map;
import java.util.Set;
-import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+import org.richfaces.tests.metamer.bean.rich.RichTreeModelRecursiveAdaptorBean;
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
Modified:
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java
===================================================================
---
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/application/src/test/java/org/richfaces/tests/metamer/TestRichTreeModelRecursiveAdaptorBeanSerialization.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -38,7 +38,7 @@
import java.util.Set;
import java.util.TreeSet;
-import org.richfaces.tests.metamer.bean.RichTreeModelRecursiveAdaptorBean;
+import org.richfaces.tests.metamer.bean.rich.RichTreeModelRecursiveAdaptorBean;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/AbstractColumnSortingTest.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -27,7 +27,7 @@
import org.jboss.test.selenium.request.RequestType;
import org.richfaces.component.SortOrder;
-import org.richfaces.tests.metamer.bean.RichColumnBean;
+import org.richfaces.tests.metamer.bean.rich.RichColumnBean;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
import org.richfaces.tests.metamer.ftest.annotations.Use;
import org.richfaces.tests.metamer.model.Capital;
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java
===================================================================
---
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java 2011-05-01
20:52:05 UTC (rev 22459)
+++
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richColumn/TestColumnFiltering.java 2011-05-03
11:12:59 UTC (rev 22460)
@@ -31,7 +31,7 @@
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.tests.metamer.bean.RichColumnBean;
+import org.richfaces.tests.metamer.bean.rich.RichColumnBean;
import org.richfaces.tests.metamer.model.Capital;
import org.testng.annotations.Test;
@@ -43,14 +43,13 @@
* @version $Revision$
*/
public class TestColumnFiltering extends AbstractColumnModelTest {
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath,
"faces/components/richColumn/filtering.xhtml");
}
-
JQueryLocator stateNameToFilter =
pjq("input:text[id$=stateNameToFilter]");
private final static String stateName = "Maryland";
-
JQueryLocator tableWithFilter = pjq("table.rf-dt[id$=richDataTable1]");
JQueryLocator tableWithFilterExpression =
pjq("table.rf-dt[id$=richDataTable2]");
@@ -77,17 +76,16 @@
richColumnBean.setStateNameToFilter(namePart);
Collection<Capital> expectedCapitals = Collections2.filter(capitals,
new Predicate<Capital>() {
+
@Override
public boolean apply(Capital capital) {
return richColumnBean.getStateNameFilter().accept(capital);
}
-
});
assertEqualsCapitals(actualCapitals, expectedCapitals);
}
}
-
RichColumnBean richColumnBean = new RichColumnBean();
private void assertEqualsCapitals(Collection<Capital> actualCapitals,
Collection<Capital> expectedCapitals) {