JBoss Rich Faces SVN: r20506 - trunk/ui/iteration/ui/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-10 12:04:10 -0500 (Fri, 10 Dec 2010)
New Revision: 20506
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java
Log:
Fixed incorrect isLeaf() condition in DeclarativeTreeDataModelImpl
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java 2010-12-10 16:59:11 UTC (rev 20505)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/model/DeclarativeTreeDataModelImpl.java 2010-12-10 17:04:10 UTC (rev 20506)
@@ -67,7 +67,7 @@
return true;
}
- return !Iterables.contains(currentComponent.getChildren(), Predicates.instanceOf(TreeModelAdaptor.class));
+ return !Iterables.any(currentComponent.getChildren(), Predicates.instanceOf(TreeModelAdaptor.class));
}
public Iterator<TreeDataModelTuple> children() {
14 years, 1 month
JBoss Rich Faces SVN: r20505 - trunk/ui/input/api/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-10 11:59:11 -0500 (Fri, 10 Dec 2010)
New Revision: 20505
Modified:
trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
Log:
add method
Modified: trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java
===================================================================
--- trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-12-10 16:49:06 UTC (rev 20504)
+++ trunk/ui/input/api/src/main/java/org/richfaces/component/InplaceComponent.java 2010-12-10 16:59:11 UTC (rev 20505)
@@ -50,5 +50,7 @@
public String getEditClass();
public String getNoneClass();
-
+
+ public abstract int getTabindex();
+
}
14 years, 1 month
JBoss Rich Faces SVN: r20504 - in trunk/ui/input/ui/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-12-10 11:49:06 -0500 (Fri, 10 Dec 2010)
New Revision: 20504
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml
trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
trunk/ui/input/ui/src/main/templates/select.template.xml
Log:
RF-9868, RF-9869, RF-9872
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2010-12-10 16:49:06 UTC (rev 20504)
@@ -65,7 +65,7 @@
public abstract String getInputWidth();
@Attribute
- public abstract String getTabIndex();
+ public abstract int getTabindex();
@Attribute
public abstract String getReadyStateClass();
@@ -85,18 +85,12 @@
@Attribute
public abstract String getNoneClass();
- @Attribute(events=@EventName("blur"))
- public abstract String getOnblur();
-
@Attribute(events=@EventName("click"))
public abstract String getOnclick();
@Attribute(events=@EventName("ondblclick"))
public abstract String getOndblclick();
- @Attribute(events=@EventName("focus"))
- public abstract String getOnfocus();
-
@Attribute(events=@EventName("keydown"))
public abstract String getOnkeydown();
@@ -151,17 +145,18 @@
@Attribute(events=@EventName("inputkeyup"))
public abstract String getOninputkeyup();
- @Attribute(events=@EventName("inputfocus"))
- public abstract String getOninputfocus();
-
- @Attribute(events=@EventName("inputblur"))
- public abstract String getOninputblur();
-
@Attribute(events=@EventName("inputselect"))
public abstract String getOninputselect();
- @Attribute(events=@EventName("inputchange"))
- public abstract String getOninputchange();
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+ @Attribute(events=@EventName("focus"))
+ public abstract String getOnfocus();
+
+ @Attribute(events=@EventName("blur"))
+ public abstract String getOnblur();
+
+
//TODO: what is default event?, add onViewActivated, onEditActivated events support
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceSelect.java 2010-12-10 16:49:06 UTC (rev 20504)
@@ -62,6 +62,9 @@
@Attribute(defaultValue="false")
public abstract boolean isShowControls();
+ @Attribute
+ public abstract int getTabindex();
+
@Override
@Attribute
public abstract String getItemClass();
@@ -107,16 +110,6 @@
@Attribute(events=@EventName("inputkeyup"))
public abstract String getOninputkeyup();
- @Attribute(events=@EventName("inputfocus"))
- public abstract String getOninputfocus();
-
- @Attribute(events=@EventName("inputblur"))
- public abstract String getOninputblur();
-
@Attribute(events=@EventName("inputselect"))
public abstract String getOninputselect();
-
- @Attribute(events=@EventName("inputchange"))
- public abstract String getOnchange();
-
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractSelectComponent.java 2010-12-10 16:49:06 UTC (rev 20504)
@@ -58,6 +58,9 @@
@Attribute(events=@EventName("click"))
public abstract String getOnclick();
+ @Attribute(events=@EventName("change"))
+ public abstract String getOnchange();
+
@Attribute(events=@EventName("dblclick"))
public abstract String getOndblclick();
@@ -120,8 +123,5 @@
@Attribute(events=@EventName("selectitem"))
public abstract String getOnselectitem();
-
- @Attribute(events=@EventName("change"))
- public abstract String getOnchange();
-
+
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2010-12-10 16:49:06 UTC (rev 20504)
@@ -115,15 +115,6 @@
new ComponentAttribute(HtmlConstants.ONKEYUP_ATTRIBUTE)
.setEventNames("inputkeyup")
.setComponentAttributeName("oninputkeyup"),
- new ComponentAttribute(HtmlConstants.ONBLUR_ATTRIBUTE)
- .setEventNames("inputblur")
- .setComponentAttributeName("oninputblur"),
- new ComponentAttribute(HtmlConstants.ONFOCUS_ATTRIBUTE)
- .setEventNames("inputfocus")
- .setComponentAttributeName("oninputfocus"),
- new ComponentAttribute(HtmlConstants.ONCHANGE_ATTRIBUTE)
- .setEventNames("inputchange").setComponentAttributeName(
- "oninputchange"),
new ComponentAttribute(HtmlConstants.ONSELECT_ATTRIBUTE)
.setEventNames("inputselect").setComponentAttributeName(
"oninputselect")));
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceBase.js 2010-12-10 16:49:06 UTC (rev 20504)
@@ -10,6 +10,9 @@
this.changedCss = mergedOptions.changedCss;
this.defaultLabel = mergedOptions.defaultLabel;
this.state = mergedOptions.state;
+
+ this.options = mergedOptions;
+
this.element = $(document.getElementById(id));
this.editContainer = $(document.getElementById(id+"Edit"));
this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-12-10 16:49:06 UTC (rev 20504)
@@ -66,7 +66,7 @@
},
__blurHandler: function(e) {
- this.onblur();
+ this.onblur(e);
},
__changeHandler: function(e) {
@@ -85,14 +85,21 @@
},
__saveBtnHandler: function(e) {
+ this.cancelButton = false;
this.save();
- return false;
+ this.onblur(e);
},
__cancelBtnHandler: function(e) {
+ this.cancelButton = true;
this.cancel();
- return false;
+ this.onblur(e);
},
+
+ __editHandler: function(e){
+ $super.__editHandler.call(this,e);
+ this.onfocus(e);
+ },
getLabel: function() {
return this.label.text();
@@ -114,15 +121,45 @@
this.focusElement.focus();
},
- onblur: function() {
- if(!this.isValueSaved() && this.__isSaveOnBlur()) {
- this.save();
- } else {
- this.__hide();
- }
- this.getInput().bind("focus", $.proxy(this.__editHandler, this));
+ onfocus: function(e) {
+ if(!this.__isFocused()) {
+ this.__setFocused(true);
+ this.focusValue = this.getValue();
+ this.invokeEvent.call(this, "focus", document.getElementById(this.id + 'Input'), e);
+ }
+ },
+
+ onblur: function(e) {
+ if(this.__isFocused()) {
+ this.__setFocused(false);
+ this.invokeEvent.call(this, "blur", document.getElementById(this.id + 'Input'), e);
+
+ if(!this.isValueSaved() && this.__isSaveOnBlur()) {
+ this.save();
+ } else {
+ this.__hide();
+ }
+
+ if(!this.cancelButton) {
+ if(this.__isValueChanged()) {
+ this.invokeEvent.call(this, "change", document.getElementById(this.id + 'Input'), e);
+ }
+ }
+ this.getInput().bind("focus", $.proxy(this.__editHandler, this));
+ }
+ },
+
+ __isValueChanged: function() {
+ return (this.focusValue != this.getValue());
+ },
+
+ __setFocused: function(focused) {
+ this.focused = focused;
+ },
+
+ __isFocused: function() {
+ return this.focused;
}
-
}
})());
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2010-12-10 16:49:06 UTC (rev 20504)
@@ -85,10 +85,18 @@
}
},
- onblur: function() {
+ onblur: function(e) {
this.hidePopup();
$super.onblur.call(this);
},
+
+ onfocus: function(e) {
+ if(!this.__isFocused()) {
+ this.__setFocused(true);
+ this.focusValue = this.selValueInput.val();
+ this.invokeEvent.call(this, "focus", document.getElementById(this.id + 'Input'), e);
+ }
+ },
processItem: function(item) {
var label = this.getItemLabel(item);
@@ -100,6 +108,8 @@
if(this.saveOnSelect) {
this.save();
}
+
+ this.invokeEvent.call(this,"selectitem", document.getElementById(this.id + 'Input'));
},
getItemValue: function(item) {
@@ -133,6 +143,10 @@
return label;
},
+ __isValueChanged: function() {
+ return (this.focusValue != this.selValueInput.val());
+ },
+
__keydownHandler: function(e) {
var code;
@@ -170,10 +184,10 @@
},
__blurHandler: function(e) {
- if(!this.isMouseDown) {
+ if(this.saveOnSelect || !this.isMouseDown) {
if(this.isEditState()) {
this.timeoutId = window.setTimeout($.proxy(function(){
- this.onblur();
+ this.onblur(e);
}, this), 200);
}
} else {
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/popupList.js 2010-12-10 16:49:06 UTC (rev 20504)
@@ -23,7 +23,7 @@
var defaultOptions = {
attachToBody: true,
positionType: "DROPDOWN",
- positionOffset: [0,20]
+ positionOffset: [0,0]
};
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2010-12-10 16:49:06 UTC (rev 20504)
@@ -367,7 +367,7 @@
this.hidePopup();
this.__setInputFocus();
- this.invokeEvent.call(this,"selectitem", document.getElementById(this.id + 'Input'), e);
+ this.invokeEvent.call(this,"selectitem", document.getElementById(this.id + 'Input'));
},
onblur: function(e) {
Modified: trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/templates/inplaceInput.template.xml 2010-12-10 16:49:06 UTC (rev 20504)
@@ -51,7 +51,7 @@
<input id="#{clientId}Focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
<span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
<input id="#{clientId}Input" autocomplete="off" name="#{clientId}"
- type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabIndex">
+ type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabindex">
<cdk:call expression="renderInputHandlers(facesContext, component);"/>
</input>
<c:if test="#{component.attributes['showControls']}">
@@ -87,6 +87,7 @@
<cdk:scriptOption name="changedCss" value="#{concatClasses('rf-ii-c-s', component.attributes['changedClass'])}"/>
<cdk:scriptOption name="editCss" value="#{concatClasses('rf-ii-e-s', component.attributes['editClass'])}"/>
<cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls" />
+ <cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
new RichFaces.ui.InplaceInput("#{clientId}", #{toScriptArgs(options)});
</script>
Modified: trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2010-12-10 16:49:06 UTC (rev 20504)
@@ -51,7 +51,7 @@
<input id="#{clientId}Input" name="#{clientId}Input" autocomplete="off"
type="text" value="#{getSelectInputLabel(facesContext, component)}"
class="rf-is-fld" style="width: #{component.attributes['inputWidth']};" readonly="readonly"
- cdk:passThrough="tabIndex">
+ cdk:passThrough="tabindex">
<cdk:call expression="renderInputHandlers(facesContext, component);" />
</input>
<c:if test="#{component.attributes['showControls']}">
@@ -104,6 +104,7 @@
<cdk:scriptOption name="changedCss" value="#{concatClasses('rf-is-c-s', component.attributes['changedClass'])}"/>
<cdk:scriptOption name="editCss" value="#{concatClasses('rf-is-e-s', component.attributes['editClass'])}"/>
<cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls openOnEdit saveOnSelect" />
+ <cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
new RichFaces.ui.InplaceSelect("#{clientId}", #{toScriptArgs(options)});
</script>
Modified: trunk/ui/input/ui/src/main/templates/select.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-10 16:41:15 UTC (rev 20503)
+++ trunk/ui/input/ui/src/main/templates/select.template.xml 2010-12-10 16:49:06 UTC (rev 20504)
@@ -23,7 +23,7 @@
<div style="position : relative; overflow : hidden; text-align : left; padding-right : 18px;">
<input id="#{clientId}selValue" name="#{clientId}" type="hidden" value="#{getInputValue(facesContext, component)}"/>
<div id="#{clientId}Field" class="rf-sel-fld">
- <input cdk:passThroughWithExclusions="class autocomplete id value disabled name type readonly onchange onblur"
+ <input cdk:passThroughWithExclusions="class autocomplete id value disabled name type readonly onchange onblur onfocus"
id="#{clientId}Input"
value="#{getSelectLabel(facesContext, component)}"
disabled="#{disabled}"
@@ -70,7 +70,7 @@
<cdk:scriptOption name="itemCss" value="#{concatClasses('rf-sel-opt', component.attributes['itemClass'])}" />
<cdk:scriptOption name="selectItemCss" value="#{concatClasses('rf-sel-sel', component.attributes['selectItemClass'])}" />
<cdk:scriptOption name="listCss" value="#{concatClasses('rf-sel-lst-cord', component.attributes['listClass'])}" />
- <cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onchange onblur onselectitem" wrapper="eventHandler"/>
+ <cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onchange onblur onselectitem onfocus" wrapper="eventHandler"/>
<cdk:scriptOption attributes="showControl defaultLabel enableManualInput selectFirst" />
</cdk:scriptObject>
new RichFaces.ui.Select("#{clientId}", #{toScriptArgs(options)});
14 years, 1 month
JBoss Rich Faces SVN: r20503 - in modules/tests/metamer/trunk/application/src/main: java/org/richfaces/tests/metamer/model and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-10 11:41:15 -0500 (Fri, 10 Dec 2010)
New Revision: 20503
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
Log:
added initial sample of rich:tree adaptors (RF-9698)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-10 16:39:36 UTC (rev 20502)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -23,6 +23,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -30,7 +31,7 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import javax.swing.tree.TreeNode;
import org.richfaces.component.UITree;
@@ -43,20 +44,18 @@
import org.slf4j.LoggerFactory;
/**
- * Managed bean for rich:list.
- *
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
@ManagedBean(name = "richTreeBean")
-// cannot be view-scoped (see https://jira.jboss.org/browse/RF-9287)
-@SessionScoped
+@ViewScoped
public class RichTreeBean implements Serializable {
private static final long serialVersionUID = 4008175400649809L;
private static Logger logger;
private Attributes attributes;
private List<TreeNode> root = new ArrayList<TreeNode>();
+ private Collection<Object> selection;
@ManagedProperty(value = "#{model}")
private Model model;
@@ -77,6 +76,10 @@
attributes.get("toggleType").setValue("ajax");
attributes.get("selectionType").setValue("ajax");
+ // hidden attributes
+ attributes.remove("selectionChangeListener");
+ attributes.remove("toggleListener");
+
for (CompactDiscXmlDescriptor descriptor : model.getCompactDiscs()) {
createCompactDisc(descriptor);
}
@@ -125,12 +128,20 @@
}
return country;
}
-
+
public void setModel(Model model) {
this.model = model;
}
-
+
public List<TreeNode> getRoot() {
return root;
}
+
+ public Collection<Object> getSelection() {
+ return selection;
+ }
+
+ public void setSelection(Collection<Object> selection) {
+ this.selection = selection;
+ }
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITreeModelAdaptor;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeModelAdaptorBean")
+@ViewScoped
+public class RichTreeModelAdaptorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class, getClass(), false);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITreeModelRecursiveAdaptor;
+import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeModelRecursiveAdaptorBean")
+@ViewScoped
+public class RichTreeModelRecursiveAdaptorBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+ private boolean leafChildrenNullable = true;
+ private transient List<RecursiveNode> rootNodes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UITreeModelRecursiveAdaptor.class, getClass(), false);
+
+ attributes.get("rendered").setValue(true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public List<RecursiveNode> getRootNodes() {
+ if (rootNodes == null) {
+ rootNodes = RecursiveNode.createChildren(null, leafChildrenNullable);
+ }
+ return rootNodes;
+ }
+
+ public boolean isLeafChildrenNullable() {
+ return leafChildrenNullable;
+ }
+
+ public void setLeafChildrenNullable(boolean leafChildrenNullable) {
+ this.leafChildrenNullable = leafChildrenNullable;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -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.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.UITreeModelAdaptor;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeNodeBean")
+@ViewScoped
+public class RichTreeNodeBean implements Serializable {
+
+ private static final long serialVersionUID = 4008175400649809L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class, getClass(), false);
+
+ attributes.get("rendered").setValue(true);
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class ModelNode extends Node {
+
+ private static final int BS = 3;
+ List<B> bs;
+ List<RecursiveNode> rs;
+
+ public ModelNode(Node parent, boolean nullable) {
+ super(parent, nullable);
+ }
+
+ public String getLabel() {
+ return isRoot() ? "M" : parent.getLabel() + "-M";
+ }
+
+ public A getValue() {
+ return new A();
+ }
+
+ public List<B> getList() {
+ if (bs == null) {
+ bs = new LinkedList<B>();
+ for (int i = 0; i < BS; i++) {
+ bs.add(new B(i));
+ }
+ }
+ return bs;
+ }
+
+ public List<RecursiveNode> getRecursive() {
+ if (rs == null) {
+ rs = RecursiveNode.createChildren(this, nullable);
+ }
+ return rs;
+ }
+
+ public class A {
+ public String getLabel() {
+ return ModelNode.this.getLabel() + "-A";
+ }
+ }
+
+ public class B {
+ int number;
+
+ public B(int number) {
+ this.number = number;
+ }
+
+ public String getLabel() {
+ return ModelNode.this.getLabel() + "-B-" + number;
+ }
+ }
+
+ private RecursiveNode getParentRecursive() {
+ for (Node predecessor : getPredecessorsFromRoot()) {
+ if (predecessor instanceof RecursiveNode) {
+ return (RecursiveNode) predecessor;
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.util.Deque;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public abstract class Node {
+ Node parent;
+ boolean nullable;
+
+ public Node(Node parent, boolean nullable) {
+ super();
+ this.parent = parent;
+ this.nullable = nullable;
+ }
+
+ public Node getParent() {
+ return parent;
+ }
+
+ public boolean isRoot() {
+ return parent == null;
+ }
+
+ public int getLevel() {
+ return isRoot() ? 1 : parent.getLevel() + 1;
+ }
+
+ public Node getRoot() {
+ return isRoot() ? this : parent.getRoot();
+ }
+
+ public Iterable<Node> getPredecessorsFromRoot() {
+ Deque<Node> list = new LinkedList<Node>();
+ list.addFirst(this);
+
+ while (list.getFirst().parent != null) {
+ list.addFirst(list.getFirst().parent);
+ }
+
+ return list;
+ }
+
+ public abstract String getLabel();
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class RecursiveNode extends Node {
+ private static final int CHILDREN = 4;
+ private static final int LEVELS = 2;
+ private static final List<RecursiveNode> EMPTY_LIST = new LinkedList<RecursiveNode>();
+
+ int number;
+ List<RecursiveNode> children = null;
+ ModelNode model;
+
+ public RecursiveNode(Node parent, boolean nullable, int number) {
+ super(parent, nullable);
+ this.number = number;
+ }
+
+ public int getNumber() {
+ return number;
+ }
+
+ public boolean isLeaf() {
+ return getRecursionLevel() >= LEVELS + (isOddBranch() ? 0 : 1);
+ }
+
+ public List<RecursiveNode> getRecursive() {
+ if (isLeaf()) {
+ return getEmpty();
+ }
+ if (children == null) {
+ children = createChildren(this, nullable);
+ }
+ return children;
+ }
+
+ private List<RecursiveNode> getEmpty() {
+ return nullable ? null : EMPTY_LIST;
+ }
+
+ public String getLabel() {
+ String parentLabel = (isRoot() ? "" : parent.getLabel() + "-") + "R-";
+ String recursionLabel = (isRecursionRoot() ? parentLabel : parent.getLabel() + ".") + number;
+ return recursionLabel;
+ }
+
+ public ModelNode getModel() {
+ if (isLeaf() && !isPreceededByModel()) {
+ if (model == null) {
+ model = new ModelNode(this, nullable);
+ }
+ return model;
+ }
+ return null;
+ }
+
+ public int getRecursionLevel() {
+ return isRecursionRoot() ? 1 : 1 + ((RecursiveNode) getParent()).getRecursionLevel();
+ }
+
+ private boolean isRecursionRoot() {
+ if (isRoot()) {
+ return true;
+ } else {
+ return !(parent instanceof RecursiveNode);
+ }
+ }
+
+ public static List<RecursiveNode> createChildren(Node parent, boolean nullable) {
+ List<RecursiveNode> children = new LinkedList<RecursiveNode>();
+ for (int i = 0; i < CHILDREN; i++) {
+ children.add(new RecursiveNode(parent, nullable, i));
+ }
+ return children;
+ }
+
+ private boolean isPreceededByModel() {
+ for (Node predecessor : getPredecessorsFromRoot()) {
+ if (predecessor instanceof ModelNode) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isOddBranch() {
+ for (Node predecessor : getPredecessorsFromRoot()) {
+ if (predecessor instanceof RecursiveNode) {
+ return ((RecursiveNode) predecessor).number % 2 == 1;
+ }
+ }
+ return this.number % 2 == 1;
+ }
+}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties 2010-12-10 16:39:36 UTC (rev 20502)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTreeBean.properties 2010-12-10 16:41:15 UTC (rev 20503)
@@ -1,3 +1,9 @@
+attr.dir.rtl=RTL
+attr.dir.ltr=LTR
+attr.dir.null=
+attr.selectionType.client=client
+attr.selectionType.ajax=ajax
+attr.selectionType.null=
attr.toggleType.ajax=ajax
attr.toggleType.client=client
attr.toggleType.server=server
@@ -2,4 +8 @@
attr.toggleType.null=
-attr.selectionType.client=client
-attr.selectionType.ajax=ajax
-attr.selectionType.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2010-12-10 16:39:36 UTC (rev 20502)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/list.xhtml 2010-12-10 16:41:15 UTC (rev 20503)
@@ -34,6 +34,10 @@
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
The simple sample of <b>rich:tree</b> usage including all its attributes.
</metamer:testPageLink>
+
+ <metamer:testPageLink id="treeAdaptors" outcome="treeAdaptors" value="Tree Adaptors">
+ The <b>rich:tree</b> with declarative model using <b>rich:treeModelRecursiveAdaptor</b> and <b>rich:treeModelAdaptor</b>.
+ </metamer:testPageLink>
</ui:define>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-10 16:41:15 UTC (rev 20503)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:tree id="richTree" var="node"
+ dir="#{richTreeBean.attributes['dir'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ >
+
+ <a4j:ajax event="selectionchange" render="selectionOutput" />
+
+ <rich:treeModelRecursiveAdaptor
+ roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
+ nodes="#{node.recursive}"
+ recursionOrder="#{richTreeModelRecursiveAdaptorBean.attributes['recursionOrder'].value}"
+ rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}"
+ >
+
+ <rich:treeNode>
+ <a4j:outputPanel id="panel">
+ #{node.label}
+ </a4j:outputPanel>
+ </rich:treeNode>
+
+ <!-- <rich:treeModelAdaptor nodes="{node.model.value}" rendered="{not empty node.model}">
+ <rich:treeNode>
+ {node}
+ </rich:treeNode>
+ </rich:treeModelAdaptor>-->
+
+ <rich:treeModelAdaptor nodes="#{node.model.list}">
+ <rich:treeNode>
+ #{node.label}
+ </rich:treeNode>
+ </rich:treeModelAdaptor>
+
+ <rich:treeModelRecursiveAdaptor roots="#{node.model.recursive}" nodes="#{node.recursive}">
+ <rich:treeNode rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number != 1}">
+ #{node.label}
+ </rich:treeNode>
+ </rich:treeModelRecursiveAdaptor>
+
+ </rich:treeModelRecursiveAdaptor>
+ </rich:tree>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+
+ <a4j:outputPanel id="selectionOutput">
+ <h:outputLabel value="Selection: " />
+ <h:outputText value="#{richTreeBean.selection}" />
+ </a4j:outputPanel>
+
+ <fieldset>
+ <legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
+ </fieldset>
+
+ <fieldset>
+ <legend>rich:treeModelRecursiveAdaptor</legend>
+ <metamer:attributes value="#{richTreeModelRecursiveAdaptorBean.attributes}" id="nodeAttributes" />
+ </fieldset>
+
+ <fieldset>
+ <legend>rich:treeNode</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes}" id="recursiveAttributes" />
+ </fieldset>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
14 years, 1 month
JBoss Rich Faces SVN: r20502 - modules/tests/metamer/trunk/application/src/main/webapp/components/expressionLanguage.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-10 11:39:36 -0500 (Fri, 10 Dec 2010)
New Revision: 20502
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/expressionLanguage/list.xhtml
Log:
fixed the title of Expression Language sample
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/expressionLanguage/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/expressionLanguage/list.xhtml 2010-12-10 16:37:09 UTC (rev 20501)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/expressionLanguage/list.xhtml 2010-12-10 16:39:36 UTC (rev 20502)
@@ -27,12 +27,12 @@
<ui:composition template="/templates/list.xhtml">
- <ui:define name="pageTitle">JSF Data Table</ui:define>
+ <ui:define name="pageTitle">Expression Language</ui:define>
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
- Simple EL Expressions (to verify compatibility)
+ Simple EL Expressions (to verify compatibility)
</metamer:testPageLink>
</ui:define>
14 years, 1 month
JBoss Rich Faces SVN: r20501 - trunk/ui/input/ui/src/main/java/org/richfaces/request.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-10 11:37:09 -0500 (Fri, 10 Dec 2010)
New Revision: 20501
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java
Log:
small code cleanup
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-10 16:14:34 UTC (rev 20500)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-10 16:37:09 UTC (rev 20501)
@@ -29,7 +29,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.UUID;
import org.richfaces.exception.FileUploadException;
import org.richfaces.log.Logger;
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-12-10 16:14:34 UTC (rev 20500)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/request/MultipartRequest.java 2010-12-10 16:37:09 UTC (rev 20501)
@@ -92,9 +92,9 @@
private String encoding = null;
- private Integer contentLength = 0;
+ private long contentLength = 0;
- private int bytesRead = 0;
+ private long bytesRead = 0;
// we shouldn't allow to stop until request reaches PhaseListener because of portlets
private volatile boolean canStop = false;
@@ -103,7 +103,7 @@
private Map<String, Object> percentMap = null;
- private Map<String, Integer> requestSizeMap = null;
+ private Map<String, Long> requestSizeMap = null;
private List<String> keys = new ArrayList<String>();
@@ -118,11 +118,13 @@
private HeadersHandler headersHandler = null;
- public MultipartRequest(HttpServletRequest request, boolean createTempFiles, String tempFilesDirectory, String uid) {
+ public MultipartRequest(HttpServletRequest request, boolean createTempFiles, String tempFilesDirectory,
+ String uid) {
super(request);
this.createTempFiles = createTempFiles;
this.tempFilesDirectory = tempFilesDirectory;
this.uid = uid;
+ this.contentLength = Long.parseLong(request.getHeader("Content-Length"));
}
private class ControlledProgressInputStream extends FilterInputStream {
@@ -399,9 +401,9 @@
}
if (requestSizeMap == null) {
- requestSizeMap = (Map<String, Integer>) sessionMap.get(REQUEST_SIZE_BEAN_NAME);
+ requestSizeMap = (Map<String, Long>) sessionMap.get(REQUEST_SIZE_BEAN_NAME);
if (requestSizeMap == null) {
- requestSizeMap = new ConcurrentHashMap<String, Integer>();
+ requestSizeMap = new ConcurrentHashMap<String, Long>();
sessionMap.put(REQUEST_SIZE_BEAN_NAME, requestSizeMap);
}
}
@@ -409,7 +411,7 @@
percentMap.put(uploadId, Double.valueOf(0));
- requestSizeMap.put(uploadId, getSize());
+ requestSizeMap.put(uploadId, contentLength);
}
}
}
@@ -507,10 +509,6 @@
return param;
}
- public Integer getSize() {
- return contentLength;
- }
-
@SuppressWarnings("rawtypes")
@Override
public Enumeration getParameterNames() {
@@ -625,8 +623,7 @@
}
public boolean isDone() {
- return !(this.shouldStop && (this.canceled || this.contentLength != null
- && this.contentLength.intValue() != this.bytesRead));
+ return !(this.contentLength != this.bytesRead && this.shouldStop && this.canceled);
}
@Override
14 years, 1 month
JBoss Rich Faces SVN: r20500 - in trunk/ui/input/ui/src/main/java/org/richfaces: request and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-12-10 11:14:34 -0500 (Fri, 10 Dec 2010)
New Revision: 20500
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
Log:
small code cleanup
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-12-10 15:30:40 UTC (rev 20499)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/context/FileUploadPartialViewContextFactory.java 2010-12-10 16:14:34 UTC (rev 20500)
@@ -112,7 +112,7 @@
//So we should use PartialViewContext.processPartial instead of.
}
}
- };
+ }
//TODO This method can be removed from here when PartialViewContextWrapper will implement it.
@Override
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-10 15:30:40 UTC (rev 20499)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/request/FileParam.java 2010-12-10 16:14:34 UTC (rev 20500)
@@ -86,7 +86,7 @@
if (tempFilesDirectory != null) {
dir = new File(tempFilesDirectory);
}
- tempFile = File.createTempFile(UUID.randomUUID().toString(), ".upload", dir);
+ tempFile = File.createTempFile("richfaces_uploaded_file_", null, dir);
tempFile.deleteOnExit();
fOut = new FileOutputStream(tempFile);
} catch (IOException ex) {
14 years, 1 month
JBoss Rich Faces SVN: r20499 - in trunk: examples/input-demo/src/main/webapp/examples and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-10 10:30:40 -0500 (Fri, 10 Dec 2010)
New Revision: 20499
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java
Log:
RF-9991 Calendar: currentDataChangeListener attribute doesn't work
Modified: trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
===================================================================
--- trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2010-12-10 14:44:43 UTC (rev 20498)
+++ trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2010-12-10 15:30:40 UTC (rev 20499)
@@ -7,6 +7,8 @@
import javax.faces.bean.SessionScoped;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.event.CurrentDateChangeEvent;
+
@ManagedBean
@SessionScoped
public class CalendarBean {
@@ -127,5 +129,12 @@
public int getVerticalOffset() {
return verticalOffset;
}
-
+
+ public void doValueChangeListener(ValueChangeEvent event) {
+ System.out.println("doValueChangeListener: old value = " + event.getOldValue()+", new value = "+event.getNewValue());
+ }
+
+ public void doCurrentDataChangeListener(CurrentDateChangeEvent event) {
+ System.out.println("doCurrentDataChangeListener: "+event.getCurrentDateString());
+ }
}
\ No newline at end of file
Modified: trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-12-10 14:44:43 UTC (rev 20498)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-12-10 15:30:40 UTC (rev 20499)
@@ -61,8 +61,10 @@
firstWeekDay="4"
horizontalOffset="#{calendarBean.horizontalOffset}"
verticalOffset="#{calendarBean.verticalOffset}"
+ valueChangeListener="#{calendarBean.doValueChangeListener}"
+ currentDataChangeListener="#{calendarBean.doCurrentDataChangeListener}"
>
- <f:ajax event="change" render="echo-text" />
+
</calendar:calendar>
<h:outputText id="echo-text" value="#{calendarBean.selectedDate}" />
</h:panelGroup>
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2010-12-10 14:44:43 UTC (rev 20498)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2010-12-10 15:30:40 UTC (rev 20499)
@@ -465,9 +465,9 @@
facesContext.addMessage(getClientId(facesContext), message);
facesContext.renderResponse();
}
- } else {
- super.broadcast(event);
- }
+ }
+
+ super.broadcast(event);
}
@Override
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java 2010-12-10 14:44:43 UTC (rev 20498)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java 2010-12-10 15:30:40 UTC (rev 20499)
@@ -66,7 +66,7 @@
static class CalendarMapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] { org.richfaces.event.CurrentDateChangeListener.class };
+ private static final Class[] SIGNATURE = new Class[] { org.richfaces.event.CurrentDateChangeEvent.class };
private final TagAttribute attribute;
14 years, 1 month
JBoss Rich Faces SVN: r20498 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-10 09:44:43 -0500 (Fri, 10 Dec 2010)
New Revision: 20498
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
Log:
* bean fixed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2010-12-10 14:18:06 UTC (rev 20497)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2010-12-10 14:44:43 UTC (rev 20498)
@@ -54,7 +54,6 @@
attributes = Attributes.getUIComponentAttributes(UIMenuGroup.class, getClass(), false);
- attributes.setAttribute("mode", "ajax");
attributes.setAttribute("rendered", true);
attributes.remove("converter");
14 years, 1 month
JBoss Rich Faces SVN: r20497 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-10 09:18:06 -0500 (Fri, 10 Dec 2010)
New Revision: 20497
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
https://issues.jboss.org/browse/RFPL-959
* added one sample for rich:menuGroup
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-10 14:08:47 UTC (rev 20496)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2010-12-10 14:18:06 UTC (rev 20497)
@@ -137,6 +137,7 @@
components.put("richInputNumberSpinner", "Rich Input Number Spinner");
components.put("richJQuery", "Rich jQuery");
components.put("richList", "Rich List");
+ components.put("richMenuGroup", "Rich Menu Group");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
components.put("richPopupPanel", "Rich Popup Panel");
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java 2010-12-10 14:18:06 UTC (rev 20497)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.UIMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:menuGroup.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richMenuGroupBean")
+@ViewScoped
+public class RichMenuGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getUIComponentAttributes(UIMenuGroup.class, getClass(), false);
+
+ attributes.setAttribute("mode", "ajax");
+ attributes.setAttribute("rendered", true);
+
+ attributes.remove("converter");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichMenuGroupBean.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/list.xhtml 2010-12-10 14:18:06 UTC (rev 20497)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Menu Group</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ Simple page containing a drop down menu with several <b>rich:menuGroup</b>s and inputs for all attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richMenuGroup/simple.xhtml 2010-12-10 14:18:06 UTC (rev 20497)
@@ -0,0 +1,133 @@
+<?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:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer" xmlns:rich="http://richfaces.org/rich"
+ xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html">
+
+ <!--
+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">
+ .pic {
+ margin-bottom: -4px;
+ margin-right: 2px;
+ }
+
+ .search .rf-ddm-itm-sel {
+ background-color: transparent;
+ background-image:none;
+ border-color: transparent;
+ cursor: default;
+ }
+ </style>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:toolbar id="toolbar" height="26px">
+ <rich:dropDownMenu id="menu1" menu="ajax">
+ <f:facet name="label">
+ <h:panelGroup>
+ <h:graphicImage library="images/icons" name="copy.gif" styleClass="pic" />
+ <h:outputText value="File" />
+ </h:panelGroup>
+ </f:facet>
+
+ <rich:menuItem label="New" icon="/resources/images/icons/create_doc.gif"/>
+
+ <rich:menuItem label="Open" icon="/resources/images/icons/open.gif" />
+
+ <rich:menuGroup label="Open Recent..." disabled="true">
+ <rich:menuItem label="Save" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem label="Save All">
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons" name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ </rich:menuGroup>
+
+ <rich:menuSeparator id="menuSeparator11" />
+
+ <rich:menuGroup id="menuGroup"
+ dir="#{richMenuGroupBean.attributes['dir'].value}"
+ disabled="#{richMenuGroupBean.attributes['disabled'].value}"
+ label="Save As..."
+ lang="#{richMenuGroupBean.attributes['lang'].value}"
+ mode="#{richMenuGroupBean.attributes['mode'].value}"
+ onclick="#{richMenuGroupBean.attributes['onclick'].value}"
+ ondblclick="#{richMenuGroupBean.attributes['ondblclick'].value}"
+ onhide="#{richMenuGroupBean.attributes['onhide'].value}"
+ onkeydown="#{richMenuGroupBean.attributes['onkeydown'].value}"
+ onkeypress="#{richMenuGroupBean.attributes['onkeypress'].value}"
+ onkeyup="#{richMenuGroupBean.attributes['onkeyup'].value}"
+ onmousedown="#{richMenuGroupBean.attributes['onmousedown'].value}"
+ onmousemove="#{richMenuGroupBean.attributes['onmousemove'].value}"
+ onmouseout="#{richMenuGroupBean.attributes['onmouseout'].value}"
+ onmouseover="#{richMenuGroupBean.attributes['onmouseover'].value}"
+ onmouseup="#{richMenuGroupBean.attributes['onmouseup'].value}"
+ onshow="#{richMenuGroupBean.attributes['onshow'].value}"
+ rendered="#{richMenuGroupBean.attributes['rendered'].value}"
+ style="#{richMenuGroupBean.attributes['style'].value}"
+ styleClass="#{richMenuGroupBean.attributes['styleClass'].value}"
+ title="#{richMenuGroupBean.attributes['title'].value}"
+ value="#{richMenuGroupBean.attributes['value'].value}"
+ >
+ <rich:menuItem label="Save" icon="/resources/images/icons/save.gif" />
+ <rich:menuItem label="Save All" >
+ <f:facet name="icon">
+ <h:graphicImage library="images/icons" name="save_all.gif" />
+ </f:facet>
+ </rich:menuItem>
+ <rich:menuItem label="Send Online" icon="/resources/images/icons/save.gif" disabled="true" />
+ </rich:menuGroup>
+
+ <rich:menuItem label="Print" disabled="true"/>
+
+ <rich:menuItem label="Close" />
+
+ <rich:menuSeparator id="menuSeparator12" />
+
+ <rich:menuItem label="Exit" />
+
+ </rich:dropDownMenu>
+
+ </rich:toolbar>
+
+ <br /><br />
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richMenuGroupBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
14 years, 1 month