JBoss Rich Faces SVN: r20282 - in sandbox/trunk/ui/fileupload/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-01 15:22:27 -0500 (Wed, 01 Dec 2010)
New Revision: 20282
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
Log:
RF-9496
Modified: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-01 20:22:02 UTC (rev 20281)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-01 20:22:27 UTC (rev 20282)
@@ -52,7 +52,7 @@
items: [],
- uploadedItems: [],
+ submitedItems: [],
init: function(id, options) {
this.id = id;
@@ -108,7 +108,7 @@
__removeItem: function(item) {
this.items.splice(this.items.indexOf(item), 1);
- this.uploadedItems.splice(this.uploadedItems.indexOf(item), 1);
+ this.submitedItems.splice(this.submitedItems.indexOf(item), 1);
this.__updateButtons();
},
@@ -116,7 +116,7 @@
this.inputContainer.children(":not(:visible)").remove();
this.list.empty();
this.items.splice(0);
- this.uploadedItems.splice(0);
+ this.submitedItems.splice(0);
this.__updateButtons();
},
@@ -163,27 +163,30 @@
var contentDocument = event.target.contentWindow.document;
contentDocument = contentDocument.XMLDocument || contentDocument;
var documentElement = contentDocument.documentElement;
- if (documentElement.tagName.toUpperCase() != "HTML") {
- jsf.ajax.response({responseXML: contentDocument}, {});
- this.loadableItem.finishUploading();
- this.uploadedItems.push(this.loadableItem);
- if (this.items.length) {
+ var responseStatus, id;
+ if (documentElement.tagName.toUpperCase() == "PARTIAL-RESPONSE") {
+ responseStatus = ITEM_STATE.DONE;
+ } else if ((id = documentElement.id) && id.indexOf(UID + this.loadableItem.uid + ":") == 0) {
+ responseStatus = id.split(":")[1];
+ }
+ if (responseStatus) {
+ responseStatus == ITEM_STATE.DONE && jsf.ajax.response({responseXML: contentDocument}, {});
+ this.loadableItem.finishUploading(responseStatus);
+ this.submitedItems.push(this.loadableItem);
+ if (responseStatus == ITEM_STATE.DONE && this.items.length) {
this.__startUpload();
} else {
this.loadableItem = null;
this.__updateButtons();
var items = [];
- for (var i in this.uploadedItems) {
- items.push(this.uploadedItems[i].model);
+ for (var i in this.items) {
+ items.push(this.items[i].model);
}
+ for (var i in this.submitedItems) {
+ items.push(this.submitedItems[i].model);
+ }
richfaces.Event.fire(this.element, "onuploadcomplete", items);
}
- } else {
- var result = documentElement.id.split(":");
- if (UID + 1 == result[0]) {
- if ("done" == result[1]) {
- }
- }
}
}
},
@@ -203,8 +206,8 @@
result = this.items[i].model.name == fileName;
}
result = result || (this.loadableItem && this.loadableItem.model.name == fileName);
- for (var i = 0; !result && i < this.uploadedItems.length; i++) {
- result = this.uploadedItems[i].model.name == fileName;
+ for (var i = 0; !result && i < this.submitedItems.length; i++) {
+ result = this.submitedItems[i].model.name == fileName;
}
return result;
}
@@ -251,15 +254,15 @@
}
},
- finishUploading: function() {
+ finishUploading: function(state) {
if (this.fileUpload.progressBar) {
this.fileUpload.progressBar.disable();
this.fileUpload.hiddenContainer.append(this.fileUpload.progressBarElement.detach());
}
this.input.remove();
- this.state.html("Done");
+ this.state.html(state == ITEM_STATE.DONE ? "Done" : "File size exceeded");
this.link.html("Clear");
- this.model.state = ITEM_STATE.DONE;
+ this.model.state = state;
}
});
}(window.RichFaces, jQuery));
Modified: sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-01 20:22:02 UTC (rev 20281)
+++ sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-01 20:22:27 UTC (rev 20282)
@@ -72,7 +72,7 @@
<div class="rf-fu-cntr-hdn">
<iframe name="#{clientId}"/>
<cdk:object name="progressBar" value="#{component.facets['progress']}"/>
- <c:if test="#{progressBar.isRendered()}">
+ <c:if test="#{progressBar != null and progressBar.isRendered()}">
<cdk:call expression="progressBar.encodeAll(facesContext)" />
</c:if>
</div>
14 years
JBoss Rich Faces SVN: r20281 - sandbox/trunk/examples/fileupload-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-01 15:22:02 -0500 (Wed, 01 Dec 2010)
New Revision: 20281
Modified:
sandbox/trunk/examples/fileupload-demo/src/main/webapp/WEB-INF/web.xml
Log:
RF-9501
Modified: sandbox/trunk/examples/fileupload-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/webapp/WEB-INF/web.xml 2010-12-01 19:03:06 UTC (rev 20280)
+++ sandbox/trunk/examples/fileupload-demo/src/main/webapp/WEB-INF/web.xml 2010-12-01 20:22:02 UTC (rev 20281)
@@ -39,6 +39,10 @@
<display-name></display-name>
<description></description>
<context-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>268435456</param-value>
+ </context-param>
+ <context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>#{skinBean.skin}</param-value>
</context-param>
14 years
JBoss Rich Faces SVN: r20280 - in sandbox/trunk/examples/fileupload-demo/src/main: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-01 14:03:06 -0500 (Wed, 01 Dec 2010)
New Revision: 20280
Modified:
sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
Log:
RF-9501
Modified: sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-01 18:17:49 UTC (rev 20279)
+++ sandbox/trunk/examples/fileupload-demo/src/main/java/org/richfaces/demo/FileUploadBean.java 2010-12-01 19:03:06 UTC (rev 20280)
@@ -23,6 +23,9 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.AjaxBehaviorEvent;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
@@ -77,6 +80,12 @@
public String getAcceptedTypes() {
return acceptedTypes;
+ }
+
+ public void updateAttribute(AjaxBehaviorEvent event) throws AbortProcessingException {
+ UIComponent component = (UIComponent) event.getSource();
+ String attributeName = (String) component.findComponent("name").getAttributes().get("value");
+ Object attributeValue = component.findComponent("value").getAttributes().get("value");
+ component.findComponent("fu").getAttributes().put(attributeName, attributeValue);
}
-
}
Modified: sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml
===================================================================
--- sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
+++ sandbox/trunk/examples/fileupload-demo/src/main/webapp/fileupload.xhtml 2010-12-01 19:03:06 UTC (rev 20280)
@@ -32,6 +32,13 @@
-->
<h:head>
<title>Richfaces FileUpload Demo</title>
+ <style>
+ <!--
+ .fu .rf-fu-lst {
+ height: 500px;
+ }
+ -->
+ </style>
</h:head>
<h:body>
<h:form id="form">
@@ -64,6 +71,14 @@
<h:outputText value="File name:" />
<a4j:outputPanel ajaxRendered="true">#{fileUploadBean.item.fileName}</a4j:outputPanel>
<br />
+ <h:outputText value="Attribute name: "/>
+ <h:inputText id="name"/>
+ <h:outputText value="Attribute value: "/>
+ <h:inputText id="value"/>
+ <h:commandButton value="Update attribute">
+ <f:ajax render="fu" execute="name value" listener="#{fileUploadBean.updateAttribute}"/>
+ </h:commandButton>
+ <br />
<h:outputText value="AcceptedTypes: " />
<h:inputText value="#{fileUploadBean.acceptedTypes}">
<f:ajax render="fu"/>
14 years
JBoss Rich Faces SVN: r20279 - in modules/tests/metamer/trunk/application/src/main: resources/org/richfaces/tests/metamer/bean and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-01 13:17:49 -0500 (Wed, 01 Dec 2010)
New Revision: 20279
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
Log:
rich:extendedDataTable - pre-automating component preparation (RFPL-918)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2010-12-01 18:17:49 UTC (rev 20279)
@@ -23,18 +23,20 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
+
import javax.annotation.PostConstruct;
-
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
-import org.richfaces.component.SortOrder;
+import javax.faces.bean.ViewScoped;
import org.ajax4jsf.model.DataComponentState;
+import org.richfaces.component.SortOrder;
import org.richfaces.component.UIExtendedDataTable;
-import org.richfaces.event.SortingEvent;
import org.richfaces.model.Filter;
+import org.richfaces.model.SortMode;
import org.richfaces.tests.metamer.Attributes;
import org.richfaces.tests.metamer.model.Employee;
import org.slf4j.Logger;
@@ -42,12 +44,12 @@
/**
* Managed bean for rich:extendedDataTable.
- *
+ *
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@ManagedBean(name = "richExtendedDataTableBean")
-@SessionScoped
+@ViewScoped
public class RichExtendedDataTableBean implements Serializable {
private static final long serialVersionUID = 481478880649809L;
@@ -60,14 +62,16 @@
private boolean state = true;
// sorting
- private SortOrder capitalsOrder = SortOrder.unsorted;
- private SortOrder statesOrder = SortOrder.unsorted;
+ private Map<String, ColumnSorting> sorting = new ColumnSortingMap();
// filtering
- private String sexFilter;
- private String nameFilter;
- private String titleFilter;
-
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+
+ // facets
+ private Map<String, String> facets = new HashMap<String, String>();
+
+ private UIExtendedDataTable binding;
+
/**
* Initializes the managed bean.
*/
@@ -82,19 +86,46 @@
attributes.setAttribute("rows", 30);
attributes.setAttribute("styleClass", "extended-data-table");
attributes.setAttribute("style", null);
-
+
+ // hidden attributes
+ attributes.remove("filterVar");
+ attributes.remove("filteringListeners");
+ attributes.remove("iterationState");
+ attributes.remove("iterationStatusVar");
+ attributes.remove("relativeRowIndex");
+ attributes.remove("rowAvailable");
+ attributes.remove("rowCount");
+ attributes.remove("rowData");
+ attributes.remove("rowIndex");
+ attributes.remove("rowIndex");
+ attributes.remove("rowKey");
+ attributes.remove("rowKeyConverter");
+ attributes.remove("sortingListeners");
+ attributes.remove("clientFirst");
+ attributes.remove("clientRows");
+
// TODO these must be tested in other way
attributes.remove("componentState");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
attributes.remove("value");
attributes.remove("var");
-
+ attributes.remove("keepSaved");
+
// TODO can be these set as attributes or only as facets?
attributes.remove("caption");
attributes.remove("header");
attributes.remove("footer");
attributes.remove("noData");
+
+ // facets initial values
+ facets.put("noData", "There is no data.");
+ facets.put("caption", "Caption");
+ facets.put("header", "Header");
+ facets.put("columnStateHeader", "State Header");
+ facets.put("columnStateFooter", "State Footer");
+ facets.put("columnCapitalHeader", "Capital Header");
+ facets.put("columnCapitalFooter", "Capital Footer");
}
public Attributes getAttributes() {
@@ -105,9 +136,17 @@
this.attributes = attributes;
}
+ public UIExtendedDataTable getBinding() {
+ return binding;
+ }
+
+ public void setBinding(UIExtendedDataTable binding) {
+ this.binding = binding;
+ }
+
/**
* Getter for page.
- *
+ *
* @return page number that will be used by data scroller
*/
public int getPage() {
@@ -116,7 +155,9 @@
/**
* Setter for page.
- * @param page page number that will be used by data scroller
+ *
+ * @param page
+ * page number that will be used by data scroller
*/
public void setPage(int page) {
this.page = page;
@@ -140,6 +181,7 @@
/**
* Getter for state.
+ *
* @return true if data should be displayed in table
*/
public boolean isState() {
@@ -148,85 +190,96 @@
/**
* Setter for state.
- * @param state true if data should be displayed in table
+ *
+ * @param state
+ * true if data should be displayed in table
*/
public void setState(boolean state) {
this.state = state;
}
- public SortOrder getCapitalsOrder() {
- return capitalsOrder;
- }
+ public Filter<?> getFilterSexImpl() {
+ return new Filter<Employee>() {
- public void setCapitalsOrder(SortOrder capitalsOrder) {
- this.capitalsOrder = capitalsOrder;
+ public boolean accept(Employee e) {
+ String sex = (String) getFiltering().get("sex");
+ if (sex == null || sex.length() == 0 || sex.equalsIgnoreCase("all")
+ || sex.equalsIgnoreCase(e.getSex().toString())) {
+ return true;
+ }
+ return false;
+ }
+ };
}
- public SortOrder getStatesOrder() {
- return statesOrder;
+ public Map<String, String> getFacets() {
+ return facets;
}
- public void setStatesOrder(SortOrder statesOrder) {
- this.statesOrder = statesOrder;
+ public Map<String, ColumnSorting> getSorting() {
+ return sorting;
}
- public String getSexFilter() {
- return sexFilter;
+ public Map<String, Object> getFiltering() {
+ return filtering;
}
- public void setSexFilter(String sexFilter) {
- this.sexFilter = sexFilter;
- }
+ public class ColumnSortingMap extends TreeMap<String, ColumnSorting> {
+ private static final long serialVersionUID = 1L;
- public String getNameFilter() {
- return nameFilter;
+ public ColumnSorting get(Object key) {
+ if (key instanceof String && !containsKey(key)) {
+ String columnName = (String) key;
+ put(columnName, new ColumnSorting(columnName));
+ }
+ return super.get(key);
+ }
}
- public void setNameFilter(String nameFilter) {
- this.nameFilter = nameFilter;
- }
+ public class ColumnSorting {
+ private String columnName;
+ private SortOrder order = SortOrder.unsorted;
- public String getTitleFilter() {
- return titleFilter;
- }
+ public ColumnSorting(String key) {
+ this.columnName = key;
+ }
- public void setTitleFilter(String titleFilter) {
- this.titleFilter = titleFilter;
- }
-
- public void sortByCapitals() {
- statesOrder = SortOrder.unsorted;
- if (capitalsOrder.equals(SortOrder.ascending)) {
- setCapitalsOrder(SortOrder.descending);
- } else {
- setCapitalsOrder(SortOrder.ascending);
+ public SortOrder getOrder() {
+ return order;
}
- }
- public void sortByStates() {
- capitalsOrder = SortOrder.unsorted;
- if (statesOrder.equals(SortOrder.ascending)) {
- setStatesOrder(SortOrder.descending);
- } else {
- setStatesOrder(SortOrder.ascending);
+ public void setOrder(SortOrder order) {
+ this.order = order;
}
- }
- public Filter<?> getFilterSexImpl() {
- return new Filter<Employee>() {
+ @SuppressWarnings("unchecked")
+ public void reverseOrder() {
+ SortMode mode = binding.getSortMode();
- public boolean accept(Employee e) {
- String sex = getSexFilter();
- if (sex == null || sex.length() == 0 || sex.equalsIgnoreCase("all") || sex.equalsIgnoreCase(e.getSex().toString())) {
- return true;
- }
- return false;
+ Object sortOrderObject = getAttributes().get("sortPriority").getValue();
+ Collection<String> sortPriority;
+ if (sortOrderObject instanceof Collection) {
+ sortPriority = (Collection<String>) sortOrderObject;
+ } else {
+ throw new IllegalStateException("sortOrder attribute have to be Collection");
}
- };
- }
- public void sortingListener(SortingEvent event) {
- System.out.println(event.getSortOrder());
+ if (SortMode.single.equals(mode)) {
+ sorting.clear();
+ sorting.put(columnName, this);
+
+ sortPriority.clear();
+ } else {
+ sortPriority.remove(columnName);
+ }
+
+ sortPriority.add(columnName);
+
+ if (SortOrder.ascending.equals(order)) {
+ order = SortOrder.descending;
+ } else {
+ order = SortOrder.ascending;
+ }
+ }
}
-
}
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.properties 2010-12-01 18:17:49 UTC (rev 20279)
@@ -0,0 +1,2 @@
+attr.sortMode.single=single
+attr.sortMode.multi=multi
\ No newline at end of file
Copied: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml (from rev 20278, modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/facets.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -0,0 +1,147 @@
+<?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:a4j="http://richfaces.org/a4j"
+ 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>
+ <style type="text/css">
+ .rf-edt {
+ width: 215px !important;
+ height: 300px !important;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richExtendedDataTableBean.state}">
+ <a4j:ajax render="richEDT scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:extendedDataTable id="richEDT"
+ beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
+ first="#{richExtendedDataTableBean.attributes['first'].value}"
+ frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
+ noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
+ rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
+ rows="#{richExtendedDataTableBean.attributes['rows'].value}"
+ selection="#{richExtendedDataTableBean.attributes['selection'].value}"
+ selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
+ sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
+ style="#{richExtendedDataTableBean.attributes['style'].value}"
+ styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
+ value="#{richExtendedDataTableBean.state ? model.capitals : null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText value="#{richExtendedDataTableBean.facets['noData']}" style="color: red;"/>
+ </f:facet>
+
+ <f:facet name="caption">
+ <h:outputText id="captionFacet" value="#{richExtendedDataTableBean.facets['caption']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['caption']}"/>
+ </f:facet>
+
+ <f:facet name="header">
+ <h:outputText id="header" value="#{richExtendedDataTableBean.facets['header']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['header']}"/>
+ </f:facet>
+
+ <rich:column id="columnState" sortBy="#{record.state}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderState" value="#{richExtendedDataTableBean.facets['columnStateHeader']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['columnStateHeader']}"/>
+ </f:facet>
+ <h:outputText value="#{record.state}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterState" value="#{richExtendedDataTableBean.facets['columnStateFooter']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['columnStateFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ <rich:column id="columnCapital" sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:outputText id="columnHeaderCapital" value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['columnCapitalHeader']}"/>
+ </f:facet>
+
+ <h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooterCapital" value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}"
+ rendered="#{not empty richExtendedDataTableBean.facets['columnCapitalFooter']}"/>
+ </f:facet>
+ </rich:column>
+
+ </rich:extendedDataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:ajax render="richEDT">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="No Data Facet: " />
+ <h:inputText id="noDataInput" value="#{richExtendedDataTableBean.facets['noData']}" />
+
+ <h:outputLabel value="Caption Facet: " />
+ <h:inputText id="captionInput" value="#{richExtendedDataTableBean.facets['caption']}" />
+
+ <h:outputLabel value="Header Facet:" />
+ <h:inputText id="headerInput" value="#{richExtendedDataTableBean.facets['header']}" />
+
+ <h:outputLabel value="State Column Header:" />
+ <h:inputText id="columnStateHeaderInput" value="#{richExtendedDataTableBean.facets['columnStateHeader']}" />
+
+ <h:outputLabel value="State Column Footer:" />
+ <h:inputText id="columnStateFooterInput" value="#{richExtendedDataTableBean.facets['columnStateFooter']}" />
+
+ <h:outputLabel value="Capital Column Header:" />
+ <h:inputText id="columnCapitalHeaderInput" value="#{richExtendedDataTableBean.facets['columnCapitalHeader']}" />
+
+ <h:outputLabel value="Capital Column Footer:" />
+ <h:inputText id="columnCapitalFooterInput" value="#{richExtendedDataTableBean.facets['columnCapitalFooter']}" />
+ </h:panelGrid>
+ </a4j:ajax>
+
+ <br/><br/>
+
+ <metamer:attributes value="#{richExtendedDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/filtering.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -129,11 +129,11 @@
<br/>
<h:outputText id="columnHeaderSexType" value="(filter)" />
<br/>
- <h:selectOneMenu id="columnHeaderSexInput" value="#{richExtendedDataTableBean.sexFilter}" >
+ <h:selectOneMenu id="columnHeaderSexInput" value="#{richExtendedDataTableBean.filtering['sex']}" >
<f:selectItem itemValue="ALL" itemLabel="all"/>
<f:selectItem itemValue="FEMALE" itemLabel="female"/>
<f:selectItem itemValue="MALE" itemLabel="male"/>
- <a4j:ajax render="commonGrid" execute="@this" event="change"/>
+ <a4j:ajax render="commonGrid" event="change"/>
</h:selectOneMenu>
</h:panelGroup>
</f:facet>
@@ -146,15 +146,15 @@
</rich:column>
- <rich:column id="columnName" filterValue="#{richExtendedDataTableBean.nameFilter}" filterExpression="#{fn:containsIgnoreCase(record.name, richDataTableBean.nameFilter)}">
+ <rich:column id="columnName" filterExpression="#{fn:containsIgnoreCase(record.name, richExtendedDataTableBean.filtering['name'])}">
<f:facet name="header">
<h:outputText id="columnHeaderName" value="Name" />
<br/>
<h:outputText id="columnHeaderNameType" value="(expression contains ignore case)" />
<br/>
- <h:inputText id="columnHeaderNameInput" value="#{richExtendedDataTableBean.nameFilter}">
- <a4j:ajax render="commonGrid" execute="@this" event="change"/>
- </h:inputText>
+ <h:inputText id="columnHeaderNameInput" value="#{richExtendedDataTableBean.filtering['name']}">
+ <a4j:ajax render="commonGrid" event="change"/>
+ </h:inputText>
</f:facet>
<h:outputText value="#{record.name}" />
@@ -163,14 +163,14 @@
</f:facet>
</rich:column>
- <rich:column id="columnTitle" filterValue="#{richExtendedDataTableBean.titleFilter}" filterExpression="#{richExtendedDataTableBean.titleFilter == null || richDataTableBean.titleFilter == '' || record.title == richDataTableBean.titleFilter}">
+ <rich:column id="columnTitle" filterExpression="#{richExtendedDataTableBean.filtering['title'] == null || richExtendedDataTableBean.filtering['title'] == '' || record.title == richExtendedDataTableBean.filtering['title']}">
<f:facet name="header">
<h:outputText id="columnHeaderTitle" value="Title" />
<br/>
<h:outputText id="columnHeaderTitleType" value="(expression equals)" />
<br/>
- <h:inputText id="columnHeaderTitleInput" value="#{richExtendedDataTableBean.titleFilter}">
- <a4j:ajax render="commonGrid" execute="@this" event="change"/>
+ <h:inputText id="columnHeaderTitleInput" value="#{richExtendedDataTableBean.filtering['title']}">
+ <a4j:ajax render="commonGrid" event="change"/>
</h:inputText>
</f:facet>
@@ -180,13 +180,15 @@
</f:facet>
</rich:column>
- <rich:column id="columnNumberOfKids">
+ <rich:column id="columnNumberOfKids1" filterExpression="#{empty richExtendedDataTableBean.filtering['numberOfKids1'] || record.numberOfKids >= richExtendedDataTableBean.filtering['numberOfKids1']}">
<f:facet name="header">
<h:outputText id="columnHeaderNumberOfKids" value="Number of Kids" />
<br/>
<h:outputText id="columnHeaderNumberOfKidsType" value="(expression >=)" />
<br/>
- <rich:inputNumberSpinner id="spinnerFilter" minValue="0" maxValue="6" value="0" cycled="true"/>
+ <rich:inputNumberSpinner id="spinnerFilter" minValue="0" maxValue="6" cycled="false" value="#{richExtendedDataTableBean.filtering['numberOfKids1']}">
+ <a4j:ajax render="commonGrid" />
+ </rich:inputNumberSpinner>
</f:facet>
<h:outputText value="#{record.numberOfKids}" />
@@ -201,7 +203,11 @@
<br/>
<h:outputText id="columnHeaderNumberOfKids2Type" value="(expression <)" />
<br/>
- <rich:inputNumberSlider id="sliderFilter" minValue="0" maxValue="6" value="6"/>
+ <rich:inputNumberSlider id="sliderFilter" minValue="0" maxValue="6" value="#{richExtendedDataTableBean.filtering['numberOfKids2']}">
+ <!-- <a4j:ajax render="commonGrid" /> -->
+ </rich:inputNumberSlider>
+ <br />
+ (DOESN'T WORK, NOT REPORTED YET (causes continuous refreshing of page))
</f:facet>
<h:outputText value="#{record.numberOfKids}" />
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/list.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -35,6 +35,10 @@
Simple page that contains <b>rich:extendedDataTable</b> (with model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="facets" outcome="facets" value="Facets">
+ Page containing <b>rich:extendedDataTable</b> (with model containing capitals) and input boxes for all facets dynamically changing.
+ </metamer:testPageLink>
+
<metamer:testPageLink id="scroller" outcome="scroller" value="Data Scroller">
Page that contains <b>rich:extendedDataTable</b> (with model containing capitals), data scroller and input boxes for all its attributes.
</metamer:testPageLink>
@@ -57,7 +61,7 @@
<b>rich:extendedDataTable</b> (with model containing states and capitals) custom sorting by <b>rich:column</b>'s attribute @sortBy, @sortOrder.
</metamer:testPageLink>
- <metamer:testPageLink id="filtering" outcome="filtering" value="Table filtering">
+ <metamer:testPageLink id="filtering" outcome="filtering" value="Table Filtering">
Page that contains filterable <b>rich:extendedDataTable</b> (with model containing capitals) and input boxes for all its attributes.
</metamer:testPageLink>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/scroller.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -56,30 +56,15 @@
<rich:extendedDataTable id="richEDT"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
- clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
- clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
- filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
- iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
- rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
- rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
- rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
- rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].value}"
rows="#{richExtendedDataTableBean.attributes['rows'].value}"
selection="#{richExtendedDataTableBean.attributes['selection'].value}"
selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
value="#{richExtendedDataTableBean.state ? model.capitals : null}"
@@ -128,72 +113,53 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort state">
- <rich:componentControl event="click" target="richEDT" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
+ <fieldset>
+ <legend>scroller1</legend>
+
+ <h:commandButton id="buttonFirst1" value="<< first">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton id="buttonPrev1" value="< previous">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="previous" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonNext1" value="next >">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonLast1" value="last >>">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
- <h:commandButton id="sortCapitalsButton" value="sort capital">
- <rich:componentControl event="click" target="richEDT" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <h:commandButton id="sortTableButton" value="sort table">
- <rich:componentControl event="click" target="richEDT" operation="sort" />
- </h:commandButton>
+ <fieldset>
+ <legend>scroller2</legend>
+ <h:commandButton id="buttonFirst2" value="<< first">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="switchToPage">
+ <f:param value="first" />
+ </rich:componentControl>
+ </h:commandButton>
+
+ <h:commandButton id="buttonPrev2" value="< previous">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="previous" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonNext2" value="next >">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="next" />
+ </h:commandButton>
+
+ <h:commandButton id="buttonLast2" value="last >>">
+ <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="switchToPage">
+ <f:param value="last" />
+ </rich:componentControl>
+ </h:commandButton>
+ </fieldset>
- <br/><br/>
-
- scroller1:
- <h:commandButton id="buttonFirst1" value="<< first">
- <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="buttonPrev1" value="< previous">
- <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="previous" />
- </h:commandButton>
-
- <h:commandButton id="buttonNext1" value="next >">
- <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="next" />
- </h:commandButton>
-
- <h:commandButton id="buttonLast1" value="last >>">
- <rich:componentControl event="click" target="#{rich:clientId('scroller1')}" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/>
-
- scroller2:
- <h:commandButton id="buttonFirst2" value="<< first">
- <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="switchToPage">
- <f:param value="first" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="buttonPrev2" value="< previous">
- <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="previous" />
- </h:commandButton>
-
- <h:commandButton id="buttonNext2" value="next >">
- <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="next" />
- </h:commandButton>
-
- <h:commandButton id="buttonLast2" value="last >>">
- <rich:componentControl event="click" target="#{rich:clientId('scroller2')}" operation="switchToPage">
- <f:param value="last" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
<metamer:attributes value="#{richExtendedDataTableBean.attributes}" id="attributes" />
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/simple.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -55,93 +55,35 @@
<rich:extendedDataTable id="richEDT"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
- clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
- clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
- filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
- iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
- rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
- rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
- rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
- rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].value}"
rows="#{richExtendedDataTableBean.attributes['rows'].value}"
selection="#{richExtendedDataTableBean.attributes['selection'].value}"
selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
value="#{richExtendedDataTableBean.state ? model.capitals : null}"
var="record"
>
- <f:facet name="noData">
- <h:outputText value="There is no data." style="color: red;"/>
- </f:facet>
+
- <f:facet name="caption">
- <h:outputText id="captionFacet" value="Caption Facet" />
- </f:facet>
-
- <f:facet name="header">
- <h:outputText value="Header Facet" />
- </f:facet>
-
<rich:column id="columnState" sortBy="#{record.state}">
- <f:facet name="header">
- <h:outputText id="columnHeaderState" value="State Header" />
- </f:facet>
-
<h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State Footer" />
- </f:facet>
</rich:column>
<rich:column id="columnCapital" sortBy="#{record.name}">
- <f:facet name="header">
- <h:outputText id="columnHeaderCapital" value="Capital Header" />
- </f:facet>
-
<h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital Footer" />
- </f:facet>
</rich:column>
</rich:extendedDataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort states">
- <rich:componentControl event="click" target="richEDT" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort capitals">
- <rich:componentControl event="click" target="richEDT" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
-
- <h:commandButton id="sortTableButton" value="sort table">
- <rich:componentControl event="click" target="richEDT" operation="sort" />
- </h:commandButton>
-
- <br/><br/>
<metamer:attributes value="#{richExtendedDataTableBean.attributes}" id="attributes" />
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-column.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -1,127 +1,158 @@
-<?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:a4j="http://richfaces.org/a4j"
- 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>
- <style type="text/css">
- .rf-edt {
- width: 300px !important;
- height: 300px !important;
- }
- </style>
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- <br/>
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richExtendedDataTableBean.state}">
- <a4j:ajax render="richDataTable scroller1"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- <rich:dataScroller id="scroller1" for="table" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table"/>
- </ui:define>
-
- <ui:define name="component">
-
- <rich:extendedDataTable id="table"
- beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
- clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
- clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
- filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
- first="#{richExtendedDataTableBean.attributes['first'].value}"
- frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
- iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
- noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
- rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
- rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
- rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
- rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
- rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].value}"
- rows="#{richExtendedDataTableBean.attributes['rows'].value}"
- selection="#{richExtendedDataTableBean.attributes['selection'].value}"
- selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
- sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
- sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
- style="#{richExtendedDataTableBean.attributes['style'].value}"
- styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
- value="#{richExtendedDataTableBean.state ? model.capitals : null}"
- var="record"
- >
-
- <f:facet name="noData">
- <h:outputText value="There is no data." style="color: red;"/>
- </f:facet>
-
- <rich:column id="columnState" sortBy="#{record.state}" sortOrder="#{richExtendedDataTableBean.statesOrder}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderState" value="State" render="table" action="#{richExtendedDataTableBean.sortByStates}"/>
- </f:facet>
-
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State" />
- </f:facet>
- </rich:column>
-
- <rich:column id="columnCapital" sortBy="#{record.name}" sortOrder="#{richExtendedDataTableBean.capitalsOrder}">
- <f:facet name="header">
- <a4j:commandLink id="columnHeaderCapital" value="Capital" render="table" action="#{richExtendedDataTableBean.sortByCapitals}"/>
- </f:facet>
-
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital" />
- </f:facet>
- </rich:column>
-
- <f:facet name="footer">
- <rich:dataScroller id="scroller2" for="table" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table" />
- </f:facet>
-
- </rich:extendedDataTable>
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richExtendedDataTableBean.attributes}" id="attributes" />
- </ui:define>
-
- </ui:composition>
+<?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:a4j="http://richfaces.org/a4j"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+
+ <!--
+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>
+ <style type="text/css">
+ .rf-edt-c {
+ height: 30px !important;
+ vertical-align: middle;
+ }
+
+ .rf-edt {
+ width: 820px !important;
+ height: 400px !important;
+ }
+
+ .rf-edt-hdr-c {
+ height: 4.2em !important;
+ }
+
+ .rf-edt-c-columnSex {
+ width: 100px !important;
+ text-align: center;
+ }
+
+ .rf-edt-c-columnName {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnTitle {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids {
+ text-align: center;
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids2 {
+ text-align: center;
+ width: 250px !important;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ <br/>
+ <h:outputText value="Show data in table: " />
+ <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richExtendedDataTableBean.state}">
+ <a4j:ajax render="richEDT scroller1"/>
+ </h:selectBooleanCheckbox>
+ <br/><br/>
+ <rich:dataScroller id="scroller1" for="richEDT" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table"/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:extendedDataTable id="richEDT"
+ binding="#{richExtendedDataTableBean.binding}"
+ beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
+ first="#{richExtendedDataTableBean.attributes['first'].value}"
+ frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
+ noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
+ rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
+ rows="#{richExtendedDataTableBean.attributes['rows'].value}"
+ selection="#{richExtendedDataTableBean.attributes['selection'].value}"
+ selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
+ sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
+ sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
+ style="#{richExtendedDataTableBean.attributes['style'].value}"
+ styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
+ value="#{richExtendedDataTableBean.state ? model.employees : null}"
+ var="record"
+ >
+
+ <f:facet name="noData">
+ <h:outputText value="There is no data." style="color: red;"/>
+ </f:facet>
+
+ <rich:column id="columnSex" sortBy="#{record.sex}" sortOrder="#{richExtendedDataTableBean.sorting['columnSex'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortBySex" value="Sex" render="richEDT" action="#{richExtendedDataTableBean.sorting['columnSex'].reverseOrder}" />
+ </f:facet>
+ <h:graphicImage library="images" name="#{record.sex == 'MALE' ? 'male.png' : 'female.png'}" />
+ </rich:column>
+
+
+ <rich:column id="columnName" sortBy="#{record.name}" sortOrder="#{richExtendedDataTableBean.sorting['columnName'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByName" value="Name" render="richEDT" action="#{richExtendedDataTableBean.sorting['columnName'].reverseOrder}" />
+ </f:facet>
+ <h:outputText value="#{record.name}" />
+ </rich:column>
+
+ <rich:column id="columnTitle" sortBy="#{record.title}" sortOrder="#{richExtendedDataTableBean.sorting['columnTitle'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByTitle" value="Title" render="richEDT" action="#{richExtendedDataTableBean.sorting['columnTitle'].reverseOrder}" />
+ </f:facet>
+ <h:outputText value="#{record.title}" />
+ </rich:column>
+
+ <rich:column id="columnNumberOfKids" sortBy="#{record.numberOfKids}" sortOrder="#{richExtendedDataTableBean.sorting['columnNumberOfKids'].order}">
+ <f:facet name="header">
+ <a4j:commandLink id="sortByNumberOfKids" value="# of Kids" render="richEDT" action="#{richExtendedDataTableBean.sorting['columnNumberOfKids'].reverseOrder}" />
+ </f:facet>
+ <h:outputText value="#{record.numberOfKids}" />
+ </rich:column>
+
+ <f:facet name="footer">
+ <rich:dataScroller id="scroller2" for="richEDT" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table" />
+ </f:facet>
+
+ </rich:extendedDataTable>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ <a4j:commandButton id="sortReset" value="Reset Sorting" action="#{richExtendedDataTableBean.sorting.clear}" render="richEDT" />
+
+ <br/><br/>
+
+ <metamer:attributes value="#{richExtendedDataTableBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-01 18:16:38 UTC (rev 20278)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richExtendedDataTable/sorting-using-component-control.xhtml 2010-12-01 18:17:49 UTC (rev 20279)
@@ -2,7 +2,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:a4j="http://richfaces.org/a4j"
- xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich">
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<!--
JBoss, Home of Professional Open Source
@@ -35,10 +36,42 @@
</f:viewParam>
</f:metadata>
<style type="text/css">
+ .rf-edt-c {
+ height: 30px !important;
+ vertical-align: middle;
+ }
+
.rf-edt {
- width: 300px !important;
- height: 300px !important;
+ width: 820px !important;
+ height: 400px !important;
}
+
+ .rf-edt-hdr-c {
+ height: 4.2em !important;
+ }
+
+ .rf-edt-c-columnSex {
+ width: 100px !important;
+ text-align: center;
+ }
+
+ .rf-edt-c-columnName {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnTitle {
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids {
+ text-align: center;
+ width: 150px !important;
+ }
+
+ .rf-edt-c-columnNumberOfKids2 {
+ text-align: center;
+ width: 250px !important;
+ }
</style>
</ui:define>
@@ -49,93 +82,89 @@
<a4j:ajax render="richDataTable scroller1"/>
</h:selectBooleanCheckbox>
<br/><br/>
- <rich:dataScroller id="scroller1" for="table" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table"/>
+ <rich:dataScroller id="scroller1" for="richEDT" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table"/>
</ui:define>
<ui:define name="component">
- <rich:extendedDataTable id="table"
+ <rich:extendedDataTable id="richEDT"
+ binding="#{richExtendedDataTableBean.binding}"
beforeselectionchange="#{richExtendedDataTableBean.attributes['beforeselectionchange'].value}"
- clientFirst="#{richExtendedDataTableBean.attributes['clientFirst'].value}"
- clientRows="#{richExtendedDataTableBean.attributes['clientRows'].value}"
- filterVar="#{richExtendedDataTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richExtendedDataTableBean.attributes['filteringListeners'].value}"
first="#{richExtendedDataTableBean.attributes['first'].value}"
frozenColumns="#{richExtendedDataTableBean.attributes['frozenColumns'].value}"
- iterationState="#{richExtendedDataTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richExtendedDataTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richExtendedDataTableBean.attributes['keepSaved'].value}"
noDataLabel="#{richExtendedDataTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richExtendedDataTableBean.attributes['relativeRowIndex'].value}"
rendered="#{richExtendedDataTableBean.attributes['rendered'].value}"
- rowAvailable="#{richExtendedDataTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richExtendedDataTableBean.attributes['rowCount'].value}"
- rowData="#{richExtendedDataTableBean.attributes['rowData'].value}"
- rowIndex="#{richExtendedDataTableBean.attributes['rowIndex'].value}"
- rowKey="#{richExtendedDataTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richExtendedDataTableBean.attributes['rowKeyConverter'].value}"
rows="#{richExtendedDataTableBean.attributes['rows'].value}"
selection="#{richExtendedDataTableBean.attributes['selection'].value}"
selectionchange="#{richExtendedDataTableBean.attributes['selectionchange'].value}"
sortMode="#{richExtendedDataTableBean.attributes['sortMode'].value}"
sortPriority="#{richExtendedDataTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richExtendedDataTableBean.attributes['sortingListeners'].value}"
style="#{richExtendedDataTableBean.attributes['style'].value}"
styleClass="#{richExtendedDataTableBean.attributes['styleClass'].value}"
- value="#{richExtendedDataTableBean.state ? model.capitals : null}"
+ value="#{richExtendedDataTableBean.state ? model.employees : null}"
var="record"
>
<f:facet name="noData">
<h:outputText value="There is no data." style="color: red;"/>
</f:facet>
-
- <rich:column id="columnState" sortBy="#{record.state}">
+
+ <rich:column id="columnSex" sortBy="#{record.sex}">
<f:facet name="header">
- State
+ <h:commandLink id="sortSexes" value="Sex">
+ <rich:componentControl event="click" target="richEDT" operation="sort">
+ <f:param value="columnSex" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:graphicImage library="images" name="#{record.sex == 'MALE' ? 'male.png' : 'female.png'}" />
+ </rich:column>
- <h:outputText value="#{record.state}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterState" value="State" />
+
+ <rich:column id="columnName" sortBy="#{record.name}">
+ <f:facet name="header">
+ <h:commandLink id="sortByName" value="Name">
+ <rich:componentControl event="click" target="richEDT" operation="sort">
+ <f:param value="columnName" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.name}" />
</rich:column>
- <rich:column id="columnCapital" sortBy="#{record.name}">
+ <rich:column id="columnTitle" sortBy="#{record.title}">
<f:facet name="header">
- Capital
+ <h:commandLink id="sortByTitle" value="Title">
+ <rich:componentControl event="click" target="richEDT" operation="sort">
+ <f:param value="columnTitle" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.title}" />
+ </rich:column>
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooterCapital" value="Capital" />
+ <rich:column id="columnNumberOfKids" sortBy="#{record.numberOfKids}">
+ <f:facet name="header">
+ <h:commandLink id="sortByNumberOfKids" value="Number of Kids">
+ <rich:componentControl event="click" target="richEDT" operation="sort">
+ <f:param value="columnNumberOfKids" />
+ </rich:componentControl>
+ </h:commandLink>
</f:facet>
+ <h:outputText value="#{record.numberOfKids}" />
</rich:column>
<f:facet name="footer">
- <rich:dataScroller id="scroller2" for="table" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table" />
+ <rich:dataScroller id="scroller2" for="richEDT" page="#{richExtendedDataTableBean.page}" maxPages="7" render="table" />
</f:facet>
</rich:extendedDataTable>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <h:commandButton id="sortStatesButton" value="sort state">
- <rich:componentControl event="click" target="table" operation="sort">
- <f:param value="columnState" />
- </rich:componentControl>
- </h:commandButton>
-
- <h:commandButton id="sortCapitalsButton" value="sort capital">
- <rich:componentControl event="click" target="table" operation="sort">
- <f:param value="columnCapital" />
- </rich:componentControl>
- </h:commandButton>
-
- <br/><br/>
- <h:commandButton id="sortTableButton" value="sort table">
- <rich:componentControl event="click" target="table" operation="sort" />
+ <h:commandButton id="sortReset" value="Reset Sorting">
+ <rich:componentControl event="click" target="richEDT" operation="sort" />
</h:commandButton>
<br/><br/>
14 years
JBoss Rich Faces SVN: r20278 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-01 13:16:38 -0500 (Wed, 01 Dec 2010)
New Revision: 20278
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
Log:
fixed Attribute setValue Collection parsing
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-12-01 18:16:03 UTC (rev 20277)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-12-01 18:16:38 UTC (rev 20278)
@@ -22,9 +22,9 @@
package org.richfaces.tests.metamer;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.LinkedList;
import java.util.List;
import javax.faces.model.SelectItem;
@@ -79,8 +79,8 @@
public void setValue(Object value) {
if (value instanceof String) {
if (type == Collection.class) {
- String[] splitted = StringUtils.split((String) value, ",[]");
- value = new ArrayList<String>(Arrays.asList(splitted));
+ String[] splitted = StringUtils.split((String) value, ",[] ");
+ value = new LinkedList<String>(Arrays.asList(splitted));
}
}
this.value = value;
14 years
JBoss Rich Faces SVN: r20277 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-01 13:16:03 -0500 (Wed, 01 Dec 2010)
New Revision: 20277
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
Log:
Attribute - setValue automatically converts attrs of Collection type to ArrayList
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-12-01 18:07:03 UTC (rev 20276)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/Attribute.java 2010-12-01 18:16:03 UTC (rev 20277)
@@ -22,6 +22,7 @@
package org.richfaces.tests.metamer;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -79,7 +80,7 @@
if (value instanceof String) {
if (type == Collection.class) {
String[] splitted = StringUtils.split((String) value, ",[]");
- value = Arrays.asList(splitted);
+ value = new ArrayList<String>(Arrays.asList(splitted));
}
}
this.value = value;
14 years
JBoss Rich Faces SVN: r20276 - sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-01 13:07:03 -0500 (Wed, 01 Dec 2010)
New Revision: 20276
Modified:
sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
Log:
RF-9496
Modified: sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-01 17:50:52 UTC (rev 20275)
+++ sandbox/trunk/ui/fileupload/ui/src/main/resources/META-INF/resources/org.richfaces/fileupload.js 2010-12-01 18:07:03 UTC (rev 20276)
@@ -36,6 +36,14 @@
SERVER_ERROR: "server_error"
};
+ var pressButton = function(event) {
+ jQuery(this).children(":first").css("background-position", "3px 3px").css("padding", "4px 4px 2px 22px");
+ };
+
+ var unpressButton = function(event) {
+ jQuery(this).children(":first").css("background-position", "2px 2px").css("padding", "3px 5px 3px 21px");
+ };
+
richfaces.ui = richfaces.ui || {};
richfaces.ui.FileUpload = richfaces.BaseComponent.extendClass({
@@ -69,8 +77,11 @@
this.cleanInput = this.input.clone();
this.addProxy = jQuery.proxy(this.__addItem, this);
this.input.change(this.addProxy);
- this.uploadButton.click(jQuery.proxy(this.__startUpload, this));
- this.clearButton.click(jQuery.proxy(this.__removeAllItems, this));
+ this.addButton.mousedown(pressButton).mouseup(unpressButton).mouseout(unpressButton);
+ this.uploadButton.click(jQuery.proxy(this.__startUpload, this)).mousedown(pressButton)
+ .mouseup(unpressButton).mouseout(unpressButton);
+ this.clearButton.click(jQuery.proxy(this.__removeAllItems, this)).mousedown(pressButton)
+ .mouseup(unpressButton).mouseout(unpressButton);
this.iframe.load(jQuery.proxy(this.__load, this));
if (this.onfilesubmit) {
richfaces.Event.bind(this.element, "onfilesubmit", new Function("event", this.onfilesubmit));
14 years
JBoss Rich Faces SVN: r20275 - in sandbox/trunk/ui/fileupload/ui: src/main/java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-01 12:50:52 -0500 (Wed, 01 Dec 2010)
New Revision: 20275
Added:
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
Modified:
sandbox/trunk/ui/fileupload/ui/pom.xml
sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
Log:
RF-9497
Modified: sandbox/trunk/ui/fileupload/ui/pom.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/pom.xml 2010-12-01 17:28:01 UTC (rev 20274)
+++ sandbox/trunk/ui/fileupload/ui/pom.xml 2010-12-01 17:50:52 UTC (rev 20275)
@@ -56,10 +56,6 @@
<artifactId>richfaces-ui-common-ui</artifactId>
</dependency>
<dependency>
- <groupId>org.richfaces.ui.output</groupId>
- <artifactId>richfaces-ui-output-ui</artifactId>
- </dependency>
- <dependency>
<groupId>org.richfaces.ui.fileupload</groupId>
<artifactId>richfaces-ui-fileupload-api</artifactId>
<version>${project.version}</version>
Modified: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-01 17:28:01 UTC (rev 20274)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/component/AbstractFileUpload.java 2010-12-01 17:50:52 UTC (rev 20275)
@@ -28,7 +28,6 @@
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ComponentSystemEvent;
-import javax.faces.event.ComponentSystemEventListener;
import javax.faces.event.ListenerFor;
import javax.faces.event.PostAddToViewEvent;
@@ -39,7 +38,6 @@
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.context.FileUploadPartialViewContextFactory;
import org.richfaces.event.FileUploadListener;
-import org.richfaces.event.UploadEvent;
import org.richfaces.request.MultipartRequest;
/**
@@ -50,7 +48,7 @@
renderer = @JsfRenderer(type = "org.richfaces.FileUploadRenderer"),
attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"})
@ListenerFor(systemEventClass = PostAddToViewEvent.class)
-public abstract class AbstractFileUpload extends UIComponentBase implements ComponentSystemEventListener {
+public abstract class AbstractFileUpload extends UIComponentBase {
@Attribute
public abstract String getAcceptedTypes();
@@ -68,29 +66,25 @@
public abstract String getOnuploadcomplete();
@Override
- public void decode(FacesContext context) {
- super.decode(context);
- Object request = context.getExternalContext().getRequest();
- if (request instanceof MultipartRequest) {
- queueEvent(new UploadEvent(this, ((MultipartRequest) request).getUploadItems()));
- }
- }
-
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
+ super.processEvent(event);
FacesContext context = getFacesContext();
Map<String, UIComponent> facets = getFacets();
UIComponent component = facets.get("progress");
if (component == null) {
- component = context.getApplication().createComponent(context, AbstractProgressBar.COMPONENT_TYPE,
+ component = context.getApplication().createComponent(context, "org.richfaces.ProgressBar",
"org.richfaces.ProgressBarRenderer");
- component.setId(getId() + "_pb");
- facets.put("progress", component);
+ if (component != null) {
+ component.setId(getId() + "_pb");
+ facets.put("progress", component);
+ }
}
- component.setValueExpression("value", context.getApplication().getExpressionFactory()
- .createValueExpression(context.getELContext(),
- "#{" + MultipartRequest.PERCENT_BEAN_NAME + "[param['"
- + FileUploadPartialViewContextFactory.UID_KEY + "']]}", Integer.class));
-
+ if (component != null) {
+ component.setValueExpression("value", context.getApplication().getExpressionFactory()
+ .createValueExpression(context.getELContext(),
+ "#{" + MultipartRequest.PERCENT_BEAN_NAME + "[param['"
+ + FileUploadPartialViewContextFactory.UID_KEY + "']]}", Integer.class));
+ }
}
/**
Added: sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java (rev 0)
+++ sandbox/trunk/ui/fileupload/ui/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2010-12-01 17:50:52 UTC (rev 20275)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.renderkit;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.event.UploadEvent;
+import org.richfaces.request.MultipartRequest;
+
+/**
+ * @author Konstantin Mishin
+ *
+ */
+public class FileUploadRendererBase extends RendererBase {
+
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ ExternalContext externalContext = context.getExternalContext();
+ Object request = externalContext.getRequest();
+ if (request instanceof MultipartRequest
+ && externalContext.getRequestParameterMap().containsKey(component.getClientId(context))) {
+ component.queueEvent(new UploadEvent(component, ((MultipartRequest) request).getUploadItems()));
+ }
+ }
+}
Modified: sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml
===================================================================
--- sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-01 17:28:01 UTC (rev 20274)
+++ sandbox/trunk/ui/fileupload/ui/src/main/templates/fileupload.template.xml 2010-12-01 17:50:52 UTC (rev 20275)
@@ -28,7 +28,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<cc:interface>
<cdk:class>org.richfaces.renderkit.html.FileUploadRenderer</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.RendererBase</cdk:superclass>
+ <cdk:superclass>org.richfaces.renderkit.FileUploadRendererBase</cdk:superclass>
<cdk:component-family>org.richfaces.FileUpload</cdk:component-family>
<cdk:renderer-type>org.richfaces.FileUploadRenderer</cdk:renderer-type>
<cdk:resource-dependency library="org.richfaces" name="fileupload.ecss" />
14 years
JBoss Rich Faces SVN: r20274 - sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-01 12:28:01 -0500 (Wed, 01 Dec 2010)
New Revision: 20274
Modified:
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
Log:
fix issue with custom drag indicatror position
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js 2010-12-01 17:16:00 UTC (rev 20273)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js 2010-12-01 17:28:01 UTC (rev 20274)
@@ -4,16 +4,19 @@
rf.ui.Draggable = function(id, options) {
this.dragElement = $(document.getElementById(id));
- this.dragElement.draggable({addClasses: false, appendTo: 'body'});
+ this.dragElement.draggable();
if(options.indicator) {
var element = document.getElementById(options.indicator);
- this.indicator = rf.$(options.indicator);
+ this.dragElement.data("indicator", true);
this.dragElement.draggable("option", "helper", function(){return element});
} else {
+ this.dragElement.data("indicator", false);
this.dragElement.draggable("option", "helper", 'clone');
}
+ this.dragElement.draggable("option", "addClasses", false);
+
this.options = options;
this.dragElement.data('type', this.options.type);
@@ -30,30 +33,38 @@
$.extend(rf.ui.Draggable.prototype, ( function () {
return {
dragStart: function(e, ui) {
- if(ui.helper) {
- var element = ui.helper[0];
- this.parentElement = element.parentNode;
- ui.helper.detach().appendTo("body");
- ui.helper.setPosition(e).show();
- }
+ var element = ui.helper[0];
+ this.parentElement = element.parentNode;
+ ui.helper.detach().appendTo("body").setPosition(e).show();
+
+ if(this.__isCustomDragIndicator()) {
+ // move cursor to the center of custom dragIndicator;
+ var left = (ui.helper.width()/2);
+ var top = (ui.helper.height()/2);
+ this.dragElement.data('draggable').offset.click.left = left;
+ this.dragElement.data('draggable').offset.click.top = top;
+ }
},
drag: function(e, ui) {
- var helper = ui.helper;
- if(this.indicator) {
- helper.addClass(this.indicator.draggingClass());
+ if(this.__isCustomDragIndicator()) {
+ var indicator = rf.$(this.options.indicator);
+ if(indicator) {
+ ui.helper.addClass(indicator.draggingClass());
+ }
}
},
dragStop: function(e, ui){
- if(ui.helper) {
- ui.helper.hide();
- ui.helper.detach().appendTo(this.parentElement);
- if(ui.helper[0] != this.dragElement[0]) {
+ ui.helper.hide().detach().appendTo(this.parentElement);
+ if(ui.helper[0] != this.dragElement[0]) {
//fix to prevent remove custom indicator from DOM tree. see jQuery draggable._clear method for details
- ui.helper[0] = this.dragElement[0];
- }
+ ui.helper[0] = this.dragElement[0];
}
+ },
+
+ __isCustomDragIndicator: function() {
+ return this.dragElement.data("indicator");
}
}
})());
Modified: sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
===================================================================
--- sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2010-12-01 17:16:00 UTC (rev 20273)
+++ sandbox/trunk/ui/drag-drop/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2010-12-01 17:28:01 UTC (rev 20274)
@@ -17,38 +17,36 @@
return {
drop: function(e, ui) {
if(this.accept(ui.draggable)) {
- var helper = ui.helper;
- var indicator = rf.$(helper.attr("id"));
- if(indicator) {
- helper.removeClass(indicator.acceptClass());
- helper.removeClass(indicator.rejectClass());
- }
this.__callAjax(e, ui);
}
+
+ var dragIndicatorObj = rf.$(ui.helper.attr("id"));
+ if(dragIndicatorObj) {
+ ui.helper.removeClass(dragIndicatorObj.acceptClass());
+ ui.helper.removeClass(dragIndicatorObj.rejectClass());
+ }
},
dropover: function(event, ui) {
var draggable = ui.draggable;
- var helper = ui.helper;
- var indicator = rf.$(helper.attr("id"));
- if(indicator) {
+ var dragIndicatorObj = rf.$(ui.helper.attr("id"));
+ if(dragIndicatorObj) {
if(this.accept(draggable)) {
- helper.removeClass(indicator.rejectClass());
- helper.addClass(indicator.acceptClass());
+ ui.helper.removeClass(dragIndicatorObj.rejectClass());
+ ui.helper.addClass(dragIndicatorObj.acceptClass());
} else {
- helper.removeClass(indicator.acceptClass());
- helper.addClass(indicator.rejectClass());
+ ui.helper.removeClass(dragIndicatorObj.acceptClass());
+ ui.helper.addClass(dragIndicatorObj.rejectClass());
}
}
},
dropout: function(event, ui) {
var draggable = ui.draggable;
- var helper = ui.helper;
- var indicator = rf.$(helper.attr("id"));
- if(indicator) {
- helper.removeClass(indicator.acceptClass());
- helper.removeClass(indicator.rejectClass());
+ var dragIndicatorObj = rf.$(ui.helper.attr("id"));
+ if(dragIndicatorObj) {
+ ui.helper.removeClass(dragIndicatorObj.acceptClass());
+ ui.helper.removeClass(dragIndicatorObj.rejectClass());
}
},
14 years
JBoss Rich Faces SVN: r20273 - in branches/RF-8742-1: examples/output-demo/src/main/webapp/examples and 33 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-01 12:16:00 -0500 (Wed, 01 Dec 2010)
New Revision: 20273
Added:
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/arrow.png
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/copy.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/create_doc.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/create_folder.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/cut.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/delete.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/edit.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/filter.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/find.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_group.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_item.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/open.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/paste.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/redo.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/reload.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/repeat.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save_all.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save_as.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/undo.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/verify.gif
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/clientStylingDisablement.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/clientStylingDisablement-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelCompositeTuplesIterator.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuplesIterator.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeTuplesIterator.java
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-item.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItem.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml
Removed:
branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenu.js
branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js
branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml
Modified:
branches/RF-8742-1/
branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
branches/RF-8742-1/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java
branches/RF-8742-1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml
branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
branches/RF-8742-1/examples/validator-demo/pom.xml
branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
branches/RF-8742-1/ui/input/ui/src/main/templates/calendar.template.xml
branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java
branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
branches/RF-8742-1/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java
branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml
branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
Log:
Merged revisions 20248,20250-20255,20257-20272 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20248 | nbelaevski | 2010-11-30 16:51:49 -0800 (Tue, 30 Nov 2010) | 1 line
ProgressBar: added missing default values for 'minValue' & 'maxValue' attributes
.......
r20250 | abelevich | 2010-12-01 02:36:16 -0800 (Wed, 01 Dec 2010) | 2 lines
fix demo
.......
r20251 | ilya_shaikovsky | 2010-12-01 02:55:48 -0800 (Wed, 01 Dec 2010) | 2 lines
https://jira.jboss.org/browse/RF-9752
+SH correction. jQuery was missed in dependencies.
.......
r20252 | ilya_shaikovsky | 2010-12-01 07:01:15 -0800 (Wed, 01 Dec 2010) | 3 lines
https://jira.jboss.org/browse/RF-9834 + calendar refactoring and issue fixes in client functions attributes
+ tooltip minor layout correction
+ panelMenu sample draft
.......
r20253 | Alex.Kolonitsky | 2010-12-01 07:12:38 -0800 (Wed, 01 Dec 2010) | 2 lines
RF-9317 panelMenu components
icons attributes
.......
r20254 | ppitonak(a)redhat.com | 2010-12-01 07:23:37 -0800 (Wed, 01 Dec 2010) | 2 lines
* project name changed from Outputs to Validators
.......
r20255 | nbelaevski | 2010-12-01 08:16:19 -0800 (Wed, 01 Dec 2010) | 5 lines
RF-9680:
- Added children() method to TreeDataModel & tuples
- Related refactorings for UIDataAdaptor
- Redesign API for walking over model
- Renderer updated for new API
.......
r20257 | nbelaevski | 2010-12-01 08:18:03 -0800 (Wed, 01 Dec 2010) | 1 line
RF-9680
.......
r20258 | nbelaevski | 2010-12-01 08:19:43 -0800 (Wed, 01 Dec 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20259 | nbelaevski | 2010-12-01 08:22:40 -0800 (Wed, 01 Dec 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20260 | nbelaevski | 2010-12-01 08:24:19 -0800 (Wed, 01 Dec 2010) | 1 line
Duplicating DeclarativeTreeModel deleted
.......
r20261 | nbelaevski | 2010-12-01 08:27:24 -0800 (Wed, 01 Dec 2010) | 1 line
RF-9680
.......
r20262 | nbelaevski | 2010-12-01 08:30:13 -0800 (Wed, 01 Dec 2010) | 5 lines
RF-9680:
- Added children() method to TreeDataModel & tuples
- Related refactorings for UIDataAdaptor
- Redesign API for walking over model
- Renderer updated for new API
.......
r20263 | nbelaevski | 2010-12-01 08:31:57 -0800 (Wed, 01 Dec 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20264 | nbelaevski | 2010-12-01 08:34:45 -0800 (Wed, 01 Dec 2010) | 1 line
https://jira.jboss.org/browse/RF-9680
.......
r20265 | nbelaevski | 2010-12-01 08:36:25 -0800 (Wed, 01 Dec 2010) | 1 line
Duplicating DeclarativeTreeModel deleted
.......
r20266 | nbelaevski | 2010-12-01 08:39:29 -0800 (Wed, 01 Dec 2010) | 1 line
Removed garbage .orig files
.......
r20267 | nbelaevski | 2010-12-01 08:42:39 -0800 (Wed, 01 Dec 2010) | 3 lines
Revert "Removed garbage .orig files"
This reverts commit 85c650a75288c2c83389496616ee375fd83233b7.
.......
r20268 | nbelaevski | 2010-12-01 08:44:18 -0800 (Wed, 01 Dec 2010) | 3 lines
Revert "Duplicating DeclarativeTreeModel deleted"
This reverts commit 0b9208ef20b1556889f431f90e7db9d86da05b33.
.......
r20269 | nbelaevski | 2010-12-01 08:47:10 -0800 (Wed, 01 Dec 2010) | 3 lines
Revert "https://jira.jboss.org/browse/RF-9680"
This reverts commit 91df734486336d26683612eaa91c59b8062aec32.
.......
r20270 | nbelaevski | 2010-12-01 08:50:17 -0800 (Wed, 01 Dec 2010) | 1 line
Removed garbage .orig files
.......
r20271 | nbelaevski | 2010-12-01 08:51:58 -0800 (Wed, 01 Dec 2010) | 1 line
Duplicating DeclarativeTreeModel deleted
.......
r20272 | nbelaevski | 2010-12-01 08:55:03 -0800 (Wed, 01 Dec 2010) | 4 lines
Merge branch 'RF-9680' into HEAD
Conflicts:
ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java
.......
Property changes on: branches/RF-8742-1
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-20241
+ /trunk:1-20272
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -7,10 +7,7 @@
<h:head>
<title>ToolBar sample</title>
<style>
- .pic {
- margin-bottom: -4px;
- margin-right: 2px;
- }
+
</style>
</h:head>
<h:body>
@@ -19,63 +16,63 @@
||
</f:facet>
<tb:toolBarGroup itemSeparator="line" onitemclick="22">
- <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
- <a href="sdsd">link 1</a> Text
- <a href="sdsd 2">link 2</a>
- <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic" onclick="q1"/>
- <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
- <a href="sdsd">link 3</a> Text
- <a href="sdsd 2">link 4</a>
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <a href="#">link 1</a> Text
+ <a href="#">link 2</a>
+ <h:graphicImage value="/images/icons/create_folder.gif" onclick="q1"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
+ <a href="#">link 3</a> Text
+ <a href="#">link 4</a>
</tb:toolBarGroup>
<tb:toolBarGroup itemSeparator="none">
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
</tb:toolBarGroup>
<tb:toolBarGroup itemSeparator="line">
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
</tb:toolBarGroup>
<tb:toolBarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/find.gif" />
+ <h:graphicImage value="/images/icons/filter.gif" />
</tb:toolBarGroup>
</tb:toolBar>
<br/>
<tb:toolBar itemSeparator="grid">
<tb:toolBarGroup itemSeparator="line">
- <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <h:graphicImage value="/images/icons/create_folder.gif"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
</tb:toolBarGroup>
<tb:toolBarGroup itemSeparator="disc">
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save.gif"/>
+ <h:graphicImage value="/images/icons/save_as.gif"/>
+ <h:graphicImage value="/images/icons/save_all.gif"/>
</tb:toolBarGroup>
<tb:toolBarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/find.gif"/>
+ <h:graphicImage value="/images/icons/filter.gif"/>
</tb:toolBarGroup>
</tb:toolBar>
<br/>
<tb:toolBar height="26" itemSeparator="grid">
<tb:toolBarGroup itemSeparator="line">
- <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/create_folder.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <h:graphicImage value="/images/icons/create_folder.gif"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
</tb:toolBarGroup>
<tb:toolBarGroup itemSeparator="disc">
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/save.gif"/>
+ <h:graphicImage value="/images/icons/save_as.gif"/>
+ <h:graphicImage value="/images/icons/save_all.gif"/>
</tb:toolBarGroup>
<tb:toolBarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif" styleClass="pic"/>
- <h:graphicImage value="/images/icons/filter.gif" styleClass="pic"/>
+ <h:graphicImage value="/images/icons/find.gif"/>
+ <h:graphicImage value="/images/icons/filter.gif"/>
</tb:toolBarGroup>
</tb:toolBar>
</h:body>
Modified: branches/RF-8742-1/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/qunit/panelMenu.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -50,26 +50,53 @@
<p>Page</p>
<h:form id="f" style="border:blue solid thin;">
- <pn:panelMenu id="panelMenu" expandSingle="true" activeItem="myFavariteIten">
- <pn:panelMenuGroup label="Group 1" mode="ajax" expandSingle="true">
- <pn:panelMenuItem label="Item 1.1" mode="ajax"/>
- <pn:panelMenuItem label="Item 1.2" mode="ajax"/>
- <pn:panelMenuItem label="Item 1.3" mode="ajax"/>
+ <pn:panelMenu
+ id="panelMenu"
+ expandSingle="true"
+ itemMode="ajax"
+ groupMode="ajax"
+ activeItem="myFavariteIten"
+ itemDisableIconLeft="disc"
+ groupDisableIconLeft="disc"
+ topItemDisableIconLeft="disc"
+ topGroupDisableIconLeft="disc"
+ >
+ <pn:panelMenuGroup label="Group 1">
+ <pn:panelMenuItem label="Item 1.1" />
+ <pn:panelMenuItem label="Item 1.2" />
+ <pn:panelMenuItem label="Item 1.3" />
</pn:panelMenuGroup>
- <pn:panelMenuGroup label="Group 2" mode="ajax" expandSingle="true">
- <pn:panelMenuItem label="Item 2.1" mode="ajax"/>
- <pn:panelMenuGroup label="Group 2.2" mode="ajax" expandSingle="true">
- <pn:panelMenuItem label="Item 2.2.1" mode="ajax"/>
- <pn:panelMenuItem name="myFavariteIten" label="Item 2.2.2" mode="ajax"/>
- <pn:panelMenuItem label="Item 2.2.3" mode="ajax"/>
+ <pn:panelMenuGroup
+ label="Group 2"
+ iconLeftCollapsed="triangle"
+ iconLeftExpanded="triangleDown">
+ <pn:panelMenuItem label="Item 2.1" />
+ <pn:panelMenuGroup
+ label="Group 2.2"
+ iconLeftCollapsed="chevron"
+ iconLeftExpanded="chevronDown">
+ <pn:panelMenuItem label="Item 2.2.1" />
+ <pn:panelMenuItem label="Item 2.2.2" name="myFavariteIten" />
+ <pn:panelMenuItem label="Item 2.2.3"/>
</pn:panelMenuGroup>
- <pn:panelMenuItem label="Item 2.3" mode="ajax"/>
+ <pn:panelMenuItem label="Item 2.3"/>
</pn:panelMenuGroup>
- <pn:panelMenuGroup label="Group 3" mode="ajax" expandSingle="true">
- <pn:panelMenuItem label="Item 3.1" mode="ajax"/>
- <pn:panelMenuItem label="Item 3.2" mode="ajax"/>
- <pn:panelMenuItem label="Item 3.3" mode="ajax" />
+ <pn:panelMenuGroup label="Group 3" >
+ <pn:panelMenuItem label="Item 3.1" disabled="true"/>
+ <pn:panelMenuItem label="Item 3.2"/>
+ <pn:panelMenuItem label="Item 3.3"/>
+ <pn:panelMenuGroup label="Group 3.4" disabled="true">
+ <pn:panelMenuItem label="Item 3.4.1" />
+ <pn:panelMenuItem label="Item 3.4.2" name="mySecondFavariteIten"/>
+ <pn:panelMenuItem label="Item 3.4.3"/>
+ </pn:panelMenuGroup>
</pn:panelMenuGroup>
+ <pn:panelMenuGroup label="Group 4">
+ <pn:panelMenuItem label="Item 4.1" />
+ <pn:panelMenuItem label="Item 4.2" />
+ <pn:panelMenuItem label="Item 4.3" />
+ </pn:panelMenuGroup>
+ <pn:panelMenuGroup label="Group 5" disabled="true" />
</pn:panelMenu>
</h:form>
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenu.js
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenu.js 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenu.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,208 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- expandSingle : true
- };
-
- rf.ui.PanelMenu = rf.BaseComponent.extendClass({
- // class name
- name:"PanelMenu",
-
- /**
- * @class PanelMenu
- * @name PanelMenu
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- this.id = componentId;
- this.items = [];
- this.attachToDom(componentId);
-
- this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
- this.activeItem = this.__getValueInput().value;
- this.nestingLevel = 0;
-
- var menuGroup = this;
- if (menuGroup.options.expandSingle) {
- menuGroup.__panelMenu().bind("expand", function (event) {
- menuGroup.__childGroups().each (function (index, group) {
- if (event.target.id != group.id) {
- rf.$(group.id).collapse();
- }
- });
-
- event.stopPropagation();
- });
- }
-
- if (menuGroup.activeItem) {
- this.__panelMenu().ready(function () {
- var item = menuGroup.items[menuGroup.activeItem];
- item.__select();
- item.__fireSelect();
- })
- }
-
- this.__addUserEventHandler("collapse");
- this.__addUserEventHandler("expand");
- },
-
- getItems: function () {
- return this.items;
- },
-
- getItem: function (name) {
- return this.items[name];
- },
-
- /***************************** Public Methods ****************************************************************/
- /**
- * @methodOf
- * @name PanelMenu#selectItem
- *
- * TODO ...
- *
- * @param {String} name
- * @return {void} TODO ...
- */
- selectItem: function (name) {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#selectedItem
- *
- * TODO ...
- *
- * @return {String} TODO ...
- */
- selectedItem: function (id) {
- if (id != undefined) {
- var valueInput = this.__getValueInput();
- var prevActiveItem = valueInput.value;
-
- this.activeItem = id;
- valueInput.value = id;
-
- return prevActiveItem;
- } else {
- return this.activeItem;
- }
- },
-
- __getValueInput : function() {
- return document.getElementById(this.id + "-value");
- },
-
- selectItem: function (itemName) {
- // TODO
- },
-
- /**
- * @methodOf
- * @name PanelMenu#expandAll
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- expandAll: function () {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#collapseAll
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- collapseAll: function () {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#expandGroup
- *
- * TODO ...
- *
- * @param {String} groupName
- * @return {void} TODO ...
- */
- expandGroup: function (groupName) {
- // TODO implement
- },
-
- /**
- * @methodOf
- * @name PanelMenu#collapseGroup
- *
- * TODO ...
- *
- * @param {String} groupName
- * @return {void} TODO ...
- */
- collapseGroup: function (groupName) {
- // TODO implement
- },
-
-
- /***************************** Private Methods ****************************************************************/
-
-
- __panelMenu : function () {
- return $(rf.getDomElement(this.id));
- },
-
- __childGroups : function () {
- return this.__panelMenu().children(".rf-pm-top-gr")
- },
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- destroy: function () {
- rf.Event.unbindById(this.id, "."+this.namespace);
-
- this.$super.destroy.call(this);
- }
- });
-})(jQuery, RichFaces);
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuGroup.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,355 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- expanded : false,
- expandSingle : true,
- bubbleSelection : true,
- stylePrefix : "rf-pm-gr",
-
- // TODO we should use selectionType = {none, selectable, unselectable}
- selectable : false,
- unselectable : false // unselectable can be only selectable item => if selectable == false than unselectable = false
- };
-
- var EXPAND_ITEM = {
-
- /**
- *
- * @return {void}
- * */
- exec : function (group, expand) {
- var mode = group.mode;
- if (mode == "server") {
- return this.execServer(group);
- } else if (mode == "ajax") {
- return this.execAjax(group);
- } else if (mode == "client" || mode == "none") {
- return this.execClient(group, expand);
- } else {
- rf.log.error("EXPAND_ITEM.exec : unknown mode (" + mode + ")");
- }
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execServer : function (group) {
- group.__changeState();
- rf.submitForm(this.__getParentForm(group));
-
- return false;
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execAjax : function (group) {
- var oldState = group.__changeState();
- rf.ajax(group.id, null, $.extend({}, group.options["ajax"], {}));
- group.__restoreState(oldState);
-
- return true;
- },
-
- /**
- * @protected
- *
- * @param {PanelMenuGroup} group
- * @param {Boolean} expand
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (group, expand) {
- if (expand) {
- group.expand();
- } else {
- group.collapse();
- }
-
- return group.__fireSwitch();
- },
-
- /**
- * @private
- * */
- __getParentForm : function (item) {
- return $($(rf.getDomElement(item.id)).parents("form")[0]);
- }
- };
-
- rf.ui.PanelMenuGroup = rf.ui.PanelMenuItem.extendClass({
- // class name
- name:"PanelMenuGroup",
-
- /**
- * @class PanelMenuGroup
- * @name PanelMenuGroup
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
-
- rf.ui.PanelMenuItem.call(this, componentId);
-
- if (!this.options.disabled) {
- var menuGroup = this;
-
- if (!this.options.selectable) {
- this.__header().bind("click", function () {
- return menuGroup.switchExpantion();
- });
- }
-
- if (this.options.selectable || this.options.bubbleSelection) {
- this.__content().bind("select", function (event) {
- if (menuGroup.options.selectable && menuGroup.__isMyEvent(event)) {
- menuGroup.expand();
- }
-
- if (menuGroup.options.bubbleSelection && !menuGroup.__isMyEvent(event)) {
- menuGroup.__select();
- if (!menuGroup.expanded()) {
- menuGroup.expand();
- }
- }
- });
-
- this.__content().bind("unselect", function (event) {
- if (menuGroup.options.selectable && menuGroup.__isMyEvent(event)) {
- menuGroup.collapse();
- }
-
- if (menuGroup.options.bubbleSelection && !menuGroup.__isMyEvent(event)) {
- menuGroup.__unselect();
- }
- });
- }
-
- if (menuGroup.options.expandSingle) {
- menuGroup.__group().bind("expand", function (event) {
- if (menuGroup.__isMyEvent(event)) {
- return;
- }
-
- menuGroup.__childGroups().each (function (index, group) {
- var rfGroup = rf.$(group);
- if (!rfGroup.__isMyEvent(event)) {
- rfGroup.collapse();
- }
- });
-
- event.stopPropagation();
- });
- }
-
- this.__addUserEventHandler("collapse");
- this.__addUserEventHandler("expand");
- }
- },
-
- /***************************** Public Methods ****************************************************************/
- expanded : function () {
- // TODO check invariant in dev mode
- // return this.__content().hasClass("rf-pm-exp")
- return this.__getExpandValue();
- },
-
- expand : function () {
- this.__expand();
-
- return this.__fireExpand();
- },
-
- __expand : function () {
- this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
- this.__setExpandValue(true);
- },
-
- collapsed : function () {
- // TODO check invariant in dev mode
- // return this.__content().hasClass("rf-pm-colps")
- return !this.__getExpandValue();
- },
-
- collapse : function () {
- this.__collapse();
-
- this.__childGroups().each (function(index, group) {
- rf.$(group.id).__collapse();
- });
-
- this.__fireCollapse();
- },
-
- __collapse : function () {
- this.__content().addClass("rf-pm-colps").removeClass("rf-pm-exp");
- this.__setExpandValue(false);
- },
-
- /**
- * @methodOf
- * @name PanelMenuGroup#switch
- *
- * TODO ...
- *
- * @param {boolean} expand
- * @return {void} TODO ...
- */
- switchExpantion : function () { // TODO rename
- var continueProcess = this.__fireBeforeSwitch();
- if (!continueProcess) {
- return false;
- }
-
- EXPAND_ITEM.exec(this, !this.expanded());
- },
-
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function () {
- EXPAND_ITEM.execClient(this, this.expanded());
- },
-
- __switch : function (expand) {
- if (expand) {
- this.expand();
- } else {
- this.collapse();
- }
- },
-
- /***************************** Private Methods ****************************************************************/
- __childGroups : function () {
- return this.__content().children(".rf-pm-gr")
- },
-
- __group : function () {
- return $(rf.getDomElement(this.id))
- },
-
- __header : function () {
- return $(rf.getDomElement(this.id + ":hdr"))
- },
-
- __content : function () {
- return $(rf.getDomElement(this.id + ":cnt"))
- },
-
- __expandValueInput : function () {
- return document.getElementById(this.id + ":expanded");
- },
-
- __getExpandValue : function () {
- return this.__expandValueInput().value == "true";
- },
-
- /**
- * @methodOf
- * @name PanelMenuGroup#__setExpandValue
- *
- * @param {boolean} value - is group expanded?
- * @return {boolean} preview value
- */
- __setExpandValue : function (value) {
- var input = this.__expandValueInput();
- var oldValue = input.value;
-
- input.value = value;
-
- return oldValue;
- },
-
- __changeState : function () {
- var state = {};
- state["expanded"] = this.__setExpandValue(!this.__getExpandValue());
- if (this.options.selectable) {
- state["itemName"] = this.__rfPanelMenu().selectedItem(this.itemName); // TODO bad function name for function which change component state
- }
-
- return state;
- },
-
- __restoreState : function (state) {
- if (!state) {
- return;
- }
-
- if (state["expanded"]) {
- this.__setExpandValue(state["expanded"]);
- }
-
- if (state["itemName"]) {
- this.__rfPanelMenu().selectedItem(state["itemName"]);
- }
- },
-
- __fireSwitch : function () {
- return new rf.Event.fireById(this.id, "switch", {
- id: this.id
- });
- },
-
- __isMyEvent: function (event) {
- return this.id == event.target.id;
- },
-
- __fireBeforeSwitch : function () {
- return rf.Event.fireById(this.id, "beforeswitch", {
- id: this.id
- });
- },
-
- __fireCollapse : function () {
- return new rf.Event.fireById(this.id, "collapse", {
- id: this.id
- });
- },
-
- __fireExpand : function () {
- return new rf.Event.fireById(this.id, "expand", {
- id: this.id
- });
- },
-
- destroy: function () {
- rf.Event.unbindById(this.id, "."+this.namespace);
-
- this.$super.destroy.call(this);
- }
- });
-})(jQuery, RichFaces);
Deleted: branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js
===================================================================
--- branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/output-demo/src/main/webapp/resources/PanelMenuItem.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,319 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright ${year}, 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.
- */
-
-
-(function ($, rf) {
-
- rf.ui = rf.ui || {};
-
- var __DEFAULT_OPTIONS = {
- disabled : false,
- selectable: true,
- mode: "client",
- unselectable: false,
- highlight: true,
- stylePrefix: "rf-pm-itm",
- itemStep: 20
- };
-
- var SELECT_ITEM = {
-
- /**
- *
- * @return {void}
- * */
- exec : function (item) {
- var mode = item.mode;
- if (mode == "server") {
- return this.execServer(item);
- } else if (mode == "ajax") {
- return this.execAjax(item);
- } else if (mode == "client" || mode == "none") {
- return this.execClient(item);
- } else {
- rf.log.error("SELECT_ITEM.exec : unknown mode (" + mode + ")");
- }
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execServer : function (item) {
- item.__changeState();
- rf.submitForm(this.__getParentForm(item));
-
- return false;
- },
-
- /**
- * @protected
- *
- * @return {Boolean} false
- * */
- execAjax : function (item) {
- var oldItem = item.__changeState();
- rf.ajax(item.__panelMenu().id, null, $.extend({}, item.options["ajax"], {}));
- item.__restoreState(oldItem);
-
- return true;
- },
-
- /**
- * @protected
- *
- * @return {undefined}
- * - false - if process has been terminated
- * - true - in other cases
- * */
- execClient : function (item) {
- var panelMenu = item.__rfPanelMenu();
- if (panelMenu.selectedItem()) {
- panelMenu.getItems()[panelMenu.selectedItem()].unselect();
- }
- panelMenu.selectedItem(item.itemName);
-
- item.__select();
-
- return item.__fireSelect();
- },
-
- /**
- * @private
- * */
- __getParentForm : function (item) {
- return $($(rf.getDomElement(item.id)).parents("form")[0]);
- }
- };
-
- rf.ui.PanelMenuItem = rf.BaseComponent.extendClass({
- // class name
- name:"PanelMenuItem",
-
- /**
- * @class PanelMenuItem
- * @name PanelMenuItem
- *
- * @constructor
- * @param {String} componentId - component id
- * @param {Hash} options - params
- * */
- init : function (componentId, options) {
- this.id = componentId;
- this.attachToDom(componentId);
-
- this.options = $.extend({}, __DEFAULT_OPTIONS, this.options || {}, options || {});
-
- this.mode = this.options.mode
- this.itemName = this.options.name
- this.__rfPanelMenu().getItems()[this.itemName] = this;
-
- // todo move it
- this.selectionClass = this.options.stylePrefix + "-sel";
- this.hoverClass = this.options.stylePrefix + "-hov";
-
- if (!this.options.disabled) {
- var item = this;
- if (this.options.highlight) {
- this.__item().bind("mouseenter", function() {
- item.highlight(true);
- });
- this.__item().bind("mouseleave", function() {
- item.highlight(false);
- });
- }
-
- if (this.options.selectable) {
- this.__header().bind("click", function() {
- if (item.__rfPanelMenu().selectedItem() == item.id) {
- if (item.options.unselectable) {
- return item.unselect();
- }
-
- // we shouldn't select one item several times
- } else {
- return item.select();
- }
- });
- }
- }
-
- item = this;
- $(this.__panelMenu()).ready(function () {
- item.__renderNestingLevel();
- });
-
- this.__addUserEventHandler("select");
- },
-
- /***************************** Public Methods ****************************************************************/
- highlight : function (highlight) {
- if (highlight && !this.selected()) {
- this.__header().addClass(this.hoverClass);
- } else {
- this.__header().removeClass(this.hoverClass);
- }
- },
-
- selected : function () {
- return this.__header().hasClass(this.selectionClass);
- },
-
- /**
- * @methodOf
- * @name PanelMenuItem#select
- *
- * TODO ...
- *
- * @return {void} TODO ...
- */
- select: function () {
- var continueProcess = this.__fireBeforeSelect();
- if (!continueProcess) {
- return false;
- }
-
- return SELECT_ITEM.exec(this)
- },
-
- /**
- * please, remove this method when client side ajax events will be added
- *
- * */
- onCompleteHandler : function () {
- SELECT_ITEM.execClient(this);
- },
-
- unselect: function () {
- var panelMenu = this.__rfPanelMenu();
- if (panelMenu.selectedItem() == this.itemName) {
- panelMenu.selectedItem(null);
- } else {
- rf.warn("You try unselect item (name=" + this.itemName + ") that isn't seleted")
- }
-
- this.__unselect();
-
- return this.__fireUnselect();
- },
-
- /***************************** Private Methods ****************************************************************/
- __rfParentItem : function () {
- var res = this.__item().parents(".rf-pm-gr")[0];
- if (!res) {
- res = this.__item().parents(".rf-pm-top-gr")[0];
- }
-
- if (!res) {
- res = this.__panelMenu();
- }
-
- return res ? rf.$(res) : null;
- },
-
- __getNestingLevel : function () {
- if (!this.nestingLevel) {
- var parentItem = this.__rfParentItem();
- if (parentItem && parentItem.__getNestingLevel) {
- this.nestingLevel = parentItem.__getNestingLevel() + 1;
- } else {
- this.nestingLevel = 0;
- }
- }
-
- return this.nestingLevel;
- },
-
- __renderNestingLevel : function () {
- this.__item().find("td").first().css("padding-left", this.options.itemStep * this.__getNestingLevel());
- },
-
- __panelMenu : function () {
- return this.__item().parents(".rf-pm")[0];
- },
-
- __rfPanelMenu : function () {
- return rf.$(this.__item().parents(".rf-pm")[0]);
- },
-
- __changeState : function () {
- return this.__rfPanelMenu().selectedItem(this.itemName);
- },
-
- __restoreState : function (state) {
- if (state) {
- this.__rfPanelMenu().selectedItem(state);
- }
- },
-
- __item : function () {
- return $(rf.getDomElement(this.id));
- },
-
- __header : function () {
- return this.__item();
- },
-
- __select: function () {
- this.__header().addClass(this.selectionClass);
- },
-
- __unselect: function () {
- this.__header().removeClass(this.selectionClass);
- },
-
- __fireBeforeSelect : function () {
- return new rf.Event.fireById(this.id, "beforeselect", {
- id: this.id
- });
- },
-
- __fireSelect : function () {
- return new rf.Event.fireById(this.id, "select", {
- id: this.id
- });
- },
-
- __fireUnselect : function () {
- return new rf.Event.fireById(this.id, "unselect", {
- id: this.id
- });
- },
-
- /**
- * @private
- * */
- __addUserEventHandler : function (name) {
- var handler = this.options["on" + name];
- if (handler) {
- rf.Event.bindById(this.id, name, handler);
- }
- },
-
- destroy: function () {
- delete this.__rfPanelMenu().getItems()[this.itemName];
-
- rf.ui.PanelMenuItem.$super.destroy.call(this);
- }
- });
-})(jQuery, RichFaces);
Modified: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/calendar/CalendarBean.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -17,6 +17,7 @@
private Date selectedDate;
private boolean showApply = true;
private boolean useCustomDayLabels;
+ private boolean disabled = false;
public CalendarBean() {
@@ -83,4 +84,12 @@
this.showApply = showApply;
}
+ public boolean isDisabled() {
+ return disabled;
+ }
+
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+
}
\ No newline at end of file
Modified: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/components/sh/SyntaxHighlighter.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -17,6 +17,7 @@
@FacesComponent(value = "syntaxHighlighter")
@ResourceDependencies({ @ResourceDependency(library = "js", name = "shCore.js"),
+ @ResourceDependency(name = "jquery.js"),
@ResourceDependency(library = "css", name = "shCore.css"),
@ResourceDependency(library = "css", name = "shThemeDefault.css"),
@ResourceDependency(library = "js", name = "shBrushJScript.js"),
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu (from rev 20272, trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu)
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,33 +0,0 @@
-package org.richfaces.demo.panelmenu;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
-
-import org.richfaces.event.ItemChangeEvent;
-@ManagedBean
-@RequestScoped
-public class PanelMenuBean {
- private String current;
- private boolean singleMode;
- public boolean isSingleMode() {
- return singleMode;
- }
-
- public void setSingleMode(boolean singleMode) {
- this.singleMode = singleMode;
- }
-
- public PanelMenuBean() {
- }
-
- public String getCurrent() {
- return this.current;
- }
-
- public void setCurrent(String current) {
- this.current = current;
- }
- public void updateCurrent(ItemChangeEvent event) {
- setCurrent(event.getNewItem());
- }
-}
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java (from rev 20272, trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/panelmenu/PanelMenuBean.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,33 @@
+package org.richfaces.demo.panelmenu;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.event.ItemChangeEvent;
+@ManagedBean
+@RequestScoped
+public class PanelMenuBean {
+ private String current;
+ private boolean singleMode;
+ public boolean isSingleMode() {
+ return singleMode;
+ }
+
+ public void setSingleMode(boolean singleMode) {
+ this.singleMode = singleMode;
+ }
+
+ public PanelMenuBean() {
+ }
+
+ public String getCurrent() {
+ return this.current;
+ }
+
+ public void setCurrent(String current) {
+ this.current = current;
+ }
+ public void updateCurrent(ItemChangeEvent event) {
+ setCurrent(event.getNewItem());
+ }
+}
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar (from rev 20272, trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar)
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,30 +0,0 @@
-package org.richfaces.demo.toolbar;
-
-import java.io.Serializable;
-
-import javax.faces.bean.ManagedBean;
-import javax.faces.bean.ViewScoped;
-
-@ManagedBean
-@ViewScoped
-public class ToolBarBean implements Serializable{
- private String groupSeparator;
- private String groupItemSeparator;
-
- public String getGroupItemSeparator() {
- return groupItemSeparator;
- }
-
- public void setGroupItemSeparator(String groupItemSeparator) {
- this.groupItemSeparator = groupItemSeparator;
- }
-
- public String getGroupSeparator() {
- return groupSeparator;
- }
-
- public void setGroupSeparator(String groupSeparator) {
- this.groupSeparator = groupSeparator;
- }
-
-}
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java (from rev 20272, trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/java/org/richfaces/demo/toolbar/ToolBarBean.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,30 @@
+package org.richfaces.demo.toolbar;
+
+import java.io.Serializable;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+@ManagedBean
+@ViewScoped
+public class ToolBarBean implements Serializable{
+ private String groupSeparator;
+ private String groupItemSeparator;
+
+ public String getGroupItemSeparator() {
+ return groupItemSeparator;
+ }
+
+ public void setGroupItemSeparator(String groupItemSeparator) {
+ this.groupItemSeparator = groupItemSeparator;
+ }
+
+ public String getGroupSeparator() {
+ return groupSeparator;
+ }
+
+ public void setGroupSeparator(String groupSeparator) {
+ this.groupSeparator = groupSeparator;
+ }
+
+}
Modified: branches/RF-8742-1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -298,7 +298,7 @@
<group>
<name>Trees</name>
<demos>
- <demo new="true">
+ <demo>
<id>tree</id>
<name>rich:tree</name>
<samples>
@@ -337,7 +337,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>tabPanel</id>
<name>rich:tabPanel</name>
<samples>
@@ -358,7 +358,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>collapsiblePanel</id>
<name>rich:collapsiblePanel</name>
<samples>
@@ -406,7 +406,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>tooltip</id>
<name>rich:tooltip</name>
<samples>
@@ -418,19 +418,39 @@
</demo>
</demos>
</group>
- <!-- group>
+ <group>
<name>Menus</name>
<demos>
- <demo>
+ <demo new="true">
<id>panelMenu</id>
<name>rich:panelMenu</name>
+ <samples>
+ <sample>
+ <id>panelMenu</id>
+ <name>Simple Panel Menu</name>
+ </sample>
+ </samples>
</demo>
+ <demo new="true">
+ <id>toolBar</id>
+ <name>rich:toolBar</name>
+ <samples>
+ <sample>
+ <id>toolBar</id>
+ <name>Simple Toolbar</name>
+ </sample>
+ <sample>
+ <id>toolBarIcons</id>
+ <name>Icons Customization</name>
+ </sample>
+ </samples>
+ </demo>
</demos>
- </group-->
+ </group>
<group>
<name>Inputs and Selects</name>
- <demos>
- <demo new="true">
+ <demos>
+ <demo>
<id>autocomplete</id>
<name>rich:autocomplete</name>
<samples>
@@ -438,20 +458,24 @@
<id>cachedAjax</id>
<name>Autocomplete in Cached Ajax mode</name>
</sample>
- <sample new="true">
+ <sample>
<id>clientFilter</id>
<name>Custom client filter</name>
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>calendar</id>
<name>rich:calendar</name>
<samples>
- <sample>
+ <sample new="true">
<id>calendar</id>
<name>Simple Calendar</name>
</sample>
+ <sample new="true">
+ <id>clientStylingDisablement</id>
+ <name>Client Side Styling/Disablement</name>
+ </sample>
</samples>
</demo>
<demo>
@@ -484,7 +508,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>inplaceSelect</id>
<name>rich:inplaceSelect</name>
<samples>
@@ -494,7 +518,7 @@
</sample>
</samples>
</demo>
- <demo new="true">
+ <demo>
<id>select</id>
<name>rich:select</name>
<samples>
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/arrow.png (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/arrow.png)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/copy.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/copy.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/create_doc.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/create_doc.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/create_folder.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/create_folder.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/cut.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/cut.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/delete.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/delete.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/edit.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/edit.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/filter.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/filter.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/find.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/find.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_group.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_group.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_item.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/ico_new_item.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/open.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/open.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/paste.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/paste.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/redo.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/redo.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/reload.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/reload.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/repeat.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/repeat.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/save.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save_all.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/save_all.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/save_as.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/save_as.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/undo.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/undo.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/images/icons/verify.gif (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/images/icons/verify.gif)
===================================================================
(Binary files differ)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/clientStylingDisablement.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/clientStylingDisablement.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/clientStylingDisablement.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/clientStylingDisablement.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,20 @@
+<!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">
+
+<ui:composition>
+ <p>This simple example shows the way of client side dates
+ disablement and styling without dataModel usage.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Modified: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/calendar-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -29,39 +29,46 @@
locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
datePattern="#{calendarBean.pattern}"
showApplyButton="#{calendarBean.showApply}" cellWidth="24px"
- cellHeight="22px" style="width:200px">
+ cellHeight="22px" style="width:200px"
+ disabled="#{calendarBean.disabled}">
</rich:calendar>
</a4j:outputPanel>
- <h:panelGrid columns="2">
- <h:outputText value="Popup Mode:" />
- <h:selectBooleanCheckbox value="#{calendarBean.popup}">
- <a4j:ajax event="click" render="calendar @this" />
- </h:selectBooleanCheckbox>
- <h:outputText value="Apply Button:" />
- <h:selectBooleanCheckbox value="#{calendarBean.showApply}">
- <a4j:ajax event="click" render="calendar @this" />
- </h:selectBooleanCheckbox>
- <h:outputText value="Select Locale" />
- <h:selectOneRadio value="en/US"
- valueChangeListener="#{calendarBean.selectLocale}">
- <a4j:ajax event="click" render="calendar @this" />
- <f:selectItem itemLabel="US" itemValue="en/US" />
- <f:selectItem itemLabel="DE" itemValue="de/DE" />
- <f:selectItem itemLabel="FR" itemValue="fr/FR" />
- <f:selectItem itemLabel="RU" itemValue="ru/RU" />
- </h:selectOneRadio>
+ <a4j:region>
+ <h:panelGrid columns="2">
+ <h:outputText value="Disabled:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.disabled}">
+ <a4j:ajax event="click" render="calendar @this" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Popup Mode:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.popup}">
+ <a4j:ajax event="click" render="calendar @this" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Apply Button:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.showApply}">
+ <a4j:ajax event="click" render="calendar @this" />
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Select Locale" />
+ <h:selectOneRadio value="en/US"
+ valueChangeListener="#{calendarBean.selectLocale}">
+ <a4j:ajax event="click" render="calendar @this" />
+ <f:selectItem itemLabel="US" itemValue="en/US" />
+ <f:selectItem itemLabel="DE" itemValue="de/DE" />
+ <f:selectItem itemLabel="FR" itemValue="fr/FR" />
+ <f:selectItem itemLabel="RU" itemValue="ru/RU" />
+ </h:selectOneRadio>
- <h:outputText value="Select Date Pattern:" />
- <h:selectOneMenu value="#{calendarBean.pattern}">
- <a4j:ajax event="change" render="calendar @this" />
- <f:selectItem itemLabel="d/M/yy HH:mm" itemValue="d/M/yy HH:mm" />
- <f:selectItem itemLabel="dd/M/yy hh:mm a"
- itemValue="dd/M/yy hh:mm a" />
- <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
- <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy" />
- </h:selectOneMenu>
+ <h:outputText value="Select Date Pattern:" />
+ <h:selectOneMenu value="#{calendarBean.pattern}">
+ <a4j:ajax event="change" render="calendar @this" />
+ <f:selectItem itemLabel="d/M/yy HH:mm" itemValue="d/M/yy HH:mm" />
+ <f:selectItem itemLabel="dd/M/yy hh:mm a"
+ itemValue="dd/M/yy hh:mm a" />
+ <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
+ <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy" />
+ </h:selectOneMenu>
- </h:panelGrid>
+ </h:panelGrid>
+ </a4j:region>
</h:panelGrid>
</h:form>
</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/clientStylingDisablement-sample.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/clientStylingDisablement-sample.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/clientStylingDisablement-sample.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/calendar/samples/clientStylingDisablement-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+.everyThirdDay {
+ background-color: gray;
+}
+
+.weekendBold {
+ font-weight: bold;
+ font-style: italic;
+}
+</style>
+ <script type="text/javascript">
+ var curDt = new Date();
+ function disablementFunction(day){
+ if (day.isWeekend) return false;
+ if (curDt==undefined){
+ curDt = day.date.getDate;
+ }
+ if (curDt.getTime() - day.date.getTime() < 0) return true; else return false;
+ }
+ function disabledClassesProv(day){
+ if (curDt.getTime() - day.date.getTime() >= 0) return 'rf-ca-boundary-dates';
+ var res = '';
+ if (day.isWeekend) res+='weekendBold ';
+ if (day.day%3==0) res+='everyThirdDay';
+ return res;
+ }
+ </script>
+ <rich:calendar dayDisableFunction="disablementFunction"
+ dayClassFunction="disabledClassesProv" boundaryDatesMode="scroll" />
+
+</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu)
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,39 +0,0 @@
-<!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">
-
-<ui:composition>
- <p>The <b>rich:panelMenu</b> component is used to define a
- collapsible side-menu panel. The component has a pre-defined skinable
- look-n-feel. You can customize it with styles and a set of component
- attributes. The folowing demo shows the example of rich:panelMenu</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
- <p>Switching mode could be chosen with the <b>itemMode</b>
- attribute for all panelMenu items except ones where this attribute was
- redefined.</p>
- <p>The <b>groupMode</b> attribute defines the submission modes for
- all collapsing/expanding panelMenu groups except ones where this
- attribute was redefined.</p>
- <p>The <b>itemMode </b>and <b>groupMode </b>attributes could be
- used with three possible parameters:</p>
- <ul>
- <li><b>server</b> (default) - The common submission of the form
- is performed and a page is completely refreshed.</li>
- <li><b>ajax</b> - An Ajax form submission is performed, and
- additionally specified elements in the "reRender" attribute are
- reRendered</li>
- <li><b>client</b> Items don't fire any submits itself. Behavior
- is completely defined by the components nested to items. Groups expand
- on the client side.</li>
- </ul>
-</ui:composition>
-</html>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/panelMenu.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,39 @@
+<!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">
+
+<ui:composition>
+ <p>The <b>rich:panelMenu</b> component is used to define a
+ collapsible side-menu panel. The component has a pre-defined skinable
+ look-n-feel. You can customize it with styles and a set of component
+ attributes. The folowing demo shows the example of rich:panelMenu</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <p>Switching mode could be chosen with the <b>itemMode</b>
+ attribute for all panelMenu items except ones where this attribute was
+ redefined.</p>
+ <p>The <b>groupMode</b> attribute defines the submission modes for
+ all collapsing/expanding panelMenu groups except ones where this
+ attribute was redefined.</p>
+ <p>The <b>itemMode </b>and <b>groupMode </b>attributes could be
+ used with three possible parameters:</p>
+ <ul>
+ <li><b>server</b> (default) - The common submission of the form
+ is performed and a page is completely refreshed.</li>
+ <li><b>ajax</b> - An Ajax form submission is performed, and
+ additionally specified elements in the "reRender" attribute are
+ reRendered</li>
+ <li><b>client</b> Items don't fire any submits itself. Behavior
+ is completely defined by the components nested to items. Groups expand
+ on the client side.</li>
+ </ul>
+</ui:composition>
+</html>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples)
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition 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:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <style>
-.cols {
- vertical-align: top;
-}
-</style>
- <h:form id="form">
- <h:panelGrid columns="2" columnClasses="cols,cols" width="400">
- <rich:panelMenu style="width:200px" mode="ajax"
- iconExpandedGroup="disc" iconCollapsedGroup="disc"
- iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
- iconCollapsedTopGroup="chevronDown"
- itemChangeListener="#{panelMenuBean.updateCurrent}">
- <rich:panelMenuGroup label="Group 1">
- <rich:panelMenuItem label="Item 1.1">
- <f:param name="current" value="Item 1.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 1.2">
- <f:param name="current" value="Item 1.2" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 1.3">
- <f:param name="current" value="Item 1.3" />
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- <rich:panelMenuGroup label="Group 2">
- <rich:panelMenuItem label="Item 2.1">
- <f:param name="current" value="Item 2.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 2.2">
- <f:param name="current" value="Item 2.2" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 2.3">
- <f:param name="current" value="Item 2.3" />
- </rich:panelMenuItem>
- <rich:panelMenuGroup label="Group 2.4">
- <rich:panelMenuItem label="Item 2.4.1">
- <f:param name="current" value="Item 2.4.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 2.4.2">
- <f:param name="current" value="Item 2.4.2" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 2.4.3">
- <f:param name="current" value="Item 2.4.3" />
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- <rich:panelMenuItem label="Item 2.5">
- <f:param name="current" value="Item 2.5" />
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- <rich:panelMenuGroup label="Group 3">
- <rich:panelMenuItem label="Item 3.1">
- <f:param name="current" value="Item 3.1" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 3.2">
- <f:param name="current" value="Item 3.2" />
- </rich:panelMenuItem>
- <rich:panelMenuItem label="Item 3.3">
- <f:param name="current" value="Item 3.3" />
- </rich:panelMenuItem>
- </rich:panelMenuGroup>
- </rich:panelMenu>
- <rich:panel bodyClass="rich-laguna-panel-no-header">
- <a4j:outputPanel ajaxRendered="true">
- <h:outputText value="#{panelMenuBean.current} selected" id="current" />
- </a4j:outputPanel>
- </rich:panel>
- </h:panelGrid>
- <rich:tabPanel>
- <rich:tab label="12 ">asdasd</rich:tab>
- </rich:tabPanel>
- </h:form>
-</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/panelMenu/samples/panelMenu-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+.cols {
+ vertical-align: top;
+}
+</style>
+ <h:form id="form">
+ <h:panelGrid columns="2" columnClasses="cols,cols" width="400">
+ <rich:panelMenu style="width:200px" mode="ajax"
+ iconExpandedGroup="disc" iconCollapsedGroup="disc"
+ iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
+ iconCollapsedTopGroup="chevronDown"
+ itemChangeListener="#{panelMenuBean.updateCurrent}">
+ <rich:panelMenuGroup label="Group 1">
+ <rich:panelMenuItem label="Item 1.1">
+ <f:param name="current" value="Item 1.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1.2">
+ <f:param name="current" value="Item 1.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 1.3">
+ <f:param name="current" value="Item 1.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Group 2">
+ <rich:panelMenuItem label="Item 2.1">
+ <f:param name="current" value="Item 2.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.2">
+ <f:param name="current" value="Item 2.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.3">
+ <f:param name="current" value="Item 2.3" />
+ </rich:panelMenuItem>
+ <rich:panelMenuGroup label="Group 2.4">
+ <rich:panelMenuItem label="Item 2.4.1">
+ <f:param name="current" value="Item 2.4.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.4.2">
+ <f:param name="current" value="Item 2.4.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 2.4.3">
+ <f:param name="current" value="Item 2.4.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuItem label="Item 2.5">
+ <f:param name="current" value="Item 2.5" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ <rich:panelMenuGroup label="Group 3">
+ <rich:panelMenuItem label="Item 3.1">
+ <f:param name="current" value="Item 3.1" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3.2">
+ <f:param name="current" value="Item 3.2" />
+ </rich:panelMenuItem>
+ <rich:panelMenuItem label="Item 3.3">
+ <f:param name="current" value="Item 3.3" />
+ </rich:panelMenuItem>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText value="#{panelMenuBean.current} selected" id="current" />
+ </a4j:outputPanel>
+ </rich:panel>
+ </h:panelGrid>
+ <rich:tabPanel>
+ <rich:tab label="12 ">asdasd</rich:tab>
+ </rich:tabPanel>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar)
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples)
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition 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:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
- <style>
-.pic {
- margin-right: 2px;
-}
-
-.barsearch {
- height: 14px;
- width: 100px;
-}
-
-.barsearchbutton {
- border-width: 1px;
- background-color: #{ a4jSkin.generalBackgroundColor
-}
-;
-}
-</style>
-
- <rich:toolBar height="26" itemSeparator="grid">
- <rich:toolBarGroup>
- <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic" />
- <h:graphicImage value="/images/icons/create_folder.gif"
- styleClass="pic" />
- <h:graphicImage value="/images/icons/copy.gif" styleClass="pic" />
- </rich:toolBarGroup>
- <rich:toolBarGroup>
- <h:graphicImage value="/images/icons/save.gif" styleClass="pic" />
- <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic" />
- <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic" />
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right">
- <h:inputText styleClass="barsearch" />
- <h:commandButton styleClass="barsearchbutton" onclick="return false;"
- value="Search" />
- </rich:toolBarGroup>
- </rich:toolBar>
-
-
-</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBar-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+.pic {
+ margin-right: 2px;
+}
+
+.barsearch {
+ height: 14px;
+ width: 100px;
+}
+
+.barsearchbutton {
+ border-width: 1px;
+ background-color: #{ a4jSkin.generalBackgroundColor
+}
+;
+}
+</style>
+
+ <rich:toolBar height="26" itemSeparator="grid">
+ <rich:toolBarGroup>
+ <h:graphicImage value="/images/icons/create_doc.gif" styleClass="pic" />
+ <h:graphicImage value="/images/icons/create_folder.gif"
+ styleClass="pic" />
+ <h:graphicImage value="/images/icons/copy.gif" styleClass="pic" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup>
+ <h:graphicImage value="/images/icons/save.gif" styleClass="pic" />
+ <h:graphicImage value="/images/icons/save_as.gif" styleClass="pic" />
+ <h:graphicImage value="/images/icons/save_all.gif" styleClass="pic" />
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right">
+ <h:inputText styleClass="barsearch" />
+ <h:commandButton styleClass="barsearchbutton" onclick="return false;"
+ value="Search" />
+ </rich:toolBarGroup>
+ </rich:toolBar>
+
+
+</ui:composition>
\ No newline at end of file
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition 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:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
-
- <h:form>
- <h:panelGrid columns="3" width="100%" cellpadding="0" cellspacing="0"
- style="margin-bottom : 4px">
- <rich:panel>
- <h:panelGrid columns="8">
- <h:outputText value="Group Separator:" />
- <a4j:commandLink value="Line">
- <a4j:param name="gs" value="line"
- assignTo="#{toolBarBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Grid">
- <a4j:param name="gs" value="grid"
- assignTo="#{toolBarBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Disc">
- <a4j:param name="gs" value="disc"
- assignTo="#{toolBarBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Square">
- <a4j:param name="gs" value="square"
- assignTo="#{toolBarBean.groupSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="None">
- <a4j:param name="gs" value="none"
- assignTo="#{toolBarBean.groupSeparator}" />
- </a4j:commandLink>
- </h:panelGrid>
- </rich:panel>
- <h:panelGroup style="padding-left : 4px">
- <br />
- </h:panelGroup>
- <rich:panel bodyClass="rich-laguna-panel-no-header">
- <h:panelGrid columns="8">
- <h:outputText value="Group Item Separator:" />
- <a4j:commandLink value="Line">
- <a4j:param name="gs" value="line"
- assignTo="#{toolBarBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Grid">
- <a4j:param name="gs" value="grid"
- assignTo="#{toolBarBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Disc">
- <a4j:param name="gs" value="disc"
- assignTo="#{toolBarBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="Square">
- <a4j:param name="gs" value="square"
- assignTo="#{toolBarBean.groupItemSeparator}" />
- </a4j:commandLink>
-
- <a4j:commandLink value="None">
- <a4j:param name="gs" value="none"
- assignTo="#{toolBarBean.groupItemSeparator}" />
- </a4j:commandLink>
- </h:panelGrid>
- </rich:panel>
- </h:panelGrid>
- </h:form>
- <a4j:outputPanel ajaxRendered="true">
- <rich:toolBar id="bar" height="30"
- itemSeparator="#{toolBarBean.groupSeparator}">
- <rich:toolBarGroup itemSeparator="#{toolBarBean.groupItemSeparator}">
- <h:outputText value="Group1.1"></h:outputText>
- <h:outputText value="Group1.2"></h:outputText>
- <h:outputText value="Group1.3"></h:outputText>
- </rich:toolBarGroup>
- <rich:toolBarGroup itemSeparator="#{toolBarBean.groupItemSeparator}">
- <h:outputText value="Group2.1"></h:outputText>
- <h:outputText value="Group2.2"></h:outputText>
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right"
- itemSeparator="#{toolBarBean.groupItemSeparator}">
- <h:outputText value="Group3.1"></h:outputText>
- <h:outputText value="Group3.2"></h:outputText>
- </rich:toolBarGroup>
- </rich:toolBar>
- </a4j:outputPanel>
-
-</ui:composition>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/samples/toolBarIcons-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,95 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:form>
+ <h:panelGrid columns="3" width="100%" cellpadding="0" cellspacing="0"
+ style="margin-bottom : 4px">
+ <rich:panel>
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Separator:" />
+ <a4j:commandLink value="Line">
+ <a4j:param name="gs" value="line"
+ assignTo="#{toolBarBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid">
+ <a4j:param name="gs" value="grid"
+ assignTo="#{toolBarBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc">
+ <a4j:param name="gs" value="disc"
+ assignTo="#{toolBarBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square">
+ <a4j:param name="gs" value="square"
+ assignTo="#{toolBarBean.groupSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None">
+ <a4j:param name="gs" value="none"
+ assignTo="#{toolBarBean.groupSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ <h:panelGroup style="padding-left : 4px">
+ <br />
+ </h:panelGroup>
+ <rich:panel bodyClass="rich-laguna-panel-no-header">
+ <h:panelGrid columns="8">
+ <h:outputText value="Group Item Separator:" />
+ <a4j:commandLink value="Line">
+ <a4j:param name="gs" value="line"
+ assignTo="#{toolBarBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Grid">
+ <a4j:param name="gs" value="grid"
+ assignTo="#{toolBarBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Disc">
+ <a4j:param name="gs" value="disc"
+ assignTo="#{toolBarBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="Square">
+ <a4j:param name="gs" value="square"
+ assignTo="#{toolBarBean.groupItemSeparator}" />
+ </a4j:commandLink>
+
+ <a4j:commandLink value="None">
+ <a4j:param name="gs" value="none"
+ assignTo="#{toolBarBean.groupItemSeparator}" />
+ </a4j:commandLink>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+ </h:form>
+ <a4j:outputPanel ajaxRendered="true">
+ <rich:toolBar id="bar" height="30"
+ itemSeparator="#{toolBarBean.groupSeparator}">
+ <rich:toolBarGroup itemSeparator="#{toolBarBean.groupItemSeparator}">
+ <h:outputText value="Group1.1"></h:outputText>
+ <h:outputText value="Group1.2"></h:outputText>
+ <h:outputText value="Group1.3"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup itemSeparator="#{toolBarBean.groupItemSeparator}">
+ <h:outputText value="Group2.1"></h:outputText>
+ <h:outputText value="Group2.2"></h:outputText>
+ </rich:toolBarGroup>
+ <rich:toolBarGroup location="right"
+ itemSeparator="#{toolBarBean.groupItemSeparator}">
+ <h:outputText value="Group3.1"></h:outputText>
+ <h:outputText value="Group3.2"></h:outputText>
+ </rich:toolBarGroup>
+ </rich:toolBar>
+ </a4j:outputPanel>
+
+</ui:composition>
\ No newline at end of file
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,29 +0,0 @@
-<!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">
-
-<ui:composition>
- <p><b>Toolbar </b>is a horizontal-oriented panel that can be used in
- different ways: for top level menu, for information panel and so on. To
- create top level menu - just use <b>dropDownMenu </b>or <b>menuItem</b>'s as child
- components.</p>
- <p>Items on the toolbar can be grouped with ability to define a
- separator between different groups and between a member of the same
- group. The "<b>location</b>" attribute set to "<b>right</b>" put a group to the right
- side of the panel.</p>
-
- <p>The following example shows how the simple toolbar might look
- like:</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
-
-</ui:composition>
-</html>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBar.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,29 @@
+<!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">
+
+<ui:composition>
+ <p><b>Toolbar </b>is a horizontal-oriented panel that can be used in
+ different ways: for top level menu, for information panel and so on. To
+ create top level menu - just use <b>dropDownMenu </b>or <b>menuItem</b>'s as child
+ components.</p>
+ <p>Items on the toolbar can be grouped with ability to define a
+ separator between different groups and between a member of the same
+ group. The "<b>location</b>" attribute set to "<b>right</b>" put a group to the right
+ side of the panel.</p>
+
+ <p>The following example shows how the simple toolbar might look
+ like:</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+
+</ui:composition>
+</html>
\ No newline at end of file
Deleted: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1,20 +0,0 @@
-<!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">
-
-<ui:composition>
- <p>There you could check how the default separators could be used:</p>
-
- <ui:include src="#{demoNavigator.sampleIncludeURI}" />
- <ui:include src="/templates/includes/source-view.xhtml">
- <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
- <ui:param name="sourceType" value="xhtml" />
- <ui:param name="openLabel" value="View Source" />
- <ui:param name="hideLabel" value="Hide Source" />
- </ui:include>
- <p>Separators could be customized using URI to custom icons in
- <b>itemSeparator</b> attribute</p>
-</ui:composition>
-</html>
\ No newline at end of file
Copied: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml (from rev 20272, trunk/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml)
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml (rev 0)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/toolBar/toolBarIcons.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,20 @@
+<!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">
+
+<ui:composition>
+ <p>There you could check how the default separators could be used:</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+ <p>Separators could be customized using URI to custom icons in
+ <b>itemSeparator</b> attribute</p>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
===================================================================
--- branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -9,7 +9,6 @@
.tooltip {
background-color: #{ richSkin.generalBackgroundColor};
border-width:3px;
- padding:10px;
}
.tooltip-custom-body {
background-color: orange;
Modified: branches/RF-8742-1/examples/validator-demo/pom.xml
===================================================================
--- branches/RF-8742-1/examples/validator-demo/pom.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/examples/validator-demo/pom.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -13,7 +13,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>validator-demo</artifactId>
<version>4.0.0-SNAPSHOT</version>
- <name>Richfaces Examples: Outputs</name>
+ <name>Richfaces Examples: Validators</name>
<packaging>war</packaging>
<properties>
Modified: branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -246,6 +246,10 @@
private Object rowKey = null;
+ private boolean rowDataIsSet = false;
+
+ private Object rowData;
+
private String clientId;
private Object originalVarValue;
@@ -367,6 +371,34 @@
return rowKey;
}
+ private void setRowKeyAndData(FacesContext facesContext, Object rowKey, boolean localRowDataAvailable, Object localRowData) {
+ this.saveChildState(facesContext);
+
+ this.rowKey = rowKey;
+
+ if (localRowDataAvailable) {
+ this.rowData = localRowData;
+ this.rowDataIsSet = (rowKey != null);
+ } else {
+ this.rowData = null;
+ this.rowDataIsSet = false;
+
+ getExtendedDataModel().setRowKey(rowKey);
+ }
+
+ this.clientId = null;
+
+ boolean rowSelected = (rowKey != null) && isRowAvailable();
+
+ setupVariable(facesContext, rowSelected);
+
+ this.restoreChildState(facesContext);
+ }
+
+ protected void setRowKeyAndData(FacesContext facesContext, Object rowKey, Object localRowData) {
+ setRowKeyAndData(facesContext, rowKey, true, localRowData);
+ }
+
/**
* Setup current row by key. Perform same functionality as
* {@link javax.faces.component.UIData#setRowIndex(int)}, but for key object - it may be not only
@@ -615,11 +647,15 @@
}
public Object getRowData() {
+ if (rowDataIsSet) {
+ return rowData;
+ }
+
return getExtendedDataModel().getRowData();
}
public boolean isRowAvailable() {
- return getExtendedDataModel().isRowAvailable();
+ return rowDataIsSet || getExtendedDataModel().isRowAvailable();
}
/**
Modified: branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
===================================================================
--- branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -138,8 +138,8 @@
@Attribute(defaultValue = "false")
public abstract boolean isEnableManualInput();
- @Attribute(defaultValue = "false")
- public abstract boolean isDayEnabled();
+ @Attribute
+ public abstract String getDayDisableFunction();
@Attribute(defaultValue = "false")
public abstract boolean isShowApplyButton();
@@ -184,7 +184,7 @@
public abstract Object getWeekDayLabels();
@Attribute
- public abstract String getDayStyleClass();
+ public abstract String getDayClassFunction();
@Attribute
public abstract String getTabindex();
Modified: branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -333,13 +333,15 @@
return null;
}
- public JSReference getIsDayEnabled(FacesContext facesContext, AbstractCalendar calendar) {
- return calendar.isDayEnabled() ? JSReference.TRUE : JSReference.FALSE;
+ public JSReference getDayEnabled(FacesContext facesContext, UIComponent component) {
+ AbstractCalendar calendar = (AbstractCalendar) component;
+ String dayEnabled = calendar.getDayDisableFunction();
+ return ((dayEnabled != null && dayEnabled.trim().length() != 0)) ? new JSReference(dayEnabled) : null;
}
public JSReference getDayStyleClass(FacesContext context, UIComponent component) {
AbstractCalendar calendar = (AbstractCalendar) component;
- String dayStyleClass = calendar.getDayStyleClass();
+ String dayStyleClass = calendar.getDayClassFunction();
return ((dayStyleClass != null && dayStyleClass.trim().length() != 0)) ? new JSReference(dayStyleClass) : null;
}
Modified: branches/RF-8742-1/ui/input/ui/src/main/templates/calendar.template.xml
===================================================================
--- branches/RF-8742-1/ui/input/ui/src/main/templates/calendar.template.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/input/ui/src/main/templates/calendar.template.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -75,6 +75,7 @@
<cdk:scriptOption name="selectedDate" value="#{getSelectedDate(facesContext, component)}" />
<cdk:scriptOption name="dayCellClass" value="#{getDayCellClass(facesContext, component)}" />
<cdk:scriptOption name="dayStyleClass" value="#{getDayStyleClass(facesContext, component)}" />
+ <cdk:scriptOption name="isDayEnabled" value="#{getDayEnabled(facesContext, component)}" />
<cdk:scriptOption name="labels" value="#{getLabels(facesContext, component)}" />
<cdk:scriptOption name="defaultTime" value="#{getPreparedDefaultTime(facesContext, component)}" />
<cdk:scriptOption name="style" value="#{getStyleWithZindex(facesContext, component)}" />
Modified: branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java
===================================================================
--- branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/iteration/api/src/main/java/org/richfaces/model/SwingTreeNodeImpl.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -22,15 +22,17 @@
package org.richfaces.model;
import java.io.Serializable;
-import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
-import java.util.List;
import javax.swing.tree.TreeNode;
import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
/**
* @author Nick Belaevski
@@ -44,17 +46,28 @@
private T data;
- private List<TreeNode> children = new ArrayList<TreeNode>();
+ private Collection<TreeNode> children;
+ private boolean allowUpdateParents = true;
+
public SwingTreeNodeImpl() {
+ this(null);
}
- public SwingTreeNodeImpl(List<TreeNode> children) {
- this.children = children;
+ void setAllowUpdateParents(boolean allowUpdateParents) {
+ this.allowUpdateParents = allowUpdateParents;
}
+
+ public SwingTreeNodeImpl(Collection<TreeNode> children) {
+ this.children = wrapNull(children);
+ }
+ private static Collection<TreeNode> wrapNull(Collection<TreeNode> src) {
+ return src != null ? src : Lists.<TreeNode>newArrayList();
+ }
+
public TreeNode getChildAt(int childIndex) {
- return children.get(childIndex);
+ return Iterables.get(children, childIndex);
}
public int getChildCount() {
@@ -70,14 +83,26 @@
}
public int getIndex(TreeNode node) {
- return children.indexOf(node);
+ return Iterables.indexOf(children, Predicates.equalTo(node));
}
public void addChild(TreeNode node) {
- ((SwingTreeNodeImpl<?>) node).setParent(this);
children.add(node);
+ if (allowUpdateParents && node instanceof SwingTreeNodeImpl<?>) {
+ SwingTreeNodeImpl<?> treeNodeImpl = (SwingTreeNodeImpl<?>) node;
+ treeNodeImpl.setParent(this);
+ }
}
+ public void removeChild(TreeNode node) {
+ if (children.remove(node)) {
+ if (allowUpdateParents && node instanceof SwingTreeNodeImpl<?>) {
+ SwingTreeNodeImpl<?> treeNodeImpl = (SwingTreeNodeImpl<?>) node;
+ treeNodeImpl.setParent(null);
+ }
+ }
+ }
+
public boolean getAllowsChildren() {
return true;
}
@@ -98,7 +123,7 @@
this.data = data;
}
- public List<TreeNode> getChildrenList() {
+ public Collection<TreeNode> getChildrenList() {
return children;
}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelCompositeTuplesIterator.java (from rev 20272, trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelCompositeTuplesIterator.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelCompositeTuplesIterator.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelCompositeTuplesIterator.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,94 @@
+/*
+ * 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.model;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.component.ComponentPredicates;
+import org.richfaces.component.TreeModelAdaptor;
+import org.richfaces.component.TreeModelRecursiveAdaptor;
+
+import com.google.common.collect.ForwardingIterator;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+
+final class DeclarativeTreeDataModelCompositeTuplesIterator extends ForwardingIterator<TreeDataModelTuple> {
+
+ private UIComponent component;
+
+ private SequenceRowKey<DeclarativeModelKey> key;
+
+ private Iterator<TreeDataModelTuple> iterator;
+
+ public DeclarativeTreeDataModelCompositeTuplesIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> key) {
+ super();
+ this.component = component;
+ this.key = key;
+ }
+
+ @Override
+ protected Iterator<TreeDataModelTuple> delegate() {
+ if (iterator == null) {
+ List<Iterator<TreeDataModelTuple>> list = Lists.newArrayList();
+
+ if (component instanceof TreeModelRecursiveAdaptor) {
+ TreeModelRecursiveAdaptor parentRecursiveAdaptor = (TreeModelRecursiveAdaptor) component;
+
+ Collection<?> nodes = (Collection<?>) parentRecursiveAdaptor.getNodes();
+
+ if (nodes != null) {
+ list.add(new DeclarativeTreeDataModelTuplesIterator(component, key, nodes.iterator()));
+ }
+ }
+
+ if (component.getChildCount() > 0) {
+ for (UIComponent child : Iterables.filter(component.getChildren(), ComponentPredicates.isRendered())) {
+ Collection<?> nodes = null;
+
+ if (child instanceof TreeModelRecursiveAdaptor) {
+ TreeModelRecursiveAdaptor treeModelRecursiveAdaptor = (TreeModelRecursiveAdaptor) child;
+
+ nodes = (Collection<?>) treeModelRecursiveAdaptor.getRoots();
+ } else if (child instanceof TreeModelAdaptor) {
+ TreeModelAdaptor treeModelAdaptor = (TreeModelAdaptor) child;
+
+ nodes = (Collection<?>) treeModelAdaptor.getNodes();
+ }
+
+ if (nodes != null) {
+ list.add(new DeclarativeTreeDataModelTuplesIterator(child, key, nodes.iterator()));
+ }
+ }
+ }
+
+ iterator = Iterators.concat(list.iterator());
+ }
+
+ return iterator;
+ }
+
+}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -21,9 +21,9 @@
*/
package org.richfaces.model;
-import java.util.Collection;
+import static com.google.common.base.Objects.firstNonNull;
+
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import javax.faces.component.UIComponent;
@@ -36,10 +36,7 @@
import org.richfaces.log.RichfacesLogger;
import com.google.common.base.Predicates;
-import com.google.common.collect.ForwardingIterator;
import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.Lists;
/**
* @author Nick Belaevski
@@ -48,108 +45,17 @@
public class DeclarativeTreeDataModelImpl extends TreeSequenceKeyModel<DeclarativeModelKey, Object> implements DeclarativeTreeModel<Object> {
private static final Logger LOGGER = RichfacesLogger.MODEL.getLogger();
-
- private final class DeclarativeModelIterator implements Iterator<TreeDataModelTuple> {
-
- private UIComponent component;
- private SequenceRowKey<DeclarativeModelKey> baseKey;
-
- private int counter = 0;
-
- private Iterator<?> nodesIterator;
-
- public DeclarativeModelIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> baseKey, Iterator<?> nodesIterator) {
- super();
- this.component = component;
- this.baseKey = baseKey;
- this.nodesIterator = nodesIterator;
- }
+ private static final SequenceRowKey<DeclarativeModelKey> EMPTY_KEY = new SequenceRowKey<DeclarativeModelKey>();
- public TreeDataModelTuple next() {
- Object nextNode = nodesIterator.next();
- DeclarativeModelKey key = new DeclarativeModelKey(component.getId(), counter++);
-
- SequenceRowKey<DeclarativeModelKey> newKey = baseKey.append(key);
-
- return new DeclarativeTreeDataModelTuple(newKey, nextNode, component);
- }
-
- public boolean hasNext() {
- return nodesIterator.hasNext();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- }
-
- private final class DeclarativeModelCompositeIterator extends ForwardingIterator<TreeDataModelTuple> {
-
- private UIComponent component;
-
- private SequenceRowKey<DeclarativeModelKey> key;
-
- private Iterator<TreeDataModelTuple> iterator;
-
- public DeclarativeModelCompositeIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> key) {
- super();
- this.component = component;
- this.key = key;
- }
-
- @Override
- protected Iterator<TreeDataModelTuple> delegate() {
- if (iterator == null) {
- List<Iterator<TreeDataModelTuple>> list = Lists.newArrayList();
-
- if (component instanceof TreeModelRecursiveAdaptor) {
- TreeModelRecursiveAdaptor parentRecursiveAdaptor = (TreeModelRecursiveAdaptor) component;
-
- Collection<?> nodes = (Collection<?>) parentRecursiveAdaptor.getNodes();
-
- if (nodes != null) {
- list.add(new DeclarativeModelIterator(component, key, nodes.iterator()));
- }
- }
-
- if (component.getChildCount() > 0) {
- for (UIComponent child : Iterables.filter(component.getChildren(), ComponentPredicates.isRendered())) {
- Collection<?> nodes = null;
-
- if (child instanceof TreeModelRecursiveAdaptor) {
- TreeModelRecursiveAdaptor treeModelRecursiveAdaptor = (TreeModelRecursiveAdaptor) child;
-
- nodes = (Collection<?>) treeModelRecursiveAdaptor.getRoots();
- } else if (child instanceof TreeModelAdaptor) {
- TreeModelAdaptor treeModelAdaptor = (TreeModelAdaptor) child;
-
- nodes = (Collection<?>) treeModelAdaptor.getNodes();
- }
-
- if (nodes != null) {
- list.add(new DeclarativeModelIterator(child, key, nodes.iterator()));
- }
- }
- }
-
- iterator = Iterators.concat(list.iterator());
- }
-
- return iterator;
- }
-
- }
-
private String var;
-
+
private Map<String, Object> contextMap;
-
+
private UIComponent tree;
-
+
private UIComponent currentComponent;
-
+
public DeclarativeTreeDataModelImpl(AbstractTree tree, String var, Map<String, Object> contextMap) {
super();
this.tree = tree;
@@ -162,11 +68,8 @@
return currentComponent;
}
- protected void setCurrentComponent(UIComponent currentComponent) {
- this.currentComponent = currentComponent;
- }
-
public boolean isLeaf() {
+ UIComponent currentComponent = getCurrentComponent();
if (currentComponent instanceof TreeModelRecursiveAdaptor) {
return false;
}
@@ -174,20 +77,16 @@
if (currentComponent.getChildCount() == 0) {
return true;
}
-
+
return Iterables.contains(currentComponent.getChildren(), Predicates.instanceOf(TreeModelAdaptor.class));
}
public Iterator<TreeDataModelTuple> children() {
- return new DeclarativeModelCompositeIterator(currentComponent, safeGetRowKey());
+ return new DeclarativeTreeDataModelCompositeTuplesIterator(currentComponent, safeGetRowKey());
}
- /* (non-Javadoc)
- * @see org.richfaces.model.TreeDataModel#getParentRowKey(java.lang.Object)
- */
public Object getParentRowKey(Object rowKey) {
- // TODO Auto-generated method stub
- return null;
+ return safeGetRowKey().getParent();
}
@Override
@@ -207,7 +106,7 @@
if (var != null) {
initialContextValue = contextMap.remove(var);
}
-
+
try {
this.currentComponent = tree;
@@ -222,11 +121,11 @@
}
}
}
-
+
@Override
protected void walkNext(DeclarativeModelKey segment) {
String modelId = segment.getModelId();
-
+
UIComponent modelComponent;
if (currentComponent instanceof TreeModelRecursiveAdaptor && modelId.equals(currentComponent.getId())) {
@@ -236,10 +135,10 @@
}
Object nodes = null;
-
+
if (modelComponent instanceof TreeModelRecursiveAdaptor) {
TreeModelRecursiveAdaptor recursiveAdaptor = (TreeModelRecursiveAdaptor) modelComponent;
-
+
if (currentComponent.equals(modelComponent)) {
nodes = recursiveAdaptor.getNodes();
} else {
@@ -251,13 +150,17 @@
Object data = Iterables.get((Iterable<?>) nodes, (Integer) segment.getModelKey());
setRowKeyAndData(safeGetRowKey().append(segment), data);
- setCurrentComponent(modelComponent);
-
+ this.currentComponent = modelComponent;
+
if (var != null) {
contextMap.put(var, data);
}
}
+ private SequenceRowKey<DeclarativeModelKey> safeGetRowKey() {
+ return firstNonNull(getRowKey(), EMPTY_KEY);
+ }
+
public TreeDataModelTuple createSnapshot() {
return new DeclarativeTreeDataModelTuple(getRowKey(), getData(), getCurrentComponent());
}
@@ -266,7 +169,7 @@
DeclarativeTreeDataModelTuple declarativeModelTuple = (DeclarativeTreeDataModelTuple) tuple;
super.restoreFromSnapshot(declarativeModelTuple);
- setCurrentComponent(declarativeModelTuple.getComponent());
+ this.currentComponent = declarativeModelTuple.getComponent();
}
-
+
}
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuplesIterator.java (from rev 20272, trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuplesIterator.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuplesIterator.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelTuplesIterator.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,62 @@
+/*
+ * 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.model;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+
+final class DeclarativeTreeDataModelTuplesIterator implements Iterator<TreeDataModelTuple> {
+
+ private UIComponent component;
+
+ private SequenceRowKey<DeclarativeModelKey> baseKey;
+
+ private int counter = 0;
+
+ private Iterator<?> dataIterator;
+
+ public DeclarativeTreeDataModelTuplesIterator(UIComponent component, SequenceRowKey<DeclarativeModelKey> baseKey, Iterator<?> dataIterator) {
+ super();
+ this.component = component;
+ this.baseKey = baseKey;
+ this.dataIterator = dataIterator;
+ }
+
+ public TreeDataModelTuple next() {
+ Object nextNode = dataIterator.next();
+ DeclarativeModelKey key = new DeclarativeModelKey(component.getId(), counter++);
+
+ SequenceRowKey<DeclarativeModelKey> newKey = baseKey.append(key);
+
+ return new DeclarativeTreeDataModelTuple(newKey, nextNode, component);
+ }
+
+ public boolean hasNext() {
+ return dataIterator.hasNext();
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeDataModelImpl.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -21,147 +21,58 @@
*/
package org.richfaces.model;
+import static com.google.common.base.Objects.firstNonNull;
+
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
-import java.util.NoSuchElementException;
import javax.swing.tree.TreeNode;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
-
+import com.google.common.collect.Lists;
/**
* @author Nick Belaevski
*
*/
public class SwingTreeNodeDataModelImpl extends TreeSequenceKeyModel<Integer, TreeNode> {
- private final class SwingTreeNodeRowKeyIterator implements Iterator<TreeDataModelTuple> {
+ private static final SequenceRowKey<Integer> EMPTY_KEY = new SequenceRowKey<Integer>();
+
+ private boolean asksAllowsChildren = false;
+
+ private Object wrappedData;
- private SequenceRowKey<Integer> baseKey;
+ private TreeNode createFakeRootNode(Object wrappedData) {
+ Collection<TreeNode> nodes;
- private Iterator<TreeNode> children;
-
- private int counter = 0;
-
- private SwingTreeNodeRowKeyIterator(SequenceRowKey<Integer> baseKey, Iterator<TreeNode> children) {
- this.baseKey = baseKey;
- this.children = children;
+ if (wrappedData instanceof Collection<?>) {
+ nodes = (Collection<TreeNode>) wrappedData;
+ } else if (wrappedData instanceof TreeNode) {
+ nodes = Lists.newArrayList((TreeNode) wrappedData);
+ } else if (wrappedData == null) {
+ nodes = null;
+ } else {
+ throw new IllegalArgumentException(String.valueOf(wrappedData));
}
-
- private int getNextCounterValue() {
- return counter++;
- }
- public boolean hasNext() {
- return children.hasNext();
- }
-
- public TreeDataModelTuple next() {
- TreeNode node = children.next();
-
- SequenceRowKey<Integer> key;
-
- if (baseKey != null) {
- key = baseKey.append(getNextCounterValue());
- } else {
- key = new SequenceRowKey<Integer>(getNextCounterValue());
- }
-
- return new TreeDataModelTuple(key, node);
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
+ SwingTreeNodeImpl<?> treeNodeImpl = new SwingTreeNodeImpl<Object>(nodes);
+ treeNodeImpl.setAllowUpdateParents(false);
+ return treeNodeImpl;
}
-
- private final class FakeRootNode implements TreeNode {
-
- private Collection<TreeNode> wrappedData;
-
- public FakeRootNode(Collection<TreeNode> wrappedData) {
- super();
- this.wrappedData = wrappedData;
- }
-
- public boolean isLeaf() {
- return !wrappedData.isEmpty();
- }
-
- public TreeNode getParent() {
- return null;
- }
-
- public int getIndex(TreeNode node) {
- if (wrappedData == null) {
- return -1;
- }
-
- return Iterables.indexOf(wrappedData, Predicates.equalTo(node));
- }
-
- public int getChildCount() {
- if (wrappedData == null) {
- return 0;
- }
-
- return wrappedData.size();
- }
-
- public TreeNode getChildAt(int childIndex) {
- if (wrappedData == null) {
- throw new NoSuchElementException(String.valueOf(childIndex));
- }
-
- return Iterables.get(wrappedData, childIndex);
- }
-
- public boolean getAllowsChildren() {
- return true;
- }
-
- public Enumeration<?> children() {
- if (wrappedData == null) {
- return Iterators.asEnumeration(Iterators.emptyIterator());
- }
-
- return Iterators.asEnumeration(wrappedData.iterator());
- }
-
- public Collection<TreeNode> getWrappedData() {
- return wrappedData;
- }
- }
-
- private boolean asksAllowsChildren = false;
- private Iterator<TreeNode> safeGetChildren(TreeNode treeNode) {
- if (treeNode == null) {
- return Iterators.emptyIterator();
- }
-
- return Iterators.forEnumeration((Enumeration<TreeNode>) treeNode.children());
- }
-
-
public Object getParentRowKey(Object rowKey) {
throw new UnsupportedOperationException();
}
public void setWrappedData(Object data) {
- setRootNode(new FakeRootNode((Collection<TreeNode>) data));
+ this.wrappedData = data;
+
+ setRootNode(createFakeRootNode(data));
}
- public Collection<TreeNode> getWrappedData() {
- FakeRootNode rootNode = (FakeRootNode) getRootNode();
- if (rootNode == null) {
- return null;
- }
- return rootNode.getWrappedData();
+ public Object getWrappedData() {
+ return wrappedData;
}
protected TreeNode findChild(TreeNode parent, Integer simpleKey) {
@@ -169,10 +80,10 @@
}
public Iterator<TreeDataModelTuple> children() {
- return new SwingTreeNodeRowKeyIterator(getRowKey(), safeGetChildren(getData()));
+ Iterator<TreeNode> children = Iterators.forEnumeration((Enumeration<TreeNode>) getData().children());
+ return new SwingTreeNodeTuplesIterator(getRowKey(), children);
}
-
public boolean isLeaf() {
if (!asksAllowsChildren) {
return getData().isLeaf();
@@ -189,4 +100,7 @@
setRowKeyAndData(safeGetRowKey().append(segment), child);
}
+ private SequenceRowKey<Integer> safeGetRowKey() {
+ return firstNonNull(getRowKey(), EMPTY_KEY);
+ }
}
\ No newline at end of file
Copied: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeTuplesIterator.java (from rev 20272, trunk/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeTuplesIterator.java)
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeTuplesIterator.java (rev 0)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/SwingTreeNodeTuplesIterator.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,67 @@
+/*
+ * 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.model;
+
+import java.util.Iterator;
+
+import javax.swing.tree.TreeNode;
+
+final class SwingTreeNodeTuplesIterator implements Iterator<TreeDataModelTuple> {
+
+ private SequenceRowKey<Integer> baseKey;
+
+ private Iterator<TreeNode> children;
+
+ private int counter = 0;
+
+ SwingTreeNodeTuplesIterator(SequenceRowKey<Integer> baseKey, Iterator<TreeNode> children) {
+ this.baseKey = baseKey;
+ this.children = children;
+ }
+
+ private int getNextCounterValue() {
+ return counter++;
+ }
+
+ public boolean hasNext() {
+ return children.hasNext();
+ }
+
+ public TreeDataModelTuple next() {
+ TreeNode node = children.next();
+
+ SequenceRowKey<Integer> key;
+
+ if (baseKey != null) {
+ key = baseKey.append(getNextCounterValue());
+ } else {
+ key = new SequenceRowKey<Integer>(getNextCounterValue());
+ }
+
+ return new TreeDataModelTuple(key, node);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+}
\ No newline at end of file
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/model/TreeSequenceKeyModel.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -34,8 +34,6 @@
*/
public abstract class TreeSequenceKeyModel<K, V> extends ExtendedDataModel<V> implements TreeDataModel<V> {
- private final SequenceRowKey<K> emptyKey = new SequenceRowKey<K>();
-
private V rootNode;
private V data;
@@ -46,16 +44,6 @@
return rowKey;
}
- protected SequenceRowKey<K> safeGetRowKey() {
- SequenceRowKey<K> key = getRowKey();
-
- if (key == null) {
- key = emptyKey;
- }
-
- return key;
- }
-
public void setRowKey(Object rowKey) {
if (this.rowKey == null || !this.rowKey.equals(rowKey)) {
walkKey((SequenceRowKey<K>) rowKey);
@@ -146,5 +134,4 @@
public void restoreFromSnapshot(TreeDataModelTuple tuple) {
setRowKeyAndData((SequenceRowKey<K>) tuple.getRowKey(), (V) tuple.getData());
}
-
}
Modified: branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
--- branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -162,7 +162,8 @@
writeTreeNodeEndElement();
} catch (IOException e) {
- throw new FacesException(e.getMessage(), e);
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
}
Modified: branches/RF-8742-1/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
===================================================================
--- branches/RF-8742-1/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -6,7 +6,8 @@
*/
public enum PanelMenuMode {
ajax,
- server;
+ server,
+ client;
- public static final PanelMenuMode DEFAULT = server;
+ public static final PanelMenuMode DEFAULT = ajax;
}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -23,7 +23,6 @@
package org.richfaces.component;
-import org.richfaces.ExpandMode;
import org.richfaces.PanelMenuMode;
import org.richfaces.event.ItemChangeEvent;
@@ -168,7 +167,7 @@
public abstract String getCollapseEvent();
- public abstract ExpandMode getGroupMode();
+ public abstract PanelMenuMode getGroupMode();
public abstract boolean isExpandSingle();
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -161,20 +161,13 @@
- public abstract boolean getBubbleSelection();
-
public abstract boolean isExpandSingle();
public abstract String getCollapseEvent();
public abstract String getExpandEvent();
- public abstract String getIconCollapsed();
+ public abstract boolean isBubbleSelection();
- public abstract String getIconExpanded();
-
public abstract String getChangeExpandListener();
-
-
-
}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -47,7 +47,7 @@
triangle("rf-pm-triangle"),
triangleUp("rf-pm-triangle-up"),
triangleDown("rf-pm-triangle-down");
-
+
public static final Icons DEFAULT = grid;
private final String cssClass;
@@ -101,8 +101,6 @@
return COMPONENT_FAMILY;
}
- public abstract String getIcon();
-
public abstract PanelMenuMode getMode();
public abstract String getLabel();
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/AbstractProgressBar.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -126,10 +126,10 @@
@Attribute(defaultValue = "SwitchType.DEFAULT")
public abstract SwitchType getMode();
- @Attribute
+ @Attribute(defaultValue = "100")
public abstract int getMaxValue();
- @Attribute
+ @Attribute(defaultValue = "0")
public abstract int getMinValue();
@Attribute
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -23,12 +23,11 @@
package org.richfaces.component;
-import org.richfaces.ExpandMode;
import org.richfaces.PanelMenuMode;
/**
* @author akolonitsky
- * @since 2010-10-25
+ * @since 2010-11-29
*/
public class UIPanelMenu extends AbstractPanelMenu {
@@ -40,6 +39,7 @@
expandSingle,
itemMode,
bubbleSelection,
+ activeItem,
itemChangeListener,
bypassUpdates,
limitToList,
@@ -73,11 +73,11 @@
getStateHelper().put(PropertyKeys.collapseEvent, collapseEvent);
}
- public ExpandMode getGroupMode() {
- return (ExpandMode) getStateHelper().eval(PropertyKeys.groupMode, ExpandMode.DEFAULT);
+ public PanelMenuMode getGroupMode() {
+ return (PanelMenuMode) getStateHelper().eval(PropertyKeys.groupMode, PanelMenuMode.client);
}
- public void setGroupMode(ExpandMode groupMode) {
+ public void setGroupMode(PanelMenuMode groupMode) {
getStateHelper().put(PropertyKeys.groupMode, groupMode);
}
@@ -105,6 +105,14 @@
getStateHelper().put(PropertyKeys.bubbleSelection, bubbleSelection);
}
+ public String getActiveItem() {
+ return (String) getStateHelper().eval(PropertyKeys.activeItem);
+ }
+
+ public void setActiveItem(String activeItem) {
+ getStateHelper().put(PropertyKeys.activeItem, activeItem);
+ }
+
public String getItemChangeListener() {
return (String) getStateHelper().eval(PropertyKeys.itemChangeListener);
}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -23,8 +23,8 @@
package org.richfaces.component;
+import org.richfaces.PanelMenuMode;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -32,28 +32,26 @@
public class UIPanelMenuGroup extends AbstractPanelMenuGroup {
public enum PropertyKeys {
- bubbleSelection,
expanded,
expandSingle,
collapseEvent,
expandEvent,
- iconCollapsed,
- iconExpanded,
+ bubbleSelection,
changeExpandListener
}
-
-
- public boolean getBubbleSelection() {
- return Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bubbleSelection, true)));
+ @Override
+ public PanelMenuMode getMode() {
+ return (PanelMenuMode) getStateHelper().eval(UIPanelMenuItem.PropertyKeys.mode, getPanelMenu().getGroupMode());
}
- public void setBubbleSelection(boolean bubbleSelection) {
- getStateHelper().put(PropertyKeys.bubbleSelection, bubbleSelection);
+ @Override
+ public void setMode(PanelMenuMode mode) {
+ super.setMode(mode); //To change body of overridden methods use File | Settings | File Templates.
}
public boolean isExpandSingle() {
- return Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.expandSingle, true)));
+ return Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.expandSingle, getPanelMenu().isExpandSingle())));
}
public void setExpandSingle(boolean expandSingle) {
@@ -76,22 +74,14 @@
getStateHelper().put(PropertyKeys.expandEvent, expandEvent);
}
- public String getIconCollapsed() {
- return (String) getStateHelper().eval(PropertyKeys.iconCollapsed);
+ public boolean isBubbleSelection() {
+ return Boolean.valueOf(String.valueOf(getStateHelper().eval(PropertyKeys.bubbleSelection, getPanelMenu().isBubbleSelection())));
}
- public void setIconCollapsed(String iconCollapsed) {
- getStateHelper().put(PropertyKeys.iconCollapsed, iconCollapsed);
+ public void setBubbleSelection(boolean bubbleSelection) {
+ getStateHelper().put(PropertyKeys.bubbleSelection, bubbleSelection);
}
- public String getIconExpanded() {
- return (String) getStateHelper().eval(PropertyKeys.iconExpanded);
- }
-
- public void setIconExpanded(String iconExpanded) {
- getStateHelper().put(PropertyKeys.iconExpanded, iconExpanded);
- }
-
public String getChangeExpandListener() {
return (String) getStateHelper().eval(PropertyKeys.changeExpandListener);
}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -27,12 +27,11 @@
/**
* @author akolonitsky
- * @since 2010-10-25
+ * @since 2010-11-29
*/
public class UIPanelMenuItem extends AbstractPanelMenuItem {
public enum PropertyKeys {
- icon,
mode,
label,
name,
@@ -45,16 +44,8 @@
render
}
- public String getIcon() {
- return (String) getStateHelper().eval(PropertyKeys.icon, Icons.DEFAULT.toString());
- }
-
- public void setIcon(String icon) {
- getStateHelper().put(PropertyKeys.icon, icon);
- }
-
public PanelMenuMode getMode() {
- return (PanelMenuMode) getStateHelper().eval(PropertyKeys.mode, PanelMenuMode.DEFAULT);
+ return (PanelMenuMode) getStateHelper().eval(PropertyKeys.mode, getPanelMenu().getItemMode());
}
public void setMode(PanelMenuMode mode) {
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenu.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -24,15 +24,17 @@
package org.richfaces.component.html;
import org.richfaces.component.UIPanelMenu;
+
import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import static org.richfaces.component.AbstractPanelMenuItem.Icons;
+
/**
* @author akolonitsky
- * @since 2010-10-25
+ * @since 2010-11-29
*/
public class HtmlPanelMenu extends UIPanelMenu implements ClientBehaviorHolder {
@@ -56,31 +58,33 @@
styleClass,
width,
itemClass,
- itemHoverClass,
itemDisableClass,
- itemIcon,
- itemDisableIcon,
- itemIconPosition,
+ itemIconLeft,
+ itemIconRight,
+ itemDisableIconLeft,
+ itemDisableIconRight,
topItemClass,
- topItemHoverClass,
topItemDisableClass,
- topItemIcon,
- topItemDisableIcon,
- topItemIconPosition,
+ topItemIconLeft,
+ topItemIconRight,
+ topItemDisableIconLeft,
+ topItemDisableIconRight,
groupClass,
- groupHoverClass,
groupDisableClass,
- groupCollapseIcon,
- groupExpandIcon,
- groupDisableIcon,
- groupIconPosition,
+ groupExpandIconLeft,
+ groupExpandIconRight,
+ groupCollapseIconLeft,
+ groupCollapseIconRight,
+ groupDisableIconLeft,
+ groupDisableIconRight,
topGroupClass,
- topGroupHoverClass,
topGroupDisableClass,
- topGroupCollapseIcon,
- topGroupExpandIcon,
- topGroupDisableIcon,
- topGroupIconPosition,
+ topGroupExpandIconLeft,
+ topGroupExpandIconRight,
+ topGroupCollapseIconLeft,
+ topGroupCollapseIconRight,
+ topGroupDisableIconLeft,
+ topGroupDisableIconRight,
onclick,
ondblclick,
onmousedown,
@@ -131,14 +135,6 @@
getStateHelper().put(PropertyKeys.itemClass, itemClass);
}
- public String getItemHoverClass() {
- return (String) getStateHelper().eval(PropertyKeys.itemHoverClass);
- }
-
- public void setItemHoverClass(String itemHoverClass) {
- getStateHelper().put(PropertyKeys.itemHoverClass, itemHoverClass);
- }
-
public String getItemDisableClass() {
return (String) getStateHelper().eval(PropertyKeys.itemDisableClass);
}
@@ -147,30 +143,38 @@
getStateHelper().put(PropertyKeys.itemDisableClass, itemDisableClass);
}
- public String getItemIcon() {
- return (String) getStateHelper().eval(PropertyKeys.itemIcon);
+ public String getItemIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.itemIconLeft, Icons.DEFAULT.toString());
}
- public void setItemIcon(String itemIcon) {
- getStateHelper().put(PropertyKeys.itemIcon, itemIcon);
+ public void setItemIconLeft(String itemIconLeft) {
+ getStateHelper().put(PropertyKeys.itemIconLeft, itemIconLeft);
}
- public String getItemDisableIcon() {
- return (String) getStateHelper().eval(PropertyKeys.itemDisableIcon);
+ public String getItemIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.itemIconRight, Icons.DEFAULT.toString());
}
- public void setItemDisableIcon(String itemDisableIcon) {
- getStateHelper().put(PropertyKeys.itemDisableIcon, itemDisableIcon);
+ public void setItemIconRight(String itemIconRight) {
+ getStateHelper().put(PropertyKeys.itemIconRight, itemIconRight);
}
- public String getItemIconPosition() {
- return (String) getStateHelper().eval(PropertyKeys.itemIconPosition);
+ public String getItemDisableIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.itemDisableIconLeft, Icons.DEFAULT.toString());
}
- public void setItemIconPosition(String itemIconPosition) {
- getStateHelper().put(PropertyKeys.itemIconPosition, itemIconPosition);
+ public void setItemDisableIconLeft(String itemDisableIconLeft) {
+ getStateHelper().put(PropertyKeys.itemDisableIconLeft, itemDisableIconLeft);
}
+ public String getItemDisableIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.itemDisableIconRight, Icons.DEFAULT.toString());
+ }
+
+ public void setItemDisableIconRight(String itemDisableIconRight) {
+ getStateHelper().put(PropertyKeys.itemDisableIconRight, itemDisableIconRight);
+ }
+
public String getTopItemClass() {
return (String) getStateHelper().eval(PropertyKeys.topItemClass);
}
@@ -179,14 +183,6 @@
getStateHelper().put(PropertyKeys.topItemClass, topItemClass);
}
- public String getTopItemHoverClass() {
- return (String) getStateHelper().eval(PropertyKeys.topItemHoverClass);
- }
-
- public void setTopItemHoverClass(String topItemHoverClass) {
- getStateHelper().put(PropertyKeys.topItemHoverClass, topItemHoverClass);
- }
-
public String getTopItemDisableClass() {
return (String) getStateHelper().eval(PropertyKeys.topItemDisableClass);
}
@@ -195,30 +191,38 @@
getStateHelper().put(PropertyKeys.topItemDisableClass, topItemDisableClass);
}
- public String getTopItemIcon() {
- return (String) getStateHelper().eval(PropertyKeys.topItemIcon);
+ public String getTopItemIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemIconLeft, Icons.DEFAULT.toString());
}
- public void setTopItemIcon(String topItemIcon) {
- getStateHelper().put(PropertyKeys.topItemIcon, topItemIcon);
+ public void setTopItemIconLeft(String topItemIconLeft) {
+ getStateHelper().put(PropertyKeys.topItemIconLeft, topItemIconLeft);
}
- public String getTopItemDisableIcon() {
- return (String) getStateHelper().eval(PropertyKeys.topItemDisableIcon);
+ public String getTopItemIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemIconRight, Icons.DEFAULT.toString());
}
- public void setTopItemDisableIcon(String topItemDisableIcon) {
- getStateHelper().put(PropertyKeys.topItemDisableIcon, topItemDisableIcon);
+ public void setTopItemIconRight(String topItemIconRight) {
+ getStateHelper().put(PropertyKeys.topItemIconRight, topItemIconRight);
}
- public String getTopItemIconPosition() {
- return (String) getStateHelper().eval(PropertyKeys.topItemIconPosition);
+ public String getTopItemDisableIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemDisableIconLeft, Icons.DEFAULT.toString());
}
- public void setTopItemIconPosition(String topItemIconPosition) {
- getStateHelper().put(PropertyKeys.topItemIconPosition, topItemIconPosition);
+ public void setTopItemDisableIconLeft(String topItemDisableIconLeft) {
+ getStateHelper().put(PropertyKeys.topItemDisableIconLeft, topItemDisableIconLeft);
}
+ public String getTopItemDisableIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.topItemDisableIconRight, Icons.DEFAULT.toString());
+ }
+
+ public void setTopItemDisableIconRight(String topItemDisableIconRight) {
+ getStateHelper().put(PropertyKeys.topItemDisableIconRight, topItemDisableIconRight);
+ }
+
public String getGroupClass() {
return (String) getStateHelper().eval(PropertyKeys.groupClass);
}
@@ -227,14 +231,6 @@
getStateHelper().put(PropertyKeys.groupClass, groupClass);
}
- public String getGroupHoverClass() {
- return (String) getStateHelper().eval(PropertyKeys.groupHoverClass);
- }
-
- public void setGroupHoverClass(String groupHoverClass) {
- getStateHelper().put(PropertyKeys.groupHoverClass, groupHoverClass);
- }
-
public String getGroupDisableClass() {
return (String) getStateHelper().eval(PropertyKeys.groupDisableClass);
}
@@ -243,38 +239,54 @@
getStateHelper().put(PropertyKeys.groupDisableClass, groupDisableClass);
}
- public String getGroupCollapseIcon() {
- return (String) getStateHelper().eval(PropertyKeys.groupCollapseIcon);
+ public String getGroupExpandIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.groupExpandIconLeft, Icons.DEFAULT.toString());
}
- public void setGroupCollapseIcon(String groupCollapseIcon) {
- getStateHelper().put(PropertyKeys.groupCollapseIcon, groupCollapseIcon);
+ public void setGroupExpandIconLeft(String groupExpandIconLeft) {
+ getStateHelper().put(PropertyKeys.groupExpandIconLeft, groupExpandIconLeft);
}
- public String getGroupExpandIcon() {
- return (String) getStateHelper().eval(PropertyKeys.groupExpandIcon);
+ public String getGroupExpandIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.groupExpandIconRight, Icons.DEFAULT.toString());
}
- public void setGroupExpandIcon(String groupExpandIcon) {
- getStateHelper().put(PropertyKeys.groupExpandIcon, groupExpandIcon);
+ public void setGroupExpandIconRight(String groupExpandIconRight) {
+ getStateHelper().put(PropertyKeys.groupExpandIconRight, groupExpandIconRight);
}
- public String getGroupDisableIcon() {
- return (String) getStateHelper().eval(PropertyKeys.groupDisableIcon);
+ public String getGroupCollapseIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.groupCollapseIconLeft, Icons.DEFAULT.toString());
}
- public void setGroupDisableIcon(String groupDisableIcon) {
- getStateHelper().put(PropertyKeys.groupDisableIcon, groupDisableIcon);
+ public void setGroupCollapseIconLeft(String groupCollapseIconLeft) {
+ getStateHelper().put(PropertyKeys.groupCollapseIconLeft, groupCollapseIconLeft);
}
- public String getGroupIconPosition() {
- return (String) getStateHelper().eval(PropertyKeys.groupIconPosition);
+ public String getGroupCollapseIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.groupCollapseIconRight, Icons.DEFAULT.toString());
}
- public void setGroupIconPosition(String groupIconPosition) {
- getStateHelper().put(PropertyKeys.groupIconPosition, groupIconPosition);
+ public void setGroupCollapseIconRight(String groupCollapseIconRight) {
+ getStateHelper().put(PropertyKeys.groupCollapseIconRight, groupCollapseIconRight);
}
+ public String getGroupDisableIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.groupDisableIconLeft, Icons.DEFAULT.toString());
+ }
+
+ public void setGroupDisableIconLeft(String groupDisableIconLeft) {
+ getStateHelper().put(PropertyKeys.groupDisableIconLeft, groupDisableIconLeft);
+ }
+
+ public String getGroupDisableIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.groupDisableIconRight, Icons.DEFAULT.toString());
+ }
+
+ public void setGroupDisableIconRight(String groupDisableIconRight) {
+ getStateHelper().put(PropertyKeys.groupDisableIconRight, groupDisableIconRight);
+ }
+
public String getTopGroupClass() {
return (String) getStateHelper().eval(PropertyKeys.topGroupClass);
}
@@ -283,14 +295,6 @@
getStateHelper().put(PropertyKeys.topGroupClass, topGroupClass);
}
- public String getTopGroupHoverClass() {
- return (String) getStateHelper().eval(PropertyKeys.topGroupHoverClass);
- }
-
- public void setTopGroupHoverClass(String topGroupHoverClass) {
- getStateHelper().put(PropertyKeys.topGroupHoverClass, topGroupHoverClass);
- }
-
public String getTopGroupDisableClass() {
return (String) getStateHelper().eval(PropertyKeys.topGroupDisableClass);
}
@@ -299,38 +303,54 @@
getStateHelper().put(PropertyKeys.topGroupDisableClass, topGroupDisableClass);
}
- public String getTopGroupCollapseIcon() {
- return (String) getStateHelper().eval(PropertyKeys.topGroupCollapseIcon);
+ public String getTopGroupExpandIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupExpandIconLeft, Icons.DEFAULT.toString());
}
- public void setTopGroupCollapseIcon(String topGroupCollapseIcon) {
- getStateHelper().put(PropertyKeys.topGroupCollapseIcon, topGroupCollapseIcon);
+ public void setTopGroupExpandIconLeft(String topGroupExpandIconLeft) {
+ getStateHelper().put(PropertyKeys.topGroupExpandIconLeft, topGroupExpandIconLeft);
}
- public String getTopGroupExpandIcon() {
- return (String) getStateHelper().eval(PropertyKeys.topGroupExpandIcon);
+ public String getTopGroupExpandIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupExpandIconRight, Icons.DEFAULT.toString());
}
- public void setTopGroupExpandIcon(String topGroupExpandIcon) {
- getStateHelper().put(PropertyKeys.topGroupExpandIcon, topGroupExpandIcon);
+ public void setTopGroupExpandIconRight(String topGroupExpandIconRight) {
+ getStateHelper().put(PropertyKeys.topGroupExpandIconRight, topGroupExpandIconRight);
}
- public String getTopGroupDisableIcon() {
- return (String) getStateHelper().eval(PropertyKeys.topGroupDisableIcon);
+ public String getTopGroupCollapseIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupCollapseIconLeft, Icons.DEFAULT.toString());
}
- public void setTopGroupDisableIcon(String topGroupDisableIcon) {
- getStateHelper().put(PropertyKeys.topGroupDisableIcon, topGroupDisableIcon);
+ public void setTopGroupCollapseIconLeft(String topGroupCollapseIconLeft) {
+ getStateHelper().put(PropertyKeys.topGroupCollapseIconLeft, topGroupCollapseIconLeft);
}
- public String getTopGroupIconPosition() {
- return (String) getStateHelper().eval(PropertyKeys.topGroupIconPosition);
+ public String getTopGroupCollapseIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupCollapseIconRight, Icons.DEFAULT.toString());
}
- public void setTopGroupIconPosition(String topGroupIconPosition) {
- getStateHelper().put(PropertyKeys.topGroupIconPosition, topGroupIconPosition);
+ public void setTopGroupCollapseIconRight(String topGroupCollapseIconRight) {
+ getStateHelper().put(PropertyKeys.topGroupCollapseIconRight, topGroupCollapseIconRight);
}
+ public String getTopGroupDisableIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupDisableIconLeft, Icons.DEFAULT.toString());
+ }
+
+ public void setTopGroupDisableIconLeft(String topGroupDisableIconLeft) {
+ getStateHelper().put(PropertyKeys.topGroupDisableIconLeft, topGroupDisableIconLeft);
+ }
+
+ public String getTopGroupDisableIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.topGroupDisableIconRight, Icons.DEFAULT.toString());
+ }
+
+ public void setTopGroupDisableIconRight(String topGroupDisableIconRight) {
+ getStateHelper().put(PropertyKeys.topGroupDisableIconRight, topGroupDisableIconRight);
+ }
+
public String getOnclick() {
return (String) getStateHelper().eval(PropertyKeys.onclick);
}
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuGroup.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -24,15 +24,15 @@
package org.richfaces.component.html;
import org.richfaces.component.UIPanelMenuGroup;
+
import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
/**
* @author akolonitsky
- * @since 2010-10-25
+ * @since 2010-11-29
*/
public class HtmlPanelMenuGroup extends UIPanelMenuGroup implements ClientBehaviorHolder {
@@ -41,6 +41,19 @@
public static final String COMPONENT_FAMILY = "org.richfaces.PanelMenuGroup";
private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(
+ "beforedomupdate",
+ "complete",
+ "click",
+ "dblclick",
+ "mousedown",
+ "mousemove",
+ "mouseout",
+ "mouseover",
+ "mouseup",
+ "unselect",
+ "select",
+ "beforeselect",
+
"collapse",
"expand",
"switch",
@@ -51,12 +64,39 @@
public enum PropertyKeys {
+ iconLeftCollapsed,
+ iconLeftExpanded,
+ iconLeftDisabled,
+
+ iconRightCollapsed,
+ iconRightExpanded,
+ iconRightDisabled,
+
oncollapse,
onexpand,
onswitch,
onbeforecollapse,
onbeforeexpand,
- onbeforeswitch
+ onbeforeswitch,
+
+ disabledClass,
+ hoverClass,
+ iconLeftClass,
+ iconRightClass,
+ style,
+ styleClass,
+ onbeforedomupdate,
+ oncomplete,
+ onclick,
+ ondblclick,
+ onmousedown,
+ onmousemove,
+ onmouseout,
+ onmouseover,
+ onmouseup,
+ onunselect,
+ onselect,
+ onbeforeselect
}
public HtmlPanelMenuGroup() {
@@ -68,6 +108,65 @@
return COMPONENT_FAMILY;
}
+ @Override
+ public HtmlPanelMenu getPanelMenu() {
+ return (HtmlPanelMenu) super.getPanelMenu();
+ }
+
+ public String getIconLeftCollapsed() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftCollapsed,
+ isTopItem() ? getPanelMenu().getTopGroupCollapseIconLeft() : getPanelMenu().getGroupCollapseIconLeft());
+ }
+
+ public void setIconLeftCollapsed(String iconLeftCollapsed) {
+ getStateHelper().put(PropertyKeys.iconLeftCollapsed, iconLeftCollapsed);
+ }
+
+ public String getIconLeftExpanded() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftExpanded,
+ isTopItem() ? getPanelMenu().getTopGroupExpandIconLeft() : getPanelMenu().getGroupExpandIconLeft());
+ }
+
+ public void setIconLeftExpanded(String iconLeftExpanded) {
+ getStateHelper().put(PropertyKeys.iconLeftExpanded, iconLeftExpanded);
+ }
+
+ public String getIconLeftDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftDisabled,
+ isTopItem() ? getPanelMenu().getTopGroupDisableIconLeft() : getPanelMenu().getGroupDisableIconLeft());
+ }
+
+ public void setIconLeftDisabled(String iconLeftDisabled) {
+ getStateHelper().put(PropertyKeys.iconLeftDisabled, iconLeftDisabled);
+ }
+
+ public String getIconRightCollapsed() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightCollapsed,
+ isTopItem() ? getPanelMenu().getTopGroupCollapseIconRight() : getPanelMenu().getGroupCollapseIconRight());
+ }
+
+ public void setIconRightCollapsed(String iconRightCollapsed) {
+ getStateHelper().put(PropertyKeys.iconRightCollapsed, iconRightCollapsed);
+ }
+
+ public String getIconRightExpanded() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightExpanded,
+ isTopItem() ? getPanelMenu().getTopGroupExpandIconRight() : getPanelMenu().getGroupExpandIconRight());
+ }
+
+ public void setIconRightExpanded(String iconRightExpanded) {
+ getStateHelper().put(PropertyKeys.iconRightExpanded, iconRightExpanded);
+ }
+
+ public String getIconRightDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightDisabled,
+ isTopItem() ? getPanelMenu().getTopGroupDisableIconRight() : getPanelMenu().getGroupDisableIconRight());
+ }
+
+ public void setIconRightDisabled(String iconRightDisabled) {
+ getStateHelper().put(PropertyKeys.iconRightDisabled, iconRightDisabled);
+ }
+
public String getOncollapse() {
return (String) getStateHelper().eval(PropertyKeys.oncollapse);
}
@@ -116,8 +215,153 @@
getStateHelper().put(PropertyKeys.onbeforeswitch, onbeforeswitch);
}
+ public String getDisabledClass() {
+ return (String) getStateHelper().eval(PropertyKeys.disabledClass,
+ isTopItem() ? getPanelMenu().getTopGroupDisableClass() : getPanelMenu().getGroupDisableClass());
+ }
+ public void setDisabledClass(String disabledClass) {
+ getStateHelper().put(PropertyKeys.disabledClass, disabledClass);
+ }
+ public String getHoverClass() {
+ return (String) getStateHelper().eval(PropertyKeys.hoverClass);
+ }
+
+ public void setHoverClass(String hoverClass) {
+ getStateHelper().put(PropertyKeys.hoverClass, hoverClass);
+ }
+
+ public String getIconLeftClass() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftClass);
+ }
+
+ public void setIconLeftClass(String iconLeftClass) {
+ getStateHelper().put(PropertyKeys.iconLeftClass, iconLeftClass);
+ }
+
+ public String getIconRightClass() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightClass);
+ }
+
+ public void setIconRightClass(String iconRightClass) {
+ getStateHelper().put(PropertyKeys.iconRightClass, iconRightClass);
+ }
+
+ public String getStyle() {
+ return (String) getStateHelper().eval(PropertyKeys.style);
+ }
+
+ public void setStyle(String style) {
+ getStateHelper().put(PropertyKeys.style, style);
+ }
+
+ public String getStyleClass() {
+ return (String) getStateHelper().eval(PropertyKeys.styleClass,
+ isTopItem() ? getPanelMenu().getTopGroupClass() : getPanelMenu().getGroupClass() );
+ }
+
+ public void setStyleClass(String styleClass) {
+ getStateHelper().put(PropertyKeys.styleClass, styleClass);
+ }
+
+ public String getOnbeforedomupdate() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforedomupdate);
+ }
+
+ public void setOnbeforedomupdate(String onbeforedomupdate) {
+ getStateHelper().put(PropertyKeys.onbeforedomupdate, onbeforedomupdate);
+ }
+
+ public String getOncomplete() {
+ return (String) getStateHelper().eval(PropertyKeys.oncomplete);
+ }
+
+ public void setOncomplete(String oncomplete) {
+ getStateHelper().put(PropertyKeys.oncomplete, oncomplete);
+ }
+
+ public String getOnclick() {
+ return (String) getStateHelper().eval(PropertyKeys.onclick);
+ }
+
+ public void setOnclick(String onclick) {
+ getStateHelper().put(PropertyKeys.onclick, onclick);
+ }
+
+ public String getOndblclick() {
+ return (String) getStateHelper().eval(PropertyKeys.ondblclick);
+ }
+
+ public void setOndblclick(String ondblclick) {
+ getStateHelper().put(PropertyKeys.ondblclick, ondblclick);
+ }
+
+ public String getOnmousedown() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousedown);
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ getStateHelper().put(PropertyKeys.onmousedown, onmousedown);
+ }
+
+ public String getOnmousemove() {
+ return (String) getStateHelper().eval(PropertyKeys.onmousemove);
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ getStateHelper().put(PropertyKeys.onmousemove, onmousemove);
+ }
+
+ public String getOnmouseout() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseout);
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ getStateHelper().put(PropertyKeys.onmouseout, onmouseout);
+ }
+
+ public String getOnmouseover() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseover);
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ getStateHelper().put(PropertyKeys.onmouseover, onmouseover);
+ }
+
+ public String getOnmouseup() {
+ return (String) getStateHelper().eval(PropertyKeys.onmouseup);
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ getStateHelper().put(PropertyKeys.onmouseup, onmouseup);
+ }
+
+ public String getOnunselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onunselect);
+ }
+
+ public void setOnunselect(String onunselect) {
+ getStateHelper().put(PropertyKeys.onunselect, onunselect);
+ }
+
+ public String getOnselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onselect);
+ }
+
+ public void setOnselect(String onselect) {
+ getStateHelper().put(PropertyKeys.onselect, onselect);
+ }
+
+ public String getOnbeforeselect() {
+ return (String) getStateHelper().eval(PropertyKeys.onbeforeselect);
+ }
+
+ public void setOnbeforeselect(String onbeforeselect) {
+ getStateHelper().put(PropertyKeys.onbeforeselect, onbeforeselect);
+ }
+
+
@Override
public Collection<String> getEventNames() {
return EVENT_NAMES;
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/component/html/HtmlPanelMenuItem.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -24,8 +24,8 @@
package org.richfaces.component.html;
import org.richfaces.component.UIPanelMenuItem;
+
import javax.faces.component.behavior.ClientBehaviorHolder;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -58,12 +58,13 @@
public enum PropertyKeys {
disabledClass,
- disabledStyle,
hoverClass,
- hoverStyle,
- iconClass,
- iconDisabled,
- iconStyle,
+ iconLeft,
+ iconLeftClass,
+ iconLeftDisabled,
+ iconRight,
+ iconRightClass,
+ iconRightDisabled,
style,
styleClass,
onbeforedomupdate,
@@ -85,26 +86,24 @@
}
@Override
+ public HtmlPanelMenu getPanelMenu() {
+ return (HtmlPanelMenu) super.getPanelMenu();
+ }
+
+ @Override
public String getFamily() {
return COMPONENT_FAMILY;
}
public String getDisabledClass() {
- return (String) getStateHelper().eval(PropertyKeys.disabledClass);
+ return (String) getStateHelper().eval(PropertyKeys.disabledClass,
+ isTopItem() ? getPanelMenu().getTopItemDisableClass() : getPanelMenu().getItemDisableClass());
}
public void setDisabledClass(String disabledClass) {
getStateHelper().put(PropertyKeys.disabledClass, disabledClass);
}
- public String getDisabledStyle() {
- return (String) getStateHelper().eval(PropertyKeys.disabledStyle);
- }
-
- public void setDisabledStyle(String disabledStyle) {
- getStateHelper().put(PropertyKeys.disabledStyle, disabledStyle);
- }
-
public String getHoverClass() {
return (String) getStateHelper().eval(PropertyKeys.hoverClass);
}
@@ -113,38 +112,58 @@
getStateHelper().put(PropertyKeys.hoverClass, hoverClass);
}
- public String getHoverStyle() {
- return (String) getStateHelper().eval(PropertyKeys.hoverStyle);
+ public String getIconLeft() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeft,
+ isTopItem() ? getPanelMenu().getTopItemIconLeft() : getPanelMenu().getItemIconLeft());
}
- public void setHoverStyle(String hoverStyle) {
- getStateHelper().put(PropertyKeys.hoverStyle, hoverStyle);
+ public void setIconLeft(String iconLeft) {
+ getStateHelper().put(PropertyKeys.iconLeft, iconLeft);
}
- public String getIconClass() {
- return (String) getStateHelper().eval(PropertyKeys.iconClass);
+ public String getIconLeftClass() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftClass);
}
- public void setIconClass(String iconClass) {
- getStateHelper().put(PropertyKeys.iconClass, iconClass);
+ public void setIconLeftClass(String iconLeftClass) {
+ getStateHelper().put(PropertyKeys.iconLeftClass, iconLeftClass);
}
- public String getIconDisabled() {
- return (String) getStateHelper().eval(PropertyKeys.iconDisabled);
+ public String getIconLeftDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.iconLeftDisabled,
+ isTopItem() ? getPanelMenu().getTopItemDisableIconLeft() : getPanelMenu().getItemDisableIconLeft());
}
- public void setIconDisabled(String iconDisabled) {
- getStateHelper().put(PropertyKeys.iconDisabled, iconDisabled);
+ public void setIconLeftDisabled(String iconLeftDisabled) {
+ getStateHelper().put(PropertyKeys.iconLeftDisabled, iconLeftDisabled);
}
- public String getIconStyle() {
- return (String) getStateHelper().eval(PropertyKeys.iconStyle);
+ public String getIconRight() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRight,
+ isTopItem() ? getPanelMenu().getTopItemIconRight() : getPanelMenu().getItemIconRight());
}
- public void setIconStyle(String iconStyle) {
- getStateHelper().put(PropertyKeys.iconStyle, iconStyle);
+ public void setIconRight(String iconRight) {
+ getStateHelper().put(PropertyKeys.iconRight, iconRight);
}
+ public String getIconRightClass() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightClass);
+ }
+
+ public void setIconRightClass(String iconRightClass) {
+ getStateHelper().put(PropertyKeys.iconRightClass, iconRightClass);
+ }
+
+ public String getIconRightDisabled() {
+ return (String) getStateHelper().eval(PropertyKeys.iconRightDisabled,
+ isTopItem() ? getPanelMenu().getTopItemDisableIconRight() : getPanelMenu().getItemDisableIconRight());
+ }
+
+ public void setIconRightDisabled(String iconRightDisabled) {
+ getStateHelper().put(PropertyKeys.iconRightDisabled, iconRightDisabled);
+ }
+
public String getStyle() {
return (String) getStateHelper().eval(PropertyKeys.style);
}
@@ -154,7 +173,8 @@
}
public String getStyleClass() {
- return (String) getStateHelper().eval(PropertyKeys.styleClass);
+ return (String) getStateHelper().eval(PropertyKeys.styleClass,
+ isTopItem() ? getPanelMenu().getTopItemClass() : getPanelMenu().getItemClass() );
}
public void setStyleClass(String styleClass) {
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -29,6 +29,7 @@
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.component.html.HtmlPanelMenuGroup;
import org.richfaces.renderkit.HtmlConstants;
+import org.richfaces.renderkit.RenderKitUtils;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -37,7 +38,6 @@
import java.util.HashMap;
import java.util.Map;
-import static org.richfaces.component.util.HtmlUtil.concatClasses;
import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
@@ -109,11 +109,79 @@
writer.startElement("div", null);
writer.writeAttribute("id", menuGroup.getClientId(context) + ":hdr", null);
writer.writeAttribute("class", getCssClass(menuGroup, "-hdr"), null);
- PanelMenuItemRenderer.encodeHeaderGroup(writer, context, menuGroup, getCssClass(menuGroup, ""));
-// writer.writeText(menuGroup.getLabel(), null);
+ encodeHeaderGroup(writer, context, menuGroup, getCssClass(menuGroup, ""));
writer.endElement("div");
}
+ private void encodeHeaderGroup(ResponseWriter writer, FacesContext context, HtmlPanelMenuGroup menuItem, String classPrefix) throws IOException {
+ writer.startElement("table", null);
+ writer.writeAttribute("class", classPrefix + "-gr", null);
+ writer.startElement("tr", null);
+
+ encodeHeaderGroupIconLeft(writer, context, menuItem, classPrefix);
+
+ writer.startElement("td", null);
+ writer.writeAttribute("class", classPrefix + "-lbl", null);
+ writer.writeText(menuItem.getLabel(), null);
+ writer.endElement("td");
+
+ encodeHeaderGroupIconRight(writer, context, menuItem, classPrefix);
+
+ writer.endElement("tr");
+ writer.endElement("table");
+ }
+
+ private void encodeHeaderGroupIconLeft(ResponseWriter writer, FacesContext context, HtmlPanelMenuGroup menuGroup, String classPrefix) throws IOException {
+ String iconCollapsed = menuGroup.isDisabled() ? menuGroup.getIconLeftDisabled() : menuGroup.getIconLeftCollapsed();
+ String iconExpanded = menuGroup.isDisabled() ? menuGroup.getIconLeftDisabled() : menuGroup.getIconLeftExpanded();
+
+ encodeTdIcon(writer, context, classPrefix + "-ico", menuGroup.isExpanded(), iconCollapsed, iconExpanded);
+ }
+
+ private void encodeHeaderGroupIconRight(ResponseWriter writer, FacesContext context, HtmlPanelMenuGroup menuItem, String classPrefix) throws IOException {
+ String iconCollapsed = menuItem.isDisabled() ? menuItem.getIconRightDisabled() : menuItem.getIconRightCollapsed();
+ String iconExpanded = menuItem.isDisabled() ? menuItem.getIconRightDisabled() : menuItem.getIconRightExpanded();
+
+ encodeTdIcon(writer, context, classPrefix + "-exp-ico", menuItem.isExpanded(), iconCollapsed, iconExpanded);
+ }
+
+ private void encodeTdIcon(ResponseWriter writer, FacesContext context, String cssClass, boolean isExpanded, String attrIconCollapsedValue, String attrIconExpandedValue) throws IOException {
+ writer.startElement("td", null);
+ writer.writeAttribute("class", cssClass, null);
+ try {
+ AbstractPanelMenuItem.Icons iconCollapsed = AbstractPanelMenuItem.Icons.valueOf(attrIconCollapsedValue);
+ writer.startElement("div", null);
+ writer.writeAttribute("class", concatClasses("rf-pm-ico-colps", iconCollapsed.cssClass()), null);
+ writer.writeAttribute("style", styleElement("display", isExpanded ? "none" : "block"), null);
+ writer.endElement("div");
+ } catch (IllegalArgumentException e) {
+ if(attrIconCollapsedValue != null && attrIconCollapsedValue.trim().length() != 0) {
+ writer.startElement(HtmlConstants.IMG_ELEMENT, null);
+ writer.writeAttribute(HtmlConstants.ALT_ATTRIBUTE, "", null);
+ writer.writeURIAttribute(HtmlConstants.SRC_ATTRIBUTE, RenderKitUtils.getResourceURL(attrIconCollapsedValue, context), null);
+ writer.endElement(HtmlConstants.IMG_ELEMENT);
+ }
+ }
+
+ try {
+ AbstractPanelMenuItem.Icons iconExpanded = AbstractPanelMenuItem.Icons.valueOf(attrIconExpandedValue);
+ writer.startElement("div", null);
+ writer.writeAttribute("class", concatClasses("rf-pm-ico-exp", iconExpanded.cssClass()), null);
+ writer.writeAttribute("style", styleElement("display", isExpanded ? "block" : "none"), null);
+ writer.endElement("div");
+ } catch (IllegalArgumentException e) {
+ if(attrIconExpandedValue != null && attrIconExpandedValue.trim().length() != 0) {
+ writer.startElement(HtmlConstants.IMG_ELEMENT, null);
+ writer.writeAttribute(HtmlConstants.ALT_ATTRIBUTE, "", null);
+ writer.writeURIAttribute(HtmlConstants.SRC_ATTRIBUTE, RenderKitUtils.getResourceURL(attrIconExpandedValue, context), null);
+ writer.endElement(HtmlConstants.IMG_ELEMENT);
+ }
+ }
+
+ writer.endElement("td");
+ }
+
+
public String getCssClass(AbstractPanelMenuItem item, String postfix) {
return (item.isTopItem() ? TOP_CSS_CLASS_PREFIX : CSS_CLASS_PREFIX) + postfix;
}
@@ -132,7 +200,12 @@
@Override
protected String getStyleClass(UIComponent component) {
- return concatClasses(getCssClass((AbstractPanelMenuItem) component, ""), attributeAsString(component, "styleClass"));
+ AbstractPanelMenuItem menuItem = (AbstractPanelMenuItem) component;
+
+ return concatClasses(getCssClass(menuItem, ""),
+ attributeAsString(component, "styleClass"),
+ menuItem.isDisabled() ? getCssClass(menuItem, "-dis") : "",
+ menuItem.isDisabled() ? attributeAsString(component, "disabledClass") : "");
}
@Override
@@ -149,10 +222,11 @@
options.put("ajax", getAjaxOptions(context, panelMenuGroup));
options.put("name", panelMenuGroup.getName());
options.put("mode", panelMenuGroup.getMode());
+ options.put("disabled", panelMenuGroup.isDisabled());
options.put("expandEvent", panelMenuGroup.getExpandEvent());
options.put("collapseEvent", panelMenuGroup.getCollapseEvent());
options.put("expandSingle", panelMenuGroup.isExpandSingle());
- options.put("bubbleSelection", panelMenuGroup.getBubbleSelection());
+ options.put("bubbleSelection", panelMenuGroup.isBubbleSelection());
options.put("expanded", panelMenuGroup.isExpanded());
addEventOption(context, panelMenuGroup, options, COLLAPSE);
Modified: branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -26,7 +26,6 @@
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.component.html.HtmlPanelMenuItem;
-import org.richfaces.component.util.HtmlUtil;
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
@@ -51,41 +50,55 @@
public static final String BEFORE_SELECT = "beforeselect";
private static final String CSS_CLASS_PREFIX = "rf-pm-itm";
+ private static final String TOP_CSS_CLASS_PREFIX = "rf-pm-top-itm";
@Override
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
super.doEncodeBegin(writer, context, component);
- encodeHeaderGroup(writer, context, (AbstractPanelMenuItem) component, CSS_CLASS_PREFIX);
+ HtmlPanelMenuItem menuItem = (HtmlPanelMenuItem) component;
+ encodeHeaderGroup(writer, context, menuItem, menuItem.isTopItem() ? TOP_CSS_CLASS_PREFIX : CSS_CLASS_PREFIX);
}
- static void encodeHeaderGroup(ResponseWriter writer, FacesContext context, AbstractPanelMenuItem menuItem, String classPrefix) throws IOException {
+ private void encodeHeaderGroup(ResponseWriter writer, FacesContext context, HtmlPanelMenuItem menuItem, String classPrefix) throws IOException {
writer.startElement("table", null);
writer.writeAttribute("class", classPrefix + "-gr", null);
writer.startElement("tr", null);
- encodeTdIcon(writer, context, classPrefix, menuItem.getIcon());
+ encodeHeaderGroupLeftIcon(writer, context, menuItem, classPrefix);
writer.startElement("td", null);
writer.writeAttribute("class", classPrefix + "-lbl", null);
writer.writeText(menuItem.getLabel(), null);
writer.endElement("td");
- writer.startElement("td", null);
- writer.writeAttribute("class", HtmlUtil.concatClasses(classPrefix + "-exp-ico", "rf-pm-triangle-down"), null);
- writer.endElement("td");
+ encodeHeaderGroupRightIcon(writer, context, menuItem, classPrefix);
writer.endElement("tr");
writer.endElement("table");
}
- private static void encodeTdIcon(ResponseWriter writer, FacesContext context, String classPrefix, String attrIconValue) throws IOException {
+ private void encodeHeaderGroupRightIcon(ResponseWriter writer, FacesContext context, HtmlPanelMenuItem menuItem, String classPrefix) throws IOException {
+ String icon = menuItem.isDisabled() ? menuItem.getIconRightDisabled() : menuItem.getIconRight();
+ String cssClasses = concatClasses(classPrefix + "-exp-ico", menuItem.getIconLeftClass());
+
+ encodeTdIcon(writer, context, cssClasses, icon);
+ }
+
+ private void encodeHeaderGroupLeftIcon(ResponseWriter writer, FacesContext context, HtmlPanelMenuItem menuItem, String classPrefix) throws IOException {
+ String icon = menuItem.isDisabled() ? menuItem.getIconLeftDisabled() : menuItem.getIconLeft();
+ String cssClasses = concatClasses(classPrefix + "-ico", menuItem.getIconLeftClass());
+
+ encodeTdIcon(writer, context, cssClasses, icon);
+ }
+
+ public void encodeTdIcon(ResponseWriter writer, FacesContext context, String classPrefix, String attrIconValue) throws IOException {
writer.startElement("td", null);
try {
AbstractPanelMenuItem.Icons icon = AbstractPanelMenuItem.Icons.valueOf(attrIconValue);
- writer.writeAttribute("class", HtmlUtil.concatClasses(classPrefix + "-ico", icon.cssClass()), null);
+ writer.writeAttribute("class", concatClasses(classPrefix, icon.cssClass()), null);
} catch (IllegalArgumentException e) {
- writer.writeAttribute("class", classPrefix + "-ico", null);
+ writer.writeAttribute("class", classPrefix, null);
if(attrIconValue != null && attrIconValue.trim().length() != 0) {
writer.startElement(HtmlConstants.IMG_ELEMENT, null);
writer.writeAttribute(HtmlConstants.ALT_ATTRIBUTE, "", null);
@@ -99,9 +112,17 @@
@Override
protected String getStyleClass(UIComponent component) {
- return concatClasses(CSS_CLASS_PREFIX, attributeAsString(component, "styleClass"));
+ AbstractPanelMenuItem menuItem = (AbstractPanelMenuItem) component;
+ return concatClasses(getCssClass(menuItem, ""),
+ attributeAsString(component, "styleClass"),
+ menuItem.isDisabled() ? getCssClass(menuItem, "-dis") : "",
+ menuItem.isDisabled() ? attributeAsString(component, "disabledClass") : "");
}
+ public String getCssClass(AbstractPanelMenuItem item, String postfix) {
+ return (item.isTopItem() ? TOP_CSS_CLASS_PREFIX : CSS_CLASS_PREFIX) + postfix;
+ }
+
@Override
protected JSObject getScriptObject(FacesContext context, UIComponent component) {
return new JSObject("RichFaces.ui.PanelMenuItem",
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -1605,16 +1605,31 @@
</property>
<property>
<description></description>
- <property-name>iconCollapsed</property-name>
+ <property-name>bubbleSelection</property-name>
+ <property-class>boolean</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>iconLeftCollapsed</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description></description>
- <property-name>iconExpanded</property-name>
+ <property-name>iconLeftExpanded</property-name>
<property-class>java.lang.String</property-class>
</property>
<property>
<description></description>
+ <property-name>iconRightCollapsed</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
+ <property-name>iconRightExpanded</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description></description>
<property-name>changeExpandListener</property-name>
<property-class>java.lang.String</property-class>
</property>
@@ -1641,7 +1656,7 @@
<property>
<description></description>
<property-name>groupMode</property-name>
- <property-class>org.richfaces.ExpandMode</property-class>
+ <property-class>org.richfaces.PanelMenuMode</property-class>
</property>
<property>
<description></description>
@@ -1698,6 +1713,7 @@
<property-name>render</property-name>
<property-class>java.lang.Object</property-class>
</property>
+
</component>
<render-kit>
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -290,32 +290,27 @@
</attribute>
<attribute>
<description></description>
- <name>disabledStyle</name>
- <type>java.lang.String</type>
- </attribute>
- <attribute>
- <description></description>
<name>hoverClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>hoverStyle</name>
+ <name>iconLeftClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>iconClass</name>
+ <name>iconLeftDisabled</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>iconDisabled</name>
+ <name>iconRightClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>iconStyle</name>
+ <name>iconRightDisabled</name>
<type>java.lang.String</type>
</attribute>
<attribute>
@@ -419,16 +414,31 @@
</attribute>
<attribute>
<description></description>
- <name>iconCollapsed</name>
+ <name>bubbleSelection</name>
+ <type>boolean</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconLeftCollapsed</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>iconExpanded</name>
+ <name>iconLeftExpanded</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
+ <name>iconRightCollapsed</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>iconRightExpanded</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
<name>changeExpandListener</name>
<type>java.lang.String</type>
</attribute>
@@ -559,7 +569,7 @@
<attribute>
<description></description>
<name>groupMode</name>
- <type>org.richfaces.ExpandMode</type>
+ <type>org.richfaces.PanelMenuMode</type>
</attribute>
<attribute>
<description></description>
@@ -653,27 +663,27 @@
</attribute>
<attribute>
<description></description>
- <name>itemHoverClass</name>
+ <name>itemDisableClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>itemDisableClass</name>
+ <name>itemIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>itemIcon</name>
+ <name>itemIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>itemDisableIcon</name>
+ <name>itemDisableIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>itemIconPosition</name>
+ <name>itemDisableIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
@@ -683,27 +693,27 @@
</attribute>
<attribute>
<description></description>
- <name>topItemHoverClass</name>
+ <name>topItemDisableClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topItemDisableClass</name>
+ <name>topItemIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topItemIcon</name>
+ <name>topItemIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topItemDisableIcon</name>
+ <name>topItemDisableIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topItemIconPosition</name>
+ <name>topItemDisableIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
@@ -713,42 +723,42 @@
</attribute>
<attribute>
<description></description>
- <name>groupHoverClass</name>
+ <name>groupDisableClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>groupDisableClass</name>
+ <name>groupExpandIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>groupCollapseIcon</name>
+ <name>groupExpandIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>groupExpandIcon</name>
+ <name>groupCollapseIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>groupDisableIcon</name>
+ <name>groupCollapseIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>groupIconPosition</name>
+ <name>groupDisableIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topGroupClass</name>
+ <name>groupDisableIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topGroupHoverClass</name>
+ <name>topGroupClass</name>
<type>java.lang.String</type>
</attribute>
<attribute>
@@ -758,26 +768,36 @@
</attribute>
<attribute>
<description></description>
- <name>topGroupCollapseIcon</name>
+ <name>topGroupExpandIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topGroupExpandIcon</name>
+ <name>topGroupExpandIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topGroupDisableIcon</name>
+ <name>topGroupCollapseIconLeft</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
- <name>topGroupIconPosition</name>
+ <name>topGroupCollapseIconRight</name>
<type>java.lang.String</type>
</attribute>
<attribute>
<description></description>
+ <name>topGroupDisableIconLeft</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
+ <name>topGroupDisableIconRight</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description></description>
<name>onclick</name>
<type>java.lang.String</type>
</attribute>
Copied: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js (from rev 20272, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expandSingle : true
+ };
+
+ rf.ui.PanelMenu = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenu",
+
+ /**
+ * @class PanelMenu
+ * @name PanelMenu
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.id = componentId;
+ this.items = [];
+ this.attachToDom(componentId);
+
+ this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+ this.activeItem = this.__getValueInput().value;
+ this.nestingLevel = 0;
+
+ var menuGroup = this;
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__panelMenu().bind("expand", function (event) {
+ menuGroup.__childGroups().each (function (index, group) {
+ if (event.target.id != group.id) {
+ rf.$(group.id).collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ if (menuGroup.activeItem) {
+ this.__panelMenu().ready(function () {
+ var item = menuGroup.items[menuGroup.activeItem];
+ item.__select();
+ item.__fireSelect();
+ })
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ },
+
+ getItems: function () {
+ return this.items;
+ },
+
+ getItem: function (name) {
+ return this.items[name];
+ },
+
+ /***************************** Public Methods ****************************************************************/
+ /**
+ * @methodOf
+ * @name PanelMenu#selectItem
+ *
+ * TODO ...
+ *
+ * @param {String} name
+ * @return {void} TODO ...
+ */
+ selectItem: function (name) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#selectedItem
+ *
+ * TODO ...
+ *
+ * @return {String} TODO ...
+ */
+ selectedItem: function (id) {
+ if (id != undefined) {
+ var valueInput = this.__getValueInput();
+ var prevActiveItem = valueInput.value;
+
+ this.activeItem = id;
+ valueInput.value = id;
+
+ return prevActiveItem;
+ } else {
+ return this.activeItem;
+ }
+ },
+
+ __getValueInput : function() {
+ return document.getElementById(this.id + "-value");
+ },
+
+ selectItem: function (itemName) {
+ // TODO
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ expandAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseAll
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ collapseAll: function () {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#expandGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ expandGroup: function (groupName) {
+ // TODO implement
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenu#collapseGroup
+ *
+ * TODO ...
+ *
+ * @param {String} groupName
+ * @return {void} TODO ...
+ */
+ collapseGroup: function (groupName) {
+ // TODO implement
+ },
+
+
+ /***************************** Private Methods ****************************************************************/
+
+
+ __panelMenu : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __childGroups : function () {
+ return this.__panelMenu().children(".rf-pm-top-gr")
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js (from rev 20272, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,363 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ expanded : false,
+ expandSingle : true,
+ bubbleSelection : true,
+ stylePrefix : "rf-pm-gr",
+
+ // TODO we should use selectionType = {none, selectable, unselectable}
+ selectable : false,
+ unselectable : false // unselectable can be only selectable item => if selectable == false than unselectable = false
+ };
+
+ var EXPAND_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (group, expand) {
+ var mode = group.mode;
+ if (mode == "server") {
+ return this.execServer(group);
+ } else if (mode == "ajax") {
+ return this.execAjax(group);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(group, expand);
+ } else {
+ rf.log.error("EXPAND_ITEM.exec : unknown mode (" + mode + ")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (group) {
+ group.__changeState();
+ rf.submitForm(this.__getParentForm(group));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (group) {
+ var oldState = group.__changeState();
+ rf.ajax(group.id, null, $.extend({}, group.options["ajax"], {}));
+ group.__restoreState(oldState);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @param {PanelMenuGroup} group
+ * @param {Boolean} expand
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (group, expand) {
+ if (expand) {
+ group.expand();
+ } else {
+ group.collapse();
+ }
+
+ return group.__fireSwitch();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuGroup = rf.ui.PanelMenuItem.extendClass({
+ // class name
+ name:"PanelMenuGroup",
+
+ /**
+ * @class PanelMenuGroup
+ * @name PanelMenuGroup
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+
+ rf.ui.PanelMenuItem.call(this, componentId);
+
+ if (!this.options.disabled) {
+ var menuGroup = this;
+
+ if (!this.options.selectable) {
+ this.__header().bind("click", function () {
+ return menuGroup.switchExpantion();
+ });
+ }
+
+ if (this.options.selectable || this.options.bubbleSelection) {
+ this.__content().bind("select", function (event) {
+ if (menuGroup.options.selectable && menuGroup.__isMyEvent(event)) {
+ menuGroup.expand();
+ }
+
+ if (menuGroup.options.bubbleSelection && !menuGroup.__isMyEvent(event)) {
+ menuGroup.__select();
+ if (!menuGroup.expanded()) {
+ menuGroup.expand();
+ }
+ }
+ });
+
+ this.__content().bind("unselect", function (event) {
+ if (menuGroup.options.selectable && menuGroup.__isMyEvent(event)) {
+ menuGroup.collapse();
+ }
+
+ if (menuGroup.options.bubbleSelection && !menuGroup.__isMyEvent(event)) {
+ menuGroup.__unselect();
+ }
+ });
+ }
+
+ if (menuGroup.options.expandSingle) {
+ menuGroup.__group().bind("expand", function (event) {
+ if (menuGroup.__isMyEvent(event)) {
+ return;
+ }
+
+ menuGroup.__childGroups().each (function (index, group) {
+ var rfGroup = rf.$(group);
+ if (!rfGroup.__isMyEvent(event)) {
+ rfGroup.collapse();
+ }
+ });
+
+ event.stopPropagation();
+ });
+ }
+
+ this.__addUserEventHandler("collapse");
+ this.__addUserEventHandler("expand");
+ }
+ },
+
+ /***************************** Public Methods ****************************************************************/
+ expanded : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-exp")
+ return this.__getExpandValue();
+ },
+
+ expand : function () {
+ this.__expand();
+
+ return this.__fireExpand();
+ },
+
+ __expand : function () {
+ this.__content().removeClass("rf-pm-colps").addClass("rf-pm-exp");
+ var header = this.__header();
+ header.find(".rf-pm-ico-colps").hide();
+ header.find(".rf-pm-ico-exp").show();
+
+ this.__setExpandValue(true);
+ },
+
+ collapsed : function () {
+ // TODO check invariant in dev mode
+ // return this.__content().hasClass("rf-pm-colps")
+ return !this.__getExpandValue();
+ },
+
+ collapse : function () {
+ this.__collapse();
+
+ this.__childGroups().each (function(index, group) {
+ rf.$(group.id).__collapse();
+ });
+
+ this.__fireCollapse();
+ },
+
+ __collapse : function () {
+ this.__content().addClass("rf-pm-colps").removeClass("rf-pm-exp");
+ var header = this.__header();
+ header.find(".rf-pm-ico-exp").hide();
+ header.find(".rf-pm-ico-colps").show();
+
+ this.__setExpandValue(false);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#switch
+ *
+ * TODO ...
+ *
+ * @param {boolean} expand
+ * @return {void} TODO ...
+ */
+ switchExpantion : function () { // TODO rename
+ var continueProcess = this.__fireBeforeSwitch();
+ if (!continueProcess) {
+ return false;
+ }
+
+ EXPAND_ITEM.exec(this, !this.expanded());
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ EXPAND_ITEM.execClient(this, this.expanded());
+ },
+
+ __switch : function (expand) {
+ if (expand) {
+ this.expand();
+ } else {
+ this.collapse();
+ }
+ },
+
+ /***************************** Private Methods ****************************************************************/
+ __childGroups : function () {
+ return this.__content().children(".rf-pm-gr")
+ },
+
+ __group : function () {
+ return $(rf.getDomElement(this.id))
+ },
+
+ __header : function () {
+ return $(rf.getDomElement(this.id + ":hdr"))
+ },
+
+ __content : function () {
+ return $(rf.getDomElement(this.id + ":cnt"))
+ },
+
+ __expandValueInput : function () {
+ return document.getElementById(this.id + ":expanded");
+ },
+
+ __getExpandValue : function () {
+ return this.__expandValueInput().value == "true";
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuGroup#__setExpandValue
+ *
+ * @param {boolean} value - is group expanded?
+ * @return {boolean} preview value
+ */
+ __setExpandValue : function (value) {
+ var input = this.__expandValueInput();
+ var oldValue = input.value;
+
+ input.value = value;
+
+ return oldValue;
+ },
+
+ __changeState : function () {
+ var state = {};
+ state["expanded"] = this.__setExpandValue(!this.__getExpandValue());
+ if (this.options.selectable) {
+ state["itemName"] = this.__rfPanelMenu().selectedItem(this.itemName); // TODO bad function name for function which change component state
+ }
+
+ return state;
+ },
+
+ __restoreState : function (state) {
+ if (!state) {
+ return;
+ }
+
+ if (state["expanded"]) {
+ this.__setExpandValue(state["expanded"]);
+ }
+
+ if (state["itemName"]) {
+ this.__rfPanelMenu().selectedItem(state["itemName"]);
+ }
+ },
+
+ __fireSwitch : function () {
+ return new rf.Event.fireById(this.id, "switch", {
+ id: this.id
+ });
+ },
+
+ __isMyEvent: function (event) {
+ return this.id == event.target.id;
+ },
+
+ __fireBeforeSwitch : function () {
+ return rf.Event.fireById(this.id, "beforeswitch", {
+ id: this.id
+ });
+ },
+
+ __fireCollapse : function () {
+ return new rf.Event.fireById(this.id, "collapse", {
+ id: this.id
+ });
+ },
+
+ __fireExpand : function () {
+ return new rf.Event.fireById(this.id, "expand", {
+ id: this.id
+ });
+ },
+
+ destroy: function () {
+ rf.Event.unbindById(this.id, "."+this.namespace);
+
+ this.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Copied: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js (from rev 20272, trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,319 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.
+ */
+
+
+(function ($, rf) {
+
+ rf.ui = rf.ui || {};
+
+ var __DEFAULT_OPTIONS = {
+ disabled : false,
+ selectable: true,
+ mode: "client",
+ unselectable: false,
+ highlight: true,
+ stylePrefix: "rf-pm-itm",
+ itemStep: 20
+ };
+
+ var SELECT_ITEM = {
+
+ /**
+ *
+ * @return {void}
+ * */
+ exec : function (item) {
+ var mode = item.mode;
+ if (mode == "server") {
+ return this.execServer(item);
+ } else if (mode == "ajax") {
+ return this.execAjax(item);
+ } else if (mode == "client" || mode == "none") {
+ return this.execClient(item);
+ } else {
+ rf.log.error("SELECT_ITEM.exec : unknown mode (" + mode + ")");
+ }
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execServer : function (item) {
+ item.__changeState();
+ rf.submitForm(this.__getParentForm(item));
+
+ return false;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {Boolean} false
+ * */
+ execAjax : function (item) {
+ var oldItem = item.__changeState();
+ rf.ajax(item.__panelMenu().id, null, $.extend({}, item.options["ajax"], {}));
+ item.__restoreState(oldItem);
+
+ return true;
+ },
+
+ /**
+ * @protected
+ *
+ * @return {undefined}
+ * - false - if process has been terminated
+ * - true - in other cases
+ * */
+ execClient : function (item) {
+ var panelMenu = item.__rfPanelMenu();
+ if (panelMenu.selectedItem()) {
+ panelMenu.getItems()[panelMenu.selectedItem()].unselect();
+ }
+ panelMenu.selectedItem(item.itemName);
+
+ item.__select();
+
+ return item.__fireSelect();
+ },
+
+ /**
+ * @private
+ * */
+ __getParentForm : function (item) {
+ return $($(rf.getDomElement(item.id)).parents("form")[0]);
+ }
+ };
+
+ rf.ui.PanelMenuItem = rf.BaseComponent.extendClass({
+ // class name
+ name:"PanelMenuItem",
+
+ /**
+ * @class PanelMenuItem
+ * @name PanelMenuItem
+ *
+ * @constructor
+ * @param {String} componentId - component id
+ * @param {Hash} options - params
+ * */
+ init : function (componentId, options) {
+ this.id = componentId;
+ this.attachToDom(componentId);
+
+ this.options = $.extend({}, __DEFAULT_OPTIONS, this.options || {}, options || {});
+
+ this.mode = this.options.mode
+ this.itemName = this.options.name
+ this.__rfPanelMenu().getItems()[this.itemName] = this;
+
+ // todo move it
+ this.selectionClass = this.options.stylePrefix + "-sel";
+ this.hoverClass = this.options.stylePrefix + "-hov";
+
+ if (!this.options.disabled) {
+ var item = this;
+ if (this.options.highlight) {
+ this.__item().bind("mouseenter", function() {
+ item.highlight(true);
+ });
+ this.__item().bind("mouseleave", function() {
+ item.highlight(false);
+ });
+ }
+
+ if (this.options.selectable) {
+ this.__header().bind("click", function() {
+ if (item.__rfPanelMenu().selectedItem() == item.id) {
+ if (item.options.unselectable) {
+ return item.unselect();
+ }
+
+ // we shouldn't select one item several times
+ } else {
+ return item.select();
+ }
+ });
+ }
+ }
+
+ item = this;
+ $(this.__panelMenu()).ready(function () {
+ item.__renderNestingLevel();
+ });
+
+ this.__addUserEventHandler("select");
+ },
+
+ /***************************** Public Methods ****************************************************************/
+ highlight : function (highlight) {
+ if (highlight && !this.selected()) {
+ this.__header().addClass(this.hoverClass);
+ } else {
+ this.__header().removeClass(this.hoverClass);
+ }
+ },
+
+ selected : function () {
+ return this.__header().hasClass(this.selectionClass);
+ },
+
+ /**
+ * @methodOf
+ * @name PanelMenuItem#select
+ *
+ * TODO ...
+ *
+ * @return {void} TODO ...
+ */
+ select: function () {
+ var continueProcess = this.__fireBeforeSelect();
+ if (!continueProcess) {
+ return false;
+ }
+
+ return SELECT_ITEM.exec(this)
+ },
+
+ /**
+ * please, remove this method when client side ajax events will be added
+ *
+ * */
+ onCompleteHandler : function () {
+ SELECT_ITEM.execClient(this);
+ },
+
+ unselect: function () {
+ var panelMenu = this.__rfPanelMenu();
+ if (panelMenu.selectedItem() == this.itemName) {
+ panelMenu.selectedItem(null);
+ } else {
+ rf.warn("You try unselect item (name=" + this.itemName + ") that isn't seleted")
+ }
+
+ this.__unselect();
+
+ return this.__fireUnselect();
+ },
+
+ /***************************** Private Methods ****************************************************************/
+ __rfParentItem : function () {
+ var res = this.__item().parents(".rf-pm-gr")[0];
+ if (!res) {
+ res = this.__item().parents(".rf-pm-top-gr")[0];
+ }
+
+ if (!res) {
+ res = this.__panelMenu();
+ }
+
+ return res ? rf.$(res) : null;
+ },
+
+ __getNestingLevel : function () {
+ if (!this.nestingLevel) {
+ var parentItem = this.__rfParentItem();
+ if (parentItem && parentItem.__getNestingLevel) {
+ this.nestingLevel = parentItem.__getNestingLevel() + 1;
+ } else {
+ this.nestingLevel = 0;
+ }
+ }
+
+ return this.nestingLevel;
+ },
+
+ __renderNestingLevel : function () {
+ this.__item().find("td").first().css("padding-left", this.options.itemStep * this.__getNestingLevel());
+ },
+
+ __panelMenu : function () {
+ return this.__item().parents(".rf-pm")[0];
+ },
+
+ __rfPanelMenu : function () {
+ return rf.$(this.__item().parents(".rf-pm")[0]);
+ },
+
+ __changeState : function () {
+ return this.__rfPanelMenu().selectedItem(this.itemName);
+ },
+
+ __restoreState : function (state) {
+ if (state) {
+ this.__rfPanelMenu().selectedItem(state);
+ }
+ },
+
+ __item : function () {
+ return $(rf.getDomElement(this.id));
+ },
+
+ __header : function () {
+ return this.__item();
+ },
+
+ __select: function () {
+ this.__header().addClass(this.selectionClass);
+ },
+
+ __unselect: function () {
+ this.__header().removeClass(this.selectionClass);
+ },
+
+ __fireBeforeSelect : function () {
+ return new rf.Event.fireById(this.id, "beforeselect", {
+ id: this.id
+ });
+ },
+
+ __fireSelect : function () {
+ return new rf.Event.fireById(this.id, "select", {
+ id: this.id
+ });
+ },
+
+ __fireUnselect : function () {
+ return new rf.Event.fireById(this.id, "unselect", {
+ id: this.id
+ });
+ },
+
+ /**
+ * @private
+ * */
+ __addUserEventHandler : function (name) {
+ var handler = this.options["on" + name];
+ if (handler) {
+ rf.Event.bindById(this.id, name, handler);
+ }
+ },
+
+ destroy: function () {
+ delete this.__rfPanelMenu().getItems()[this.itemName];
+
+ rf.ui.PanelMenuItem.$super.destroy.call(this);
+ }
+ });
+})(jQuery, RichFaces);
Modified: branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.ecss 2010-12-01 17:16:00 UTC (rev 20273)
@@ -62,6 +62,10 @@
margin: 0px 3px;
}
+.rf-pm-itm-dis {
+ color: #BED6F8;
+}
+
.rf-pm-itm-hov {
background-color: '#{richSkin.additionalBackgroundColor}';
}
@@ -79,10 +83,14 @@
margin-bottom: 3px
}
+.rf-pm-gr-dis {
+ color: #BED6F8;
+}
+
.rf-pm-gr-hov {
background: '#{richSkin.additionalBackgroundColor}';
- color: white;
+ color: white; /*TODO skin?*/
}
.rf-pm-gr-sel {
@@ -169,6 +177,10 @@
margin: 0px 3px;
}
+.rf-pm-top-itm-dis {
+ color: #BED6F8;
+}
+
.rf-pm-top-itm-hov {
background-color:#ffd700;
}
@@ -185,9 +197,13 @@
margin-bottom: 3px
}
+.rf-pm-top-gr-dis {
+ color: #BED6F8;
+}
+
.rf-pm-top-gr-hov {
background-color: green;
- color: white;
+ color: white; /*TODO skin?*/
}
.rf-pm-top-gr-sel {
@@ -251,17 +267,20 @@
display: block;
}
+.rf-pm-ico-colps {}
+.rf-pm-ico-exp {}
+
/* Icons */
-.rf-pm-chevron { background-image: "url(#{resource['org.richfaces.images:Chevron.png']})" }
-.rf-pm-chevron-down { background-image: "url(#{resource['org.richfaces.images:ChevronDown.png']})" }
-.rf-pm-chevron-left { background-image: "url(#{resource['org.richfaces.images:ChevronLeft.png']})" }
-.rf-pm-chevron-up { background-image: "url(#{resource['org.richfaces.images:ChevronUp.png']})" }
-.rf-pm-disc { background-image: "url(#{resource['org.richfaces.images:Disc.png']})" }
-.rf-pm-grid { background-image: "url(#{resource['org.richfaces.images:Grid.png']})" }
-.rf-pm-spacer { background-image: "url(#{resource['org.richfaces.images:Spacer.png']})" }
-.rf-pm-triangle { background-image: "url(#{resource['org.richfaces.images:Triangle.png']})" }
-.rf-pm-triangle-down { background-image: "url(#{resource['org.richfaces.images:TriangleDown.png']})" }
-.rf-pm-triangle-left { background-image: "url(#{resource['org.richfaces.images:TriangleLeft.png']})" }
-.rf-pm-triangle-up { background-image: "url(#{resource['org.richfaces.images:TriangleUp.png']})" }
\ No newline at end of file
+.rf-pm-chevron { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:Chevron.png']})" }
+.rf-pm-chevron-down { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:ChevronDown.png']})" }
+.rf-pm-chevron-left { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:ChevronLeft.png']})" }
+.rf-pm-chevron-up { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:ChevronUp.png']})" }
+.rf-pm-disc { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:Disc.png']})" }
+.rf-pm-grid { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:Grid.png']})" }
+.rf-pm-spacer { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:Spacer.png']})" }
+.rf-pm-triangle { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:Triangle.png']})" }
+.rf-pm-triangle-down { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:TriangleDown.png']})" }
+.rf-pm-triangle-left { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:TriangleLeft.png']})" }
+.rf-pm-triangle-up { width: 16px; height: 16px; background-image: "url(#{resource['org.richfaces.images:TriangleUp.png']})" }
\ No newline at end of file
Modified: branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelMenuGroupRendererTest.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -25,11 +25,15 @@
import java.io.IOException;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.junit.Ignore;
import org.junit.Test;
import org.xml.sax.SAXException;
- /**
+import static org.junit.Assert.assertNotNull;
+
+/**
* @author akolonitsky
* @since 2010-10-25
*/
@@ -50,6 +54,30 @@
doTest("panelMenuGroup-topGroup", "f:panelMenuGroup");
}
+ @Test
+ public void testIconsInheritanceTopGroup() throws IOException, SAXException {
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-topGroup", "f:panelMenuGroup-top");
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-topGroupDis", "f:panelMenuGroup-topDis");
+ }
+
+ @Test
+ public void testIconsInheritanceTopItem() throws IOException, SAXException {
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-topItem", "f:panelMenuItem-top");
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-topItemDis", "f:panelMenuItem-topDis");
+ }
+
+ @Test
+ public void testIconsInheritanceItem() throws IOException, SAXException {
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-item", "f:panelMenuItem");
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-itemDis", "f:panelMenuItem-dis");
+ }
+
+ @Test
+ public void testIconsInheritanceGroup() throws IOException, SAXException {
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-group", "f:panelMenuGroup");
+ doTest("panelMenu-icons-inheritance", "panelMenu-icons-inheritance-groupDis", "f:panelMenuGroup-dis");
+ }
+
}
Modified: branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/java/org/richfaces/renderkit/html/RendererTestBase.java 2010-12-01 17:16:00 UTC (rev 20273)
@@ -71,17 +71,21 @@
}
protected void doTest(String pageName, String pageElementToTest) throws IOException, SAXException {
- HtmlPage page = environment.getPage('/' + pageName + ".jsf");
+ doTest(pageName, pageName, pageElementToTest);
+ }
+
+ protected void doTest(String jsfPage, String xmlPage, String pageElementToTest) throws IOException, SAXException {
+ HtmlPage page = environment.getPage('/' + jsfPage + ".jsf");
HtmlElement panel = page.getElementById(pageElementToTest);
assertNotNull(panel);
- checkXmlStructure(pageName, panel.asXml());
+ checkXmlStructure(xmlPage, panel.asXml());
}
protected void checkXmlStructure(String pageName, String pageCode) throws SAXException, IOException {
InputStream expectedPageCode = this.getClass().getResourceAsStream(pageName + ".xmlunit.xml");
if (expectedPageCode == null) {
- return;
+ throw new IllegalArgumentException("Page: " + pageName + ".xmlunit.xml doesn't exist.");
}
Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new StringReader(pageCode));
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-group.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,26 @@
+<div id="f:panelMenuGroup" class="rf-pm-gr groupClass">
+ <input id="f:panelMenuGroup:expanded" name="f:panelMenuGroup:expanded" type="hidden" value="false"/>
+ <div id="f:panelMenuGroup:hdr" class="rf-pm-gr-hdr">
+ <table class="rf-pm-gr-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-triangle-down" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-disc" style="display:none"></div>
+ </td>
+ <td class="rf-pm-gr-lbl">panelMenuGroup-top</td>
+ <td class="rf-pm-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-triangle-up" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-disc" style="display:none"></div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="f:panelMenuGroup:cnt" class="rf-pm-gr-cnt rf-pm-colps">
+ <script type="text/javascript">
+ // Text
+ </script>
+
+ </div>
+</div>
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,26 @@
+<div id="f:panelMenuGroup-dis" class="rf-pm-gr groupClass rf-pm-gr-dis groupDisableClass">
+ <input id="f:panelMenuGroup-dis:expanded" name="f:panelMenuGroup-dis:expanded" type="hidden" value="false"/>
+ <div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr">
+ <table class="rf-pm-gr-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-chevron-down" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-chevron-down" style="display:none"></div>
+ </td>
+ <td class="rf-pm-gr-lbl">panelMenuGroup-top</td>
+ <td class="rf-pm-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-chevron-up" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-chevron-up" style="display:none"></div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="f:panelMenuGroup-dis:cnt" class="rf-pm-gr-cnt rf-pm-colps">
+ <script type="text/javascript">
+ // Text
+ </script>
+
+ </div>
+</div>
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-item.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-item.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-item.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-item.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,15 @@
+<div id="f:panelMenuItem" class="rf-pm-itm itemClass">
+ <table class="rf-pm-itm-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-itm-ico rf-pm-triangle-down"></td>
+ <td class="rf-pm-itm-lbl">panelMenuItem</td>
+ <td class="rf-pm-itm-exp-ico rf-pm-triangle-up"></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,15 @@
+<div id="f:panelMenuItem-dis" class="rf-pm-itm itemClass rf-pm-itm-dis itemDisableClass">
+ <table class="rf-pm-itm-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-itm-ico rf-pm-chevron-down"></td>
+ <td class="rf-pm-itm-lbl">panelMenuItem</td>
+ <td class="rf-pm-itm-exp-ico rf-pm-chevron-up"></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroup.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,26 @@
+<div id="f:panelMenuGroup-top" class="rf-pm-top-gr topGroupClass">
+ <input id="f:panelMenuGroup-top:expanded" name="f:panelMenuGroup-top:expanded" type="hidden" value="false"/>
+ <div id="f:panelMenuGroup-top:hdr" class="rf-pm-top-gr-hdr">
+ <table class="rf-pm-top-gr-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-top-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-triangle" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-disc" style="display:none"></div>
+ </td>
+ <td class="rf-pm-top-gr-lbl">panelMenuGroup-top</td>
+ <td class="rf-pm-top-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-triangle" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-disc" style="display:none"></div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="f:panelMenuGroup-top:cnt" class="rf-pm-top-gr-cnt rf-pm-colps">
+ <script type="text/javascript">
+ // Text
+ </script>
+
+ </div>
+</div>
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,26 @@
+<div id="f:panelMenuGroup-topDis" class="rf-pm-top-gr topGroupClass rf-pm-top-gr-dis topGroupDisableClass">
+ <input id="f:panelMenuGroup-topDis:expanded" name="f:panelMenuGroup-topDis:expanded" type="hidden" value="false"/>
+ <div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr">
+ <table class="rf-pm-top-gr-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-top-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-chevron" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-chevron" style="display:none"></div>
+ </td>
+ <td class="rf-pm-top-gr-lbl">panelMenuGroup-top</td>
+ <td class="rf-pm-top-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-chevron" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-chevron" style="display:none"></div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="f:panelMenuGroup-topDis:cnt" class="rf-pm-top-gr-cnt rf-pm-colps">
+ <script type="text/javascript">
+ // Text
+ </script>
+
+ </div>
+</div>
\ No newline at end of file
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItem.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItem.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItem.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItem.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,15 @@
+<div id="f:panelMenuItem-top" class="rf-pm-top-itm topItemClass">
+ <table class="rf-pm-top-itm-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-top-itm-ico rf-pm-triangle"></td>
+ <td class="rf-pm-top-itm-lbl">panelMenuItem</td>
+ <td class="rf-pm-top-itm-exp-ico rf-pm-triangle"></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,15 @@
+<div id="f:panelMenuItem-topDis" class="rf-pm-top-itm topItemClass rf-pm-top-itm-dis topItemDisableClass">
+ <table class="rf-pm-top-itm-gr">
+ <tbody>
+ <tr>
+ <td class="rf-pm-top-itm-ico rf-pm-chevron"></td>
+ <td class="rf-pm-top-itm-lbl">panelMenuItem</td>
+ <td class="rf-pm-top-itm-exp-ico rf-pm-chevron"></td>
+ </tr>
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ // Text
+ </script>
+</div>
Copied: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml (from rev 20272, trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml)
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml (rev 0)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -0,0 +1,93 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright ${year}, 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.
+-->
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:pn="http://richfaces.org/output"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:head>
+ <title>Richfaces PanelMenuGroup Test</title>
+ </h:head>
+
+<h:body>
+ <h:form id="f">
+ <pn:panelMenu
+ itemIconRight="triangleUp"
+ itemIconLeft="triangleDown"
+ itemClass="itemClass"
+
+ itemDisableIconRight="chevronUp"
+ itemDisableIconLeft="chevronDown"
+ itemDisableClass="itemDisableClass"
+
+ topItemIconRight="triangle"
+ topItemIconLeft="triangle"
+ topItemClass="topItemClass"
+
+ topItemDisableIconRight="chevron"
+ topItemDisableIconLeft="chevron"
+ topItemDisableClass="topItemDisableClass"
+
+ groupCollapseIconRight="triangleUp"
+ groupExpandIconRight="disc"
+ groupCollapseIconLeft="triangleDown"
+ groupExpandIconLeft="disc"
+ groupClass="groupClass"
+
+ groupDisableIconRight="chevronUp"
+ groupDisableIconLeft="chevronDown"
+ groupDisableClass="groupDisableClass"
+
+ topGroupCollapseIconRight="triangle"
+ topGroupExpandIconRight="disc"
+ topGroupCollapseIconLeft="triangle"
+ topGroupExpandIconLeft="disc"
+ topGroupClass="topGroupClass"
+
+ topGroupDisableIconRight="chevron"
+ topGroupDisableIconLeft="chevron"
+ topGroupDisableClass="topGroupDisableClass"
+ >
+
+ <pn:panelMenuGroup id="panelMenuGroup-top"></pn:panelMenuGroup>
+ <pn:panelMenuGroup id="panelMenuGroup-topDis" disabled="true"></pn:panelMenuGroup>
+ <pn:panelMenuItem id="panelMenuItem-top"></pn:panelMenuItem>
+ <pn:panelMenuItem id="panelMenuItem-topDis" disabled="true"></pn:panelMenuItem>
+ <pn:panelMenuGroup>
+ <pn:panelMenuGroup id="panelMenuGroup"></pn:panelMenuGroup>
+ <pn:panelMenuGroup id="panelMenuGroup-dis" disabled="true"></pn:panelMenuGroup>
+ <pn:panelMenuItem id="panelMenuItem"></pn:panelMenuItem>
+ <pn:panelMenuItem id="panelMenuItem-dis" disabled="true"></pn:panelMenuItem>
+ </pn:panelMenuGroup>
+ </pn:panelMenu>
+ </h:form>
+</h:body>
+</html>
+
+
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -37,9 +37,13 @@
<h:body>
<h:form id="f" style="border:blue solid thin;">
- <pn:panelMenuGroup id="panelMenuGroup" expanded="true" label="Group Label">
- <!-- TODO -->
- </pn:panelMenuGroup>
+ <pn:panelMenu>
+ <pn:panelMenuGroup>
+ <pn:panelMenuGroup id="panelMenuGroup" expanded="true" label="Group Label">
+ <!-- TODO -->
+ </pn:panelMenuGroup>
+ </pn:panelMenuGroup>
+ </pn:panelMenu>
</h:form>
</h:body>
</html>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-expanded.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -4,9 +4,15 @@
<table class="rf-pm-gr-gr">
<tbody>
<tr>
- <td class="rf-pm-gr-ico rf-pm-grid"></td>
+ <td class="rf-pm-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:none"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:block"></div>
+ </td>
<td class="rf-pm-gr-lbl">Group Label</td>
- <td class="rf-pm-gr-exp-ico rf-pm-triangle-down"></td>
+ <td class="rf-pm-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:none"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:block"></div>
+ </td>
</tr>
</tbody>
</table>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup-topGroup.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -4,9 +4,15 @@
<table class="rf-pm-top-gr-gr">
<tbody>
<tr>
- <td class="rf-pm-top-gr-ico rf-pm-grid"></td>
+ <td class="rf-pm-top-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:none"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:block"></div>
+ </td>
<td class="rf-pm-top-gr-lbl">Group Label</td>
- <td class="rf-pm-top-gr-exp-ico rf-pm-triangle-down"></td>
+ <td class="rf-pm-top-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:none"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:block"></div>
+ </td>
</tr>
</tbody>
</table>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -37,9 +37,13 @@
<h:body>
<h:form id="f" style="border:blue solid thin;">
- <pn:panelMenuGroup id="panelMenuGroup">
- <!-- TODO -->
- </pn:panelMenuGroup>
+ <pn:panelMenu>
+ <pn:panelMenuGroup>
+ <pn:panelMenuGroup id="panelMenuGroup">
+ <!-- TODO -->
+ </pn:panelMenuGroup>
+ </pn:panelMenuGroup>
+ </pn:panelMenu>
</h:form>
</h:body>
</html>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuGroup.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -4,9 +4,15 @@
<table class="rf-pm-gr-gr">
<tbody>
<tr>
- <td class="rf-pm-gr-ico rf-pm-grid"></td>
+ <td class="rf-pm-gr-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:none"></div>
+ </td>
<td class="rf-pm-gr-lbl">panelMenuGroup</td>
- <td class="rf-pm-gr-exp-ico rf-pm-triangle-down"></td>
+ <td class="rf-pm-gr-exp-ico">
+ <div class="rf-pm-ico-colps rf-pm-grid" style="display:block"></div>
+ <div class="rf-pm-ico-exp rf-pm-grid" style="display:none"></div>
+ </td>
</tr>
</tbody>
</table>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xhtml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -37,9 +37,13 @@
<h:body>
<h:form id="f" style="border:blue solid thin;">
- <pn:panelMenuItem id="panelMenuItem">
- <!-- TODO -->
- </pn:panelMenuItem>
+ <pn:panelMenu>
+ <pn:panelMenuGroup>
+ <pn:panelMenuItem id="panelMenuItem">
+ <!-- TODO -->
+ </pn:panelMenuItem>
+ </pn:panelMenuGroup>
+ </pn:panelMenu>
</h:form>
</h:body>
</html>
Modified: branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml
===================================================================
--- branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml 2010-12-01 16:55:03 UTC (rev 20272)
+++ branches/RF-8742-1/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenuItem.xmlunit.xml 2010-12-01 17:16:00 UTC (rev 20273)
@@ -4,7 +4,7 @@
<tr>
<td class="rf-pm-itm-ico rf-pm-grid"></td>
<td class="rf-pm-itm-lbl">panelMenuItem</td>
- <td class="rf-pm-itm-exp-ico rf-pm-triangle-down"></td>
+ <td class="rf-pm-itm-exp-ico rf-pm-grid"></td>
</tr>
</tbody>
</table>
14 years