JBoss Rich Faces SVN: r19914 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-03 11:01:37 -0400 (Wed, 03 Nov 2010)
New Revision: 19914
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
Log:
https://jira.jboss.org/browse/RF-9246
* added 1 page for rich:select
* added rich:select to h:dataTable, rich:dataTable, rich:extendedDataTable and rich:subTable
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 14:27:36 UTC (rev 19913)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 15:01:37 UTC (rev 19914)
@@ -133,6 +133,7 @@
components.put("richPanel", "Rich Panel");
components.put("richPopupPanel", "Rich Popup Panel");
components.put("richProgressBar", "Rich Progress Bar");
+ components.put("richSelect", "Rich Select");
components.put("richSubTable", "Rich Subtable");
components.put("richSubTableToggleControl", "Rich Subtable Toggle Control");
components.put("richTab", "Rich Tab");
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java 2010-11-03 15:01:37 UTC (rev 19914)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.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.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+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")
+@SessionScoped
+public class RichSelectBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals;
+ private List<SelectItem> capitalsOptions = null;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ capitalsOptions = new ArrayList<SelectItem>();
+ for (Capital capital : capitals) {
+ capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
+ }
+
+ attributes = Attributes.getUIComponentAttributes(UISelect.class, getClass(), false);
+
+ attributes.setAttribute("defaultLabel", "Click here to edit");
+ attributes.setAttribute("rendered", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("validator");
+
+ 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 void listener(ValueChangeEvent event) {
+ RichBean.logToPage("* value changed: " + event.getOldValue() + " -> " + event.getNewValue());
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichSelectBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components1.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -128,10 +128,14 @@
<f:facet name="header">
<h:outputText id="columnHeaderTitle" value="Title" />
<br/>
- <h:outputText id="columnHeaderTitleComponent" value="rich:inplaceSelect" />
+ <h:outputText id="columnHeaderTitleComponent" value="rich:select" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:select id="title" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change" render="@this"/>
+ </rich:select>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle" value="Title" />
</f:facet>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components1.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -106,7 +106,7 @@
<h:outputText id="columnHeaderNameComponent" value="h:outputText" />
</f:facet>
- <h:outputText value="#{record.name}" />
+ <h:outputText id="name" value="#{record.name}" />
<f:facet name="footer">
<h:outputText id="columnFooterState" value="Name" />
</f:facet>
@@ -116,10 +116,14 @@
<f:facet name="header">
<h:outputText id="columnHeaderTitle" value="Title" />
<br/>
- <h:outputText id="columnHeaderTitleComponent" value="rich:inplaceSelect" />
+ <h:outputText id="columnHeaderTitleComponent" value="rich:select" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:select id="title" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change" render="@this"/>
+ </rich:select>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle" value="Title" />
</f:facet>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components1.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -58,6 +58,11 @@
width: 150px !important;
}
+ .rf-edt-c-columnTitle {
+ width: 210px !important;
+ text-align: center;
+ }
+
.rf-edt-c-columnSmoker {
text-align: center;
width: 150px !important;
@@ -69,7 +74,13 @@
.rf-edt-c-columnNumberOfKids {
width: 150px !important;
+ text-align: center;
+ vertical-align: middle;
}
+
+ .rf-sel-fld {
+ width: 180px !important;
+ }
</style>
</ui:define>
@@ -150,12 +161,29 @@
<h:outputText id="columnHeaderNameComponent" value="h:outputText" />
</f:facet>
- <h:outputText value="#{record.name}" />
+ <h:outputText id="name" value="#{record.name}" />
<f:facet name="footer">
<h:outputText id="columnFooterState" value="Name" />
</f:facet>
</rich:column>
+ <rich:column id="columnTitle" sortBy="#{record.title}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderTitle" value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleComponent" value="rich:select" />
+ </f:facet>
+
+ <rich:select id="title" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change" render="@this"/>
+ </rich:select>
+
+ <f:facet name="footer">
+ <h:outputText id="columnFooterTitle" value="Title" />
+ </f:facet>
+ </rich:column>
+
<rich:column id="columnSmoker" sortBy="#{record.smoker}">
<f:facet name="header">
<h:outputText id="columnHeaderSmoker" value="Smoker" />
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Select</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ Simple page that contains <b>rich:select</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/simple.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:select id="inplaceSelect"
+ converterMessage="#{richSelectBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richSelectBean.attributes['defaultLabel'].value}"
+ enableManualInput="#{richSelectBean.attributes['editManualInput'].value}"
+ immediate="#{richSelectBean.attributes['immediate'].value}"
+ itemClass="#{richSelectBean.attributes['itemClass'].value}"
+ listClass="#{richSelectBean.attributes['listClass'].value}"
+ listHeight="#{richSelectBean.attributes['listHeight'].value}"
+ listWidth="#{richSelectBean.attributes['listWidth'].value}"
+ onblur="#{richSelectBean.attributes['onblur'].value}"
+ onchange="#{richSelectBean.attributes['onchange'].value}"
+ onclick="#{richSelectBean.attributes['onclick'].value}"
+ ondblclick="#{richSelectBean.attributes['ondblclick'].value}"
+ onfocus="#{richSelectBean.attributes['onfocus'].value}"
+ onkeydown="#{richSelectBean.attributes['onkeydown'].value}"
+ onkeypress="#{richSelectBean.attributes['onkeypress'].value}"
+ onkeyup="#{richSelectBean.attributes['onkeyup'].value}"
+ onlistclick="#{richSelectBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richSelectBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richSelectBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richSelectBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richSelectBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richSelectBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richSelectBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richSelectBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richSelectBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richSelectBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richSelectBean.attributes['onmousedown'].value}"
+ onmousemove="#{richSelectBean.attributes['onmousemove'].value}"
+ onmouseout="#{richSelectBean.attributes['onmouseout'].value}"
+ onmouseover="#{richSelectBean.attributes['onmouseover'].value}"
+ onmouseup="#{richSelectBean.attributes['onmouseup'].value}"
+ onselect="#{richSelectBean.attributes['onselect'].value}"
+ rendered="#{richSelectBean.attributes['rendered'].value}"
+ required="#{richSelectBean.attributes['required'].value}"
+ requiredMessage="#{richSelectBean.attributes['requiredMessage'].value}"
+ selectFirst="#{richSelectBean.attributes['selectFirst'].value}"
+ selectItemClass="#{richSelectBean.attributes['selectItemClass'].value}"
+ showButton="#{richSelectBean.attributes['showButton'].value}"
+ validatorMessage="#{richSelectBean.attributes['validatorMessage'].value}"
+ value="#{richSelectBean.attributes['value'].value}"
+ valueChangeListener="#{richSelectBean.listener}"
+ >
+
+ <f:selectItems value="#{richSelectBean.capitalsOptions}" />
+ <a4j:ajax event="change" render="output"/>
+
+ </rich:select>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richSelectBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSelectBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components1.xhtml 2010-11-03 15:01:37 UTC (rev 19914)
@@ -122,7 +122,10 @@
<h:outputText id="name" value="#{item.name}" />
</rich:column>
<rich:column id="columnTitle">
- <h:outputText value="#{item.title}" />
+ <rich:select id="title" value="#{item.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ <a4j:ajax event="change" render="@this"/>
+ </rich:select>
</rich:column>
<rich:column id="columnSmoker">
<h:selectBooleanCheckbox id="smokerCheckbox" value="#{item.smoker}">
14 years, 10 months
JBoss Rich Faces SVN: r19913 - in modules/tests/metamer/trunk/application/src/main: resources/org/richfaces/tests/metamer/bean and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-03 10:27:36 -0400 (Wed, 03 Nov 2010)
New Revision: 19913
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
added rich:tree simple sample (RF-9457)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 14:25:46 UTC (rev 19912)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 14:27:36 UTC (rev 19913)
@@ -140,6 +140,7 @@
components.put("richToggleControl", "Rich Toggle Control");
components.put("richTogglePanel", "Rich Toggle Panel");
components.put("richTogglePanelItem", "Rich Toggle Panel Item");
+ components.put("richTree", "Rich Tree");
}
private void createSkinList() {
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-11-03 14:27:36 UTC (rev 19913)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.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.ManagedProperty;
+import javax.faces.bean.ViewScoped;
+import javax.swing.tree.TreeNode;
+
+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.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 = "richTreeBean")
+@ViewScoped
+public class RichTreeBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private List<TreeNode> root = new ArrayList<TreeNode>();
+
+ @ManagedProperty(value = "#{model}")
+ private Model model;
+
+ private Map<String, Country> countriesCache = new HashMap<String, Country>();
+ private Map<String, Company> companiesCache = new HashMap<String, Company>();
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UITree.class, getClass(), false);
+ attributes.get("rendered").setValue(true);
+ attributes.get("toggleType").setValue("ajax");
+ attributes.get("selectionType").setValue("ajax");
+
+ for (CompactDiscXmlDescriptor descriptor : model.getCompactDiscs()) {
+ 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);
+ 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);
+ }
+ 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);
+ root.add(country);
+ }
+ return country;
+ }
+
+ public void setModel(Model model) {
+ this.model = model;
+ }
+
+ public List<TreeNode> getRoot() {
+ return root;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties 2010-11-03 14:27:36 UTC (rev 19913)
@@ -0,0 +1,7 @@
+attr.toggleType.ajax=ajax
+attr.toggleType.client=client
+attr.toggleType.server=server
+attr.toggleType.null=
+attr.selectionType.client=client
+attr.selectionType.ajax=ajax
+attr.selectionType.null=
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Tree</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ The simple sample of <b>rich:tree</b> usage including all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-11-03 14:27:36 UTC (rev 19913)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:tree id="tree"
+ nodeType="#{node.type}"
+ var="node"
+ value="#{richTreeBean.root}"
+
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}">
+
+ <rich:treeNode type="country">
+ #{node.name}
+ </rich:treeNode>
+
+ <rich:treeNode type="company" icon="/images/tree/disc.gif">
+ #{node.name}
+ </rich:treeNode>
+
+ <rich:treeNode type="cd" icon="/images/tree/song.gif">
+ #{node.artist} - #{node.title}
+ </rich:treeNode>
+ </rich:tree>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r19912 - modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-03 10:25:46 -0400 (Wed, 03 Nov 2010)
New Revision: 19912
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichListBean.properties
Log:
list bean 'none' properties renamed as 'null'
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichListBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichListBean.properties 2010-11-03 14:24:39 UTC (rev 19911)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichListBean.properties 2010-11-03 14:25:46 UTC (rev 19912)
@@ -1,6 +1,6 @@
attr.dir.ltr=ltr
attr.dir.rtl=rtl
-attr.dir.none=
+attr.dir.null=
attr.type.ordered=ordered
attr.type.unordered=unordered
attr.type.definitions=definitions
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r19911 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/model and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-03 10:24:39 -0400 (Wed, 03 Nov 2010)
New Revision: 19911
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/model/compact-discs.xml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
Log:
added model for CompactDisc (suitable for tree structure testing) - refactored Model class to be more generic
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2010-11-03 13:42:19 UTC (rev 19910)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -22,14 +22,11 @@
package org.richfaces.tests.metamer.bean;
-import org.richfaces.tests.metamer.model.*;
-
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import javax.annotation.PostConstruct;
import javax.faces.FacesException;
import javax.faces.bean.ApplicationScoped;
@@ -39,13 +36,17 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.richfaces.tests.metamer.model.Capital;
+import org.richfaces.tests.metamer.model.Employee;
+import org.richfaces.tests.metamer.model.tree.CompactDiscXmlDescriptor;
+
/**
* Application scoped managed bean holding models usable e.g. in iteration components.
- *
- * @author Exadel, <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ *
+ * @author Exadel
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
@ManagedBean
@@ -56,58 +57,57 @@
private List<Employee> employeesList;
private Set<String> jobTitles;
private List<SelectItem> jobTitlesSelectItems;
- private Logger logger;
+ private List<CompactDiscXmlDescriptor> compactDiscList;
- @PostConstruct
- public void init() {
- logger = LoggerFactory.getLogger(getClass());
- }
-
- @XmlRootElement(name = "capitals")
- private static final class CapitalsHolder {
-
- private List<Capital> capitals;
-
- @XmlElement(name = "capital")
- public List<Capital> getCapitals() {
- return capitals;
+ /**
+ * Model containing US states, their capitals and timezones.
+ *
+ * @return list of US states and their capitals
+ */
+ public synchronized List<Capital> getCapitals() {
+ if (capitalsList == null) {
+ try {
+ capitalsList = unmarshallCapitals();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
}
- public void setCapitals(List<Capital> capitals) {
- this.capitals = capitals;
- }
+ return capitalsList;
}
- @XmlRootElement(name = "employees")
- private static final class EmployeesHolder {
-
- private List<Employee> employees;
-
- @XmlElement(name = "employee")
- public List<Employee> getEmployees() {
- return employees;
+ /**
+ * Model containing employees. Can be used to test various components inside iteration components.
+ *
+ * @return list of employees
+ */
+ public synchronized List<Employee> getEmployees() {
+ if (employeesList == null) {
+ try {
+ employeesList = unmarshallEmployees();
+ } catch (JAXBException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
}
- public void setEmployees(List<Employee> employees) {
- this.employees = employees;
- }
+ return employeesList;
}
/**
- * Model containing US states, their capitals and timezones.
+ * Model containing compact discs. Suitable to be used in Tree-structured components.
*
- * @return list of US states and their capitals
+ * @return list of compact discs
*/
- public synchronized List<Capital> getCapitals() {
- if (capitalsList == null) {
+ public synchronized List<CompactDiscXmlDescriptor> getCompactDiscs() {
+ if (compactDiscList == null) {
try {
- capitalsList = unmarshallCapitals();
+ compactDiscList = unmarshallCompactDiscs();
} catch (JAXBException e) {
throw new FacesException(e.getMessage(), e);
}
}
- return capitalsList;
+ return compactDiscList;
}
/**
@@ -117,41 +117,83 @@
* @throws JAXBException
* if any unexpected errors occurs during unmarshalling
*/
- @SuppressWarnings("restriction")
public static final List<Capital> unmarshallCapitals() throws JAXBException {
+ return unmarshall(CapitalsHolder.class, "org/richfaces/tests/metamer/model/capitals.xml");
+ }
+
+ public static final List<Employee> unmarshallEmployees() throws JAXBException {
+ return unmarshall(EmployeesHolder.class, "org/richfaces/tests/metamer/model/employees.xml");
+ }
+
+ public static final List<CompactDiscXmlDescriptor> unmarshallCompactDiscs() throws JAXBException {
+ return unmarshall(CompactDiscsHolder.class, "org/richfaces/tests/metamer/model/compact-discs.xml");
+ }
+
+ @SuppressWarnings("unchecked")
+ static final <R, T extends ListHolder<R>> List<R> unmarshall(Class<T> rootElementType, String resourceURL)
+ throws JAXBException {
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
- URL resource = ccl.getResource("org/richfaces/tests/metamer/model/capitals.xml");
- JAXBContext context = JAXBContext.newInstance(CapitalsHolder.class);
- CapitalsHolder capitalsHolder = (CapitalsHolder) context.createUnmarshaller().unmarshal(resource);
- return capitalsHolder.getCapitals();
+ URL resource = ccl.getResource(resourceURL);
+ JAXBContext context = JAXBContext.newInstance(rootElementType);
+ T holder = (T) context.createUnmarshaller().unmarshal(resource);
+ return holder.getList();
}
- /**
- * Model containing employees. Can be used to test various components inside iteration components.
- *
- * @return list of employees
- */
- public synchronized List<Employee> getEmployees() {
- if (employeesList == null) {
- ClassLoader ccl = Thread.currentThread().getContextClassLoader();
- URL resource = ccl.getResource("org/richfaces/tests/metamer/model/employees.xml");
+ private static interface ListHolder<T> {
- JAXBContext context;
- try {
- context = JAXBContext.newInstance(EmployeesHolder.class);
- EmployeesHolder employeesHolder = (EmployeesHolder) context.createUnmarshaller().unmarshal(resource);
- employeesList = employeesHolder.getEmployees();
- } catch (JAXBException e) {
- throw new FacesException(e.getMessage(), e);
- }
+ public List<T> getList();
+
+ public void setList(List<T> list);
+ }
+
+ @XmlRootElement(name = "capitals")
+ private static final class CapitalsHolder implements ListHolder<Capital> {
+
+ private List<Capital> list;
+
+ @XmlElement(name = "capital")
+ public List<Capital> getList() {
+ return list;
}
- return employeesList;
+ public void setList(List<Capital> list) {
+ this.list = list;
+ }
}
+ @XmlRootElement(name = "employees")
+ private static final class EmployeesHolder implements ListHolder<Employee> {
+
+ private List<Employee> list;
+
+ @XmlElement(name = "employee")
+ public List<Employee> getList() {
+ return list;
+ }
+
+ public void setList(List<Employee> list) {
+ this.list = list;
+ }
+ }
+
+ @XmlRootElement(name = "CATALOG")
+ private static final class CompactDiscsHolder implements ListHolder<CompactDiscXmlDescriptor> {
+
+ private List<CompactDiscXmlDescriptor> list;
+
+ @XmlElement(name = "CD")
+ public List<CompactDiscXmlDescriptor> getList() {
+ return list;
+ }
+
+ public void setList(List<CompactDiscXmlDescriptor> list) {
+ this.list = list;
+ }
+ }
+
/**
* Model containing various job titles, e.g. CEO, President, Director.
- *
+ *
* @return set of job titles
*/
public synchronized Set<String> getJobTitles() {
@@ -167,7 +209,7 @@
/**
* Model containing select items with various job titles.
- *
+ *
* @return set of job titles
*/
public synchronized List<SelectItem> getJobTitlesSelectItems() {
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,96 @@
+package org.richfaces.tests.metamer.model.tree;
+
+import java.util.Enumeration;
+
+import javax.swing.tree.TreeNode;
+
+public class CompactDisc extends NamedNode implements TreeNode {
+ private Company company;
+ private String artist;
+ private String title;
+ private float price;
+ private int year;
+
+ public CompactDisc() {
+ this.setType("cd");
+ }
+
+ public CompactDisc(String title, String artist, Company company, float price, int year) {
+ super();
+ this.setType("cd");
+ this.company = company;
+ this.artist = artist;
+ this.title = title;
+ this.price = price;
+ this.year = year;
+ }
+
+ public TreeNode getChildAt(int childIndex) {
+ return null;
+ }
+
+ public int getChildCount() {
+ return 0;
+ }
+
+ public TreeNode getParent() {
+ return company;
+ }
+
+ public int getIndex(TreeNode node) {
+ return 0;
+ }
+
+ public boolean getAllowsChildren() {
+ return false;
+ }
+
+ public boolean isLeaf() {
+ return true;
+ }
+
+ public Enumeration<TreeNode> children() {
+ return new Enumeration<TreeNode>() {
+
+ public boolean hasMoreElements() {
+ return false;
+ }
+
+ public TreeNode nextElement() {
+ return null;
+ }
+ };
+ }
+
+ public String getArtist() {
+ return artist;
+ }
+
+ public void setArtist(String artist) {
+ this.artist = artist;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public float getPrice() {
+ return price;
+ }
+
+ public void setPrice(float price) {
+ this.price = price;
+ }
+
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDiscXmlDescriptor.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,69 @@
+package org.richfaces.tests.metamer.model.tree;
+
+import java.io.Serializable;
+
+import javax.xml.bind.annotation.XmlElement;
+
+public class CompactDiscXmlDescriptor implements Serializable {
+ private String artist;
+ private String title;
+ private String country;
+ private String company;
+ private float price;
+ private int year;
+
+ @XmlElement(name = "ARTIST")
+ public String getArtist() {
+ return artist;
+ }
+
+ public void setArtist(String artist) {
+ this.artist = artist;
+ }
+
+ @XmlElement(name = "TITLE")
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ @XmlElement(name = "COUNTRY")
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @XmlElement(name = "COMPANY")
+ public String getCompany() {
+ return company;
+ }
+
+ public void setCompany(String company) {
+ this.company = company;
+ }
+
+ @XmlElement(name = "PRICE")
+ public float getPrice() {
+ return price;
+ }
+
+ public void setPrice(float price) {
+ this.price = price;
+ }
+
+ @XmlElement(name = "YEAR")
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,73 @@
+package org.richfaces.tests.metamer.model.tree;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.tree.TreeNode;
+
+import com.google.common.collect.Iterators;
+
+public class Company extends NamedNode implements TreeNode {
+ private String name;
+ private List<CompactDisc> compactDiscs = new ArrayList<CompactDisc>();
+
+ private Country country;
+
+ public Company() {
+ this.setType("company");
+ }
+
+ public TreeNode getChildAt(int childIndex) {
+ return compactDiscs.get(childIndex);
+ }
+
+ public int getChildCount() {
+ return compactDiscs.size();
+ }
+
+ public TreeNode getParent() {
+ return country;
+ }
+
+ public void setParent(Country country) {
+ this.country = country;
+ }
+
+ public int getIndex(TreeNode node) {
+ return compactDiscs.indexOf(node);
+ }
+
+ public boolean getAllowsChildren() {
+ return true;
+ }
+
+ public boolean isLeaf() {
+ return compactDiscs.isEmpty();
+ }
+
+ public Enumeration children() {
+ return Iterators.asEnumeration(compactDiscs.iterator());
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Country getCountry() {
+ return country;
+ }
+
+ public void setCountry(Country country) {
+ this.country = country;
+ }
+
+ public List<CompactDisc> getCds() {
+ return compactDiscs;
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,60 @@
+package org.richfaces.tests.metamer.model.tree;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.tree.TreeNode;
+
+import com.google.common.collect.Iterators;
+
+public class Country extends NamedNode implements TreeNode {
+
+ private String name;
+ private List<Company> companies = new ArrayList<Company>();
+
+ public Country() {
+ this.setType("country");
+ }
+
+ public TreeNode getChildAt(int childIndex) {
+ return companies.get(childIndex);
+ }
+
+ public int getChildCount() {
+ return companies.size();
+ }
+
+ public TreeNode getParent() {
+ return null;
+ }
+
+ public int getIndex(TreeNode node) {
+ return companies.indexOf(node);
+ }
+
+ public boolean getAllowsChildren() {
+ return true;
+ }
+
+ public boolean isLeaf() {
+ return companies.isEmpty();
+ }
+
+ public Enumeration<Company> children() {
+ return Iterators.asEnumeration(companies.iterator());
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List<Company> getCompanies() {
+ return companies;
+ }
+
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/NamedNode.java 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,13 @@
+package org.richfaces.tests.metamer.model.tree;
+
+public class NamedNode {
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/model/compact-discs.xml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/model/compact-discs.xml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/model/compact-discs.xml 2010-11-03 14:24:39 UTC (rev 19911)
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<CATALOG>
+ <CD>
+ <TITLE>Empire Burlesque</TITLE>
+ <ARTIST>Bob Dylan</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Columbia</COMPANY>
+ <PRICE>10.90</PRICE>
+ <YEAR>1985</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Hide your heart</TITLE>
+ <ARTIST>Bonnie Tylor</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>CBS Records</COMPANY>
+ <PRICE>9.90</PRICE>
+ <YEAR>1988</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Greatest Hits</TITLE>
+ <ARTIST>Dolly Parton</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>RCA</COMPANY>
+ <PRICE>9.90</PRICE>
+ <YEAR>1982</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Still got the blues</TITLE>
+ <ARTIST>Gary More</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Virgin redords</COMPANY>
+ <PRICE>10.20</PRICE>
+ <YEAR>1990</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Eros</TITLE>
+ <ARTIST>Eros Ramazzotti</ARTIST>
+ <COUNTRY>Europe</COUNTRY>
+ <COMPANY>BMG</COMPANY>
+ <PRICE>9.90</PRICE>
+ <YEAR>1997</YEAR>
+ </CD>
+ <CD>
+ <TITLE>One night only</TITLE>
+ <ARTIST>Bee Gees</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Polydor</COMPANY>
+ <PRICE>10.90</PRICE>
+ <YEAR>1998</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Sylvias Mother</TITLE>
+ <ARTIST>Dr.Hook</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>CBS</COMPANY>
+ <PRICE>8.10</PRICE>
+ <YEAR>1973</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Maggie May</TITLE>
+ <ARTIST>Rod Stewart</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Pickwick</COMPANY>
+ <PRICE>8.50</PRICE>
+ <YEAR>1990</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Romanza</TITLE>
+ <ARTIST>Andrea Bocelli</ARTIST>
+ <COUNTRY>Europe</COUNTRY>
+ <COMPANY>Polydor</COMPANY>
+ <PRICE>10.80</PRICE>
+ <YEAR>1996</YEAR>
+ </CD>
+ <CD>
+ <TITLE>When a man loves a woman</TITLE>
+ <ARTIST>Percy Sledge</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Atlantic</COMPANY>
+ <PRICE>8.70</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Black angel</TITLE>
+ <ARTIST>Savage Rose</ARTIST>
+ <COUNTRY>Europe</COUNTRY>
+ <COMPANY>Mega</COMPANY>
+ <PRICE>10.90</PRICE>
+ <YEAR>1995</YEAR>
+ </CD>
+ <CD>
+ <TITLE>1999 Grammy Nominees</TITLE>
+ <ARTIST>Many</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Grammy</COMPANY>
+ <PRICE>10.20</PRICE>
+ <YEAR>1999</YEAR>
+ </CD>
+ <CD>
+ <TITLE>For the good times</TITLE>
+ <ARTIST>Kenny Rogers</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Mucik Master</COMPANY>
+ <PRICE>8.70</PRICE>
+ <YEAR>1995</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Big Willie style</TITLE>
+ <ARTIST>Will Smith</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Columbia</COMPANY>
+ <PRICE>9.90</PRICE>
+ <YEAR>1997</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Tupelo Honey</TITLE>
+ <ARTIST>Van Morrison</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Polydor</COMPANY>
+ <PRICE>8.20</PRICE>
+ <YEAR>1971</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Soulsville</TITLE>
+ <ARTIST>Jorn Hoel</ARTIST>
+ <COUNTRY>Norway</COUNTRY>
+ <COMPANY>WEA</COMPANY>
+ <PRICE>7.90</PRICE>
+ <YEAR>1996</YEAR>
+ </CD>
+ <CD>
+ <TITLE>The very best of</TITLE>
+ <ARTIST>Cat Stevens</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Island</COMPANY>
+ <PRICE>8.90</PRICE>
+ <YEAR>1990</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Stop</TITLE>
+ <ARTIST>Sam Brown</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>A and M</COMPANY>
+ <PRICE>8.90</PRICE>
+ <YEAR>1988</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Bridge of Spies</TITLE>
+ <ARTIST>T`Pau</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Siren</COMPANY>
+ <PRICE>7.90</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Private Dancer</TITLE>
+ <ARTIST>Tina Turner</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>Capitol</COMPANY>
+ <PRICE>8.90</PRICE>
+ <YEAR>1983</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Midt om natten</TITLE>
+ <ARTIST>Kim Larsen</ARTIST>
+ <COUNTRY>Europe</COUNTRY>
+ <COMPANY>Medley</COMPANY>
+ <PRICE>7.80</PRICE>
+ <YEAR>1983</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Pavarotti Gala Concert</TITLE>
+ <ARTIST>Luciano Pavarotti</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>DECCA</COMPANY>
+ <PRICE>9.90</PRICE>
+ <YEAR>1991</YEAR>
+ </CD>
+ <CD>
+ <TITLE>The dock of the bay</TITLE>
+ <ARTIST>Otis Redding</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Atlantic</COMPANY>
+ <PRICE>7.90</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Picture book</TITLE>
+ <ARTIST>Simply Red</ARTIST>
+ <COUNTRY>Europe</COUNTRY>
+ <COMPANY>Elektra</COMPANY>
+ <PRICE>7.20</PRICE>
+ <YEAR>1985</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Red</TITLE>
+ <ARTIST>The Communards</ARTIST>
+ <COUNTRY>United Kingdom</COUNTRY>
+ <COMPANY>London</COMPANY>
+ <PRICE>7.80</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Unchain my heart</TITLE>
+ <ARTIST>Joe Cocker</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>EMI</COMPANY>
+ <PRICE>8.20</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+</CATALOG>
14 years, 10 months
JBoss Rich Faces SVN: r19910 - in trunk/ui/input/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-11-03 09:42:19 -0400 (Wed, 03 Nov 2010)
New Revision: 19910
Removed:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
Log:
RF-9579
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-11-03 12:43:47 UTC (rev 19909)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/SelectRendererBase.java 2010-11-03 13:42:19 UTC (rev 19910)
@@ -48,7 +48,6 @@
@ResourceDependency(library = "org.richfaces", name = "inputBase.js"),
@ResourceDependency(library = "org.richfaces", name = "popup.js"),
@ResourceDependency(library = "org.richfaces", name = "popupList.js"),
- @ResourceDependency(library = "org.richfaces", name = "selectList.js"),
@ResourceDependency(library = "org.richfaces", name = "select.js"),
@ResourceDependency(library = "org.richfaces", name = "select.ecss") })
public class SelectRendererBase extends InputRendererBase {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-11-03 12:43:47 UTC (rev 19909)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-11-03 13:42:19 UTC (rev 19910)
@@ -176,8 +176,7 @@
__onListClick: function(e) {
window.clearTimeout(this.timeoutId);
- }
-
+ }
}
})());
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-03 12:43:47 UTC (rev 19909)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-11-03 13:42:19 UTC (rev 19910)
@@ -115,11 +115,10 @@
}));
}
this.selectFirst = mergedOptions.selectFirst;
- this.popupList = new rf.ui.SelectList((id+"List"), this, mergedOptions);
+ this.popupList = new rf.ui.PopupList((id+"List"), this, mergedOptions);
this.listElem = $(document.getElementById(id+"List"));
this.listElem.bind("click", $.proxy(this.__onListClick, this));
-
var items = this.popupList.__getItems();
var enableManualInput = mergedOptions.enableManualInput;
if (items.length>0 && enableManualInput) {
@@ -160,9 +159,10 @@
__clickHandler: function(e) {
if(!this.popupList.isVisible()) {
- this.popupList.show();
+ this.__updateItems();
+ this.showPopup();
} else {
- this.popupList.hide();
+ this.hidePopup();
}
this.__setInputFocus();
window.clearTimeout(this.timeoutId);
@@ -188,7 +188,8 @@
case rf.KEYS.DOWN:
e.preventDefault();
if(!visible) {
- this.popupList.show();
+ this.__updateItems();
+ this.showPopup();
} else {
this.popupList.__selectNext() ;
}
@@ -209,6 +210,15 @@
return false;
break;
+ case rf.KEYS.TAB:
+ break;
+
+ case rf.KEYS.ESC:
+ if(visible) {
+ this.hidePopup();
+ }
+ break;
+
default:
var _this = this;
window.clearTimeout(this.changeTimerId);
@@ -223,20 +233,11 @@
if(this.cache && this.cache.isCached(newValue)) {
- if(this.initialValue !=newValue) {
- var newItems = this.cache.getItems(newValue);
- var items = $(newItems);
- this.popupList.__setItems(items);
- $(document.getElementById(this.id+"Items")).empty().append(items);
- }
-
+ this.__updateItems();
+
if(!this.popupList.isVisible()) {
- this.popupList.show();
+ this.showPopup();
}
-
- if(this.selectFirst) {
- this.popupList.__selectByIndex(0);
- }
}
},
@@ -244,12 +245,13 @@
var inputLabel = this.getValue();
if(!inputLabel || inputLabel == "") {
this.setValue(this.defaultLabel);
+ this.selValueInput.val("");
}
},
__blurHandler: function(e) {
this.timeoutId = window.setTimeout($.proxy(function(){
- this.popupList.hide();
+ this.hidePopup();
this.__handleBlur();
}, this), 200);
},
@@ -258,13 +260,37 @@
window.clearTimeout(this.timeoutId);
},
+ __updateItems: function() {
+ var newValue = this.getValue();
+ newValue = (newValue != this.defaultLabel) ? newValue : "";
+ this.__updateItemsFromCache(newValue);
+ if(this.selectFirst) {
+ this.popupList.__selectByIndex(0);
+ }
+ },
+
+ __updateItemsFromCache: function(value) {
+ var newItems = this.cache.getItems(value);
+ var items = $(newItems);
+ this.popupList.__setItems(items);
+ $(document.getElementById(this.id+"Items")).empty().append(items);
+ },
+
+ showPopup: function() {
+ this.popupList.show();
+ },
+
+ hidePopup: function() {
+ this.popupList.hide();
+ },
+
processItem: function(item) {
var key = $(item).attr("id");
var value = this.getItemValue(key);
this.saveItemValue(value);
var label = this.getItemLabel(key);
this.setValue(label);
- this.popupList.hide();
+ this.hidePopup();
this.__setInputFocus();
},
Deleted: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-11-03 12:43:47 UTC (rev 19909)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/selectList.js 2010-11-03 13:42:19 UTC (rev 19910)
@@ -1,37 +0,0 @@
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- rf.ui.SelectList = function(id, listener, options) {
- $super.constructor.call(this, id, listener, options);
- this.selectFirst = options.selectFirst;
- };
-
- rf.ui.PopupList.extend(rf.ui.SelectList);
- var $super = rf.ui.SelectList.$super;
-
- $.extend(rf.ui.SelectList.prototype,(function () {
-
- return{
- name : "selectList",
-
- show: function() {
- if(!this.isVisible()) {
- $super.show.call(this);
- if(this.selectFirst) {
- this.__selectByIndex(0);
- }
- }
- },
-
- hide: function() {
- if(this.isVisible()) {
- $super.hide.call(this);
- this.__selectByIndex(-1);
- }
- }
- }
-
- })());
-
-})(jQuery, window.RichFaces);
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r19909 - in modules/tests/metamer/trunk/application: src/main/java/org/richfaces/tests/metamer/bean and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-03 08:43:47 -0400 (Wed, 03 Nov 2010)
New Revision: 19909
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
Log:
https://jira.jboss.org/browse/RF-9037
* added 1 page for rich:inplaceSelect
* inplace select added to rich:dataTable, h:dataTable, rich:extendedDataTable and rich:subTable
* added new model - job titles
Property changes on: modules/tests/metamer/trunk/application
___________________________________________________________________
Name: svn:ignore
- .checkstyle
.classpath
.project
.settings
target
nbactions.xml
nb-configuration.xml
+ .checkstyle
.classpath
.project
.settings
target
nbactions.xml
nb-configuration.xml
.pom.xml.swp
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/Model.java 2010-11-03 12:43:47 UTC (rev 19909)
@@ -25,12 +25,16 @@
import org.richfaces.tests.metamer.model.*;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.annotation.PostConstruct;
import javax.faces.FacesException;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
+import javax.faces.model.SelectItem;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.annotation.XmlElement;
@@ -50,6 +54,8 @@
private List<Capital> capitalsList;
private List<Employee> employeesList;
+ private Set<String> jobTitles;
+ private List<SelectItem> jobTitlesSelectItems;
private Logger logger;
@PostConstruct
@@ -142,4 +148,37 @@
return employeesList;
}
+
+ /**
+ * Model containing various job titles, e.g. CEO, President, Director.
+ *
+ * @return set of job titles
+ */
+ public synchronized Set<String> getJobTitles() {
+ if (jobTitles == null) {
+ jobTitles = new HashSet<String>();
+ for (Employee e : getEmployees()) {
+ jobTitles.add(e.getTitle());
+ }
+ }
+
+ return jobTitles;
+ }
+
+ /**
+ * Model containing select items with various job titles.
+ *
+ * @return set of job titles
+ */
+ public synchronized List<SelectItem> getJobTitlesSelectItems() {
+ if (jobTitlesSelectItems == null) {
+ jobTitlesSelectItems = new ArrayList<SelectItem>();
+
+ for (String title : getJobTitles()) {
+ jobTitlesSelectItems.add(new SelectItem(title, title));
+ }
+ }
+
+ return jobTitlesSelectItems;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-11-03 12:43:47 UTC (rev 19909)
@@ -125,6 +125,7 @@
components.put("richExtendedDataTable", "Rich Extended Data Table");
components.put("richFunctions", "Rich Functions");
components.put("richInplaceInput", "Rich Inplace Input");
+ components.put("richInplaceSelect", "Rich Inplace Select");
components.put("richInputNumberSlider", "Rich Input Number Slider");
components.put("richInputNumberSpinner", "Rich Input Number Spinner");
components.put("richJQuery", "Rich jQuery");
Added: 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 (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2010-11-03 12:43:47 UTC (rev 19909)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.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.ManagedProperty;
+import javax.faces.bean.SessionScoped;
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+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")
+@SessionScoped
+public class RichInplaceSelectBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+ @ManagedProperty(value = "#{model.capitals}")
+ private List<Capital> capitals;
+ private List<SelectItem> capitalsOptions = null;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ capitalsOptions = new ArrayList<SelectItem>();
+ for (Capital capital : capitals) {
+ capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
+ }
+
+ attributes = Attributes.getUIComponentAttributes(UIInplaceSelect.class, getClass(), false);
+
+ attributes.setAttribute("defaultLabel", "Click here to edit");
+ attributes.setAttribute("editEvent", "click");
+ attributes.setAttribute("rendered", true);
+
+ // TODO has to be tested in another way
+ attributes.remove("converter");
+ attributes.remove("validator");
+ }
+
+ 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 void listener(ValueChangeEvent event) {
+ RichBean.logToPage("* value changed: " + event.getOldValue() + " -> " + event.getNewValue());
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/hDataTable/components2.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -131,7 +131,10 @@
<h:outputText id="columnHeaderTitleComponent" value="rich:comboBox" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:inplaceSelect id="titleInput" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ </rich:inplaceSelect>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle" value="Title" />
</f:facet>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDataTable/components2.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -106,7 +106,7 @@
</f:facet>
<rich:inplaceInput id="nameInput" value="#{record.name}" defaultLabel="Click here to edit">
- <a4j:ajax event="change"/>
+ <a4j:ajax event="inputchange" render="@this"/>
</rich:inplaceInput>
<f:facet name="footer">
@@ -118,10 +118,13 @@
<f:facet name="header">
<h:outputText id="columnHeaderTitle" value="Title" />
<br/>
- <h:outputText id="columnHeaderTitleComponent" value="rich:comboBox" />
+ <h:outputText id="columnHeaderTitleComponent" value="rich:inplaceSelect" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:inplaceSelect id="titleInput" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ </rich:inplaceSelect>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle" value="Title" />
</f:facet>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/components2.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -154,7 +154,7 @@
</f:facet>
<rich:inplaceInput id="nameInput" value="#{record.name}" defaultLabel="Click here to edit">
- <a4j:ajax event="change"/>
+ <a4j:ajax event="inputchange" render="@this"/>
</rich:inplaceInput>
<f:facet name="footer">
@@ -169,7 +169,10 @@
<h:outputText id="columnHeaderTitleComponent" value="rich:inplaceSelect" />
</f:facet>
- <h:outputText value="#{record.title}" />
+ <rich:inplaceSelect id="titleInput" value="#{record.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ </rich:inplaceSelect>
+
<f:facet name="footer">
<h:outputText id="columnFooterTitle" value="Title" />
</f:facet>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Inplace Select</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ Simple page that contains <b>rich:inplaceSelect</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/simple.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:inplaceSelect id="inplaceSelect"
+ converterMessage="#{richInplaceSelectBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richInplaceSelectBean.attributes['defaultLabel'].value}"
+ editEvent="#{richInplaceSelectBean.attributes['editEvent'].value}"
+ enableManualInput="#{richInplaceSelectBean.attributes['editManualInput'].value}"
+ immediate="#{richInplaceSelectBean.attributes['immediate'].value}"
+ itemClass="#{richInplaceSelectBean.attributes['itemClass'].value}"
+ listClass="#{richInplaceSelectBean.attributes['listClass'].value}"
+ listHeight="#{richInplaceSelectBean.attributes['listHeight'].value}"
+ listWidth="#{richInplaceSelectBean.attributes['listWidth'].value}"
+ onblur="#{richInplaceSelectBean.attributes['onblur'].value}"
+ onchange="#{richInplaceSelectBean.attributes['onchange'].value}"
+ onclick="#{richInplaceSelectBean.attributes['onclick'].value}"
+ ondblclick="#{richInplaceSelectBean.attributes['ondblclick'].value}"
+ onfocus="#{richInplaceSelectBean.attributes['onfocus'].value}"
+ oninputblur="#{richInplaceSelectBean.attributes['oninputblur'].value}"
+ oninputclick="#{richInplaceSelectBean.attributes['oninputclick'].value}"
+ oninputdblclick="#{richInplaceSelectBean.attributes['oninputdblclick'].value}"
+ oninputfocus="#{richInplaceSelectBean.attributes['oninputfocus'].value}"
+ oninputkeydown="#{richInplaceSelectBean.attributes['oninputkeydown'].value}"
+ oninputkeypress="#{richInplaceSelectBean.attributes['oninputkeypress'].value}"
+ oninputkeyup="#{richInplaceSelectBean.attributes['oninputkeyup'].value}"
+ oninputmousedown="#{richInplaceSelectBean.attributes['oninputmousedown'].value}"
+ oninputmousemove="#{richInplaceSelectBean.attributes['oninputmousemove'].value}"
+ oninputmouseout="#{richInplaceSelectBean.attributes['oninputmouseout'].value}"
+ oninputmouseover="#{richInplaceSelectBean.attributes['oninputmouseover'].value}"
+ oninputmouseup="#{richInplaceSelectBean.attributes['oninputmouseup'].value}"
+ oninputselect="#{richInplaceSelectBean.attributes['oninputselect'].value}"
+ onkeydown="#{richInplaceSelectBean.attributes['onkeydown'].value}"
+ onkeypress="#{richInplaceSelectBean.attributes['onkeypress'].value}"
+ onkeyup="#{richInplaceSelectBean.attributes['onkeyup'].value}"
+ onlistclick="#{richInplaceSelectBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richInplaceSelectBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richInplaceSelectBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richInplaceSelectBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richInplaceSelectBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richInplaceSelectBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richInplaceSelectBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richInplaceSelectBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richInplaceSelectBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richInplaceSelectBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richInplaceSelectBean.attributes['onmousedown'].value}"
+ onmousemove="#{richInplaceSelectBean.attributes['onmousemove'].value}"
+ onmouseout="#{richInplaceSelectBean.attributes['onmouseout'].value}"
+ onmouseover="#{richInplaceSelectBean.attributes['onmouseover'].value}"
+ onmouseup="#{richInplaceSelectBean.attributes['onmouseup'].value}"
+ onselect="#{richInplaceSelectBean.attributes['onselect'].value}"
+ openOnEdit="#{richInplaceSelectBean.attributes['openOnEdit'].value}"
+ rendered="#{richInplaceSelectBean.attributes['rendered'].value}"
+ required="#{richInplaceSelectBean.attributes['required'].value}"
+ requiredMessage="#{richInplaceSelectBean.attributes['requiredMessage'].value}"
+ saveOnBlur="#{richInplaceSelectBean.attributes['saveOnBlur'].value}"
+ saveOnSelect="#{richInplaceSelectBean.attributes['saveOnSelect'].value}"
+ selectFirst="#{richInplaceSelectBean.attributes['selectFirst'].value}"
+ selectItemClass="#{richInplaceSelectBean.attributes['selectItemClass'].value}"
+ showButton="#{richInplaceSelectBean.attributes['showButton'].value}"
+ showControls="#{richInplaceSelectBean.attributes['showControls'].value}"
+ state="#{richInplaceSelectBean.attributes['state'].value}"
+ validatorMessage="#{richInplaceSelectBean.attributes['validatorMessage'].value}"
+ value="#{richInplaceSelectBean.attributes['value'].value}"
+ valueChangeListener="#{richInplaceSelectBean.listener}"
+ >
+
+ <f:selectItems value="#{richInplaceSelectBean.capitalsOptions}" />
+ <!-- TODO change event to "change" as soon as implemented -->
+ <a4j:ajax event="select" render="output"/>
+
+ </rich:inplaceSelect>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richInplaceSelectBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richInplaceSelectBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml 2010-11-03 09:11:50 UTC (rev 19908)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSubTable/components2.xhtml 2010-11-03 12:43:47 UTC (rev 19909)
@@ -119,11 +119,13 @@
</rich:column>
<rich:column id="columnName">
<rich:inplaceInput id="nameInput" value="#{item.name}" defaultLabel="Click here to edit">
- <a4j:ajax event="change"/>
+ <a4j:ajax event="inputchange" render="@this"/>
</rich:inplaceInput>
</rich:column>
<rich:column id="columnTitle">
- <h:outputText value="#{item.title}" />
+ <rich:inplaceSelect id="titleInput" value="#{item.title}">
+ <f:selectItems value="#{model.jobTitlesSelectItems}"/>
+ </rich:inplaceSelect>
</rich:column>
<rich:column id="columnBirthdate">
<h:outputText value="#{item.birthdate}" />
14 years, 10 months
JBoss Rich Faces SVN: r19908 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-03 05:11:50 -0400 (Wed, 03 Nov 2010)
New Revision: 19908
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml
Log:
treeNode markup corrected.
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml 2010-11-03 09:10:45 UTC (rev 19907)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml 2010-11-03 09:11:50 UTC (rev 19908)
@@ -15,7 +15,7 @@
#{node.name}
</rich:treeNode>
<rich:treeNode type="cd" icon="/images/tree/song.gif">
- #{node.artist} - #{node.title}
+ #{node.artist} - #{node.title} - #{node.year}
</rich:treeNode>
</rich:tree>
</ui:composition>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r19907 - in trunk/examples/richfaces-showcase/src/main/webapp/richfaces: tree/samples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-03 05:10:45 -0400 (Wed, 03 Nov 2010)
New Revision: 19907
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml
Log:
layout corrections
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-11-03 09:05:36 UTC (rev 19906)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-11-03 09:10:45 UTC (rev 19907)
@@ -7,21 +7,10 @@
xmlns:rich="http://richfaces.org/rich">
<style>
.tooltip {
- background-color: #{ richSkin.generalBackgroundColor
+ background-color: #{ richSkin.generalBackgroundColor};
+ border-width:3px;
+ padding:10px;
}
-
-;
-border-width
-:
-3px;
-
-
-padding
-:
-10px;
-
-
-}
.tooltip-custom-body {
background-color: orange;
}
@@ -45,7 +34,7 @@
<rich:panel id="sample1" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
<p>Here you can see <b>default client-side</b> tool-tip</p>
- <rich:tooltip id="tt1">
+ <rich:tooltip id="tt1" styleClass="tooltip">
<span style="white-space: nowrap"> This tool-tip content was
<strong>pre-rendered</strong> to the page.<br />
Also the tooltip following mouse by default </span>
@@ -56,7 +45,7 @@
<p>This tool-tip will not <b>follow mouse</b>. Also this tool-tip
has a <b>delay 1.5 sec</b>, so be patient!</p>
<rich:tooltip followMouse="false" showDelay="1500"
- bodyClass="tooltip-custom-body" styleClass="qqq">
+ styleClass="tooltip-custom-body">
<span style="white-space: nowrap"> This tool-tip content also
<strong>pre-rendered</strong> to the page.<br />
</span>
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml 2010-11-03 09:05:36 UTC (rev 19906)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tree/samples/tree-sample.xhtml 2010-11-03 09:10:45 UTC (rev 19907)
@@ -5,7 +5,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
-<h:form>
+
<rich:tree id="tree" nodeType="#{node.type}" var="node"
value="#{treeBean.rootNodes}" toggleType="client">
<rich:treeNode type="country">
@@ -18,6 +18,4 @@
#{node.artist} - #{node.title}
</rich:treeNode>
</rich:tree>
- <a4j:commandButton execute="@all" render="@all"></a4j:commandButton>
-</h:form>
</ui:composition>
\ No newline at end of file
14 years, 10 months
JBoss Rich Faces SVN: r19906 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-03 05:05:36 -0400 (Wed, 03 Nov 2010)
New Revision: 19906
Modified:
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/A4JPushEventProcuder.java
Log:
https://jira.jboss.org/browse/RF-9163
* code commented out, it has to be reimplemented because of new implementation of a4j:push
Modified: 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 2010-11-03 08:36:10 UTC (rev 19905)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushBean.java 2010-11-03 09:05:36 UTC (rev 19906)
@@ -24,14 +24,14 @@
import java.io.Serializable;
import java.util.Date;
-import java.util.EventListener;
+//import java.util.EventListener;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
-import org.ajax4jsf.event.PushEventListener;
+//import org.ajax4jsf.event.PushEventListener;
import org.richfaces.component.UIPush;
import org.richfaces.tests.metamer.Attributes;
@@ -52,7 +52,7 @@
private static Logger logger;
private Attributes attributes;
private int counter = 0;
- private transient volatile PushEventListener listener;
+// private transient volatile PushEventListener listener;
@ManagedProperty(value = "#{a4jPushEventProcuder}")
private transient A4JPushEventProcuder pushEventProducer;
@@ -103,10 +103,10 @@
this.attributes = attributes;
}
- public void setListener(EventListener listener) {
- this.listener = (PushEventListener) listener;
- pushEventProducer.registerListener(this.listener);
- }
+// public void setListener(EventListener listener) {
+// this.listener = (PushEventListener) listener;
+// pushEventProducer.registerListener(this.listener);
+// }
public int getCounter() {
return counter;
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java 2010-11-03 08:36:10 UTC (rev 19905)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPushEventProcuder.java 2010-11-03 09:05:36 UTC (rev 19906)
@@ -19,20 +19,19 @@
* 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.Collection;
-import java.util.EventObject;
-import java.util.HashSet;
-import java.util.LinkedList;
+//import java.util.Collection;
+//import java.util.EventObject;
+//import java.util.HashSet;
+//import java.util.LinkedList;
import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
-import org.ajax4jsf.event.PushEventListener;
+//import org.ajax4jsf.event.PushEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,27 +47,27 @@
private static final long serialVersionUID = 4532283098337277878L;
private Logger logger;
- private Collection<PushEventListener> registeredListeners = new HashSet<PushEventListener>();
+// FIXME example has to be reimplemented because of new implementation of a4j:push
+// private Collection<PushEventListener> registeredListeners = new HashSet<PushEventListener>();
@PostConstruct
public void init() {
logger = LoggerFactory.getLogger(getClass());
}
-
- public void registerListener(PushEventListener listener) {
- synchronized (registeredListeners) {
- registeredListeners.add(listener);
- }
- }
-
- public void produceEvent() {
- Collection<PushEventListener> listeners;
- synchronized (registeredListeners) {
- listeners = new LinkedList<PushEventListener>(registeredListeners);
- }
- for (PushEventListener listener : listeners) {
- listener.onEvent(new EventObject(A4JPushBean.class));
- }
- logger.debug("push event (listeners: " + listeners.size() + ")");
- }
+// public void registerListener(PushEventListener listener) {
+// synchronized (registeredListeners) {
+// registeredListeners.add(listener);
+// }
+// }
+//
+// public void produceEvent() {
+// Collection<PushEventListener> listeners;
+// synchronized (registeredListeners) {
+// listeners = new LinkedList<PushEventListener>(registeredListeners);
+// }
+// for (PushEventListener listener : listeners) {
+// listener.onEvent(new EventObject(A4JPushBean.class));
+// }
+// logger.debug("push event (listeners: " + listeners.size() + ")");
+// }
}
14 years, 10 months
JBoss Rich Faces SVN: r19905 - modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-11-03 04:36:10 -0400 (Wed, 03 Nov 2010)
New Revision: 19905
Modified:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTogglePanelBean.properties
Log:
https://jira.jboss.org/browse/RFPL-675
* select options fixed
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTogglePanelBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTogglePanelBean.properties 2010-11-03 06:47:48 UTC (rev 19904)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTogglePanelBean.properties 2010-11-03 08:36:10 UTC (rev 19905)
@@ -1,6 +1,7 @@
attr.dir.ltr=ltr
attr.dir.rtl=rtl
-attr.dir.none=
+attr.dir.null=
attr.switchType.client=client
attr.switchType.ajax=ajax
+attr.switchType.server=server
attr.switchType.null=
\ No newline at end of file
14 years, 10 months