JBoss Rich Faces SVN: r12033 - trunk/ui/calendar/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 12:01:00 -0500 (Thu, 25 Dec 2008)
New Revision: 12033
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5390
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-12-25 16:55:44 UTC (rev 12032)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2008-12-25 17:01:00 UTC (rev 12033)
@@ -310,6 +310,11 @@
// TODO nick - nick - queue this event when ValueChangeEvent is
// queued?
new AjaxEvent(component).queue();
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ if (ajaxContext.isAjaxRequest(context)) {
+ ajaxContext.addAreasToProcessFromComponent(context, component);
+ }
}
String selectedDateString = (String) requestParameterMap.get(clientId
@@ -456,11 +461,6 @@
Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, calendar, params);
options.put("calendar", JSReference.THIS);
- boolean isSingle = ((Boolean) calendar.getAttributes()
- .get("ajaxSingle")).booleanValue();
- if (isSingle) {
- options.put("single", JSReference.TRUE);
- }
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
16 years, 8 months
JBoss Rich Faces SVN: r12032 - in trunk/framework: impl/src/main/java/org/ajax4jsf/context and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 11:55:44 -0500 (Thu, 25 Dec 2008)
New Revision: 12032
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
Log:
https://jira.jboss.org/jira/browse/RF-5390
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/context/AjaxContext.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -76,6 +76,12 @@
public abstract void addRegionsFromComponent(UIComponent component);
+ /**
+ * @param component
+ * @since 3.3.0
+ */
+ public abstract void addAreasToProcessFromComponent(FacesContext context, UIComponent component);
+
public abstract Set<String> getAjaxAreasToRender();
public abstract Set<String> getAjaxAreasToProcess();
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -333,6 +333,36 @@
}
}
+ /**
+ * Add IDs of regions to process
+ *
+ * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.component.UIComponent)
+ */
+ @Override
+ public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
+ RendererUtils rendererUtils = RendererUtils.getInstance();
+
+ Set<String> areasToProcess = AjaxRendererUtils.getAjaxAreasToProcess(component);
+ if (areasToProcess != null) {
+ Set<String> convertedAreaIds = new HashSet<String>();
+
+ for (String areaId : areasToProcess) {
+ UIComponent areaComponent = rendererUtils.findComponentFor(component, areaId);
+ if (areaComponent != null) {
+ convertedAreaIds.add(areaComponent.getClientId(context));
+ } else {
+ convertedAreaIds.add(areaId);
+ }
+ }
+
+ if (this.ajaxAreasToProcess == null) {
+ this.ajaxAreasToProcess = convertedAreaIds;
+ } else {
+ this.ajaxAreasToProcess.addAll(convertedAreaIds);
+ }
+ }
+ }
+
public void addComponentToAjaxRender(UIComponent component) {
this.ajaxAreasToRender.add(AjaxRendererUtils.getAbsoluteId(component));
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxRendererUtils.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -103,6 +103,11 @@
public static final String AJAX_REGIONS_ATTRIBUTE = "reRender";
+ /**
+ * @since 3.3.0
+ */
+ public static final String AJAX_PROCESS_ATTRIBUTE = "process";
+
private static final Class<?> OBJECT_ARRAY_CLASS = (new Object[0]).getClass();
public static final String VALUE_ATTR = "value";
@@ -509,6 +514,25 @@
}
/**
+ * Returns set of areas to be processed as a result of this component action invocation
+ *
+ * @param component
+ * @return set of IDs that should be processed as a
+ * @since 3.3.0
+ */
+ public static Set<String> getAjaxAreasToProcess(UIComponent component) {
+ Object areas;
+
+ if (component instanceof AjaxComponent) {
+ areas = ((AjaxComponent) component).getProcess();
+ } else {
+ areas = component.getAttributes().get(AjaxRendererUtils.AJAX_PROCESS_ATTRIBUTE);
+ }
+
+ return asSet(areas);
+ }
+
+ /**
* Convert parameter ( Collection, List, array, String, comma-separated
* String ) to list of srings. TODO - when move to JDK 5, change to
* List<String>
Modified: trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java
===================================================================
--- trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-12-25 13:51:03 UTC (rev 12031)
+++ trunk/framework/test/src/test/java/org/ajax4jsf/context/MockAjaxContext.java 2008-12-25 16:55:44 UTC (rev 12032)
@@ -68,6 +68,15 @@
}
/* (non-Javadoc)
+ * @see org.ajax4jsf.context.AjaxContext#addAreasToProcessFromComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void addAreasToProcessFromComponent(FacesContext context, UIComponent component) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
* @see org.ajax4jsf.context.AjaxContext#addRenderedArea(java.lang.String)
*/
@Override
16 years, 8 months
JBoss Rich Faces SVN: r12031 - trunk/ui/dataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-25 08:51:03 -0500 (Thu, 25 Dec 2008)
New Revision: 12031
Modified:
trunk/ui/dataTable/src/main/config/component/colgroup.xml
trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
Log:
https://jira.jboss.org/jira/browse/RF-4569
Modified: trunk/ui/dataTable/src/main/config/component/colgroup.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/colgroup.xml 2008-12-25 00:34:22 UTC (rev 12030)
+++ trunk/ui/dataTable/src/main/config/component/colgroup.xml 2008-12-25 13:51:03 UTC (rev 12031)
@@ -63,7 +63,7 @@
<property disabled="false" hidden="true">
<name>sortExpression</name>
<classname>java.lang.String</classname>
- <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
+ <description>Attribute defines a bean property which is used for sorting of a column</description>
</property>
<property elonly="true">
<name>filterMethod</name>
Modified: trunk/ui/dataTable/src/main/config/component/columnAttributes.ent
===================================================================
--- trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-12-25 00:34:22 UTC (rev 12030)
+++ trunk/ui/dataTable/src/main/config/component/columnAttributes.ent 2008-12-25 13:51:03 UTC (rev 12031)
@@ -52,7 +52,7 @@
<property>
<name>sortExpression</name>
<classname>java.lang.String</classname>
- <description>DEPRECATED(use sortBy)Attribute defines a bean property which is used for sorting of a column</description>
+ <description>Attribute defines a bean property which is used for sorting of a column</description>
</property>
<property>
<name>sortBy</name>
16 years, 8 months
JBoss Rich Faces SVN: r12030 - trunk/ui/tree/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:34:22 -0500 (Wed, 24 Dec 2008)
New Revision: 12030
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5464
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-12-25 00:32:47 UTC (rev 12029)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-12-25 00:34:22 UTC (rev 12030)
@@ -201,7 +201,7 @@
}
if (resource != null) {
- variables.setVariable("folder", resource);
+ variables.setVariable("folderIcon", resource);
}
resource = ViewUtil.getResourceURL(treeNode.getIconCollapsed());
@@ -228,7 +228,7 @@
}
if (resource != null) {
- variables.setVariable("leaf", resource);
+ variables.setVariable("leafIcon", resource);
}
}
16 years, 9 months
JBoss Rich Faces SVN: r12029 - trunk/ui/tree/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:32:47 -0500 (Wed, 24 Dec 2008)
New Revision: 12029
Modified:
trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5464
Modified: trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-25 00:04:10 UTC (rev 12028)
+++ trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-25 00:32:47 UTC (rev 12029)
@@ -23,18 +23,20 @@
var="expanded" />
<f:resource
name="images/iconFolder.gif"
- var="folder" />
+ var="folderIcon" />
<f:resource
name="images/iconLeaf.gif"
- var="leaf" />
+ var="leafIcon" />
<f:call name="initializeLines" />
<f:call name="initializeResources" />
+ <c:object var="leaf" type="boolean" value="#{component.UITree.leaf}" />
+
<table border="0" cellpadding="0" cellspacing="0" id="#{clientId}" class="dr-tree-full-width rich-tree-node">
<tbody>
- <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{this:getToggleScript(context, component, 'mainRow')}" >
+ <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{!leaf ? this:getToggleScript(context, component, 'mainRow') : ''}" >
<f:call name="encodeAttributeParameters" />
<f:call name="utils.encodePassThruWithExclusions">
@@ -56,7 +58,6 @@
<div>
<jsp:scriptlet>
<![CDATA[
- boolean leaf = component.getUITree().isLeaf();
if (leaf) {
]]>
</jsp:scriptlet>
@@ -196,7 +197,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{leaf}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{leafIcon}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
@@ -221,7 +222,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{folder}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{folderIcon}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
16 years, 9 months
JBoss Rich Faces SVN: r12028 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 19:04:10 -0500 (Wed, 24 Dec 2008)
New Revision: 12028
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
Log:
comment fixed
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-24 20:29:22 UTC (rev 12027)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-25 00:04:10 UTC (rev 12028)
@@ -102,7 +102,7 @@
}
return val;
}
-//TODO: jsDoc this Satanism
+//TODO: jsDoc this code
Richfaces.borders = {l: 'border-left-width', r: 'border-right-width', t: 'border-top-width', b: 'border-bottom-width'},
Richfaces.paddings = {l: 'padding-left', r: 'padding-right', t: 'padding-top', b: 'padding-bottom'},
Richfaces.margins = {l: 'margin-left', r: 'margin-right', t: 'margin-top', b: 'margin-bottom'}
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r12027 - in trunk/ui/tree/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 15:29:22 -0500 (Wed, 24 Dec 2008)
New Revision: 12027
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/ui/tree/src/main/templates/htmlTree.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5442
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-24 20:29:22 UTC (rev 12027)
@@ -570,15 +570,6 @@
return buffer.toString();
}
- protected String getScriptContributions(FacesContext context, UITree tree) {
- return super.getScriptContributions(getJavaScriptVarName(context, tree), context, tree);
- }
-
- protected String getJavaScriptVarName(FacesContext context, UITree tree) {
- String id = tree.getBaseClientId(context);
- return "Richfaces_Tree_" + id.replaceAll("[^A-Za-z0-9_]", "_");
- }
-
private void writeScript(FacesContext context, UITree tree, List encodedAreaIds,
Set renderedAreas) throws IOException {
final ResponseWriter writer = context.getResponseWriter();
@@ -590,20 +581,16 @@
writer.startElement("script", tree);
getUtils().writeAttribute(writer, "type", "text/javascript");
- String varName = getJavaScriptVarName(context, tree);
-
- writer.writeText(varName + ".getNodeElements(" +
- ScriptUtils.toScript(encodedAreaIds) + ");", null);
+ StringBuffer sb = new StringBuffer("$(");
+ sb.append(ScriptUtils.toScript(clientId));
+ sb.append(").component.");
- writer.writeText(varName + ".updateSelection(" +
- ScriptUtils.toScript(getSelectionValue(context, tree)) + ");", null);
+ new JSFunction("refreshAfterAjax", encodedAreaIds, getSelectionValue(context, tree)).appendScript(sb);
+ writer.writeText(sb, null);
writer.endElement("script");
writer.endElement("div");
- renderedAreas.add(tree.getClientId(context)
- + NamingContainer.SEPARATOR_CHAR + "input");
-
renderedAreas.add(scriptId);
}
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-12-24 20:29:22 UTC (rev 12027)
@@ -183,6 +183,11 @@
*/
}
},
+
+ refreshAfterAjax: function(nodeIds, selectedNode) {
+ this.getNodeElements(nodeIds);
+ this.updateSelection(selectedNode);
+ },
getNodeElements: function(nodeIds) {
if (nodeIds) {
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-24 18:53:06 UTC (rev 12026)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-24 20:29:22 UTC (rev 12027)
@@ -49,20 +49,20 @@
<f:call name="encodeSelectionStateInput" />
<f:clientId var="clientId" />
- <script type="text/javascript">
- var #{this:getJavaScriptVarName(context, component)} =
- new Tree("#{clientId}", "#{clientId}:input", "#{component.switchType}",
- {
- onselect: "#{component.attributes['onselected']}",
- onexpand: "#{component.attributes['onexpand']}",
- oncollapse: "#{component.attributes['oncollapse']}"
- },
- function(event) {
- #{this:getAjaxScript(context, component)}
- },
- #{this:getOptions(context, component)}
- );
- #{this:getScriptContributions(context, component)}
+ <script type="text/javascript">(function() {
+ var tree = new Tree("#{clientId}", "#{clientId}:input", "#{component.switchType}",
+ {
+ onselect: "#{component.attributes['onselected']}",
+ onexpand: "#{component.attributes['onexpand']}",
+ oncollapse: "#{component.attributes['oncollapse']}"
+ },
+ function(event) {
+ #{this:getAjaxScript(context, component)}
+ },
+ #{this:getOptions(context, component)}
+ );
+ #{this:getScriptContributions("tree", context, component)}
+ }());
</script>
<div id="#{clientId}:script" class="dr-tree-h-script">
<script type="text/javascript">
16 years, 9 months
JBoss Rich Faces SVN: r12026 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:53:06 -0500 (Wed, 24 Dec 2008)
New Revision: 12026
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-24 18:53:02 UTC (rev 12025)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-12-24 18:53:06 UTC (rev 12026)
@@ -458,4 +458,32 @@
}
}
}
+};
+
+Richfaces.invokeEvent = function(eventFunc, element, eventName, memo) {
+ var result;
+ if (eventFunc) {
+ element = $(element);
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ var event;
+ if (document.createEvent) {
+ event = document.createEvent("HTMLEvents");
+ event.initEvent("dataavailable", true, true);
+ } else {
+ event = document.createEventObject();
+ event.eventType = "ondataavailable";
+ }
+
+ event.eventName = eventName;
+ event.rich = {component:this};
+ event.memo = memo || { };
+ try {
+ result = eventFunc.call(element,event);
+ }
+ catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
+ }
+ if (result!=false) result = true;
+ return result;
};
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r12025 - trunk/samples/listShuttleDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:53:02 -0500 (Wed, 24 Dec 2008)
New Revision: 12025
Modified:
trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:52:59 UTC (rev 12024)
+++ trunk/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:53:02 UTC (rev 12025)
@@ -49,6 +49,8 @@
fastMoveControlsVisible="#{listShuttleDemoBean.fastMoveControlsVisible}"
converter="#{converter}"
onorderchanged="orderChanged(event)"
+ onorderchange="return false;"
+ onlistchange="return false;"
sourceSelection="#{listShuttleDemoBean.sourceSelection}"
targetSelection="#{listShuttleDemoBean.targetSelection}"
16 years, 9 months
JBoss Rich Faces SVN: r12024 - in trunk/ui/inplaceInput/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:59 -0500 (Wed, 24 Dec 2008)
New Revision: 12024
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-12-24 18:52:59 UTC (rev 12024)
@@ -121,7 +121,7 @@
},
edit: function (){
- if (this.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.oneditactivation, this.inplaceInput, "rich:oneditactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
this.startEditableState();
if (this.events.oneditactivated) {
this.inplaceInput.fire("rich:oneditactivated", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value});
@@ -275,7 +275,7 @@
},
cancel : function(e, value) {
- if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
this.endEditableState();
if (!value) {
value = this.valueKeeper.value;
@@ -301,7 +301,7 @@
},
save : function(e) {
- if (this.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
+ if (Richfaces.invokeEvent(this.events.onviewactivation, this.inplaceInput, "rich:onviewactivation", {oldValue : this.valueKeeper.value, value : this.tempValueKeeper.value})) {
var userValue = this.tempValueKeeper.value;
this.setValue(userValue);
if (this.events.onviewactivated) {
@@ -338,7 +338,7 @@
this.startChangedState();
if (value != userValue) {
this.tempValueKeeper.value = userValue;
- this.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
+ Richfaces.invokeEvent(this.events.onchange, this.inplaceInput, "onchange", userValue);
}
} else {
@@ -350,36 +350,6 @@
return this.valueKeeper.value;
},
- //TODO: remove Bucks
- //TODO: to shared library
- invokeEvent : function(eventFunc, element, eventName, memo) {
- var result;
- if (eventFunc) {
- element = $(element);
- if (element == document && document.createEvent && !element.dispatchEvent)
- element = document.documentElement;
-
- var event;
- if (document.createEvent) {
- event = document.createEvent("HTMLEvents");
- event.initEvent("dataavailable", true, true);
- } else {
- event = document.createEventObject();
- event.eventType = "ondataavailable";
- }
-
- event.eventName = eventName;
- event.rich = {component:this};
- event.memo = memo || { };
- try {
- result = eventFunc.call(element,event);
- }
- catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName + "]"); }
- }
- if (result!=false) result = true;
- return result;
- },
-
setDefaultText : function() {
this.currentText = this.attributes.defaultLabel;
},
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-24 18:52:54 UTC (rev 12023)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-24 18:52:59 UTC (rev 12024)
@@ -15,9 +15,9 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/comboboxUtils.js,
+ scripts/utils.js,
scripts/inplaceinput.js,
- scripts/inplaceinputstyles.js,
- scripts/utils.js
+ scripts/inplaceinputstyles.js
</h:scripts>
<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
16 years, 9 months
JBoss Rich Faces SVN: r12023 - in trunk/ui/orderingList/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:54 -0500 (Wed, 24 Dec 2008)
New Revision: 12023
Modified:
trunk/ui/orderingList/src/main/config/component/orderinglist.xml
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-12-24 18:52:48 UTC (rev 12022)
+++ trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-12-24 18:52:54 UTC (rev 12023)
@@ -191,6 +191,14 @@
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
+ <name>onorderchange</name>
+ <classname>java.lang.String</classname>
+ <description>
+ A JavaScript event handler called before order operation
+ </description>
+ <defaultvalue><![CDATA[""]]></defaultvalue>
+ </property>
+ <property>
<name>ontopclick</name>
<classname>java.lang.String</classname>
<description>
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-12-24 18:52:48 UTC (rev 12022)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2008-12-24 18:52:54 UTC (rev 12023)
@@ -95,50 +95,54 @@
},
moveSelectedItems : function(action, event) {
- event = window.event||event;
- var rows = this.shuttleTbody.rows;
- var item;
if (this.selectedItems.length > 0) {
- this.selectedItems.sort(this.compareByRowIndex);
- if ((action == 'up') && this.getExtremeItem("first").previousSibling) {
- for (var i = 0; i < this.selectedItems.length; i++) {
- item = this.selectedItems[i];
- item.parentNode.insertBefore(item, item.previousSibling);
+ if (Richfaces.invokeEvent(this.events.onorderchange, this.container, "rich:onorderchange", {items: this.shuttleItems})) {
+ event = window.event||event;
+ var rows = this.shuttleTbody.rows;
+ var item;
+
+ this.selectedItems.sort(this.compareByRowIndex);
+
+ if ((action == 'up') && this.getExtremeItem("first").previousSibling) {
+ for (var i = 0; i < this.selectedItems.length; i++) {
+ item = this.selectedItems[i];
+ item.parentNode.insertBefore(item, item.previousSibling);
+ }
+ } else if ((action == 'down') && this.getExtremeItem("last").nextSibling) {
+ for (var i = this.selectedItems.length - 1; i > -1; i--) {
+ item = this.selectedItems[i];
+ item.parentNode.insertBefore(item.nextSibling, item);
+ }
+ } else if (action == 'first') {
+ var incr = this.selectedItems[0].rowIndex;
+ for (var i = 0; i < this.selectedItems.length; i++) {
+ item = this.selectedItems[i];
+ item.parentNode.insertBefore(item, rows[item.rowIndex - incr]);
+ }
+ } else if (action == 'last') {
+ var length = this.shuttleItems.length;
+ var incr = length - this.selectedItems[this.selectedItems.length - 1].rowIndex;
+ for (var i = this.selectedItems.length - 1; i > -1; i--) {
+ item = this.selectedItems[i];
+ if (item.rowIndex + incr > length - 1) {
+ item.parentNode.insertBefore(item, null);
+ } else {
+ item.parentNode.insertBefore(item, rows[item.rowIndex + incr]);
+ }
+ }
}
- } else if ((action == 'down') && this.getExtremeItem("last").nextSibling) {
- for (var i = this.selectedItems.length - 1; i > -1; i--) {
- item = this.selectedItems[i];
- item.parentNode.insertBefore(item.nextSibling, item);
+
+ this.shuttleItems = new Array();
+ for (var i = 0; i < rows.length; i++) {
+ this.shuttleItems.push(rows[i].item);
}
- } else if (action == 'first') {
- var incr = this.selectedItems[0].rowIndex;
- for (var i = 0; i < this.selectedItems.length; i++) {
- item = this.selectedItems[i];
- item.parentNode.insertBefore(item, rows[item.rowIndex - incr]);
- }
- } else if (action == 'last') {
- var length = this.shuttleItems.length;
- var incr = length - this.selectedItems[this.selectedItems.length - 1].rowIndex;
- for (var i = this.selectedItems.length - 1; i > -1; i--) {
- item = this.selectedItems[i];
- if (item.rowIndex + incr > length - 1) {
- item.parentNode.insertBefore(item, null);
- } else {
- item.parentNode.insertBefore(item, rows[item.rowIndex + incr]);
- }
- }
+ if (action != null)
+ this.autoScrolling(action, event);
+
+ this.container.fire("rich:onorderchanged", {items: this.shuttleItems});
+ this.controlListManager();
}
-
- this.shuttleItems = new Array();
- for (var i = 0; i < rows.length; i++) {
- this.shuttleItems.push(rows[i].item);
- }
- if (action != null)
- this.autoScrolling(action, event);
-
- this.container.fire("rich:onorderchanged", {items: this.shuttleItems});
- this.controlListManager();
}
},
Modified: trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-12-24 18:52:48 UTC (rev 12022)
+++ trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-12-24 18:52:54 UTC (rev 12023)
@@ -123,6 +123,7 @@
[['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']],
'#{cId}sortLabel',
{onorderchanged:#{this:getAsEventHandler(context, component, "onorderchanged")},
+ onorderchange:#{this:getAsEventHandler(context, component, "onorderchange")},
ontopclick:#{this:getAsEventHandler(context, component, "ontopclick")},
onbottomclick:#{this:getAsEventHandler(context, component, "onbottomclick")},
onupclick:#{this:getAsEventHandler(context, component, "onupclick")},
16 years, 9 months
JBoss Rich Faces SVN: r12022 - in trunk/ui/pickList/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:48 -0500 (Wed, 24 Dec 2008)
New Revision: 12022
Modified:
trunk/ui/pickList/src/main/config/component/picklist.xml
trunk/ui/pickList/src/main/templates/htmlPickList.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-12-24 18:52:44 UTC (rev 12021)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-12-24 18:52:48 UTC (rev 12022)
@@ -180,6 +180,11 @@
<classname>java.lang.String</classname>
<description>A JavaScript event handler called on a list change operation</description>
</property>
+ <property>
+ <name>onlistchange</name>
+ <classname>java.lang.String</classname>
+ <description>A JavaScript event handler called before list change operation</description>
+ </property>
<property>
<name>disabled</name>
<classname>boolean</classname>
Modified: trunk/ui/pickList/src/main/templates/htmlPickList.jspx
===================================================================
--- trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-12-24 18:52:44 UTC (rev 12021)
+++ trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-12-24 18:52:48 UTC (rev 12022)
@@ -166,6 +166,7 @@
new Richfaces.PickList.Source('#{clientId}', '#{clientId}internal_tab', '#{clientId}internal_header_tab', '#{clientId}focusKeeper', undefined, Richfaces.PickList.Source.SelectItem, #{this:getColumnClassesAsJSArray(context, component)}, #{this:getRowClassesAsJSArray(context, component)}),
"#{clientId}", [['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
"#{switchByClick}", {onlistchanged: #{this:getAsEventHandler(context, component, "onlistchanged")},
+ onlistchange: #{this:getAsEventHandler(context, component, "onlistchange")},
onfocus:#{this:getAsEventHandler(context, component, "onfocus")},
onblur:#{this:getAsEventHandler(context, component, "onblur")}},
"#{clientId}valueKeeper");
16 years, 9 months
JBoss Rich Faces SVN: r12021 - trunk/samples/pickList-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:44 -0500 (Wed, 24 Dec 2008)
New Revision: 12021
Modified:
trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-12-24 18:52:42 UTC (rev 12020)
+++ trunk/samples/pickList-sample/src/main/webapp/pages/index.jsp 2008-12-24 18:52:44 UTC (rev 12021)
@@ -57,6 +57,7 @@
removeControlLabel = "#{pickBean.removeLabel}"
removeAllControlLabel ="#{pickBean.removeAllLabel}"
value="#{pickBean.listValues}"
+ onlistchange="return false;"
showButtonsLabel="true">
<f:selectItem itemValue="cat" itemLabel="cat"/>
<f:selectItem itemValue="dog" itemLabel="dog"/>
16 years, 9 months
JBoss Rich Faces SVN: r12020 - trunk/samples/orderingListDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:42 -0500 (Wed, 24 Dec 2008)
New Revision: 12020
Modified:
trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:52:38 UTC (rev 12019)
+++ trunk/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2008-12-24 18:52:42 UTC (rev 12020)
@@ -72,7 +72,8 @@
ontopclick="#{demoBean.ontopclick}"
onbottomclick="#{demoBean.onbottomclick}"
- onorderchanged="orderChanged(event); new Effect.Highlight('form:onorderchangedDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});"
+ onorderchanged="orderChanged(event); new Effect.Highlight('form:onorderchangedDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});"
+ onorderchange="orderChanged(event); new Effect.Highlight('form:onorderchangedDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});return false;"
ondownclick="new Effect.Highlight('form:ondownclickDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});"
onheaderclick="new Effect.Highlight('form:onheaderclickDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});"
onupclick="new Effect.Highlight('form:onupclickDiv', {startcolor:'#FF0000', endcolor:'#FF0000', restorecolor: 'green'});" >
16 years, 9 months
JBoss Rich Faces SVN: r12019 - in trunk/ui/listShuttle/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 13:52:38 -0500 (Wed, 24 Dec 2008)
New Revision: 12019
Modified:
trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4595
Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-12-24 18:52:38 UTC (rev 12019)
@@ -158,6 +158,16 @@
<classname>java.lang.String</classname>
<description>HTML: script expression; called after ordering action</description>
</property>
+ <property>
+ <name>onlistchange</name>
+ <classname>java.lang.String</classname>
+ <description>A JavaScript event handler called before list change operation</description>
+ </property>
+ <property>
+ <name>onorderchange</name>
+ <classname>java.lang.String</classname>
+ <description>HTML: script expression; called before ordering action</description>
+ </property>
<property>
<name>showButtonLabels</name>
Modified: trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2008-12-24 18:52:38 UTC (rev 12019)
@@ -159,21 +159,23 @@
},
moveItems : function(sourceComponent, targetComponent, items) {
- if (items.length > 0) {
- var length = items.length;
- for (var i = 0; items.length > 0;) {
- var item = items[i];
- this.moveItem(sourceComponent, targetComponent, item);
- }
- this.controlListManager();
- if (this.targetList.controlListManager) {
- this.targetList.controlListManager();
+ if (Richfaces.invokeEvent(this.events.onlistchange, this.container, "rich:onlistchange", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems})) {
+ if (items.length > 0) {
+ var length = items.length;
+ for (var i = 0; items.length > 0;) {
+ var item = items[i];
+ this.moveItem(sourceComponent, targetComponent, item);
+ }
+ this.controlListManager();
+ if (this.targetList.controlListManager) {
+ this.targetList.controlListManager();
+ }
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
+
+ this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
}
-
- this.targetLayoutManager.widthSynchronization();
- this.sourceLayoutManager.widthSynchronization();
-
- this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
}
},
@@ -228,18 +230,20 @@
},
moveItemByClick : function(event, sourceComponent, targetComponent, layoutManager) {
- var item = this.sourceList.getEventTargetRow(event);
- this.moveItem(sourceComponent, targetComponent, item);
+ if (Richfaces.invokeEvent(this.events.onlistchange, this.container, "rich:onlistchange", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems})) {
+ var item = this.sourceList.getEventTargetRow(event);
+ this.moveItem(sourceComponent, targetComponent, item);
+
+ this.controlListManager();
+ if (this.targetList.controlListManager) {
+ this.targetList.controlListManager();
+ }
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
- this.controlListManager();
- if (this.targetList.controlListManager) {
- this.targetList.controlListManager();
+ this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
}
-
- this.targetLayoutManager.widthSynchronization();
- this.sourceLayoutManager.widthSynchronization();
-
- this.container.fire("rich:onlistchanged", {sourceItems: sourceComponent.shuttleItems, targetItems: targetComponent.shuttleItems});
},
copyAll : function() {
Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-12-24 18:41:33 UTC (rev 12018)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-12-24 18:52:38 UTC (rev 12019)
@@ -194,6 +194,7 @@
[['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']],
'#{clientId}sortLabel',
{onorderchanged:#{this:getAsEventHandler(context, component, "onorderchanged")},
+ onorderchange:#{this:getAsEventHandler(context, component, "onorderchange")},
ontopclick:#{this:getAsEventHandler(context, component, "ontopclick")},
onbottomclick:#{this:getAsEventHandler(context, component, "onbottomclick")},
onupclick:#{this:getAsEventHandler(context, component, "onupclick")},
@@ -215,6 +216,7 @@
[['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']],
"#{switchByClick}",
{onlistchanged:#{this:getAsEventHandler(context, component, "onlistchanged")},
+ onlistchange:#{this:getAsEventHandler(context, component, "onlistchange")},
oncopyallclick:#{this:getAsEventHandler(context, component, "oncopyallclick")},
oncopyclick:#{this:getAsEventHandler(context, component, "oncopyclick")},
onremoveallclick:#{this:getAsEventHandler(context, component, "onremoveallclick")},
16 years, 9 months
JBoss Rich Faces SVN: r12018 - in trunk/framework/api/src: main/java/org/richfaces/model and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 13:41:33 -0500 (Wed, 24 Dec 2008)
New Revision: 12018
Added:
trunk/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
Log:
https://jira.jboss.org/jira/browse/RF-5454
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2008-12-24 18:09:05 UTC (rev 12017)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2008-12-24 18:41:33 UTC (rev 12018)
@@ -46,6 +46,13 @@
}
/**
+ *
+ */
+ protected SequenceRange() {
+ super();
+ }
+
+ /**
* @param firstRow
* @param rows
*/
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2008-12-24 18:09:05 UTC (rev 12017)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2008-12-24 18:41:33 UTC (rev 12018)
@@ -10,6 +10,7 @@
package org.richfaces.model;
+import java.io.IOException;
import java.io.Serializable;
import org.ajax4jsf.model.SequenceRange;
@@ -25,6 +26,10 @@
private SortOrder sortOrder;
+ public ScrollableTableDataRange() {
+ super();
+ }
+
public ScrollableTableDataRange(int first, int last, SortOrder sortOrder) {
super(first, last > 0 ? last - first : -1);
this.sortOrder = sortOrder;
@@ -94,4 +99,23 @@
return false;
return true;
}
+
+ private void writeObject(java.io.ObjectOutputStream out)
+ throws IOException {
+
+ out.defaultWriteObject();
+
+ out.writeInt(getFirstRow());
+ out.writeInt(getRows());
+ }
+
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException, ClassNotFoundException {
+
+ in.defaultReadObject();
+
+ setFirstRow(in.readInt());
+ setRows(in.readInt());
+ }
+
}
Added: trunk/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java
===================================================================
--- trunk/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java (rev 0)
+++ trunk/framework/api/src/test/java/org/richfaces/model/ScrollableTableDataRangeSerializationTest.java 2008-12-24 18:41:33 UTC (rev 12018)
@@ -0,0 +1,59 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.model;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+
+public class ScrollableTableDataRangeSerializationTest extends TestCase {
+
+ private ScrollableTableDataRange readWriteRange(ScrollableTableDataRange range) throws Exception {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(range);
+ oos.close();
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bais);
+
+ return (ScrollableTableDataRange) ois.readObject();
+ }
+
+ public void testSerialization() throws Exception {
+ SortOrder order = new SortOrder(new SortField[] { new SortField("xxx", true) });
+ ScrollableTableDataRange range = new ScrollableTableDataRange(10, 300, order);
+
+ ScrollableTableDataRange serializedRange = readWriteRange(range);
+
+ assertNotSame(range, serializedRange);
+ assertEquals(range, serializedRange);
+ }
+}
16 years, 9 months
JBoss Rich Faces SVN: r12017 - trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-24 13:09:05 -0500 (Wed, 24 Dec 2008)
New Revision: 12017
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
https://jira.jboss.org/jira/browse/RF-4592
Modified: trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-12-24 17:28:05 UTC (rev 12016)
+++ trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-12-24 18:09:05 UTC (rev 12017)
@@ -1232,7 +1232,7 @@
eventObj = document.createEvent('Events');
eventObj.initEvent(eventName, true, false );
}
- result = eventFunction.call(eventObj);
+ result = eventFunction.call(this, eventObj);
}
if (result!=false) result = true;
return result;
16 years, 9 months
JBoss Rich Faces SVN: r12016 - Reports/3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-24 12:28:05 -0500 (Wed, 24 Dec 2008)
New Revision: 12016
Added:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.CR1.xls
Modified:
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA5.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.BETA5.xls
===================================================================
(Binary files differ)
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.CR1.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.CR1.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Rich Faces SVN: r12015 - trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 12:22:35 -0500 (Wed, 24 Dec 2008)
New Revision: 12015
Modified:
trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
Log:
https://jira.jboss.org/jira/browse/RF-3365
Modified: trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-12-24 17:19:37 UTC (rev 12014)
+++ trunk/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2008-12-24 17:22:35 UTC (rev 12015)
@@ -68,6 +68,8 @@
background : top left repeat-x;
border-style: solid;
padding : 2px 0px 0px 2px;
+ cursor : pointer;
+ cursor : hand;
}
.rich-ordering-list-button-valign {
16 years, 9 months
JBoss Rich Faces SVN: r12014 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/effect and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-24 12:19:37 -0500 (Wed, 24 Dec 2008)
New Revision: 12014
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/effect/effectTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EffectTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
Refactor failed tests
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/layout.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/effect/effectTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/effect/effectTest.xhtml 2008-12-24 16:40:12 UTC (rev 12013)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/effect/effectTest.xhtml 2008-12-24 17:19:37 UTC (rev 12014)
@@ -25,10 +25,10 @@
<a href="#" id="hideLink1">Hide Button</a><br/>
<a href="#" id="showLink2">Show Command Button</a><br/>
<a href="#" id="hideLink2">Hide Command Button</a><br/>
- <a href="#" id="testLink" onclick="myEffect({duration:1, from:1.0, to:0.1})">Test named effect</a>
+ <a href="#" id="testLink" onclick="myEffect({duration:2, from:1.0, to:0.1})">Test named effect</a>
<rich:effect for="hideLink1" event="onclick" type="Fade"
- params="targetId: 'button1', duration: 2.0, from: 1.0, to: 0.0"></rich:effect>
+ params="targetId: 'button1', duration: 3.0, from: 1.0, to: 0.0"></rich:effect>
<rich:effect rendered="#{effectBean.rendered}" for="hideLink2" event="onclick" type="Fade"
params="targetId: getParentId() + 'button2', duration: 0, from: 1.0, to: 0.0"></rich:effect>
@@ -41,6 +41,7 @@
</rich:effect>
+ <a href='#' onclick="pause(3000, 'crack');">Test</a>
</ui:define>
</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-24 16:40:12 UTC (rev 12013)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-24 17:19:37 UTC (rev 12014)
@@ -54,10 +54,10 @@
public abstract class SeleniumTestBase implements RichSeleniumTest {
/** Specifies the time to wait for page rendering */
- private static final Integer pageRenderTime = 5000;
+ private static final Integer pageRenderTime = 10000;
/** Specifies the time to wait for ajax processing */
- protected static final int ajaxCompletionTime = 3000;
+ protected static final int ajaxCompletionTime = 10000;
protected static final String serverPort = "8085";
@@ -372,7 +372,7 @@
} else {
selenium.getEval("selenium.browserbot.getCurrentWindow().reRenderAll();");
}
- waitForAjaxCompletion(3000);
+ waitForAjaxCompletion(ajaxCompletionTime);
}
/**
@@ -899,7 +899,7 @@
script.append("');");
runScript(script.toString());
selenium.waitForCondition(WINDOW_JS_RESOLVER + "pauseHolder['" + id + "'] == true;", String
- .valueOf(miliSeconds + 1000));
+ .valueOf(miliSeconds + 10000));
}
/**
@@ -1141,6 +1141,15 @@
public boolean isFF() {
return new Boolean(selenium.getEval("navigator.userAgent.indexOf('Firefox') > -1"));
}
+
+ /**
+ * Checks whether client is FireFox
+ *
+ * @return true if client is FireFox
+ */
+ public boolean isIE() {
+ return new Boolean(selenium.getEval("!!(window.attachEvent && !window.opera)"));
+ }
/**
* Returns the url to test page to be opened by selenium
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EffectTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EffectTest.java 2008-12-24 16:40:12 UTC (rev 12013)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EffectTest.java 2008-12-24 17:19:37 UTC (rev 12014)
@@ -20,8 +20,11 @@
*/
package org.richfaces.testng;
+import java.util.Date;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
import org.testng.annotations.Test;
/**
@@ -59,7 +62,18 @@
pause(200, testLink);
assertStyleAttribute(testLink, "opacity", "Named effect does not work");
pause(1500, testLink);
- assertStyleAttribute(testLink, "opacity: 0.1", "Opacity effect has not been completed");
+
+ if (isIE()) {
+ String style = getStyleAttributeString(testLink, "filter");
+ if (style == null || (!style.contains("opacity=9.99") && !style.contains("opacity=10"))) {
+ Assert.fail("Opacity effect has not been completed. Style expected [filter = {opacity: 9.99}]. But was: " + style);
+ }
+ }else {
+ String style = getStyleAttributeString(testLink, "opacity");
+ if (style == null || !style.equals("0.1")) {
+ Assert.fail("Opacity effect has not been completed. Style expected [opacity: 0.1]. But was: " + style);
+ }
+ }
}
@Test
@@ -104,11 +118,11 @@
AssertVisible(button2Id);
clickById(hideLink1);
- pause(500, hideLink1);
- AssertVisible(button1Id, "Duration param of Fade effect does not work ");
- assertStyleAttribute(button1Id, "opacity", "Element has no opacity style");
+
+ //AssertVisible(button1Id, "Duration param of Fade effect does not work ");
+ //assertStyleAttribute(button1Id, "opacity", "Element has no opacity style");
- pause(2000, hideLink1);
+ pause(3000, hideLink1);
AssertNotVisible(button1Id, "Input button has not been hidden by Fade effect or targetId has not been resolved");
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java 2008-12-24 16:40:12 UTC (rev 12013)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java 2008-12-24 17:19:37 UTC (rev 12014)
@@ -22,6 +22,7 @@
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
import org.testng.annotations.Test;
public class GraphValidatorTest extends SeleniumTestBase {
@@ -136,7 +137,10 @@
spinnerManualInput("10", 2);
spinnerManualInput("10", 3);
clickAjaxCommandAndWait(saveBtn);
- AssertTextEquals(allMessages, "Invalid values: Only 24h in a day!Invalid values: Are you sure you have power for this??!!", "All properties validation phase has been skipped ");
+ String messageText = getTextById(allMessages);
+ if (!messageText.contains("Invalid values: Only 24h in a day!") || !messageText.contains("Are you sure you have power for this??!!")) {
+ Assert.fail("All properties validation phase has been skipped. Expected: Invalid values: Only 24h in a day!Invalid values: Are you sure you have power for this??!!. But was: " + messageText);
+ }
spinnerManualInput("9", 0);
clickAjaxCommandAndWait(saveBtn);
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-12-24 16:40:12 UTC (rev 12013)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-12-24 17:19:37 UTC (rev 12014)
@@ -89,7 +89,7 @@
assertStyleAttributes(getParentId() + PANEL_CONTENT_DIV_ID, styles);
}
- //@Test
+ @Test
public void testModalPanel(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing modal panel");
@@ -111,7 +111,7 @@
}
- //@Test
+ @Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing rendered attribute");
@@ -126,7 +126,7 @@
}
- //@Test
+ @Test
public void testShowWhenRenderedAttribute(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing showWhenRendered attribute");
@@ -142,7 +142,7 @@
AssertVisible(panelId);
}
- //@Test
+ @Test
public void testNotResizeableAndNotMoveable(Template template) {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing not resizeable panel");
@@ -175,7 +175,7 @@
}
- //@Test
+ @Test
public void testJSApi(Template template) {
renderPage(template, RESET_METHOD_NAME);
String panelId = getParentId() + PANEL_CONTAINER_DIV_ID;
@@ -190,7 +190,7 @@
AssertNotVisible(panelId, "Modal panel has not closed by JS API");
}
- //@Test
+ @Test
public void testLayoutAttributes(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing layout attribute");
@@ -226,7 +226,7 @@
assertClassNames(panelContainerId, new String [] {"rich-modalpanel"}, "", true);
}
- //@Test
+ @Test
public void testDragByHeader(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -250,7 +250,7 @@
}
- // @Test
+ @Test
public void testMinWidthAndMinHeight(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -269,7 +269,7 @@
}
- //@Test
+ @Test
public void testNestedInputAndCommand(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -294,7 +294,7 @@
}
- //@Test
+ @Test
public void testAutosized(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -335,7 +335,7 @@
}
- // @Test
+ @Test
public void testKeepVisualState(Template template) {
renderPage(template, RESET_METHOD_NAME);
String message = "KeepVisualState attribute does not work";
16 years, 9 months
JBoss Rich Faces SVN: r12013 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-24 11:40:12 -0500 (Wed, 24 Dec 2008)
New Revision: 12013
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
Log:
fix comboBox/inplaceSelect list
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-24 16:34:15 UTC (rev 12012)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-24 16:40:12 UTC (rev 12013)
@@ -61,31 +61,18 @@
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
}*/
- if( typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0 ) {
- return document.viewport.getDimensions().height + document.viewport.getScrollOffsets().top;
- } else {
-
- var scrollOffsets = 0;
- var innerHeight = 0;
-
- if(document.documentElement) {
- scrollOffsets += document.documentElement.scrollTop ? document.documentElement.scrollTop : 0 ;
- innerHeight += document.documentElement.clientHeigh ? document.documentElement.clientHeigh : 0 ;
- }
-
- if (document.body) {
- scrollOffsets += document.body.scrollTop ? document.body.scrollTop : 0;
- innerHeight += document.body.clientHeight ? document.body.clientHeight : 0;
- }
-
- scrollOffsets += window.pageYOffset;
- innerHeight += self.innerHeight;
-
- return innerHeight + scrollOffsets;
-
+ var viewportheight = 0;
+
+ // must be checked in the next prototype release version !!!
+ if(Richfaces.browser.isIE6) {
+ var height = (document.compatMode=='CSS1Compat') ? document.documentElement['clientHeight'] : document.body['clientHeigth'];
+ var scrollHeight = document.viewport.getScrollOffsets().top;
+ viewportheight = height + scrollHeight;
+ } else {
+ viewportheight = document.viewport.getDimensions().height + document.viewport.getScrollOffsets().top;
}
- //return viewportheight;
+ return viewportheight;
}
Richfaces.getScrollWidth = function(elem) {
16 years, 9 months
JBoss Rich Faces SVN: r12012 - trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-24 11:34:15 -0500 (Wed, 24 Dec 2008)
New Revision: 12012
Modified:
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-3418
Modified: trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java
===================================================================
--- trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-12-24 16:33:36 UTC (rev 12011)
+++ trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/ContextMenuRendererBase.java 2008-12-24 16:34:15 UTC (rev 12012)
@@ -43,6 +43,7 @@
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIContextMenu;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.component.util.MessageUtil;
import org.richfaces.renderkit.TemplateEncoderRendererBase;
import org.xml.sax.ContentHandler;
@@ -107,6 +108,7 @@
protected void doEncodeBegin(ResponseWriter writer, FacesContext context,
UIComponent component) throws IOException {
ensureParentPresent(component);
+ checkAttachTimingValidity(context, component);
writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute(HTML.id_ATTRIBUTE, component.getClientId(context), "id");
}
@@ -134,21 +136,18 @@
}
/**
- * Perform validation of the contextMenu configuration. Throws
- * FacesException in case validation fails.
+ * Perform validation of the contextMenu configuration.
*
- * @param clientId -
- * id of the component
- * @param name -
- * component name
- * @param attachTiming -
- * timing options
+ * @param component - menu component
*/
- protected void checkValidity(String clientId, String name, String attachTiming) {
+ protected void checkAttachTimingValidity(FacesContext context, UIComponent component) {
+ UIContextMenu menu = (UIContextMenu) component;
+ String attachTiming = menu.getAttachTiming();
if (!ON_LOAD.equals(attachTiming) && !IMMEDIATE.equals(attachTiming) && !ON_AVAILABLE.equals(attachTiming)) {
- throw new FacesException("The attachTiming attribute of the contextMenu (id='" + clientId
- + "') has an invalid value:'" + attachTiming + "'. It may have only the following values: '"
- + IMMEDIATE + "', '" + ON_LOAD + "', '" + ON_AVAILABLE + "'");
+ context.getExternalContext().log(attachTiming + " value of attachTiming attribute is not a legal one for component: "
+ + MessageUtil.getLabel(context, component)
+ + ". Default value was applied.");
+ menu.setAttachTiming(ON_AVAILABLE);
}
}
16 years, 9 months
JBoss Rich Faces SVN: r12011 - trunk/ui/calendar/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-24 11:33:36 -0500 (Wed, 24 Dec 2008)
New Revision: 12011
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
Log:
https://jira.jboss.org/jira/browse/RF-4005
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-12-24 16:03:34 UTC (rev 12010)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2008-12-24 16:33:36 UTC (rev 12011)
@@ -54,6 +54,7 @@
import org.ajax4jsf.event.AjaxEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.richfaces.component.util.MessageUtil;
import org.richfaces.event.CurrentDateChangeEvent;
import org.richfaces.event.CurrentDateChangeListener;
import org.richfaces.model.CalendarDataModel;
@@ -787,20 +788,27 @@
* @return firstWeekDay value from local variable or value bindings
*/
public int getFirstWeekDay( ){
- if(this._firstWeekDaySet){
- return this._firstWeekDay;
- }
- ValueExpression ve = getValueExpression("firstWeekDay");
- if (ve != null) {
-
- Integer value = (Integer) ve.getValue(getFacesContext().getELContext());
- if (null == value) {
- return getDefaultFirstWeekDay();
+ int result;
+ if (this._firstWeekDaySet) {
+ result = this._firstWeekDay;
+ }else{
+ ValueExpression ve = getValueExpression("firstWeekDay");
+ if (ve != null) {
+
+ Integer value = (Integer) ve.getValue(getFacesContext().getELContext());
+ result = (value.intValue());
+ } else {
+ result = getDefaultFirstWeekDay();
}
- return (value.intValue());
- } else {
- return getDefaultFirstWeekDay();
}
+ if (result < 0 || result > 6) {
+ getFacesContext().getExternalContext()
+ .log(result + " value of firstWeekDay attribute is not a legal one for component: "
+ + MessageUtil.getLabel(getFacesContext(), this)
+ + ". Default value was applied.");
+ result = getDefaultFirstWeekDay();
+ }
+ return result;
}
public Object saveState(FacesContext context) {
16 years, 9 months
JBoss Rich Faces SVN: r12010 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-24 11:03:34 -0500 (Wed, 24 Dec 2008)
New Revision: 12010
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
//https://jira.jboss.org/jira/browse/RF-4050
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-12-24 15:56:36 UTC (rev 12009)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-12-24 16:03:34 UTC (rev 12010)
@@ -192,7 +192,8 @@
},
listMousedownHandler : function(event) {
- if (Prototype.Browser.IE) {
+ //https://jira.jboss.org/jira/browse/RF-4050
+ if (!Prototype.Browser.Firefox) {
if (!Element.match(event.target,"span")) {
this.clickOnScroll = true;
}
@@ -201,12 +202,13 @@
},
listMouseUpHandler : function(e) {
- if (window.getSelection) {
- if (window.getSelection().getRangeAt(0).toString() != '') {
+ //https://jira.jboss.org/jira/browse/RF-4050
+ //if (window.getSelection) {
+ //if (window.getSelection().getRangeAt(0).toString() != '') {
this.field.focus();
this.comboList.isList = false;
- }
- }
+ //}
+ //}
},
listClickHandler : function(event) {
16 years, 9 months
JBoss Rich Faces SVN: r12009 - in trunk/samples/richfaces-demo/src/main: resources/org/richfaces/demo/common and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-24 10:56:36 -0500 (Wed, 24 Dec 2008)
New Revision: 12009
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentDescriptor.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/css/common.css
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/editTable.xhtml
trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml
trunk/samples/richfaces-demo/src/main/webapp/welcome.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-5466
https://jira.jboss.org/jira/browse/RF-4910
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentDescriptor.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentDescriptor.java 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentDescriptor.java 2008-12-24 15:56:36 UTC (rev 12009)
@@ -25,8 +25,18 @@
private boolean current;
private String activeTab;
+
+ private boolean newComponent;
+
+ public boolean isNewComponent() {
+ return newComponent;
+ }
- public ComponentDescriptor() {
+ public void setNewComponent(boolean newComponent) {
+ this.newComponent = newComponent;
+ }
+
+ public ComponentDescriptor() {
this.id = "";
this.name = "";
this.captionImage = "";
@@ -36,6 +46,7 @@
this.javaDocLocation = "";
this.current = false;
this.activeTab = "usage";
+ this.newComponent=false;
}
public String getCaptionImage() {
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2008-12-24 15:56:36 UTC (rev 12009)
@@ -221,6 +221,10 @@
desc.setTldDocLocation(toc.nextToken().trim());
desc.setJavaDocLocation(toc.nextToken().trim());
desc.setDemoLocation(toc.nextToken().trim());
+ if (toc.hasMoreElements())
+ if ("new".equals(toc.nextToken().trim()))
+ desc.setNewComponent(true);
+ else desc.setNewComponent(false);
temp.add(desc);
}
Collections.sort(temp, new Comparator() {
Modified: trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-12-24 15:56:36 UTC (rev 12009)
@@ -7,7 +7,7 @@
inputNumberSlider= richInputs, Input Number Slider, /images/ico_DataFilterSlider.gif, /images/cn_slider.gif, inputNumberSlider.html, jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSlider.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSlider.html, /richfaces/inputNumberSlider.jsf
inputNumberSpinner= richInputs, Input Number Spinner, /images/ico_spinner.gif, /images/cn_spinner.gif, inputNumberSpinner.html, jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSpinner.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSpinner.html, /richfaces/inputNumberSpinner.jsf
dataFilterSlider= richDataIterators, Data Filter Slider, /images/ico_DataFilterSlider.gif, /images/cn_DataFilterSlider.gif, dataFilterSlider.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataFilterSlider.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataFltrSlider.html, /richfaces/dataFilterSlider.jsf
-dataTable= richDataIterators, Data Table, /images/ico_DataTable.gif, /images/cn_DataTable.gif, dataTable.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html, /richfaces/dataTable.jsf
+dataTable=richDataIterators, Data Table, /images/ico_DataTable.gif, /images/cn_DataTable.gif, dataTable.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html, /richfaces/dataTable.jsf,new
column= richDataIterators, Column, /images/ico_Column.gif, /images/cn_Column.gif, column.html, jbossrichfaces/freezone/docs/tlddoc/rich/column.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumn.html, /richfaces/dataTable.jsf
columnGroup= richDataIterators, Column Group, /images/ico_ColumnGroup.gif, /images/cn_ColumnGroup.gif, columnGroup.html, jbossrichfaces/freezone/docs/tlddoc/rich/columnGroup.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumnGroup.html, /richfaces/dataTable.jsf
dataDefinitionList= richDataIterators, Data Definition List, /images/ico_DataDefinitionList.gif, /images/cn_DataDefinitionList.gif, dataDefinitionList.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataDefinitionList.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataDefinitionList.html, /richfaces/dataLists.jsf
@@ -48,7 +48,7 @@
commandButton= ajaxSupport, Command Button, /images/ico_common.gif, /images/cn_commandButton.gif, commandButton.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/commandButton.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxCommandButton.html, /richfaces/commandButton.jsf
commandLink= ajaxSupport, Command Link, /images/ico_common.gif, /images/cn_commandLink.gif, commandLink.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/commandLink.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxCommandLink.html, /richfaces/commandLink.jsf
form= ajaxSupport, Ajax Form, /images/ico_common.gif, /images/cn_ajaxForm.gif, form.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/form.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxForm.html, /richfaces/form.jsf
-support= ajaxSupport, Ajax Support, /images/ico_common.gif, /images/cn_ajaxSupport.gif, support.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/support.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxSupport.html, /richfaces/support.jsf
+support= ajaxSupport, Ajax Support, /images/ico_common.gif, /images/cn_ajaxSupport.gif, support.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/support.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxSupport.html, /richfaces/support.jsf, new
jsFunction= ajaxSupport, JS Function, /images/ico_common.gif, /images/cn_jsFunction.gif, jsFunction.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/jsFunction.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIAjaxFunction.html, /richfaces/jsFunction.jsf
poll= ajaxSupport, Poll, /images/ico_common.gif, /images/cn_poll.gif, poll.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/poll.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPoll.html, /richfaces/poll.jsf
push= ajaxSupport, Push, /images/ico_common.gif, /images/cn_push.gif, push.html, jbossajax4jsf/freezone/docs/tlddoc/a4j/push.html, jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPush.html, /richfaces/push.jsf
@@ -89,5 +89,5 @@
graphValidator=richValidators, \t Graph Validator, \t\t/images/ico_GraphValidator.gif, \t\t/images/cn_GraphValidator.gif, graphValidator.html, jbossrichfaces/freezone/docs/tlddoc/rich/graphValidator.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html, \t\t\t\t\t/richfaces/graphValidator.jsf
stateAPI=richMisc, \t State Manager API, \t\t/images/ico_StateManagerAPI.gif, \t\t/images/cn_StateManagerAPI.gif, ArchitectureOverview.html\#statemanagerapi, jbossrichfaces/freezone/docs/tlddoc/rich/graphValidator.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html, \t\t\t\t\t/richfaces/stateAPI.jsf
extendedDataTable= richDataIterators, Extended Data Table, /images/ico_ExtendedDataTable.gif, /images/cn_ExtendedDataTable.gif, extendedDataTable.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html, /richfaces/extendedDataTable.jsf
-editor= richInputs, Editor, /images/ico_Editor.gif, /images/cn_Editor.gif, editor.html, jbossrichfaces/freezone/docs/tlddoc/rich/editor.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEditor.html, /richfaces/editor.jsf
-queue= ajaxSupport, Queue, /images/ico_common.gif, /images/cn_Queue.gif, Queue.html, jbossrichfaces/freezone/docs/tlddoc/rich/queue.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIQueue.html, /richfaces/queue.jsf
+editor=richInputs, Editor, /images/ico_Editor.gif, /images/cn_Editor.gif, editor.html, jbossrichfaces/freezone/docs/tlddoc/rich/editor.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEditor.html, /richfaces/editor.jsf, new
+queue=ajaxSupport, Queue, /images/ico_common.gif, /images/cn_Queue.gif, Queue.html, jbossrichfaces/freezone/docs/tlddoc/rich/queue.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIQueue.html, /richfaces/queue.jsf, new
Modified: trunk/samples/richfaces-demo/src/main/webapp/css/common.css
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-12-24 15:56:36 UTC (rev 12009)
@@ -223,6 +223,9 @@
background-color : #ACBECE;
padding-left : 10px
}
+.panel_menu table * .bold{
+ font-weight:bold;
+}
.panel_menu table .unactive .text{
font-family : verdana;
font-size : 11px;
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/editTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/editTable.xhtml 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/editTable.xhtml 2008-12-24 15:56:36 UTC (rev 12009)
@@ -77,7 +77,7 @@
</a4j:region>
</h:form>
- <rich:modalPanel id="editPanel" autosized="true">
+ <rich:modalPanel id="editPanel" autosized="true" width="450">
<f:facet name="header">
<h:outputText value="Edit Current Car" />
</f:facet>
@@ -90,20 +90,23 @@
</h:panelGroup>
</f:facet>
<h:form>
+ <h:panelGrid columns="1">
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid columns="2">
- <h:outputText value="Make" />
+ <h:outputText value="Make"/>
<h:inputText value="#{dataTableScrollerBean.currentItem.make}" />
<h:outputText value="Model" />
<h:inputText value="#{dataTableScrollerBean.currentItem.model}" />
<h:outputText value="Price" />
- <h:inputText value="#{dataTableScrollerBean.currentItem.price}" />
+ <h:inputText value="#{dataTableScrollerBean.currentItem.price}" label="Price"/>
</h:panelGrid>
+ <rich:message showSummary="true" showDetail="false" for="price"/>
</a4j:outputPanel>
<a4j:commandButton value="Store"
action="#{dataTableScrollerBean.store}"
reRender="make, model, price"
- oncomplete="#{rich:component('editPanel')}.hide();" />
+ oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('editPanel')}.hide();" />
+ </h:panelGrid>
</h:form>
</rich:modalPanel>
<rich:modalPanel id="deletePanel" autosized="true">
Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/include/components-group.xhtml 2008-12-24 15:56:36 UTC (rev 12009)
@@ -10,7 +10,7 @@
<a4j:repeat var="component" value="#{components}">
<tr class="#{component.current?'active':'unactive'}" onmouseover="this.className='active'" onmouseout="this.className='#{component.current?'active':'unactive'}'">
<td class="ico"><h:graphicImage value="#{component.iconImage}" width="16" height="16" alt="" border="0" /></td>
- <td class="text" width="100%">
+ <td class="text #{component.newComponent?'bold':''}" width="100%">
<h:outputLink style="display:block;height:20px" value="#{component.contextRelativeDemoLocation}">
<span style="display:block;padding-top:3px;text-decoration : none; color : #000000;">
#{component.name}
Modified: trunk/samples/richfaces-demo/src/main/webapp/welcome.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/welcome.xhtml 2008-12-24 15:50:48 UTC (rev 12008)
+++ trunk/samples/richfaces-demo/src/main/webapp/welcome.xhtml 2008-12-24 15:56:36 UTC (rev 12009)
@@ -24,6 +24,10 @@
or component set selected in the left-hand sidebar, you can see it in action. Also, you can immediately see the effect of predefined
skins on the application whole look-and-feel.
</p>
+ <p class="note">
+ Components which names marked with bold text in left-hand sidebar was introduced
+ in latest official GA or the component page has new examples inside.
+ </p>
</ui:define>
</ui:composition>
</html>
16 years, 9 months
JBoss Rich Faces SVN: r12008 - trunk/ui/dataTable/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-24 10:50:48 -0500 (Wed, 24 Dec 2008)
New Revision: 12008
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-3019
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-24 15:11:51 UTC (rev 12007)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-24 15:50:48 UTC (rev 12008)
@@ -44,6 +44,7 @@
import org.richfaces.component.Column;
import org.richfaces.component.Row;
import org.richfaces.component.UIDataTable;
+import org.richfaces.component.util.FormUtil;
import org.richfaces.component.util.ViewUtil;
import org.richfaces.model.Ordering;
import org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc;
@@ -150,7 +151,14 @@
ResponseWriter writer = context.getResponseWriter();
UIComponent header = table.getHeader();
boolean columnFacetPresent = isColumnFacetPresent(table, "header");
- boolean isFilterByPresent = isHeaderFactoryColumnAttributePresent(table, "filterBy");
+ boolean isFilterByPresent = isHeaderFactoryColumnAttributePresent(table, "filterBy");
+ boolean isSortingPresent = isHeaderFactoryColumnAttributePresent(table, "sortBy")
+ || isHeaderFactoryColumnAttributePresent(table, "comparator");
+
+ if (isFilterByPresent || isSortingPresent) {
+ FormUtil.throwEnclFormReqExceptionIfNeed(context, table);
+ }
+
Iterator<UIComponent> colums = table.columns();
16 years, 9 months
JBoss Rich Faces SVN: r12007 - in trunk/ui: editor/src/main/config/component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-24 10:11:51 -0500 (Wed, 24 Dec 2008)
New Revision: 12007
Modified:
trunk/ui/combobox/src/main/config/component/combobox.xml
trunk/ui/editor/src/main/config/component/editor.xml
trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
trunk/ui/orderingList/src/main/config/component/orderinglist.xml
trunk/ui/pickList/src/main/config/component/picklist.xml
Log:
https://jira.jboss.org/jira/browse/RF-5294
Modified: trunk/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/ui/combobox/src/main/config/component/combobox.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/combobox/src/main/config/component/combobox.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -273,6 +273,11 @@
replacing any message that comes from the validator
</description>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
&html_input_attributes;
Modified: trunk/ui/editor/src/main/config/component/editor.xml
===================================================================
--- trunk/ui/editor/src/main/config/component/editor.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/editor/src/main/config/component/editor.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -192,5 +192,10 @@
</description>
<defaultvalue>"modal"</defaultvalue>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</component>
</components>
Modified: trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml
===================================================================
--- trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/inplaceInput/src/main/config/component/inplaceinput.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -267,7 +267,13 @@
A ValueExpression enabled attribute that, if present, will be used as the text of the validator message, replacing any message that comes from the validator
</description>
</property>
- &html_events;
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
+
+ &html_events;
&ui_input_attributes;
<property hidden="true">
<name>localValueSet</name>
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -367,6 +367,11 @@
<name>valid</name>
<classname>boolean</classname>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</properties>
</component>
</components>
Modified: trunk/ui/listShuttle/src/main/config/component/listShuttle.xml
===================================================================
--- trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/listShuttle/src/main/config/component/listShuttle.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -509,5 +509,10 @@
<description>CSS class for remove control</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</component>
</components>
Modified: trunk/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -327,5 +327,10 @@
Stores active item
</description>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</component>
</components>
Modified: trunk/ui/pickList/src/main/config/component/picklist.xml
===================================================================
--- trunk/ui/pickList/src/main/config/component/picklist.xml 2008-12-24 13:16:45 UTC (rev 12006)
+++ trunk/ui/pickList/src/main/config/component/picklist.xml 2008-12-24 15:11:51 UTC (rev 12007)
@@ -232,6 +232,11 @@
<description>HTML: script expression; the element lost the focus</description>
</property>
+ <property>
+ <name>label</name>
+ <classname>java.lang.String</classname>
+ <description>A localized user presentable name for this component.</description>
+ </property>
</properties>
</component>
16 years, 9 months
JBoss Rich Faces SVN: r12006 - in trunk/docs/migrationguide/en/src/main/docbook: included and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-12-24 08:16:45 -0500 (Wed, 24 Dec 2008)
New Revision: 12006
Removed:
trunk/docs/migrationguide/en/src/main/docbook/included/asClientId.xml
trunk/docs/migrationguide/en/src/main/docbook/included/panelGridClass.xml
Modified:
trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
trunk/docs/migrationguide/en/src/main/docbook/master.xml
Log:
RF-3048 - Migration issues were added
Deleted: trunk/docs/migrationguide/en/src/main/docbook/included/asClientId.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/included/asClientId.xml 2008-12-24 12:17:19 UTC (rev 12005)
+++ trunk/docs/migrationguide/en/src/main/docbook/included/asClientId.xml 2008-12-24 13:16:45 UTC (rev 12006)
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<section id="asClientId" role="new">
- <?dbhtml filename="asClientId.html"?>
- <sectioninfo>
- <keywordset>
- <keyword>clientId</keyword>
- <keyword>AS</keyword>
- </keywordset>
- </sectioninfo>
- <title></title>
- <!--section>
- <title>Description</title>
- <para>
-
- </para>
- </section-->
- <section>
- <title>Links</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="http://jira.jboss.org/jira/browse/RF-5088">Jira</ulink>
- </para>
- </listitem>
- <listitem>
- <para>
- <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=144620&a...">RichFaces Forum</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- <!--section>
- <title>How to reproduce</title>
- <para>
-
- </para>
- </section>
- <section>
- <title>Causes</title>
- <para>
-
- </para>
- </section>
-
- <section>
- <title>Workarounds</title>
- <para>
-
- </para>
- </section-->
-</section>
Modified: trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml 2008-12-24 12:17:19 UTC (rev 12005)
+++ trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml 2008-12-24 13:16:45 UTC (rev 12006)
@@ -7,13 +7,13 @@
<keyword>ajax</keyword>
</keywordset>
</sectioninfo>
- <title>Ajax request calls encode() method of <rich:dataTable> even if it is not necessary</title>
+ <title>Ajax request calls encode() methods of <rich:dataTable> even if it is not necessary</title>
<section>
<title>Description</title>
<para>
Any Ajax request reloads the list that is related to the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component even if the Ajax request is related to another bean.
-It happens because the Ajax request checks whether the <emphasis role="bold"><property><rich:dataTable></property></emphasis> has nested <emphasis role="bold"><property><h:outputPanel></property></emphasis> or <emphasis role="bold"><property><h:messages></property></emphasis> components that should be updated.
-If there are no <emphasis role="bold"><property><h:outputPanel></property></emphasis>, <emphasis role="bold"><property><h:messages></property></emphasis> components inside the <emphasis role="bold"><property><rich:dataTable></property></emphasis> is not updated, but anyway the <code>encode()</code> method is called by the Ajax request.
+It happens because the Ajax request checks whether the <emphasis role="bold"><property><rich:dataTable></property></emphasis> has nested <emphasis role="bold"><property><rich:outputPanel></property></emphasis> or <emphasis role="bold"><property><rich:messages></property></emphasis> components that should be updated.
+If there are no <emphasis role="bold"><property><rich:outputPanel></property></emphasis>, <emphasis role="bold"><property><rich:messages></property></emphasis> components inside the <emphasis role="bold"><property><rich:dataTable></property></emphasis> will not be updated, but anyway the <code>encode()</code> methods is called by the Ajax request.
</para>
</section>
<section>
Deleted: trunk/docs/migrationguide/en/src/main/docbook/included/panelGridClass.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/included/panelGridClass.xml 2008-12-24 12:17:19 UTC (rev 12005)
+++ trunk/docs/migrationguide/en/src/main/docbook/included/panelGridClass.xml 2008-12-24 13:16:45 UTC (rev 12006)
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<section id="panelGridClass" role="new">
- <?dbhtml filename="panelGridClass.html"?>
- <sectioninfo>
- <keywordset>
- <keyword>panelGrid</keyword>
- <keyword>class</keyword>
- </keywordset>
- </sectioninfo>
- <title><h:panelGrid>: column classes are encoded in a wrong way</title>
- <section>
- <title>Description</title>
- <para>
- The column classes of <emphasis role="bold"><property><h:panelGrid></property></emphasis> are encoded in a wrong way: only the first <emphasis role="bold"><property><td></property></emphasis> element in a table has the class specified in the <emphasis><property>"columnClasses"</property></emphasis> attribute.
- </para>
- </section>
- <section>
- <title>Links</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="https://jira.jboss.org/jira/browse/RF-5424">Jira</ulink>
- </para>
- </listitem>
- <listitem>
- <para>
- <ulink url="https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=900">JavaServer Faces issues</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- <section>
- <title>How to reproduce</title>
- <para>
- Place <code><h:panelGrid columns="3" columnClasses="cell"></code> on a page and specify styles for the <code>.cell</code> class. As the result only the first <emphasis role="bold"><property><td></property></emphasis> in a table has this class.
- </para>
- </section>
- <section>
- <title>Causes</title>
- <para>
- It is a defect in JSF-RI 1.2.10 and JSF-RI 1.2_11.
- </para>
- </section>
-
- <section>
- <title>Workarounds</title>
- <para>
- The solution is to use as many <emphasis><property>"columnClasses"</property></emphasis> attributes as columns in the <emphasis role="bold"><property><h:panelGrid></property></emphasis>.
- </para>
- </section>
-</section>
Modified: trunk/docs/migrationguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/master.xml 2008-12-24 12:17:19 UTC (rev 12005)
+++ trunk/docs/migrationguide/en/src/main/docbook/master.xml 2008-12-24 13:16:45 UTC (rev 12006)
@@ -21,8 +21,7 @@
<!ENTITY myfaces SYSTEM "included/myfaces.xml">
<!ENTITY seamMultipartFilter SYSTEM "included/seamMultipartFilter.xml">
- <!ENTITY asClientId SYSTEM "included/asClientId.xml">
- <!ENTITY panelGridClass SYSTEM "included/panelGridClass.xml">
+
<!ENTITY dataTableAjax SYSTEM "included/dataTableAjax.xml">
]>
@@ -141,36 +140,8 @@
However, <ulink url="http://jira.jboss.com/jira/browse/RF">Jira</ulink> contains all issues
and if you can not find your case there, please, feel free to report it.
</para>
- <section id="MostImportant32to33">
- <?dbhtml filename="MostImportant32to33.html"?>
- <sectioninfo>
- <keywordset>
- <keyword>important</keyword>
- <keyword>issues</keyword>
- </keywordset>
- </sectioninfo>
- <title>Most important issues</title>
- <para>
- Migrating to <property>RichFaces 3.2.x</property> you can encounter
- with malfunction of the components caused by a number of reasons.
- However, most of the problems can be positively solved.
- This section covers the most significant issues you can potentially encounter, providing ways to handle the cases.
- </para>
-&panelGridClass;
+
+
&dataTableAjax;
- </section>
- <section id="ThirdPartyFrameworks32to33">
- <?dbhtml filename="ThirdPartyFrameworks32to33.html"?>
- <sectioninfo>
- <keywordset>
- <keyword>third</keyword>
- <keyword>party</keyword>
- <keyword>frameworks</keyword>
- </keywordset>
- </sectioninfo>
- <title>Issues with compatibility with third party frameworks</title>
- <para>This section covers issues related to compatibility with third party frameworks.</para>
-&asClientId;
- </section>
</chapter>
</book>
16 years, 9 months
JBoss Rich Faces SVN: r12005 - in trunk/test-applications/realworld: ejb/src/main/java/org/richfaces/realworld/service and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-12-24 07:17:19 -0500 (Wed, 24 Dec 2008)
New Revision: 12005
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
trunk/test-applications/realworld/web/src/main/webapp/includes/
trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload/
Removed:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/addComment.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java
trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -97,17 +97,6 @@
*/
public Album() {
}
-
- /**
- * Constructor
- *
- * @param name - name of album
- * @param parent - link for parent album
- */
- public Album(String name) {
- this.name = name;
- //this.parent = parent;
- }
// ********************** Accessor Methods ********************** //
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -18,8 +18,6 @@
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -19,9 +19,6 @@
@In @Out
private User user;
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
- */
public void addAlbum(Album album) {
if(album.getChangedName() != album.getName()){
album.setName(album.getChangedName());
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -16,9 +16,6 @@
@In(value="entityManager")
EntityManager em;
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IMessageAction#sendMessage(org.richfaces.realworld.domain.Message)
- */
public void sendMessage(Message message){
if(message.getOwnerLogin() != null){
User user = (User)em.createQuery("from User u where u.login = :login")
@@ -34,9 +31,6 @@
em.flush();
}
- /* (non-Javadoc)
- * @see org.richfaces.realworld.service.IMessageAction#deleteMessage(org.richfaces.realworld.domain.Message)
- */
public void deleteMessage(Message message){
em.remove(message);
message.getOwner().removeMessage(message);
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -37,19 +37,19 @@
public List<Image> searchImages(String searchPattern, String additionalParams, Map<String, Object> paramMap){
String fullQuery = SEARCH_QUERY_BEGIN + additionalParams + SEARCH_QUERY_END;
Query prepared = prepareQuery(fullQuery, searchPattern, additionalParams, paramMap);
- return initImages(prepared);
+ return prepared.getResultList();
}
public List<Image> popularImages(String additionalParams, Map<String, Object> paramMap){
String fullQuery = SEARCH_RELEVANT_QUERY_BEGIN + additionalParams + SEARCH_POPULAR_QUERY_END;
Query prepared = prepareQuery(fullQuery, null, additionalParams, paramMap);
- return initImages(prepared);
+ return prepared.getResultList();
}
public List<Image> worstImages(String additionalParams, Map<String, Object> paramMap){
String fullQuery = SEARCH_RELEVANT_QUERY_BEGIN + additionalParams + SEARCH_UNPOPULAR_QUERY_END;
Query prepared = prepareQuery(fullQuery, null, additionalParams, paramMap);
- return initImages(prepared);
+ return prepared.getResultList();
}
private Query prepareQuery(String fullQuery ,String searchPattern, String additionalParams,
@@ -70,12 +70,4 @@
prepared.setMaxResults(20);
return prepared;
}
-
- private List<Image> initImages(Query prepared) {
- List<Image> images = prepared.getResultList();
- for(Image image:images){
- image.getAlbum().getOwner().getLogin();
- }
- return images;
- }
}
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-12-24 12:17:19 UTC (rev 12005)
@@ -38,37 +38,37 @@
INSERT INTO Ranks(rank_id, total, hits) VALUES (30, 100, 30);
INSERT INTO Ranks(rank_id, total, hits) VALUES (31, 110, 31);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (1, 'Aston Martin', 'aston_martin.jpg', 'Where is the Batman?', '2008-12-18', 1, 1);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (2, 'Ferrari', 'ferrari_profile.jpg', 'Beauty!', '2008-12-18', 1, 2);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (3, 'Australian supercar', 'holden-efijy-1809.jpg', 'This one glitters in my garage ;)', '2008-12-18', 1, 3);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (4, 'Hulme Supercar', 'hulme_supercar_side_parked.jpg', 'Saw it in Germany in summer 2007', '2008-12-18', 1, 4);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (5, 'Pagani Zonda', 'Pagani_Zonda.jpg', 'The picture is provided by my friend photographer', '2008-12-18', 1, 5);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (6, 'Codatronca (concept)', 'spadaconcept codatronca.jpg', 'Just concept', '2008-12-18', 1, 6);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (7, 'Unknown supercar', 'supercar.jpg', 'Tell me it name if you know', '2008-12-18', 1, 7);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (8, 'Audrey Tautou', 'Audrey_Tautou.jpg', 'Pretty girl!', '2008-12-18', 2, 8);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (9, 'Juliette Binoche', 'Juliette_Binoche.jpg', 'Saw her in "Chocolate" at first', '2008-12-18', 2, 9);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (10, 'Penelope Cruz', 'Penelope_Cruz.jpg', 'Without comments', '2008-12-18', 2, 10);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (11, 'Rihanna', 'Rihanna.jpg', 'Was born in Barbados. True or false?', '2008-12-18', 2, 11);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (12, 'Uma Turman', 'Uma_Turman.jpg', 'Share the delight with Tarantino )', '2008-12-18', 2, 12);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (13, 'Basketball soccer', 'Basketball_soccer.jpg', 'They never saw camera', '2008-12-18', 3, 13);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (14, 'bdysch!!!', 'bdysch!!!.jpg', 'Dermo sluchaetsia', '2008-12-18', 3, 14);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (15, 'Training', 'euro2008_holland_wideweb__470x321,0.jpg', ' ) ', '2008-12-18', 3, 15);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (16, 'Also football', 'flag_football.jpg', 'This is also football, but I do not understand it at all', '2008-12-18', 3, 16);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (17, 'Soccer', 'soccer.jpg', 'Soccer differs from football', '2008-12-18', 3, 17);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (18, 'from birds fly', 'birds_fly.jpg', 'One of the megalopolices', '2008-12-18', 4, 18);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (19, 'Haruki Murakami', 'Haruki_Murakami.jpg', 'World famous aouthor', '2008-12-18', 4, 19);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (20, 'Street fashion', 'Japanese_Street_Fashion.jpg', 'Venture to walk in such in our streets?', '2008-12-18', 4, 20);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (21, 'Kendo Championship', 'Kendo_Championship_2006.jpg', 'Samurais steel alive!', '2008-12-18', 4, 21);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (22, 'Live in peace', 'live_in_piece.jpg', 'The best place for meditation', '2008-12-18', 4, 22);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (23, 'Modern family', 'modern_japanesse_family.jpg', 'Where is his mother?!', '2008-12-18', 4, 23);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (24, 'Zen garden', 'zen-garden_landscape_design.jpg', 'Fen Shui i vsia fignia', '2008-12-18', 4, 24);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (25, 'Sergei Babkin', 'Babkin.jpg', 'Also plays in theatre', '2008-12-18', 5, 25);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (26, 'Bob Marley', 'Bob_Marley.jpg', 'Everyone should know him', '2008-12-18', 5, 26);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (27, 'Infected Mushroom', 'Infected_Mushroom.jpg', 'Famous psyhedelic trance group from Israel', '2008-12-18', 5, 27);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (28, 'Massive Attack', 'massiveAttack.jpg', 'They play theme to "House"', '2008-12-18', 5, 28);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (29, 'Street musician', 'StreetMusician.jpg', 'unknown musician', '2008-12-18', 5, 29);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (30, 'SOAD', 'system-of-a-down.jpg', 'Try not to loose your innervision!', '2008-12-18', 5, 30);
-INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (31, 'Amon Tobin', 'tobin.jpg', 'Brasilian, works in London. Try his "Supermodified2000" album', '2008-12-18', 5, 31);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (1, 'Aston Martin', 'amarkhel/Cars/aston_martin.jpg', 'Where is the Batman?', '2008-12-18', 1, 1);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (2, 'Ferrari', 'amarkhel/Cars/ferrari_profile.jpg', 'Beauty!', '2008-12-18', 1, 2);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (3, 'Australian supercar', 'amarkhel/Cars/holden-efijy-1809.jpg', 'This one glitters in my garage ;)', '2008-12-18', 1, 3);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (4, 'Hulme Supercar', 'amarkhel/Cars/hulme_supercar_side_parked.jpg', 'Saw it in Germany in summer 2007', '2008-12-18', 1, 4);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (5, 'Pagani Zonda', 'amarkhel/Cars/Pagani_Zonda.jpg', 'The picture is provided by my friend photographer', '2008-12-18', 1, 5);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (6, 'Codatronca (concept)', 'amarkhel/Cars/spadaconcept codatronca.jpg', 'Just concept', '2008-12-18', 1, 6);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (7, 'Unknown supercar', 'amarkhel/Cars/supercar.jpg', 'Tell me it name if you know', '2008-12-18', 1, 7);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (8, 'Audrey Tautou', 'amarkhel/Tetki/Audrey_Tautou.jpg', 'Pretty girl!', '2008-12-18', 2, 8);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (9, 'Juliette Binoche', 'amarkhel/Tetki/Juliette_Binoche.jpg', 'Saw her in "Chocolate" at first', '2008-12-18', 2, 9);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (10, 'Penelope Cruz', 'amarkhel/Tetki/Penelope_Cruz.jpg', 'Without comments', '2008-12-18', 2, 10);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (11, 'Rihanna', 'amarkhel/Tetki/Rihanna.jpg', 'Was born in Barbados. True or false?', '2008-12-18', 2, 11);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (12, 'Uma Turman', 'amarkhel/Tetki/Uma_Turman.jpg', 'Share the delight with Tarantino )', '2008-12-18', 2, 12);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (13, 'Basketball soccer', 'root/Football/Basketball_soccer.jpg', 'They never saw camera', '2008-12-18', 3, 13);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (14, 'bdysch!!!', 'root/Football/bdysch!!!.jpg', 'Dermo sluchaetsia', '2008-12-18', 3, 14);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (15, 'Training', 'root/Football/euro2008_holland_wideweb__470x321,0.jpg', ' ) ', '2008-12-18', 3, 15);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (16, 'Also football', 'root/Football/flag_football.jpg', 'This is also football, but I do not understand it at all', '2008-12-18', 3, 16);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (17, 'Soccer', 'root/Football/soccer.jpg', 'Soccer differs from football', '2008-12-18', 3, 17);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (18, 'from birds fly', 'qqqq/Japan/birds_fly.jpg', 'One of the megalopolices', '2008-12-18', 4, 18);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (19, 'Haruki Murakami', 'qqqq/Japan/Haruki_Murakami.jpg', 'World famous aouthor', '2008-12-18', 4, 19);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (20, 'Street fashion', 'qqqq/Japan/Japanese_Street_Fashion.jpg', 'Venture to walk in such in our streets?', '2008-12-18', 4, 20);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (21, 'Kendo Championship', 'qqqq/Japan/Kendo_Championship_2006.jpg', 'Samurais steel alive!', '2008-12-18', 4, 21);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (22, 'Live in peace', 'qqqq/Japan/live_in_piece.jpg', 'The best place for meditation', '2008-12-18', 4, 22);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (23, 'Modern family', 'qqqq/Japan/modern_japanesse_family.jpg', 'Where is his mother?!', '2008-12-18', 4, 23);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (24, 'Zen garden', 'qqqq/Japan/zen-garden_landscape_design.jpg', 'Fen Shui i vsia fignia', '2008-12-18', 4, 24);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (25, 'Sergei Babkin', 'qqqq/Music/Babkin.jpg', 'Also plays in theatre', '2008-12-18', 5, 25);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (26, 'Bob Marley', 'qqqq/Music/Bob_Marley.jpg', 'Everyone should know him', '2008-12-18', 5, 26);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (27, 'Infected Mushroom', 'qqqq/Music/Infected_Mushroom.jpg', 'Famous psyhedelic trance group from Israel', '2008-12-18', 5, 27);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (28, 'Massive Attack', 'qqqq/Music/massiveAttack.jpg', 'They play theme to "House"', '2008-12-18', 5, 28);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (29, 'Street musician', 'qqqq/Music/StreetMusician.jpg', 'unknown musician', '2008-12-18', 5, 29);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (30, 'SOAD', 'qqqq/Music/system-of-a-down.jpg', 'Try not to loose your innervision!', '2008-12-18', 5, 30);
+INSERT INTO images(image_id, name, path, description, created, img_album_id, rank_id) VALUES (31, 'Amon Tobin', 'qqqq/Music/tobin.jpg', 'Brasilian, works in London. Try his "Supermodified2000" album', '2008-12-18', 5, 31);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (1, 'Cool', 1);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (2, 'Cool2', 1);
INSERT INTO metatags(metatag_id, tag, image_metatag_id) VALUES (3, 'richfaces', 2);
@@ -94,7 +94,7 @@
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (2, '1985-01-08', 'Hello I am user2', 1, 3);
INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme, friendshipRequest) VALUES (1, '1985-01-08', 'Hello I am user', 2, 1, false, 'Hello, amarkhel', false);
INSERT INTO messages(message_id, date, message, author_id, owner_id, readed, theme, friendshipRequest) VALUES (2, '1985-01-08', 'Please, add meto your friends', 3, 1, false, 'Request for friendship', true);
-INSERT INTO shared_albums(album_id, user_id) VALUES(1, 1);
-INSERT INTO shared_albums(album_id, user_id) VALUES(2, 1);
+INSERT INTO shared_albums(album_id, user_id) VALUES(4, 1);
+INSERT INTO shared_albums(album_id, user_id) VALUES(5, 1);
INSERT INTO user_friends(user1_id, user2_id) VALUES(1, 2);
INSERT INTO friendship_requests(REQUEST_ID, USER_ID, FRIEND_ID) VALUES(1, 3, 1);
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -73,14 +73,14 @@
}
}
- public void renameDirectory(String directoryOld, String directoryNew) throws Exception {
+ public void renameDirectory(String directoryOld, String directoryNew){
String fullPath = getAbsolutePath(directoryOld);
File fileOld = new File(fullPath);
File fileNew = new File(getUploadRoot() + directoryNew);
createDirectoryIfNotExist(directoryNew);
if(fileNew.exists())
if( fileNew.isDirectory() ){
- throw new Exception("exc");
+ //throw new Exception("exc");
}else{
fileNew.delete();
}
@@ -159,4 +159,15 @@
private String getAbsolutePath(String fileName) {
return getUploadRoot() + fileName;
}
+
+ public String transformToServerPath(String filename){
+ String[] res = filename.split("/");
+ StringBuilder sb = new StringBuilder();
+ sb.append(res[0]);
+ for(int i = 1; i < res.length; i++){
+ sb.append(this.getFileSeparator() + res[i]);
+ }
+ String string = sb.toString();
+ return string;
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -35,9 +35,9 @@
import org.jboss.seam.core.Events;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
-import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.util.SelectionHelper;
/**
* @author $Autor$
@@ -48,9 +48,9 @@
public class FileUploadBean implements Serializable{
- private static final String SAMPLE_NAME = "Sample Name";
+ @In("#{messages['samplename']}") private String SAMPLE_NAME;
- private static final String SAMPLE_DESCRIPTION = "Sample Description";
+ @In("#{messages['sampledesc']}") private String SAMPLE_DESCRIPTION;
private static final String ADD_IMAGE_EVENT = "addImage";
@@ -61,12 +61,12 @@
@In(create=true) @Out
FileWrapper fileWrapper;
-
- @In(required=false)
- private Album selectedAlbum;
@In(create=true)
private FileManager fileManager;
+
+ @In @Out
+ private SelectionHelper selectionHelper;
public synchronized void listener(UploadEvent event) throws Exception{
UploadItem item = event.getUploadItem();
@@ -78,9 +78,9 @@
image.setCreated(new Date());
image.setDescription(SAMPLE_DESCRIPTION);
image.setName(SAMPLE_NAME);
- image.setPath(item.getFileName());
- image.setAlbumName(selectedAlbum.getName());
- image.setAlbum(selectedAlbum);
+ image.setPath(user.getLogin() + "/" + selectionHelper.getSelectedAlbum().getName() + "/" + item.getFileName());
+ image.setAlbumName(selectionHelper.getSelectedAlbum().getName());
+ image.setAlbum(selectionHelper.getSelectedAlbum());
file.setImage(image);
fileWrapper.getFiles().add(file);
}
@@ -102,7 +102,7 @@
for(FileItem file:fileWrapper.getFiles()){
if(file.isSelected()){
//Save file to disk
- String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+ String fileName = fileManager.transformToServerPath(file.getImage().getPath());
try {
fileManager.addImage(fileName , file.getData());
} catch (IOException e) {
@@ -121,7 +121,7 @@
public void storeAll() {
for(FileItem file:fileWrapper.getFiles()){
//Save file to disk
- String fileName = user.getLogin() + fileManager.getFileSeparator() + selectedAlbum.getName() + fileManager.getFileSeparator() + file.getImage().getPath();
+ String fileName = fileManager.transformToServerPath(file.getImage().getPath());
try {
fileManager.addImage(fileName , file.getData());
} catch (IOException e) {
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -55,7 +55,7 @@
public synchronized void paintSearchImage(OutputStream stream, Object object) throws IOException {
Image painted = (Image)object;
- File image = fileManager.getImage(painted.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + painted.getAlbum().getName()+ fileManager.getFileSeparator() + painted.getPath());
+ File image = fileManager.getImage(fileManager.transformToServerPath(painted.getPath()));
InputStream paintData = null;
byte[] data = new byte[(int)image.length() - 1];
FileInputStream fileInputStream = null;
@@ -102,7 +102,7 @@
return;
}
Image image = (Image)data;
- File imageResource = fileManager.getImage(image.getAlbum().getOwner().getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath());
+ File imageResource = fileManager.getImage(fileManager.transformToServerPath(image.getPath()));;
if (imageResource != null) {
FileInputStream fileInputStream = new FileInputStream(imageResource);
BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,105 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.manager;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IAlbumAction;
+import org.richfaces.realworld.tree.TreeAlbumItem;
+import org.richfaces.realworld.tree.TreeRootItem;
+import org.richfaces.realworld.util.SelectionHelper;
+
+@Name("albumManager")
+(a)Scope(ScopeType.CONVERSATION)
+public class AlbumManager {
+
+ @In(create=true, required=true)
+ private IAlbumAction albumAction;
+
+ @In(create=true) @Out TreeRootItem treeRoot;
+
+ @In(create=true, required=true) @Out
+ private Album album;
+
+ @In
+ private User user;
+
+ @In(create=true)
+ FileManager fileManager;
+
+ @In @Out
+ private SelectionHelper selectionHelper;
+
+ public void addAlbum(){
+ albumAction.addAlbum(album);
+ treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
+ TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
+ treeRoot.addAlbumToTree(albumItem);
+ fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
+ selectionHelper.setSelectedImage(null);
+ selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+
+ }
+
+ public void editAlbum(Album album){
+ boolean nameChanged = !album.getName().equals(album.getChangedName());
+ if(nameChanged){
+ String directoryOld = user.getLogin() + fileManager.getFileSeparator() + album.getName();
+ String directoryNew = user.getLogin() + fileManager.getFileSeparator() + album.getChangedName();
+ try {
+ fileManager.renameDirectory(directoryOld, directoryNew);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ album.setName(album.getChangedName());
+ album.setChangedName(null);
+ }
+ albumAction.editAlbum(album);
+ treeRoot.updateChild(album);
+ }
+
+ public void deleteAlbum(Album album){
+ String albumName = album.getName();
+ albumAction.deleteAlbum(album);
+ SelectItem item = treeRoot.getSelectItemByName(album.getName());
+ treeRoot.getAvailableAlbums().remove(item);
+ treeRoot.removeChild(album.getId());
+ fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
+ selectionHelper.setSelectedAlbum(user.getChildAlbums().get(0));
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+ }
+
+ public void updateSelectedAlbum(){
+ selectionHelper.setSelectedAlbum(user.getAlbumByName(selectionHelper.getSelectedAlbum().getName()));
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+ selectionHelper.setSelectedImageIndex(1);
+ selectionHelper.setUserAlbumSelected(true);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,157 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Identity;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.AvatarUpload;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.SelectionHelper;
+
+@Name("authenticator")
+(a)Scope(ScopeType.CONVERSATION)
+public class Authenticator implements Serializable
+{
+
+ @In("#{messages['user.exist']}") private String USER_WITH_THIS_LOGIN_ALREADY_EXIST;
+
+ @In("#{messages['user.confirm.error']}") private String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
+
+ private static final String REGISTER_LOGIN_NAME_ID = "register:loginName";
+
+ private static final String REGISTER_CONFIRM_PASSWORD_ID = "register:confirmPassword";
+
+ private static final String INDEX_OUTCOME = "index";
+
+ private static final String ADMIN_ROLE = "admin";
+
+ private static final String GUEST_ROLE = "guest";
+
+ private static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
+
+ private static final long serialVersionUID = -4585673256547342140L;
+
+ @Logger Log log;
+
+ @In Identity identity;
+
+ @In FacesMessages facesMessages;
+
+ @In(create = true)
+ IUserAction userAction;
+
+ @In(create = true)
+ FileManager fileManager;
+
+ @In(create = true)
+ AvatarUpload avatarUpload;
+
+ @In(create=true) @Out
+ private SelectionHelper selectionHelper;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAuthenticator#authenticate()
+ */
+ public boolean authenticate()
+ {
+ if(null == identity.getUsername() || identity.getUsername().equals("")){
+ identity.addRole(GUEST_ROLE);
+ Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.SEARCH);
+ userAction.loginAnonymous();
+ return true;
+ }
+ try{
+ User user = userAction.login(identity.getUsername(), identity.getPassword());
+ if(user != null){
+ identity.addRole(ADMIN_ROLE);
+ if(!fileManager.isDirectoryPresent(identity.getUsername())){
+ fileManager.addDirectory(identity.getUsername());
+ }
+ if(user.getChildAlbums().size() > 0){
+ selectionHelper.setSelectedAlbum(user.getChildAlbums().get(0));
+ if(selectionHelper.getSelectedAlbum().getImages().size() > 0){
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+ }
+ }
+ Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
+ return true;
+ }
+ }catch(Exception nre){
+ facesMessages.add("Invalid login or password");
+ return false;
+ }
+ return false;
+ }
+
+ @End
+ public String register(User user){
+ boolean errorHappened = false;
+ if(!user.getPassword().equals(user.getConfirmPassword())){
+ UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
+ UIComponent component = root.findComponent(REGISTER_CONFIRM_PASSWORD_ID);
+ FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD , CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD));
+ errorHappened = true;
+ }
+ if(userAction.isUserExist(user.getLogin())){
+ UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
+ UIComponent component = root.findComponent(REGISTER_LOGIN_NAME_ID);
+ FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, USER_WITH_THIS_LOGIN_ALREADY_EXIST , USER_WITH_THIS_LOGIN_ALREADY_EXIST));
+ errorHappened = true;
+ }
+ if(errorHappened){
+ return "";
+ }
+ userAction.register(user);
+ if(avatarUpload.getAvatarItem() != null){
+ user.setAvatarPath(avatarUpload.getAvatarItem().getImage().getName());
+ fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + "avatars");
+ fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + "avatars");
+ try {
+ fileManager.addImage(user.getLogin() + fileManager.getFileSeparator() + "avatars" + fileManager.getFileSeparator() + user.getAvatarPath(), avatarUpload.getAvatarItem().getData());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return INDEX_OUTCOME;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,134 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.util.Date;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Comment;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IImageAction;
+import org.richfaces.realworld.tree.TreeAlbumItem;
+import org.richfaces.realworld.tree.TreeImageItem;
+import org.richfaces.realworld.tree.TreeRootItem;
+import org.richfaces.realworld.util.RatingBinder;
+import org.richfaces.realworld.util.SelectionHelper;
+
+@Name("imageManager")
+(a)Scope(ScopeType.CONVERSATION)
+public class ImageManager {
+
+ @In(create=true, required=true)
+ private IImageAction imageAction;
+
+ @In(create=true)
+ FileManager fileManager;
+
+ @In(create=true) @Out TreeRootItem treeRoot;
+
+ @In(create=true) @Out
+ private SelectionHelper selectionHelper;
+
+ @In
+ private User user;
+
+ @In(create=true, required=true)
+ private RatingBinder ratingBinder;
+
+ public void deleteImage(Image image){
+ int index = image.getAlbum().getIndex(image);
+ String albumName = image.getAlbum().getName();
+ String imagePath = image.getPath();
+ TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
+ imageAction.deleteImage(image);
+ parent.removeChild(image.getId());
+ fileManager.deleteImage(fileManager.transformToServerPath(imagePath));
+ if(selectionHelper.getSelectedAlbum().getImages().size() > index){
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index));
+ }else{
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index-1));
+ }
+ }
+
+ public void editImage(Image image){
+ TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
+ boolean parentChanged = !parent.getAlbum().getName().equals(image.getAlbumName());
+
+ if(parentChanged){
+ parent.removeChild(image.getId());
+ TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+ TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+ albumItem.addChild(image.getId(), imageItem);
+ String fileNameOld = fileManager.transformToServerPath(image.getPath());
+ int lastIndexOf = image.getPath().lastIndexOf("/");
+ String prevPathEnd = image.getPath().substring(lastIndexOf);
+ String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + prevPathEnd;
+ String newPath = user.getLogin() + "/" + image.getAlbumName() + "/" + prevPathEnd;
+ image.setPath(newPath);
+ fileManager.renameImage(fileNameOld, fileNameNew);
+ selectionHelper.setSelectedImage(imageItem.getImage());
+ selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+ }else{
+ TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
+ imageItem.setImage(image);
+ }
+ imageAction.editImage(image, parentChanged);
+ }
+
+ @Observer("addImage")
+ public void addImage(Image image) {
+ imageAction.addImage(image);
+ TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+ TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+ albumItem.addChild(image.getId(), imageItem);
+ selectionHelper.setSelectedImage(imageItem.getImage());
+ selectionHelper.setSelectedAlbum(albumItem.getAlbum());
+ }
+
+
+ public void editComment(Comment comment) {
+ imageAction.editComment(comment);
+ }
+
+ public void addComment(Comment comment) {
+ imageAction.addComment(comment);
+ }
+
+ public void addAutoComment(Image image) {
+ Comment comment = new Comment();
+ comment.setAuthor(user);
+ comment.setDate(new Date());
+ comment.setImage(image);
+ comment.setMessage("+1");
+ imageAction.addComment(comment);
+ }
+
+ public void vote(Image image){
+ imageAction.vote(image, (Long)Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -0,0 +1,148 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.manager;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.FriendshipRequest;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Message;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.IMessageAction;
+import org.richfaces.realworld.service.IUserAction;
+import org.richfaces.realworld.util.SelectionHelper;
+
+@Name("userManager")
+(a)Scope(ScopeType.CONVERSATION)
+public class UserManager implements Serializable{
+
+ @In("#{messages['addedtofriends']}") private String ADDED_TO_FRIENDS_MESSAGE_THEME;
+ @In("#{messages['addedtofriendsby']}") private String ADDED_TO_FRIENDS_MESSAGE;
+ @In("#{messages['removedfromfriends']}") private String REMOVED_FROM_FRIENDS_MESSAGE_THEME;
+ @In("#{messages['removedfromfriendsby']}") private String YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE;
+
+ private static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
+
+ private static final long serialVersionUID = 6027103521084558931L;
+
+ @In
+ private User user;
+
+ private Long countUnreadedMessages;
+
+ @In(create=true, required=true)
+ private IMessageAction messageAction;
+
+ @In(create=true, required=true)
+ private IUserAction userAction;
+
+ @In(create=true) @Out
+ private SelectionHelper selectionHelper;
+
+ public List<String> availableUserLogins(Object suggest){
+ List<String> suggestions = userAction.getUsers((String)suggest);
+ return suggestions;
+ }
+
+ public void sendMessage(Message message) {
+ messageAction.sendMessage(message);
+ }
+
+ public Long getCountUnreadedMessages() {
+ if(null == countUnreadedMessages){
+ countUnreadedMessages = userAction.countNotReadedMessages(user);
+ }
+ return countUnreadedMessages != null ? countUnreadedMessages : 0;
+ }
+
+ public void setCountUnreadedMessages(Long count){
+ countUnreadedMessages = null;
+ }
+
+ public void removeFromFriends(User owner, User removed){
+ userAction.removeFromFriends(owner, removed);
+ Message message = new Message();
+ message.setAuthor(user);
+ message.setDate(new Date());
+ message.setOwner(removed);
+ message.setFriendshipRequest(false);
+ message.setReaded(false);
+ message.setMessage(YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE+ user.getLogin());
+ message.setTheme(REMOVED_FROM_FRIENDS_MESSAGE_THEME);
+ messageAction.sendMessage(message);
+ }
+
+ public void addToFriends(User friend){
+ FriendshipRequest request = friend.getFriendshipRequest(user, friend);
+ if(request != null){
+ if(!userAction.friendExist(user, friend)){
+ userAction.addFriend(user, friend, request);
+ Message message = new Message();
+ message.setAuthor(user);
+ message.setDate(new Date());
+ message.setOwner(friend);
+ message.setFriendshipRequest(false);
+ message.setReaded(false);
+ message.setMessage(ADDED_TO_FRIENDS_MESSAGE+ user.getLogin());
+ message.setTheme(ADDED_TO_FRIENDS_MESSAGE_THEME);
+ messageAction.sendMessage(message);
+ }
+ }/*else{
+ throw new Exception("This user won't be your friend!");
+ }*/
+ }
+
+ public void addToSharedAlbums(Image image){
+ userAction.addSharedAlbum(image.getAlbum());
+ }
+
+ public void removeFromSharedAlbums(Album album){
+ userAction.removeFromSharedAlbums(user, album);
+ }
+
+ public void showSharedAlbum(Image image){
+ Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
+ selectionHelper.setSelectedAlbum(image.getAlbum());
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+ selectionHelper.setSelectedImageIndex(1);
+ selectionHelper.setUserAlbumSelected(false);
+ }
+
+ public void markAsReaded(Message message){
+ messageAction.markAsReaded(message);
+ this.setCountUnreadedMessages(null);
+ }
+
+ public void deleteMessage(Message message){
+ messageAction.deleteMessage(message);
+ this.setCountUnreadedMessages(null);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -41,14 +41,11 @@
@Scope(ScopeType.CONVERSATION)
public class SearchBean implements Serializable {
- private static final String EQUALS_CHOICE = "Equals";
+ @In("#{messages['equals']}") private String EQUALS_CHOICE;
+ @In("#{messages['less']}") private String LESS_CHOICE;
+ @In("#{messages['more']}") private String MORE_CHOICE;
+ @In("#{messages['nomatter']}") private String NO_MATTER_CHOICE;
- private static final String LESS_CHOICE = "Less";
-
- private static final String MORE_CHOICE = "More";
-
- private static final String NO_MATTER_CHOICE = "No Matter";
-
private static final String EQUALS = "= ";
private static final String LESSTHEN = "< ";
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,291 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.tree;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import javax.faces.model.SelectItem;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Comment;
-import org.richfaces.realworld.domain.FriendshipRequest;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.Message;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.navigation.NavigationEnum;
-import org.richfaces.realworld.service.IAlbumAction;
-import org.richfaces.realworld.service.IImageAction;
-import org.richfaces.realworld.service.IMessageAction;
-import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.util.RatingBinder;
-import org.richfaces.realworld.util.SelectionHelper;
-
-@Name("treeActionManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class TreeActionManager implements Serializable{
-
- private static final String ADDED_TO_FRIENDS_MESSAGE_THEME = "You are were added to friends";
-
- private static final String ADDED_TO_FRIENDS_MESSAGE = "You are were added to friends by User ";
-
- private static final String REMOVED_FROM_FRIENDS_MESSAGE_THEME = "You are were removed from friends";
-
- private static final String YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE = "You are were removed from friends of ";
-
- private static final long serialVersionUID = 6027103521084558931L;
-
- @In
- private User user;
-
- @In(create=true, required=true)
- private IAlbumAction albumAction;
-
- @In(create=true, required=true)
- private RatingBinder ratingBinder;
-
- @In(create=true, required=true)
- private IMessageAction messageAction;
-
- @In(create=true, required=true)
- private IImageAction imageAction;
-
- @In(create=true, required=true)
- private IUserAction userAction;
-
- @In(create=true, required=true) @Out
- private Album album;
-
- @In(create=true) @Out
- private SelectionHelper selectionHelper;
-
- @In(create=true)
- FileManager fileManager;
-
- @In(create=true) @Out(required=false)
- private Image selectedImage;
-
- @In(create=true) @Out
- private Album selectedAlbum;
-
- @In(create=true) TreeSelectionManager treeSelectionManager;
-
- @In(create=true) @Out TreeRootItem treeRoot;
-
- private String selectedAlbumName;
-
- public String getSelectedAlbumName() {
- return selectedAlbumName;
- }
-
- public void setSelectedAlbumName(String selectedAlbumName) {
- this.selectedAlbumName = selectedAlbumName;
- }
-
- public void addAlbum(){
- albumAction.addAlbum(album);
- treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
- TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
- treeRoot.addAlbumToTree(albumItem);
- fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
- selectedImage = null;
- selectedAlbum = albumItem.getAlbum();
-
- }
-
- public List<String> availableUserLogins(Object suggest){
- List<String> suggestions = userAction.getUsers((String)suggest);
- return suggestions;
- }
-
- public void editAlbum(Album album){
- boolean nameChanged = !album.getName().equals(album.getChangedName());
- if(nameChanged){
- String directoryOld = user.getLogin() + fileManager.getFileSeparator() + album.getName();
- String directoryNew = user.getLogin() + fileManager.getFileSeparator() + album.getChangedName();
- try {
- fileManager.renameDirectory(directoryOld, directoryNew);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- album.setName(album.getChangedName());
- album.setChangedName(null);
- }
- albumAction.editAlbum(album);
- treeRoot.updateChild(album);
-
- }
-
- public void deleteAlbum(Album album){
- String albumName = album.getName();
- albumAction.deleteAlbum(album);
- SelectItem item = treeRoot.getSelectItemByName(album.getName());
- treeRoot.getAvailableAlbums().remove(item);
- treeRoot.removeChild(album.getId());
- fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
- selectedAlbum = user.getChildAlbums().get(0);
- selectedImage = selectedAlbum.getImages().get(0);
- }
-
- public void deleteImage(Image image){
- int index = image.getAlbum().getIndex(image);
- String albumName = image.getAlbum().getName();
- String imagePath = image.getPath();
- TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
- imageAction.deleteImage(image);
- parent.removeChild(image.getId());
- fileManager.deleteImage(user.getLogin() + fileManager.getFileSeparator() + albumName + fileManager.getFileSeparator() + imagePath);
- if(selectedAlbum.getImages().size() > index){
- selectedImage = selectedAlbum.getImages().get(index);
- }else{
- selectedImage = selectedAlbum.getImages().get(index-1);
- }
- }
-
- public void editImage(Image image){
- TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
- boolean parentChanged = !parent.getAlbum().getName().equals(image.getAlbumName());
- imageAction.editImage(image, parentChanged);
-
- if(parentChanged){
- parent.removeChild(image.getId());
- TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
- TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
- albumItem.addChild(image.getId(), imageItem);
- String fileNameOld = user.getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath();
- String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + image.getPath();
- fileManager.renameImage(fileNameOld, fileNameNew);
- selectedImage = imageItem.getImage();
- selectedAlbum = albumItem.getAlbum();
- }else{
- TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
- imageItem.setImage(image);
- }
- }
-
- @Observer("addImage")
- public void addImage(Image image) {
- imageAction.addImage(image);
- TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
- TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
- albumItem.addChild(image.getId(), imageItem);
- selectedImage = imageItem.getImage();
- selectedAlbum = albumItem.getAlbum();
- }
-
- public void editComment(Comment comment) {
- imageAction.editComment(comment);
- }
-
- public void addComment(Comment comment) {
- imageAction.addComment(comment);
- }
-
- public void addAutoComment(Image image) {
- Comment comment = new Comment();
- comment.setAuthor(user);
- comment.setDate(new Date());
- comment.setImage(image);
- comment.setMessage("+1");
- imageAction.addComment(comment);
- }
-
- public void sendMessage(Message message) {
- messageAction.sendMessage(message);
- }
-
- public Long getCountUnreadedMessages() {
- Long count = userAction.countNotReadedMessages(user);
- return count!= null? count:0;
- }
-
- public void removeFromFriends(User owner, User removed){
- userAction.removeFromFriends(owner, removed);
- Message message = new Message();
- message.setAuthor(user);
- message.setDate(new Date());
- message.setOwner(removed);
- message.setFriendshipRequest(false);
- message.setReaded(false);
- message.setMessage(YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE+ user.getLogin());
- message.setTheme(REMOVED_FROM_FRIENDS_MESSAGE_THEME);
- messageAction.sendMessage(message);
- }
-
- public void addToFriends(User friend){
- FriendshipRequest request = friend.getFriendshipRequest(user, friend);
- if(request != null){
- if(!userAction.friendExist(user, friend)){
- userAction.addFriend(user, friend, request);
- Message message = new Message();
- message.setAuthor(user);
- message.setDate(new Date());
- message.setOwner(friend);
- message.setFriendshipRequest(false);
- message.setReaded(false);
- message.setMessage(ADDED_TO_FRIENDS_MESSAGE+ user.getLogin());
- message.setTheme(ADDED_TO_FRIENDS_MESSAGE_THEME);
- messageAction.sendMessage(message);
- }
- }/*else{
- throw new Exception("This user won't be your friend!");
- }*/
- }
-
- public void addToSharedAlbums(Image image){
- userAction.addSharedAlbum(image.getAlbum());
- }
-
-
- public void removeFromSharedAlbums(Album album){
- userAction.removeFromSharedAlbums(user, album);
- }
-
- public void vote(Image image){
- imageAction.vote(image, (Long)Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
- }
-
- public void showSharedAlbum(Image image){
- NavigationEnum mainArea = NavigationEnum.IMAGE_PREVIEW;
- treeSelectionManager.setMainArea(mainArea);
- selectedAlbum = image.getAlbum();
- selectedImage = selectedAlbum.getImages().get(0);
- selectionHelper.setSelectedImageIndex(1);
- selectionHelper.setUserAlbumSelected(false);
- }
-
-
- public void updateSelectedAlbum(){
- selectedAlbum = user.getAlbumByName(this.getSelectedAlbumName());
- selectedImage = selectedAlbum.getImages().get(0);
- selectionHelper.setSelectedImageIndex(1);
- selectionHelper.setUserAlbumSelected(true);
- }
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -22,8 +22,6 @@
import java.util.Iterator;
-import javax.faces.component.UIGraphic;
-
import org.richfaces.model.TreeNode;
import org.richfaces.realworld.domain.Image;
@@ -34,15 +32,12 @@
private long id;
private Image image;
- private UIGraphic uiImage;
private TreeAlbumItem album;
public TreeImageItem(long id, TreeAlbumItem album, Image image) {
this.id = id;
this.album = album;
this.image = image;
- this.uiImage = new UIGraphic();
- this.uiImage.setUrl(image.getPath());
}
public void addChild(Object identifier, TreeNode child) {
@@ -95,13 +90,5 @@
public void setImage(Image image) {
this.image = image;
}
-
- public UIGraphic getUiImage() {
- return uiImage;
- }
-
- public void setUiImage(UIGraphic uiImage) {
- this.uiImage = uiImage;
- }
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -52,6 +52,7 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.manager.ImageManager;
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.util.SelectionHelper;
@@ -60,9 +61,9 @@
@Synchronized(timeout=200000)
public class TreeSelectionManager implements Serializable{
- private static final String DATASCROLLER_ID = "mainform:sc1";
+ private static final String DATASCROLLER_ID = "mainform:imageScroller";
- private static final String IMAGE_DATATABLE_ID = "mainform:imageList";
+ private static final String IMAGE_DATATABLE_ID = "mainform:mainImage";
private static final String FIRST = "first";
@@ -76,12 +77,6 @@
private NavigationEnum mainArea;
- @In(required=false) @Out(required=false)
- private Image selectedImage;
-
- @In(required=false) @Out(required=false)
- private Album selectedAlbum;
-
@In(required=false) @Out(required=false)
private SelectionHelper selectionHelper;
@@ -89,16 +84,16 @@
FileManager fileManager;
@In(required=false)
- TreeActionManager treeActionManager;
+ ImageManager imageManager;
private String nodeTitle;
public void showFileUpload(TreeAlbumItem item){
- selectedAlbum = item.getAlbum();
+ selectionHelper.setSelectedAlbum(item.getAlbum());
if(item.isLeaf()){
- selectedImage=null;
+ selectionHelper.setSelectedImage(null);
}else{
- selectedImage = ((TreeImageItem)(item.getImages().get(0))).getImage();
+ selectionHelper.setSelectedImage(((TreeImageItem)(item.getImages().get(0))).getImage());
}
this.setMainArea(NavigationEnum.FILE_UPLOAD);
}
@@ -109,27 +104,27 @@
}
public void scrollerListener(DataScrollerEvent event) {
- List<Image> images = selectedAlbum.getImages();
+ List<Image> images = selectionHelper.getSelectedAlbum().getImages();
if (event.getNewScrolVal().equals(PREVIOUS)) {
for(int index = 0 ; index < images.size(); index++){
- if(images.get(index) == selectedImage){
- selectedImage = images.get(index - 1);
+ if(images.get(index) == selectionHelper.getSelectedImage()){
+ selectionHelper.setSelectedImage(images.get(index - 1));
selectionHelper.setSelectedImageIndex(index);
}
}
} else if (event.getNewScrolVal().equals(LAST)) {
- selectedImage = images.get(images.size() - 1);
+ selectionHelper.setSelectedImage(images.get(images.size() - 1));
selectionHelper.setSelectedImageIndex(images.size());
} else if (event.getNewScrolVal().equals(NEXT)) {
for(int index = 0 ; index < images.size(); index++){
- if(images.get(index) == selectedImage){
- selectedImage = images.get(index + 1);
+ if(images.get(index) == selectionHelper.getSelectedImage()){
+ selectionHelper.setSelectedImage(images.get(index + 1));
selectionHelper.setSelectedImageIndex(index + 2);
return;
}
}
} else if (event.getNewScrolVal().equals(FIRST)) {
- selectedImage = images.get(0);
+ selectionHelper.setSelectedImage(images.get(0));
selectionHelper.setSelectedImageIndex(1);
}
@@ -194,7 +189,7 @@
ac.addRenderedArea(IMAGE_DATATABLE_ID);
Image draggedImage = ((TreeImageItem)draggedNode).getImage();
draggedImage.setAlbumName(((TreeAlbumItem)droppedInNode).getAlbum().getName());
- treeActionManager.editImage(draggedImage);
+ imageManager.editImage(draggedImage);
// Add destination tree to reRender
try {
ac.addComponentToAjaxRender(destTree);
@@ -224,9 +219,9 @@
TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
if (treeNode instanceof TreeAlbumItem) {
TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
- return currentNode.getAlbum() == selectedAlbum;
+ return currentNode.getAlbum() == selectionHelper.getSelectedAlbum();
} else if (treeNode instanceof TreeImageItem) {
- return ((TreeImageItem) treeNode).getImage() == selectedImage;
+ return ((TreeImageItem) treeNode).getImage() == selectionHelper.getSelectedImage();
}
return null;
}
@@ -236,7 +231,7 @@
TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
if (treeNode instanceof TreeAlbumItem) {
TreeAlbumItem currentNode = (TreeAlbumItem) treeNode;
- return currentNode.getAlbum() == selectedAlbum;
+ return currentNode.getAlbum() == selectionHelper.getSelectedAlbum();
}
return null;
}
@@ -252,12 +247,13 @@
.getName();
}
TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
+ selectionHelper.setUserAlbumSelected(true);
if(currentNode instanceof TreeImageItem){
Image image = ((TreeImageItem)currentNode).getImage();
- selectedImage = image;
+ selectionHelper.setSelectedImage(image);
Album album = ((TreeAlbumItem)currentNode.getParent()).getAlbum();
- if(album != selectedAlbum){
- selectedAlbum = album;
+ if(album != selectionHelper.getSelectedAlbum()){
+ selectionHelper.setSelectedAlbum(album);
}
int index = album.getIndex(image);
setDataScrollerIndex(index);
@@ -266,19 +262,18 @@
TreeAlbumItem node = (TreeAlbumItem)currentNode;
setDataScrollerIndex(0);
if (node.isLeaf()) {
- selectedImage = null;
+ selectionHelper.setSelectedImage(null);
Album album = node.getAlbum();
- selectedAlbum = album;
+ selectionHelper.setSelectedAlbum(album);
}else{
- if(node.getAlbum() == selectedAlbum){
+ if(node.getAlbum() == selectionHelper.getSelectedAlbum()){
return;
}else{
- selectedAlbum = node.getAlbum();
- selectedImage = node.getAlbum().getImages().get(0);
+ selectionHelper.setSelectedAlbum(node.getAlbum());
+ selectionHelper.setSelectedImage(node.getAlbum().getImages().get(0));
}
}
}
- selectionHelper.setUserAlbumSelected(true);
}
catch(Exception e){
//Bla-bla-bla
@@ -298,11 +293,11 @@
}
public void incrementSlideshowIndex() {
- int index = selectedAlbum.getIndex(selectedImage);
- if(selectedAlbum.getImages().size() == index +1){
+ int index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
+ if(selectionHelper.getSelectedAlbum().getImages().size() == index +1){
index = -1;
}
- selectedImage = selectedAlbum.getImages().get(index +1);
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(index +1));
UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
UIDatascroller scroller = (UIDatascroller)component.findComponent(DATASCROLLER_ID);
Map<String, Object> attributes = scroller.getDataTable().getAttributes();
@@ -327,16 +322,16 @@
}
public SelectItem[] getAvailableIndexOfImages(){
- SelectItem[] group = new SelectItem[selectedAlbum.getImages().size()];
- for(int i = 0; i < selectedAlbum.getImages().size(); i++){
+ SelectItem[] group = new SelectItem[selectionHelper.getSelectedAlbum().getImages().size()];
+ for(int i = 0; i < selectionHelper.getSelectedAlbum().getImages().size(); i++){
group[i] = new SelectItem(i+1);
}
return group;
}
public void updateSelectedItems(Image image){
- selectedImage = image;
- Integer index = selectedAlbum.getIndex(selectedImage);
+ selectionHelper.setSelectedImage(image);
+ Integer index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
setDataScrollerIndex(index);
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/AlbumPopupHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.richfaces.realworld.util;
import java.io.Serializable;
@@ -10,7 +30,7 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.AlbumManager;
@Name("albumPopupHelper")
@Scope(ScopeType.CONVERSATION)
@@ -26,7 +46,7 @@
private Album album;
@In(create=true, required=true)
- private TreeActionManager treeActionManager;
+ private AlbumManager albumManager;
public void initAlbumData( String actionName, String caption, Album album){
this.caption = caption;
@@ -39,7 +59,7 @@
}
public void editAlbum(ActionEvent event){
- treeActionManager.editAlbum(this.album);
+ albumManager.editAlbum(this.album);
}
public String getCaption() {
@@ -59,6 +79,6 @@
}
public void addAlbum(ActionEvent event){
- treeActionManager.addAlbum();
+ albumManager.addAlbum();
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/CommentPopupHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.richfaces.realworld.util;
import java.io.Serializable;
@@ -13,7 +33,7 @@
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.ImageManager;
@Name("commentPopupHelper")
@Scope(ScopeType.CONVERSATION)
@@ -32,7 +52,7 @@
private User user;
@In(create=true, required=true)
- private TreeActionManager treeActionManager;
+ private ImageManager imageManager;
public String getCaption() {
return caption;
@@ -64,10 +84,10 @@
}
public void editComment(ActionEvent event){
- treeActionManager.editComment(this.comment);
+ imageManager.editComment(this.comment);
}
public void addComment(ActionEvent event){
- treeActionManager.addComment(this.comment);
+ imageManager.addComment(this.comment);
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConfirmationPopupHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.richfaces.realworld.util;
import java.io.Serializable;
@@ -12,7 +32,8 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.AlbumManager;
+import org.richfaces.realworld.manager.ImageManager;
@Name("confirmationPopupHelper")
@Scope(ScopeType.CONVERSATION)
@@ -24,15 +45,18 @@
private String actionName;
- @In(required=true)
+ @In(create=true, required=true)
private Image image;
- @In(required=true)
+ @In(create=true, required=true)
private Album album;
- @In(required=true)
- private TreeActionManager treeActionManager;
+ @In(create=true, required=true)
+ private AlbumManager albumManager;
+ @In(create=true, required=true)
+ private ImageManager imageManager;
+
public void initImagePopup( String actionName, String caption, Image image){
this.caption = caption;
this.actionName = actionName;
@@ -55,7 +79,7 @@
}
public void deleteAlbum(ActionEvent event){
- treeActionManager.deleteAlbum(this.album);
+ albumManager.deleteAlbum(this.album);
}
public String getCaption() {
@@ -75,7 +99,7 @@
}
public void deleteImage(ActionEvent event){
- treeActionManager.deleteImage(this.image);
+ imageManager.deleteImage(this.image);
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/FriendHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -28,7 +28,6 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
@Name("friendHelper")
@@ -36,12 +35,6 @@
public class FriendHelper implements Serializable{
private static final long serialVersionUID = 4735350615108906608L;
-
- @In(required=false) @Out(required=false)
- private Image selectedImage;
-
- @In(required=false) @Out(required=false)
- private Album selectedAlbum;
@In(required=false) @Out(required=false)
private SelectionHelper selectionHelper;
@@ -50,15 +43,15 @@
ComboboxHelper comboboxHelper;
public void chooseAlbum(User friend){
- selectedAlbum = friend.getAlbumByName(comboboxHelper.getAlbumName());
- selectedImage = selectedAlbum.getImages().get(0);
+ selectionHelper.setSelectedAlbum(friend.getAlbumByName(comboboxHelper.getAlbumName()));
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
selectionHelper.setSelectedImageIndex(1);
selectionHelper.setUserAlbumSelected(false);
}
public void chooseAlbum(Album album){
- selectedAlbum = album;
- selectedImage = selectedAlbum.getImages().get(0);
+ selectionHelper.setSelectedAlbum(album);
+ selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
selectionHelper.setSelectedImageIndex(1);
selectionHelper.setUserAlbumSelected(false);
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImagePopupHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,3 +1,23 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
package org.richfaces.realworld.util;
import java.io.Serializable;
@@ -12,7 +32,7 @@
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.ImageManager;
@Name("imagePopupHelper")
@Scope(ScopeType.CONVERSATION)
@@ -24,7 +44,7 @@
private Image image;
@In(create=true, required=true)
- private TreeActionManager treeActionManager;
+ private ImageManager imageManager;
public void initImagePopup(Image image){
if(null != image){
@@ -36,6 +56,6 @@
}
public void editImage(ActionEvent event){
- treeActionManager.editImage(this.image);
+ imageManager.editImage(this.image);
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -21,7 +21,6 @@
package org.richfaces.realworld.util;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Date;
import javax.faces.event.ActionEvent;
@@ -31,24 +30,16 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Comment;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.Message;
-import org.richfaces.realworld.domain.MetaTag;
import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.tree.TreeActionManager;
+import org.richfaces.realworld.manager.UserManager;
-@Name("modalPanelHelper")
+@Name("messagePanelHelper")
@Scope(ScopeType.CONVERSATION)
public class MessagePanelHelper implements Serializable{
private static final long serialVersionUID = 2561824019376412988L;
-
- private String caption;
- private String actionName;
-
private boolean sendRequired;
private boolean searchRequired = false;
@@ -59,27 +50,10 @@
@Out(required=false)
private Message message;
- @In(create=true, required=true)
- private TreeActionManager treeActionManager;
-
- public String getCaption() {
- return caption;
- }
-
- public void setCaption(String caption) {
- this.caption = caption;
- }
-
- public String getActionName() {
- return actionName;
- }
-
- public void setActionName(String actionName) {
- this.actionName = actionName;
- }
+ @In(create=true, required=true) @Out
+ private UserManager userManager;
- public void initModalPanelData( String actionName, boolean sendRequired, Message message){
- this.actionName = actionName;
+ public void initReMessage(boolean sendRequired, Message message){
this.sendRequired = sendRequired;
this.message = new Message();
this.message.setTheme("Re:" + message.getTheme());
@@ -89,8 +63,7 @@
this.searchRequired = false;
}
- public void initMessage( String actionName, boolean sendRequired, Message message, boolean userSearchRequired){
- this.actionName = actionName;
+ public void initMessage(boolean sendRequired, Message message, boolean userSearchRequired){
this.sendRequired = sendRequired;
this.searchRequired = userSearchRequired;
this.message = new Message();
@@ -103,10 +76,10 @@
this.message = message;
this.message.setReaded(true);
this.searchRequired = false;
+ userManager.setCountUnreadedMessages(null);
}
- public void initModalPanelData( String actionName, boolean sendRequired, User owner){
- this.actionName = actionName;
+ public void initMessage(boolean sendRequired, User owner){
this.sendRequired = sendRequired;
this.message = new Message();
this.message.setAuthor(user);
@@ -115,8 +88,7 @@
this.searchRequired = false;
}
- public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message){
- this.actionName = actionName;
+ public void initMessage(boolean sendRequired, User owner, String theme, String message){
this.sendRequired = sendRequired;
this.message = new Message();
this.message.setAuthor(user);
@@ -127,8 +99,7 @@
this.searchRequired = false;
}
- public void initModalPanelData( String actionName, boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
- this.actionName = actionName;
+ public void initMessage(boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
this.sendRequired = sendRequired;
this.message = new Message();
this.message.setAuthor(user);
@@ -142,7 +113,7 @@
public void sendMessage(ActionEvent event){
this.message.setDate(new Date());
- treeActionManager.sendMessage(this.message);
+ userManager.sendMessage(this.message);
}
public boolean isSendRequired() {
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/SelectionHelper.java 2008-12-24 12:17:19 UTC (rev 12005)
@@ -25,14 +25,21 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
@Name("selectionHelper")
@Scope(ScopeType.CONVERSATION)
public class SelectionHelper implements Serializable{
private static final long serialVersionUID = 5656562187249324512L;
+
private Integer selectedImageIndex = 1;
+ private Image selectedImage;
+
+ private Album selectedAlbum;
+
private boolean userAlbumSelected = true;
public boolean isUserAlbumSelected() {
@@ -50,4 +57,20 @@
public void setSelectedImageIndex(Integer selectedImageIndex) {
this.selectedImageIndex = selectedImageIndex;
}
+
+ public Image getSelectedImage() {
+ return selectedImage;
+ }
+
+ public void setSelectedImage(Image selectedImage) {
+ this.selectedImage = selectedImage;
+ }
+
+ public Album getSelectedAlbum() {
+ return selectedAlbum;
+ }
+
+ public void setSelectedAlbum(Album selectedAlbum) {
+ this.selectedAlbum = selectedAlbum;
+ }
}
Modified: trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld/web/src/main/resources/messages_en.properties 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/resources/messages_en.properties 2008-12-24 12:17:19 UTC (rev 12005)
@@ -90,7 +90,8 @@
error=Error
errorStub=Something bad happened :-(
-fileUpload.header=You will upload files in album: #{selectedAlbum.name}. If you want upload in another album, select it.
+
+fileUpload.header=You will upload files in album: #{selectionHelper.selectedAlbum.name}. If you want upload in another album, select it.
fileUpload.header2=Choose album:
fileUpload.uploadedPanelHeader=Uploaded Files Info
fileUpload.fileNameLabel=File Name:
@@ -101,4 +102,155 @@
fileUpload.clearLabel=Clear Uploaded Data
fileUpload.clearSelectedLabel=Clear Selected
-image.panelHeader=Image Preview\: Selected Album\: \#{selectedAlbum.name}
\ No newline at end of file
+comment.label=View comments(#{selectionHelper.selectedImage.comments.size})
+comment.author=Author: #{record.author.login}
+comment.askForFriend=Ask for friendship
+comment.askForFriend.message=Please, add me to your friends
+comment.date=Date: #{record.date}
+comment.delete=Delete comment
+comment.edit=Edit Comment
+comment.noComments=No Comments for this image
+comment.add=Add comment
+comment.save=Save
+comment.cancel=Cancel
+
+message.sendMessage=Send message
+message.sendToUser=Send message for this user
+message.readed=Mark as read
+message.authorHeader=Author
+message.themeHeader=Theme
+message.dateHeader=Date
+message.theme=Theme: #{record.theme}
+message.author=Author:
+message.date=Date: #{record.date}
+message.delete=Delete
+message.read=Read
+message.re=Re:
+message.message=Message
+message.owner=Owner:
+message.content=Content:
+message.addFriend=Add to friends
+message.friendRequest=It is request for friendship message. You may add this user to your friends by clicking on the 'Add to Friends button'
+message.send=Send
+message.close=Close
+message.theme=Theme:
+
+confirm.confirm=Confirmation:
+confirm.ok=OK
+confirm.cancel=Cancel
+
+shared.delete=Delete From shared
+
+album.edit=Edit
+album.delete=Delete
+album.delete.confirm=Are you sure? All images associated with this album will also dropped! Click OK to proceed, else click Cancel.
+album.add=Add album
+album.edit.long=Edit Album:
+album.addImages=Add images
+album.name=Name:
+album.shared=Shared:
+album.owner=Owner:
+album.desc=Short description:
+album.store=Store
+album.cancel=Cancel
+
+scroller.first=First
+scroller.last=Last
+scroller.prev=Prev
+scroller.next=Next
+scroller.pager.begin=Image
+scroller.pager.end=of #{selectionHelper.selectedAlbum.images.size}
+
+image.rating=Current Rating: #{record.rank.rating}
+image.numberVotes=Number of votes: #{record.rank.hits}
+image.vote=Vote for this picture
+image.vote.short=Vote
+image.panelHeader=Image Preview: Selected Album: #{selectionHelper.selectedAlbum.name}
+image.delete=Delete
+image.delete.confirm=Are you sure? Click OK to proceed, else click Cancel.
+image.edit=Edit Properties
+image.prop=Image Properties:
+image.name=Name:
+image.desc=Short Description:
+image.album=Album
+image.date=Created Date:
+image.meta=Image Meta-information:
+image.store=Store
+image.cancel=Cancel
+
+slideshow.start=Start Slideshow
+slideshow.stop=Stop slideshow
+slideshow.interval=Interval in sec
+
+index.header=Welcome!
+
+login.header=Please login here
+login.login=Login
+login.userName=Username
+login.password=Password
+login.register=Register
+login.anonymous=Anonymous
+
+friends.delete=Delete from friends
+friends.choose=Choose album for preview:
+
+search.advanced=Advanced search:
+search.rank=Rank:
+search.numberVotes=Number of votes:
+search.date=Date created
+search.addShared=Add to shared Albums
+search.preview=Preview
+search.search=Search
+search.popular=Popular Images
+search.unpopular=UnPopular Images
+search.nofound=No images found
+
+user.loginPrefs=Login Preferences
+user.registration=Registration
+user.reginfo=Registration Info:
+user.firstname=First name
+user.secondname=Second Name
+user.login=Login
+user.password=Password
+user.email=Email
+user.birthdate=Birth Date
+user.avatar=Avatar
+user.userPrefs=User preferences
+user.save=Save
+user.reset=Reset
+user.confirm=Confirm Password
+user.avatar.info=Uploaded File Info
+user.avatar.name=File Name:
+user.avatar.length=File Length(bytes):
+user.register=Register
+user.cancel=Cancel
+user.exist=User with this login already exist;
+user.confirm.error=Confirm Password not equals password
+
+menu.welcome=Welcome, #{identity.username}!
+menu.welcome.guest=Welcome, guest! If you want access to full version of application, please register or login.
+menu.message.tooltip=You have #{userManager.countUnreadedMessages} not-readed messages
+menu.messages=Read Messages
+menu.search=Search
+menu.image=Image Preview
+menu.user=User Prefs
+menu.file=File Upload
+menu.logout=Logout
+menu.login=Login
+
+realworld=RealWorld Demo application
+panel.albumHeader=Album Management
+panel.my=My albums
+panel.friend=Friend Albums
+panel.shared=Shared albums
+
+samplename=Sample Name
+sampledesc=Sample Description
+addedtofriends=You are were added to friends
+addedtofriendsby=You are were added to friends by User
+removedfromfriends=You are were removed from friends
+removedfromfriendsby=You are were removed from friends of
+equals=Equals
+more=More
+less=Less
+nomatter=No Matter
\ No newline at end of file
Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-12-24 12:17:19 UTC (rev 12005)
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE facelet-taglib PUBLIC
- "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
- "facelet-taglib_1_0.dtd">
-<facelet-taglib>
- <namespace>http://richfaces.org/richx</namespace>
- <tag>
- <tag-name>albumModalPanel</tag-name>
- <source>templates/albumModalPanel.xhtml</source>
- </tag>
- <tag>
- <tag-name>confirm</tag-name>
- <source>templates/confirmation.xhtml</source>
- </tag>
- <tag>
- <tag-name>imagePrefs</tag-name>
- <source>templates/imagePrefs.xhtml</source>
- </tag>
- <tag>
- <tag-name>comment</tag-name>
- <source>templates/addComment.xhtml</source>
- </tag>
- <tag>
- <tag-name>message</tag-name>
- <source>templates/message.xhtml</source>
- </tag>
-</facelet-taglib>
\ No newline at end of file
Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/addComment.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml 2008-12-23 20:20:47 UTC (rev 12004)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml 2008-12-24 12:17:19 UTC (rev 12005)
@@ -32,7 +32,7 @@
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>
- /WEB-INF/tags/albumModalPanel-taglib.xml
+ /WEB-INF/tags/realWorld-taglib.xml
</param-value>
</context-param>
Deleted: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/navigation.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/readMessages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/search.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Rich Faces SVN: r12004 - trunk/ui/tree/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-23 15:20:47 -0500 (Tue, 23 Dec 2008)
New Revision: 12004
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-5455
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-23 20:04:48 UTC (rev 12003)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2008-12-23 20:20:47 UTC (rev 12004)
@@ -548,7 +548,7 @@
writer.writeAttribute("id", selectionHolderInputId, null);
writer.writeAttribute("name", selectionHolderInputId, null);
- writer.writeAttribute("value", ScriptUtils.toScript(getSelectionValue(context, tree)), null);
+ writer.writeAttribute("value", getSelectionValue(context, tree), null);
writer.endElement("input");
return selectionHolderInputId;
16 years, 9 months
JBoss Rich Faces SVN: r12003 - in trunk/framework/impl/src/main/java/org/ajax4jsf: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-12-23 15:04:48 -0500 (Tue, 23 Dec 2008)
New Revision: 12003
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
trunk/framework/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
Log:
https://jira.jboss.org/jira/browse/RF-4432
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-12-23 18:52:44 UTC (rev 12002)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/AjaxViewRoot.java 2008-12-23 20:04:48 UTC (rev 12003)
@@ -540,7 +540,7 @@
.getSubmittedRegionClientId();
boolean invoked = false;
if (submittedRegionClientId != null && !submittedRegionClientId.equals(JS_NULL) && !submittedRegionClientId.equals(getClientId(context))) {
- invoked = invokeOnComponent(context, submittedRegionClientId, new ContextCallbackWrapper(_ajaxInvoker));
+ invoked = invokeOnComponent(context, submittedRegionClientId, _ajaxInvoker);
}
// if container not found, use Root for encode.
// https://jira.jboss.org/jira/browse/RF-3975
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java 2008-12-23 18:52:44 UTC (rev 12002)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/ContextCallbackWrapper.java 2008-12-23 20:04:48 UTC (rev 12003)
@@ -29,38 +29,31 @@
/**
* @author Anton Belevich
- *
+ *
*/
public class ContextCallbackWrapper implements ContextCallback {
-
- ContextCallback callback;
-
- public ContextCallbackWrapper(ContextCallback callback) {
- this.callback = callback;
- }
-
- public void invokeContextCallback(FacesContext context, UIComponent target) {
- if(isParentRendered(target)) {
- callback.invokeContextCallback(context, target);
+
+ ContextCallback callback;
+
+ public ContextCallbackWrapper(ContextCallback callback) {
+ this.callback = callback;
}
- }
-
- public boolean isParentRendered( UIComponent target) {
- List <UIComponent> componentsList = new ArrayList<UIComponent>();
- UIComponent component = target;
-
- while (component != null) {
- componentsList.add(component);
- component = component.getParent();
+
+ public void invokeContextCallback(FacesContext context, UIComponent target) {
+ if (isParentRendered(target)) {
+ callback.invokeContextCallback(context, target);
+ }
}
-
- for (int i = componentsList.size() - 1; i >= 0; i--) {
- UIComponent processComponent = componentsList.get(i);
- if(!processComponent.isRendered()) {
- return false;
- }
- }
- return true;
- }
+ public boolean isParentRendered(UIComponent target) {
+ UIComponent component = target;
+
+ while (component != null) {
+ if (!component.isRendered()) {
+ return false;
+ }
+ component = component.getParent();
+ }
+ return true;
+ }
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-12-23 18:52:44 UTC (rev 12002)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/AjaxContainerRenderer.java 2008-12-23 20:04:48 UTC (rev 12003)
@@ -65,8 +65,7 @@
public static final String AJAX_UPDATE_HEADER = "Ajax-Update-Ids";
- static final Log log = LogFactory
- .getLog(AjaxContainerRenderer.class);
+ static final Log log = LogFactory.getLog(AjaxContainerRenderer.class);
public static final String AJAX_FLAG_HEADER = "Ajax-Response";
@@ -105,7 +104,7 @@
*/
public void encodeAjax(FacesContext context, UIComponent component)
throws IOException {
- UIComponent root ;
+ UIComponent root;
// Iterate over all childrens, render it if nessesary...
log.debug(Messages.getMessage(Messages.RENDER_CHILDREN_AJAX_INFO));
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
@@ -114,19 +113,31 @@
if (((AjaxContainer) component).isRenderRegionOnly()) {
root = component;
} else {
- root = context.getViewRoot();
+ root = context.getViewRoot();
}
String path = AjaxRendererUtils.getAbsoluteId(root);
// if(! (component instanceof NamingContainer)){
path = path.substring(0, path
.lastIndexOf(NamingContainer.SEPARATOR_CHAR) + 1);
- encodeAjaxComponent(context, root, path, ids, renderedAreas);
+ if (isParentRendered(root)) {
+ encodeAjaxComponent(context, root, path, ids, renderedAreas);
+ }
// Write information about encoded areas after submission.
AjaxRendererUtils.encodeAreas(context, component);
}
-
-
+ public boolean isParentRendered(UIComponent target) {
+ UIComponent component = target;
+
+ while (component != null) {
+ if (!component.isRendered()) {
+ return false;
+ }
+ component = component.getParent();
+ }
+ return true;
+ }
+
/*
* always return true, since component must maintain set of rendered
* components.
@@ -140,27 +151,29 @@
/*
* (non-Javadoc)
*
- * @see org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent)
+ * @see
+ * org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext
+ * , javax.faces.component.UIComponent)
*/
protected void doDecode(FacesContext context, UIComponent component) {
String clientId = component.getClientId(context);
- Map<String, String> paramMap = context.getExternalContext().getRequestParameterMap();
+ Map<String, String> paramMap = context.getExternalContext()
+ .getRequestParameterMap();
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(
Messages.DECODE_AJAX_REQUEST_STATUS_INFO, clientId));
-// log.debug(Messages.getMessage(Messages.REQUEST_PARAMETERS_MAP,
-// paramMap.toString()));
+ // log.debug(Messages.getMessage(Messages.REQUEST_PARAMETERS_MAP,
+ // paramMap.toString()));
}
Object ajaxParameter = paramMap.get(AJAX_PARAMETER_NAME);
AjaxContainer ajaxContainer = (AjaxContainer) component;
if (null != ajaxParameter && ajaxParameter.equals(clientId)) {
- ajaxContainer.setSubmitted(true);
- if(ajaxContainer.isSelfRendered()){
- AjaxContext.getCurrentInstance(context).setSelfRender(true);
- }
- AjaxEvent event = new AjaxEvent(component);
- component.queueEvent(event);
+ ajaxContainer.setSubmitted(true);
+ if (ajaxContainer.isSelfRendered()) {
+ AjaxContext.getCurrentInstance(context).setSelfRender(true);
+ }
+ AjaxEvent event = new AjaxEvent(component);
+ component.queueEvent(event);
} else {
ajaxContainer.setSubmitted(false);
}
16 years, 9 months
JBoss Rich Faces SVN: r12002 - trunk/ui/core/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-23 13:52:44 -0500 (Tue, 23 Dec 2008)
New Revision: 12002
Modified:
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
Log:
https://jira.jboss.org/jira/browse/RF-4553
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-12-23 18:36:09 UTC (rev 12001)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIInclude.java 2008-12-23 18:52:44 UTC (rev 12002)
@@ -51,7 +51,7 @@
public static final String LAYOUT_BLOCK ="block";
public static final String LAYOUT_INLINE ="inline";
- private boolean _ajaxRendered = true;
+ private boolean _ajaxRendered = false;
private boolean _ajaxRenderedSet = false;
private boolean wasNavigation = false;
@@ -63,7 +63,7 @@
* @see org.ajax4jsf.framework.ajax.ViewIdHolder#skipNavigation(java.lang.String)
*/
public boolean skipNavigation(String ViewId) {
-// wasNavigation = true;
+ wasNavigation = true;
return true;
}
@@ -126,8 +126,12 @@
public boolean isAjaxRendered() {
Boolean value = null;
- if(!this._ajaxRenderedSet) {
- ValueExpression ve = getValueExpression("ajaxRendered");
+
+ if(this._ajaxRenderedSet) {
+ return this._ajaxRendered;
+ }
+
+ ValueExpression ve = getValueExpression("ajaxRendered");
if (ve != null) {
try {
value = (Boolean) ve.getValue(getFacesContext().getELContext());
@@ -135,10 +139,11 @@
throw new FacesException(e);
}
}
- }
+
if (null == value) {
- value = this._ajaxRendered;
+// value = this._ajaxRendered;
+ value = isWasNavigation();
}
return (!LAYOUT_NONE.equals(getLayout())) && value;
16 years, 9 months
JBoss Rich Faces SVN: r12001 - trunk/framework/api/src/main/java/org/ajax4jsf/resource/util.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-23 13:36:09 -0500 (Tue, 23 Dec 2008)
New Revision: 12001
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
Log:
JavaDoc added for urlToStreamSafe() method
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2008-12-23 18:34:51 UTC (rev 12000)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/resource/util/URLToStreamHelper.java 2008-12-23 18:36:09 UTC (rev 12001)
@@ -69,6 +69,12 @@
}
}
+ /**
+ * Variant of {@link #urlToStream(URL)} method that doesn't throw IOException, but silently ignores them
+ *
+ * @param url
+ * @return
+ */
public static final InputStream urlToStreamSafe(URL url) {
try {
return urlToStream(url);
16 years, 9 months
JBoss Rich Faces SVN: r12000 - in trunk/ui: beanValidator/src/main/java/org/richfaces/event and 95 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-23 13:34:51 -0500 (Tue, 23 Dec 2008)
New Revision: 12000
Modified:
trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java
trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java
trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationEvent.java
trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationListener.java
trunk/ui/beanValidator/src/main/java/org/richfaces/renderkit/html/BeanValidatorRenderer.java
trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorHandler.java
trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorTagBase.java
trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorHandler.java
trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorTag.java
trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
trunk/ui/beanValidator/src/main/templates/org/richfaces/ui/htmlBeanValidator.jspx
trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
trunk/ui/beanValidator/src/test/java/org/richfaces/validator/UnValidableBean.java
trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarSeparator.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
trunk/ui/combobox/src/main/templates/combobox.jspx
trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx
trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/Lifo.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java
trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/button.jspx
trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/function.jspx
trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/link.jspx
trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/log.jspx
trunk/ui/core/src/test/java/org/ajax4jsf/component/IncludeComponentTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadBundleComponentTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxFormRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxIncludeRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPageRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPushRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxStatusRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java
trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/MediaOutputRendererTest.java
trunk/ui/dataFilterSlider/src/main/templates/dataFilterSlider.jspx
trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/ColumnsIterator.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/DataIterator.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/FixedChildrenIterator.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java
trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconConstants.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortAsc.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortDesc.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortNone.java
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlColgroup.jspx
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataDefinitionList.jspx
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataGrid.jspx
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx
trunk/ui/dataTable/src/main/templates/org/richfaces/htmlSubTable.jspx
trunk/ui/dataTable/src/test/java/org/richfaces/component/DataTableComponentTest.java
trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java
trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/SortableHeaderRenderingTest.java
trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java
trunk/ui/effect/src/main/templates/effect.jspx
trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
trunk/ui/gmap/src/main/templates/gmap.jspx
trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
trunk/ui/inplaceInput/src/main/java/org/richfaces/component/UIInplaceInput.java
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java
trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
trunk/ui/insert/src/main/java/org/richfaces/ui/component/DummyHighLight.java
trunk/ui/insert/src/main/java/org/richfaces/ui/component/Highlight.java
trunk/ui/insert/src/main/java/org/richfaces/ui/component/HighlightImpl.java
trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
trunk/ui/jQuery/src/main/templates/jQuery.jspx
trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx
trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuSeparatorComponentTest.java
trunk/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessageRenderer.java
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListButtonGradient.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottom.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottomDisabled.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDown.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDownDisabled.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTop.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTopDisabled.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUp.java
trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUpDisabled.java
trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuItem.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronLeft.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleLeft.java
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
trunk/ui/pickList/src/main/templates/htmlPickList.jspx
trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
trunk/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconSplit.java
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-cell.jspx
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-itself.jspx
trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java
trunk/ui/separator/src/main/templates/separator.jspx
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java
trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
trunk/ui/spacer/src/main/templates/spacer.jspx
trunk/ui/state/src/main/java/org/richfaces/el/StateELResolver.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplicationFactory.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateMethodExpressionWrapper.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StatePropertyResolver.java
trunk/ui/state/src/main/java/org/richfaces/ui/application/StateResolver.java
trunk/ui/state/src/main/java/org/richfaces/ui/model/State.java
trunk/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java
trunk/ui/state/src/main/java/org/richfaces/ui/model/States.java
trunk/ui/state/src/main/templates/org/richfaces/ui/htmlState.jspx
trunk/ui/state/src/main/templates/org/richfaces/ui/htmlStates.jspx
trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabClassBuilder.java
trunk/ui/tabPanel/src/main/templates/tab.jspx
trunk/ui/tabPanel/src/main/templates/tabHeader.jspx
trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java
trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
trunk/ui/togglePanel/src/main/templates/toggleControl.jspx
trunk/ui/togglePanel/src/main/templates/togglePanel.jspx
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
trunk/ui/tooltip/src/main/java/org/richfaces/taglib/ToolTipTagHandlerBase.java
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
trunk/ui/tree/src/main/templates/htmlTree.jspx
trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsListenersTest.java
trunk/ui/treeModel/src/test/java/org/richfaces/component/TreeModelComponentTest.java
trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx
Log:
https://jira.jboss.org/jira/browse/RF-5104
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputText.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,98 +1,98 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component.html;
-
-import java.util.List;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-
-import org.richfaces.validator.FacesBeanValidator;
-
-/**
- * @author asmirnov
- *
- */
-public class HtmlInputText extends javax.faces.component.html.HtmlInputText {
-
- @Override
- protected void validateValue(FacesContext context, Object newValue) {
- // If our value is valid, enforce the required property if present
- if (isValid() && isRequired() && isEmpty(newValue)) {
- super.validateValue(context, newValue);
- }
- // If our value is valid and not empty, call all validators
- if (isValid()) {
- Validator[] validators = this.getValidators();
- if (validators != null) {
- for (Validator validator : validators) {
- try {
- if (validator instanceof FacesBeanValidator
- || !isEmpty(newValue)) {
- validator.validate(context, this, newValue);
- }
- } catch (ValidatorException ve) {
- // If the validator throws an exception, we're
- // invalid, and we need to add a message
- setValid(false);
- FacesMessage message;
- String validatorMessageString = getValidatorMessage();
-
- if (null != validatorMessageString) {
- message = new FacesMessage(
- FacesMessage.SEVERITY_ERROR,
- validatorMessageString,
- validatorMessageString);
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- } else {
- message = ve.getFacesMessage();
- }
- if (message != null) {
- context.addMessage(getClientId(context), message);
- }
- }
- }
- }
- }
-
- }
-
- private static boolean isEmpty(Object value) {
-
- if (value == null) {
- return (true);
- } else if ((value instanceof String) && (((String) value).length() < 1)) {
- return (true);
- } else if (value.getClass().isArray()) {
- if (0 == java.lang.reflect.Array.getLength(value)) {
- return (true);
- }
- } else if (value instanceof List) {
- if (((List) value).isEmpty()) {
- return (true);
- }
- }
- return (false);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component.html;
+
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import org.richfaces.validator.FacesBeanValidator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class HtmlInputText extends javax.faces.component.html.HtmlInputText {
+
+ @Override
+ protected void validateValue(FacesContext context, Object newValue) {
+ // If our value is valid, enforce the required property if present
+ if (isValid() && isRequired() && isEmpty(newValue)) {
+ super.validateValue(context, newValue);
+ }
+ // If our value is valid and not empty, call all validators
+ if (isValid()) {
+ Validator[] validators = this.getValidators();
+ if (validators != null) {
+ for (Validator validator : validators) {
+ try {
+ if (validator instanceof FacesBeanValidator
+ || !isEmpty(newValue)) {
+ validator.validate(context, this, newValue);
+ }
+ } catch (ValidatorException ve) {
+ // If the validator throws an exception, we're
+ // invalid, and we need to add a message
+ setValid(false);
+ FacesMessage message;
+ String validatorMessageString = getValidatorMessage();
+
+ if (null != validatorMessageString) {
+ message = new FacesMessage(
+ FacesMessage.SEVERITY_ERROR,
+ validatorMessageString,
+ validatorMessageString);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ } else {
+ message = ve.getFacesMessage();
+ }
+ if (message != null) {
+ context.addMessage(getClientId(context), message);
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ private static boolean isEmpty(Object value) {
+
+ if (value == null) {
+ return (true);
+ } else if ((value instanceof String) && (((String) value).length() < 1)) {
+ return (true);
+ } else if (value.getClass().isArray()) {
+ if (0 == java.lang.reflect.Array.getLength(value)) {
+ return (true);
+ }
+ } else if (value instanceof List) {
+ if (((List) value).isEmpty()) {
+ return (true);
+ }
+ }
+ return (false);
+ }
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/component/html/HtmlInputTextarea.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,98 +1,98 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component.html;
-
-import java.util.List;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-
-import org.richfaces.validator.FacesBeanValidator;
-
-/**
- * @author asmirnov
- *
- */
-public class HtmlInputTextarea extends javax.faces.component.html.HtmlInputTextarea {
-
- @Override
- protected void validateValue(FacesContext context, Object newValue) {
- // If our value is valid, enforce the required property if present
- if (isValid() && isRequired() && isEmpty(newValue)) {
- super.validateValue(context, newValue);
- }
- // If our value is valid and not empty, call all validators
- if (isValid()) {
- Validator[] validators = this.getValidators();
- if (validators != null) {
- for (Validator validator : validators) {
- try {
- if (validator instanceof FacesBeanValidator
- || !isEmpty(newValue)) {
- validator.validate(context, this, newValue);
- }
- } catch (ValidatorException ve) {
- // If the validator throws an exception, we're
- // invalid, and we need to add a message
- setValid(false);
- FacesMessage message;
- String validatorMessageString = getValidatorMessage();
-
- if (null != validatorMessageString) {
- message = new FacesMessage(
- FacesMessage.SEVERITY_ERROR,
- validatorMessageString,
- validatorMessageString);
- message.setSeverity(FacesMessage.SEVERITY_ERROR);
- } else {
- message = ve.getFacesMessage();
- }
- if (message != null) {
- context.addMessage(getClientId(context), message);
- }
- }
- }
- }
- }
-
- }
-
- private static boolean isEmpty(Object value) {
-
- if (value == null) {
- return (true);
- } else if ((value instanceof String) && (((String) value).length() < 1)) {
- return (true);
- } else if (value.getClass().isArray()) {
- if (0 == java.lang.reflect.Array.getLength(value)) {
- return (true);
- }
- } else if (value instanceof List) {
- if (((List) value).isEmpty()) {
- return (true);
- }
- }
- return (false);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component.html;
+
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+import org.richfaces.validator.FacesBeanValidator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class HtmlInputTextarea extends javax.faces.component.html.HtmlInputTextarea {
+
+ @Override
+ protected void validateValue(FacesContext context, Object newValue) {
+ // If our value is valid, enforce the required property if present
+ if (isValid() && isRequired() && isEmpty(newValue)) {
+ super.validateValue(context, newValue);
+ }
+ // If our value is valid and not empty, call all validators
+ if (isValid()) {
+ Validator[] validators = this.getValidators();
+ if (validators != null) {
+ for (Validator validator : validators) {
+ try {
+ if (validator instanceof FacesBeanValidator
+ || !isEmpty(newValue)) {
+ validator.validate(context, this, newValue);
+ }
+ } catch (ValidatorException ve) {
+ // If the validator throws an exception, we're
+ // invalid, and we need to add a message
+ setValid(false);
+ FacesMessage message;
+ String validatorMessageString = getValidatorMessage();
+
+ if (null != validatorMessageString) {
+ message = new FacesMessage(
+ FacesMessage.SEVERITY_ERROR,
+ validatorMessageString,
+ validatorMessageString);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ } else {
+ message = ve.getFacesMessage();
+ }
+ if (message != null) {
+ context.addMessage(getClientId(context), message);
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ private static boolean isEmpty(Object value) {
+
+ if (value == null) {
+ return (true);
+ } else if ((value instanceof String) && (((String) value).length() < 1)) {
+ return (true);
+ } else if (value.getClass().isArray()) {
+ if (0 == java.lang.reflect.Array.getLength(value)) {
+ return (true);
+ }
+ } else if (value instanceof List) {
+ if (((List) value).isEmpty()) {
+ return (true);
+ }
+ }
+ return (false);
+ }
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationEvent.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationEvent.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationEvent.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,68 +1,68 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/**
- *
- */
-package org.richfaces.event;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-
-/**
- * @author asmirnov
- *
- */
-public class ValidationEvent extends FacesEvent {
-
- /**
- *
- */
- private static final long serialVersionUID = 5593837134704144777L;
-
- public ValidationEvent(UIComponent component) {
- super(component);
- // TODO Auto-generated constructor stub
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
- */
- @Override
- public boolean isAppropriateListener(FacesListener listener) {
- // TODO Auto-generated method stub
- return listener instanceof ValidationListener;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
- */
- @Override
- public void processListener(FacesListener listener) {
- if (listener instanceof ValidationListener) {
- ValidationListener validationListener = (ValidationListener) listener;
- validationListener.processValidation(this);
- }
-
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+/**
+ *
+ */
+package org.richfaces.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ValidationEvent extends FacesEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5593837134704144777L;
+
+ public ValidationEvent(UIComponent component) {
+ super(component);
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public boolean isAppropriateListener(FacesListener listener) {
+ // TODO Auto-generated method stub
+ return listener instanceof ValidationListener;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
+ */
+ @Override
+ public void processListener(FacesListener listener) {
+ if (listener instanceof ValidationListener) {
+ ValidationListener validationListener = (ValidationListener) listener;
+ validationListener.processValidation(this);
+ }
+
+ }
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationListener.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationListener.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/event/ValidationListener.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,34 +1,34 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.event;
-
-import javax.faces.event.FacesListener;
-
-
-/**
- * @author asmirnov
- *
- */
-public interface ValidationListener extends FacesListener {
-
- public void processValidation(ValidationEvent event);
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.event;
+
+import javax.faces.event.FacesListener;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface ValidationListener extends FacesListener {
+
+ public void processValidation(ValidationEvent event);
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/renderkit/html/BeanValidatorRenderer.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/renderkit/html/BeanValidatorRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/renderkit/html/BeanValidatorRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -106,5 +106,5 @@
return org.richfaces.component.UIBeanValidator.class;
}
-
-}
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorHandler.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorHandler.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorHandler.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,118 +1,118 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.taglib;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.webapp.taglib.AjaxComponentHandler;
-import org.richfaces.component.UIBeanValidator;
-import org.richfaces.validator.FacesBeanValidator;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-
-/**
- * @author asmirnov
- *
- */
-public class AjaxValidatorHandler extends TagHandler {
-
- /**
- * A UIComponent for capturing a child UIComponent, representative of the
- * desired Facet
- *
- * @author Jacob Hookom
- *
- */
- private final static class UIFacet extends UIComponentBase {
- public String getFamily() {
- return null;
- }
- }
-
- private TagAttribute _event;
- private TagAttribute _summary;
- private AjaxComponentHandler _validatorHandler;
-
- /**
- * @param config
- */
- public AjaxValidatorHandler(ComponentConfig config) {
- super(config);
- _event = getAttribute("event");
- _summary = getAttribute("summary");
- _validatorHandler = new AjaxComponentHandler(config);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- if (parent == null || !(parent instanceof EditableValueHolder)) {
- throw new TagException(this.tag,
- "Parent not an instance of EditableValueHolder: " + parent);
- }
- if (null == parent.getParent()) {
- // New created component, add validator.
- FacesContext facesContext = FacesContext.getCurrentInstance();
- FacesBeanValidator validator = (FacesBeanValidator) facesContext
- .getApplication().createValidator(
- FacesBeanValidator.BEAN_VALIDATOR_TYPE);
- if (null != _summary) {
- validator.setSummary(_summary.getValueExpression(ctx, String.class));
- }
- ((EditableValueHolder) parent).addValidator(validator);
- }
- if (null != this._event) {
- UIComponent c;
- UIFacet facet = new UIFacet();
- // Find facet for client validation component
- String eventName = _event.getValue();
- String facetName = UIBeanValidator.BEAN_VALIDATOR_FACET + eventName;
- c = parent.getFacet(facetName);
- if (null != c) {
- parent.getFacets().remove(facetName);
- facet.getChildren().add(c);
- }
- this._validatorHandler.apply(ctx, facet);
- c = (UIComponent) facet.getChildren().get(0);
- parent.getFacets().put(facetName, c);
-
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.taglib;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.webapp.taglib.AjaxComponentHandler;
+import org.richfaces.component.UIBeanValidator;
+import org.richfaces.validator.FacesBeanValidator;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class AjaxValidatorHandler extends TagHandler {
+
+ /**
+ * A UIComponent for capturing a child UIComponent, representative of the
+ * desired Facet
+ *
+ * @author Jacob Hookom
+ *
+ */
+ private final static class UIFacet extends UIComponentBase {
+ public String getFamily() {
+ return null;
+ }
+ }
+
+ private TagAttribute _event;
+ private TagAttribute _summary;
+ private AjaxComponentHandler _validatorHandler;
+
+ /**
+ * @param config
+ */
+ public AjaxValidatorHandler(ComponentConfig config) {
+ super(config);
+ _event = getAttribute("event");
+ _summary = getAttribute("summary");
+ _validatorHandler = new AjaxComponentHandler(config);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ if (parent == null || !(parent instanceof EditableValueHolder)) {
+ throw new TagException(this.tag,
+ "Parent not an instance of EditableValueHolder: " + parent);
+ }
+ if (null == parent.getParent()) {
+ // New created component, add validator.
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesBeanValidator validator = (FacesBeanValidator) facesContext
+ .getApplication().createValidator(
+ FacesBeanValidator.BEAN_VALIDATOR_TYPE);
+ if (null != _summary) {
+ validator.setSummary(_summary.getValueExpression(ctx, String.class));
+ }
+ ((EditableValueHolder) parent).addValidator(validator);
+ }
+ if (null != this._event) {
+ UIComponent c;
+ UIFacet facet = new UIFacet();
+ // Find facet for client validation component
+ String eventName = _event.getValue();
+ String facetName = UIBeanValidator.BEAN_VALIDATOR_FACET + eventName;
+ c = parent.getFacet(facetName);
+ if (null != c) {
+ parent.getFacets().remove(facetName);
+ facet.getChildren().add(c);
+ }
+ this._validatorHandler.apply(ctx, facet);
+ c = (UIComponent) facet.getChildren().get(0);
+ parent.getFacets().put(facetName, c);
+
+ }
+ }
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorTagBase.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorTagBase.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/AjaxValidatorTagBase.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,137 +1,137 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.taglib;
-
-import javax.el.ValueExpression;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.webapp.UIComponentClassicTagBase;
-import javax.servlet.jsp.JspException;
-
-import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
-import org.richfaces.component.UIBeanValidator;
-import org.richfaces.renderkit.html.BeanValidatorRenderer;
-import org.richfaces.validator.FacesBeanValidator;
-
-/**
- * @author asmirnov
- *
- */
-public class AjaxValidatorTagBase extends UIComponentTagBase {
-
- /**
- * Generate script for given event ( onclick, onenter ... )
- */
- private String event = null;
-
- private ValueExpression summary = null;
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.webapp.UIComponentTagBase#getComponentType()
- */
- @Override
- public String getComponentType() {
- return UIBeanValidator.COMPONENT_TYPE;
- }
-
- /**
- * @param event
- * the event to set
- */
- public void setEvent(String event) {
- this.event = event;
- }
-
- /**
- * @param summary
- * the summary to set
- */
- public void setSummary(ValueExpression summary) {
- this.summary = summary;
- }
-
- @Override
- public int doStartTag() throws JspException {
- // Locate our parent UIComponentTag
- UIComponentClassicTagBase tag = UIComponentClassicTagBase
- .getParentUIComponentClassicTagBase(pageContext);
- if (tag == null) {
- // PENDING i18n
- throw new JspException(
- "Not nested in a UIComponentTag Error for tag with handler class:"
- + this.getClass().getName());
- }
- UIComponent component = tag.getComponentInstance();
- if (!(component instanceof EditableValueHolder)) {
- // PENDING i18n
- throw new JspException(
- "Not nested in a UIInput component. Error for tag with handler class:"
- + this.getClass().getName());
-
- }
- // Nothing to do unless this tag created a component
- if (tag.getCreated()) {
- // New created component, add validator.
- FacesContext facesContext = FacesContext.getCurrentInstance();
- FacesBeanValidator validator = (FacesBeanValidator) facesContext
- .getApplication().createValidator(
- FacesBeanValidator.BEAN_VALIDATOR_TYPE);
- if (null != summary) {
- validator.setSummary(summary);
- }
- ((EditableValueHolder) component).addValidator(validator);
-
- }
- return super.doStartTag();
- }
-
- @Override
- protected void setProperties(UIComponent component) {
- super.setProperties(component);
- setStringProperty(component, "event", event);
- }
-
- @Override
- public void release() {
- super.release();
- event = null;
- summary = null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.webapp.UIComponentTagBase#getRendererType()
- */
- @Override
- public String getRendererType() {
- return BeanValidatorRenderer.RENDERER_TYPE;
- }
-
- @Override
- protected String getFacetName() {
- return UIBeanValidator.BEAN_VALIDATOR_FACET
- + (null == event ? "" : event);
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.taglib;
+
+import javax.el.ValueExpression;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.webapp.UIComponentClassicTagBase;
+import javax.servlet.jsp.JspException;
+
+import org.ajax4jsf.webapp.taglib.UIComponentTagBase;
+import org.richfaces.component.UIBeanValidator;
+import org.richfaces.renderkit.html.BeanValidatorRenderer;
+import org.richfaces.validator.FacesBeanValidator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class AjaxValidatorTagBase extends UIComponentTagBase {
+
+ /**
+ * Generate script for given event ( onclick, onenter ... )
+ */
+ private String event = null;
+
+ private ValueExpression summary = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.webapp.UIComponentTagBase#getComponentType()
+ */
+ @Override
+ public String getComponentType() {
+ return UIBeanValidator.COMPONENT_TYPE;
+ }
+
+ /**
+ * @param event
+ * the event to set
+ */
+ public void setEvent(String event) {
+ this.event = event;
+ }
+
+ /**
+ * @param summary
+ * the summary to set
+ */
+ public void setSummary(ValueExpression summary) {
+ this.summary = summary;
+ }
+
+ @Override
+ public int doStartTag() throws JspException {
+ // Locate our parent UIComponentTag
+ UIComponentClassicTagBase tag = UIComponentClassicTagBase
+ .getParentUIComponentClassicTagBase(pageContext);
+ if (tag == null) {
+ // PENDING i18n
+ throw new JspException(
+ "Not nested in a UIComponentTag Error for tag with handler class:"
+ + this.getClass().getName());
+ }
+ UIComponent component = tag.getComponentInstance();
+ if (!(component instanceof EditableValueHolder)) {
+ // PENDING i18n
+ throw new JspException(
+ "Not nested in a UIInput component. Error for tag with handler class:"
+ + this.getClass().getName());
+
+ }
+ // Nothing to do unless this tag created a component
+ if (tag.getCreated()) {
+ // New created component, add validator.
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ FacesBeanValidator validator = (FacesBeanValidator) facesContext
+ .getApplication().createValidator(
+ FacesBeanValidator.BEAN_VALIDATOR_TYPE);
+ if (null != summary) {
+ validator.setSummary(summary);
+ }
+ ((EditableValueHolder) component).addValidator(validator);
+
+ }
+ return super.doStartTag();
+ }
+
+ @Override
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ setStringProperty(component, "event", event);
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ event = null;
+ summary = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.webapp.UIComponentTagBase#getRendererType()
+ */
+ @Override
+ public String getRendererType() {
+ return BeanValidatorRenderer.RENDERER_TYPE;
+ }
+
+ @Override
+ protected String getFacetName() {
+ return UIBeanValidator.BEAN_VALIDATOR_FACET
+ + (null == event ? "" : event);
+ }
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorHandler.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorHandler.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorHandler.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,61 +1,61 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.taglib;
-
-import javax.faces.validator.Validator;
-
-import org.richfaces.validator.FacesBeanValidator;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.jsf.ValidateHandler;
-import com.sun.facelets.tag.jsf.ValidatorConfig;
-
-/**
- * @author asmirnov
- *
- */
-public class BeanValidatorHandler extends ValidateHandler {
-
- private TagAttribute _summary;
-
- /**
- * @param config
- */
- public BeanValidatorHandler(TagConfig config) {
- super(config);
- _summary = getAttribute("summary");
- }
-
- @Override
- protected Validator createValidator(FaceletContext ctx) {
- FacesBeanValidator validator = (FacesBeanValidator) ctx.getFacesContext()
- .getApplication().createValidator(
- FacesBeanValidator.BEAN_VALIDATOR_TYPE);
- if (null != _summary) {
- validator
- .setSummary(_summary.getValueExpression(ctx, String.class));
- }
- return validator;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.taglib;
+
+import javax.faces.validator.Validator;
+
+import org.richfaces.validator.FacesBeanValidator;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.jsf.ValidateHandler;
+import com.sun.facelets.tag.jsf.ValidatorConfig;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class BeanValidatorHandler extends ValidateHandler {
+
+ private TagAttribute _summary;
+
+ /**
+ * @param config
+ */
+ public BeanValidatorHandler(TagConfig config) {
+ super(config);
+ _summary = getAttribute("summary");
+ }
+
+ @Override
+ protected Validator createValidator(FaceletContext ctx) {
+ FacesBeanValidator validator = (FacesBeanValidator) ctx.getFacesContext()
+ .getApplication().createValidator(
+ FacesBeanValidator.BEAN_VALIDATOR_TYPE);
+ if (null != _summary) {
+ validator
+ .setSummary(_summary.getValueExpression(ctx, String.class));
+ }
+ return validator;
+ }
+
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorTag.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorTag.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/taglib/BeanValidatorTag.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,113 +1,113 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.taglib;
-
-import javax.el.ELContext;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.servlet.jsp.JspException;
-
-import org.richfaces.validator.BeanValidator;
-import org.richfaces.validator.FacesBeanValidator;
-
-public class BeanValidatorTag extends javax.faces.webapp.ValidatorELTag {
-
- /**
- *
- */
- private static final long serialVersionUID = -5230299574915210593L;
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.taglib;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.servlet.jsp.JspException;
+
+import org.richfaces.validator.BeanValidator;
+import org.richfaces.validator.FacesBeanValidator;
+
+public class BeanValidatorTag extends javax.faces.webapp.ValidatorELTag {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5230299574915210593L;
// Fields
-
- /*
- * summary Summary message for a validation errors.
- */
- private ValueExpression _summary;
-
- /**
- * <p>The {@link javax.el.ValueExpression} that evaluates to an object that
- * implements {@link BeanValidator}.</p>
- */
- private ValueExpression binding = null;
-
- /**
- * Summary message for a validation errors. Setter for summary
- *
- * @param summary
- * - new value
- */
- public void setSummary(ValueExpression __summary) {
- this._summary = __summary;
- }
-
- /**
- * <p>Set the expression that will be used to create a
- * {@link javax.el.ValueExpression} that references a backing bean property
- * of the {@link BeanValidator} instance to be created.</p>
- *
- * @param binding The new expression
- */
- public void setBinding(ValueExpression binding) {
- this.binding = binding;
- }
-
- protected Validator createValidator() throws JspException {
- ValueExpression ve = this.binding;
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
-
- FacesBeanValidator validator = null;
-
- try {
- ELContext elContext = facesContext.getELContext();
- if (ve != null) {
- validator = (FacesBeanValidator) ve.getValue(elContext);
- }
-
- if (validator == null) {
- validator = (FacesBeanValidator) FacesContext
- .getCurrentInstance().getApplication().createValidator(
- "org.richfaces.BeanValidator");
-
- if (ve != null && validator != null) {
- ve.setValue(elContext, validator);
- }
- }
- } catch (Exception e) {
- throw new FacesException(e);
- }
-
- _setProperties(validator);
-
- return validator;
- }
-
- // Support method to wire in properties
- private void _setProperties(FacesBeanValidator validator)
- throws JspException {
- if (_summary != null) {
- if (_summary instanceof ValueExpression) {
- validator.setSummary(_summary);
- }
- }
- }
-}
+
+ /*
+ * summary Summary message for a validation errors.
+ */
+ private ValueExpression _summary;
+
+ /**
+ * <p>The {@link javax.el.ValueExpression} that evaluates to an object that
+ * implements {@link BeanValidator}.</p>
+ */
+ private ValueExpression binding = null;
+
+ /**
+ * Summary message for a validation errors. Setter for summary
+ *
+ * @param summary
+ * - new value
+ */
+ public void setSummary(ValueExpression __summary) {
+ this._summary = __summary;
+ }
+
+ /**
+ * <p>Set the expression that will be used to create a
+ * {@link javax.el.ValueExpression} that references a backing bean property
+ * of the {@link BeanValidator} instance to be created.</p>
+ *
+ * @param binding The new expression
+ */
+ public void setBinding(ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ protected Validator createValidator() throws JspException {
+ ValueExpression ve = this.binding;
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+
+ FacesBeanValidator validator = null;
+
+ try {
+ ELContext elContext = facesContext.getELContext();
+ if (ve != null) {
+ validator = (FacesBeanValidator) ve.getValue(elContext);
+ }
+
+ if (validator == null) {
+ validator = (FacesBeanValidator) FacesContext
+ .getCurrentInstance().getApplication().createValidator(
+ "org.richfaces.BeanValidator");
+
+ if (ve != null && validator != null) {
+ ve.setValue(elContext, validator);
+ }
+ }
+ } catch (Exception e) {
+ throw new FacesException(e);
+ }
+
+ _setProperties(validator);
+
+ return validator;
+ }
+
+ // Support method to wire in properties
+ private void _setProperties(FacesBeanValidator validator)
+ throws JspException {
+ if (_summary != null) {
+ if (_summary instanceof ValueExpression) {
+ validator.setSummary(_summary);
+ }
+ }
+ }
+}
Modified: trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/java/org/richfaces/validator/BeanValidator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,508 +1,508 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.el.ELContextWrapper;
-import org.hibernate.validator.ClassValidator;
-import org.hibernate.validator.InvalidValue;
-
-/**
- * Perform validation by Hibernate Validator annotations
- *
- * @author asmirnov
- *
- */
-public class BeanValidator {
-
- private static final String RESOURCE_BUNDLE_IS_NOT_REGISTERED_FOR_CURRENT_LOCALE = "Resource bundle is not registered for current locale";
-
- private static final String FACES_CONTEXT_IS_NULL = "Faces context is null";
-
- private static final String INPUT_PARAMETERS_IS_NOT_CORRECT = "Input parameters is not correct.";
-
- private static final String LOCALE_IS_NOT_SET = "Locale is not set";
-
- private static final String VIEW_ROOT_IS_NOT_INITIALIZED = "ViewRoot is not initialized";
-
- public static final String VALIDATOR_PARAM = BeanValidator.class.getName();
-
- private Map<ValidatorKey, ClassValidator<? extends Object>> classValidators = new ConcurrentHashMap<ValidatorKey, ClassValidator<? extends Object>>();
-
- private BeanValidator() {
- // This is a "singleton"-like class. Only factory methods allowed.
- }
-
- /**
- * Create BeanValidator instance. For a Junit tests only.
- *
- * @return
- */
- static BeanValidator createInstance() {
- // TODO - get instance class name from a "META-INF/service"
- // If the Seam framework is active, use org.jboss.seam.core.Validators
- // component should be used.
- return new BeanValidator();
- }
-
- private static final Object MUTEX = new Object();
-
- /**
- * Return BeanValidator object from a ServletContext attribute. Create new
- * instance if none is defined.
- *
- * @param context
- * @return
- */
- public static BeanValidator getInstance(FacesContext context) {
- ExternalContext externalContext = context.getExternalContext();
- externalContext.getContext();
- BeanValidator instance;
- // TODO - use properly synchronization mutex ?
- synchronized (MUTEX) {
- Map<String, Object> applicationMap = externalContext
- .getApplicationMap();
- instance = (BeanValidator) applicationMap.get(VALIDATOR_PARAM);
- if (null == instance) {
- // Vaildator not initialized - create and store new instance.
- instance = createInstance();
- applicationMap.put(VALIDATOR_PARAM, instance);
- }
- }
- return instance;
- }
-
- /**
- * Perform Validation for a new value.
- *
- * @param context
- * current faces context.
- * @param target
- * {@link ValueExpression} for a value assignment.
- * @param value
- * new value for validation
- * @return null if no validation errors. Array of the validation messages
- * otherwise.
- * @throws FacesException
- * if locale or context not properly initialized
- */
- public String[] validate(FacesContext context, ValueExpression target,
- Object value) {
- // TODO - check null parameters.
- if (null == context) {
- throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
- }
- String[] validationMessages = null;
- if (null != target) {
- ELContext elContext = context.getELContext();
- ValidationResolver validationResolver = new ValidationResolver(
- elContext.getELResolver(), calculateLocale(context));
- ELContextWrapper wrappedElContext = new ELContextWrapper(elContext,
- validationResolver);
- // TODO - handle ELExceptions ?
- try {
- target.setValue(wrappedElContext, value);
- } catch (ELException e) {
- throw new FacesException(e);
- }
- if (!validationResolver.isValid()) {
- validationMessages = validationResolver.getValidationMessages();
- }
-
- }
- return validationMessages;
- }
-
- protected Locale calculateLocale(FacesContext context) {
- if (null == context.getViewRoot()) {
- throw new FacesException(VIEW_ROOT_IS_NOT_INITIALIZED);
- } else if (null == context.getViewRoot().getLocale()) {
- throw new FacesException(LOCALE_IS_NOT_SET);
- }
- Locale locale = context.getViewRoot().getLocale();
- return locale;
- }
-
- // Method for checking input parameters for prevent NPE
- private void checkInputParameters(FacesContext context,
- ValueExpression target) {
- if (null == context || null == target ) {
- throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
- }
- }
-
- /**
- * Validate bean property for a new value. TODO - localization ?
- *
- * @param base
- * - bean
- * @param property
- * - bean property name.
- * @param value
- * new value.
- * @return null for a valid value, array of the validation messages
- * othervise.
- */
- public String[] validate(Object base, String property, Object value,
- Locale locale) {
- InvalidValue[] invalidValues = validateBean(base, property, value,
- locale);
- if (null == invalidValues) {
- return null;
- } else {
- String[] result = new String[invalidValues.length];
- for (int i = 0; i < invalidValues.length; i++) {
- InvalidValue invalidValue = invalidValues[i];
- result[i] = invalidValue.getMessage();
- }
- return result;
- }
- }
-
- @SuppressWarnings("unchecked")
- public String[] validateGraph(FacesContext context, Object value,
- Set<String> profiles) {
- if (null == context) {
- throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
- }
- String validationMessages[] = null;
- if (null != value) {
- ClassValidator<Object> validator = (ClassValidator<Object>) getValidator(
- value.getClass(), calculateLocale(context));
- if (validator.hasValidationRules()) {
- InvalidValue[] invalidValues = validator
- .getInvalidValues(value);
- if (null != invalidValues && invalidValues.length > 0) {
- validationMessages = new String[invalidValues.length];
- for (int i = 0; i < invalidValues.length; i++) {
- InvalidValue invalidValue = invalidValues[i];
- validationMessages[i] = invalidValue.getMessage();
- }
- }
- }
-
- }
- return validationMessages;
- }
-
- /**
- * Validate bean property of the base object aganist new value
- *
- * @param base
- * @param property
- * @param value
- * @return
- */
- protected InvalidValue[] validateBean(Object base, String property,
- Object value, Locale locale) {
- Class<? extends Object> beanClass = base.getClass();
- InvalidValue[] invalidValues = validateClass(beanClass, property,
- value, locale);
- return invalidValues;
- }
-
- /**
- * Validate bean property in the base class aganist new value.
- *
- * @param beanClass
- * @param property
- * @param value
- * @return
- */
- protected InvalidValue[] validateClass(Class<? extends Object> beanClass,
- String property, Object value, Locale locale) {
- ClassValidator<? extends Object> classValidator = getValidator(
- beanClass, locale);
- InvalidValue[] invalidValues = classValidator
- .getPotentialInvalidValues(property, value);
- return invalidValues;
- }
-
- /**
- * Get ( or create ) {@link ClassValidator} for a given bean class.
- *
- * @param beanClass
- * @return
- */
- @SuppressWarnings("unchecked")
- protected ClassValidator<? extends Object> getValidator(
- Class<? extends Object> beanClass, Locale locale) {
- // TODO - localization support.
- ValidatorKey key = new ValidatorKey(beanClass, locale);
- ClassValidator result = classValidators.get(key);
- if (null == result) {
- result = createValidator(beanClass, locale);
- classValidators.put(key, result);
- }
- return result;
- }
-
- /*
- * This method determine ResourceBundle, used in current request @param
- * locale - user locale @return ResourceBundle instance
- */
- private ResourceBundle getCurrentResourceBundle(Locale locale) {
- if (null == FacesContext.getCurrentInstance()
- || null == FacesContext.getCurrentInstance().getApplication()) {
- throw new FacesException(FACES_CONTEXT_IS_NULL);
- }
- String appBundle = FacesContext.getCurrentInstance().getApplication()
- .getMessageBundle();
- if (null == appBundle || null == locale) {
- return null;
- }
-
- ResourceBundle bundle;
-
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- if (classLoader != null) {
- bundle = ResourceBundle.getBundle(appBundle, locale, classLoader);
- } else {
- bundle = ResourceBundle.getBundle(appBundle, locale);
- }
-
- return bundle;
- }
-
- /*
- * Method for create new instance of ClassValidator, if same not in cache.
- *
- * @param beanClass - Class to validate @param locale - user Locale, used
- * during validation process @return ClassValidator instance
- */
- @SuppressWarnings("unchecked")
- private ClassValidator<? extends Object> createValidator(
- Class<? extends Object> beanClass, Locale locale) {
- ResourceBundle bundle = getCurrentResourceBundle(locale);
- return bundle == null ? new ClassValidator(beanClass)
- : new ClassValidator(beanClass, bundle);
- }
-
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perform
- * validation instead of real assignment.
- *
- * @author asmirnov
- *
- */
- final class ValidationResolver extends ELResolver {
-
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid = true;
-
- private String[] validationMessages = null;
-
- private Locale locale = null;
-
- /**
- * @param parent
- */
- public ValidationResolver(ELResolver parent, Locale locale) {
- this.parent = parent;
- this.locale = locale;
- }
-
- public boolean isValid() {
- // TODO Auto-generated method stub
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext,
- * java.lang.Object)
- */
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext,
- * java.lang.Object)
- */
- public Iterator<FeatureDescriptor> getFeatureDescriptors(
- ELContext context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public Class<?> getType(ELContext context, Object base, Object property) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object property) {
- return parent.getValue(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext,
- * java.lang.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base,
- Object property) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext,
- * java.lang.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object property,
- Object value) {
- if (null != base && null != property) {
- context.setPropertyResolved(true);
- //https://jira.jboss.org/jira/browse/RF-4034
- //apache el looses locale information during value resolution,
- //so we use our own
- validationMessages = validate(base, property.toString(), value, locale);
- valid = null == validationMessages
- || 0 == validationMessages.length;
- }
- }
-
- /**
- * @return the validationMessages
- */
- public String[] getValidationMessages() {
- return validationMessages;
- }
-
- }
-
- /**
- * Class for identify validator instance by locale
- *
- * @author amarkhel
- *
- */
- static class ValidatorKey {
- private final Class<? extends Object> validatableClass;
- private final Locale locale;
-
- /**
- * Constructor for ValidatorKey object
- *
- * @param validatableClass
- * - class to validate
- * @param locale
- * - User locale to determine Resource bundle, used during
- * validation process
- */
- public ValidatorKey(Class<? extends Object> validatableClass,
- Locale locale) {
- this.validatableClass = validatableClass;
- this.locale = locale;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((locale == null) ? 0 : locale.hashCode());
- result = prime
- * result
- + ((validatableClass == null) ? 0 : validatableClass
- .hashCode());
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (!(obj instanceof ValidatorKey))
- return false;
- ValidatorKey other = (ValidatorKey) obj;
- if (locale == null) {
- if (other.locale != null)
- return false;
- } else if (!locale.equals(other.locale))
- return false;
- if (validatableClass == null) {
- if (other.validatableClass != null)
- return false;
- } else if (!validatableClass.equals(other.validatableClass))
- return false;
- return true;
- }
-
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.validator;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.el.ELContextWrapper;
+import org.hibernate.validator.ClassValidator;
+import org.hibernate.validator.InvalidValue;
+
+/**
+ * Perform validation by Hibernate Validator annotations
+ *
+ * @author asmirnov
+ *
+ */
+public class BeanValidator {
+
+ private static final String RESOURCE_BUNDLE_IS_NOT_REGISTERED_FOR_CURRENT_LOCALE = "Resource bundle is not registered for current locale";
+
+ private static final String FACES_CONTEXT_IS_NULL = "Faces context is null";
+
+ private static final String INPUT_PARAMETERS_IS_NOT_CORRECT = "Input parameters is not correct.";
+
+ private static final String LOCALE_IS_NOT_SET = "Locale is not set";
+
+ private static final String VIEW_ROOT_IS_NOT_INITIALIZED = "ViewRoot is not initialized";
+
+ public static final String VALIDATOR_PARAM = BeanValidator.class.getName();
+
+ private Map<ValidatorKey, ClassValidator<? extends Object>> classValidators = new ConcurrentHashMap<ValidatorKey, ClassValidator<? extends Object>>();
+
+ private BeanValidator() {
+ // This is a "singleton"-like class. Only factory methods allowed.
+ }
+
+ /**
+ * Create BeanValidator instance. For a Junit tests only.
+ *
+ * @return
+ */
+ static BeanValidator createInstance() {
+ // TODO - get instance class name from a "META-INF/service"
+ // If the Seam framework is active, use org.jboss.seam.core.Validators
+ // component should be used.
+ return new BeanValidator();
+ }
+
+ private static final Object MUTEX = new Object();
+
+ /**
+ * Return BeanValidator object from a ServletContext attribute. Create new
+ * instance if none is defined.
+ *
+ * @param context
+ * @return
+ */
+ public static BeanValidator getInstance(FacesContext context) {
+ ExternalContext externalContext = context.getExternalContext();
+ externalContext.getContext();
+ BeanValidator instance;
+ // TODO - use properly synchronization mutex ?
+ synchronized (MUTEX) {
+ Map<String, Object> applicationMap = externalContext
+ .getApplicationMap();
+ instance = (BeanValidator) applicationMap.get(VALIDATOR_PARAM);
+ if (null == instance) {
+ // Vaildator not initialized - create and store new instance.
+ instance = createInstance();
+ applicationMap.put(VALIDATOR_PARAM, instance);
+ }
+ }
+ return instance;
+ }
+
+ /**
+ * Perform Validation for a new value.
+ *
+ * @param context
+ * current faces context.
+ * @param target
+ * {@link ValueExpression} for a value assignment.
+ * @param value
+ * new value for validation
+ * @return null if no validation errors. Array of the validation messages
+ * otherwise.
+ * @throws FacesException
+ * if locale or context not properly initialized
+ */
+ public String[] validate(FacesContext context, ValueExpression target,
+ Object value) {
+ // TODO - check null parameters.
+ if (null == context) {
+ throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
+ }
+ String[] validationMessages = null;
+ if (null != target) {
+ ELContext elContext = context.getELContext();
+ ValidationResolver validationResolver = new ValidationResolver(
+ elContext.getELResolver(), calculateLocale(context));
+ ELContextWrapper wrappedElContext = new ELContextWrapper(elContext,
+ validationResolver);
+ // TODO - handle ELExceptions ?
+ try {
+ target.setValue(wrappedElContext, value);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ if (!validationResolver.isValid()) {
+ validationMessages = validationResolver.getValidationMessages();
+ }
+
+ }
+ return validationMessages;
+ }
+
+ protected Locale calculateLocale(FacesContext context) {
+ if (null == context.getViewRoot()) {
+ throw new FacesException(VIEW_ROOT_IS_NOT_INITIALIZED);
+ } else if (null == context.getViewRoot().getLocale()) {
+ throw new FacesException(LOCALE_IS_NOT_SET);
+ }
+ Locale locale = context.getViewRoot().getLocale();
+ return locale;
+ }
+
+ // Method for checking input parameters for prevent NPE
+ private void checkInputParameters(FacesContext context,
+ ValueExpression target) {
+ if (null == context || null == target ) {
+ throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
+ }
+ }
+
+ /**
+ * Validate bean property for a new value. TODO - localization ?
+ *
+ * @param base
+ * - bean
+ * @param property
+ * - bean property name.
+ * @param value
+ * new value.
+ * @return null for a valid value, array of the validation messages
+ * othervise.
+ */
+ public String[] validate(Object base, String property, Object value,
+ Locale locale) {
+ InvalidValue[] invalidValues = validateBean(base, property, value,
+ locale);
+ if (null == invalidValues) {
+ return null;
+ } else {
+ String[] result = new String[invalidValues.length];
+ for (int i = 0; i < invalidValues.length; i++) {
+ InvalidValue invalidValue = invalidValues[i];
+ result[i] = invalidValue.getMessage();
+ }
+ return result;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public String[] validateGraph(FacesContext context, Object value,
+ Set<String> profiles) {
+ if (null == context) {
+ throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
+ }
+ String validationMessages[] = null;
+ if (null != value) {
+ ClassValidator<Object> validator = (ClassValidator<Object>) getValidator(
+ value.getClass(), calculateLocale(context));
+ if (validator.hasValidationRules()) {
+ InvalidValue[] invalidValues = validator
+ .getInvalidValues(value);
+ if (null != invalidValues && invalidValues.length > 0) {
+ validationMessages = new String[invalidValues.length];
+ for (int i = 0; i < invalidValues.length; i++) {
+ InvalidValue invalidValue = invalidValues[i];
+ validationMessages[i] = invalidValue.getMessage();
+ }
+ }
+ }
+
+ }
+ return validationMessages;
+ }
+
+ /**
+ * Validate bean property of the base object aganist new value
+ *
+ * @param base
+ * @param property
+ * @param value
+ * @return
+ */
+ protected InvalidValue[] validateBean(Object base, String property,
+ Object value, Locale locale) {
+ Class<? extends Object> beanClass = base.getClass();
+ InvalidValue[] invalidValues = validateClass(beanClass, property,
+ value, locale);
+ return invalidValues;
+ }
+
+ /**
+ * Validate bean property in the base class aganist new value.
+ *
+ * @param beanClass
+ * @param property
+ * @param value
+ * @return
+ */
+ protected InvalidValue[] validateClass(Class<? extends Object> beanClass,
+ String property, Object value, Locale locale) {
+ ClassValidator<? extends Object> classValidator = getValidator(
+ beanClass, locale);
+ InvalidValue[] invalidValues = classValidator
+ .getPotentialInvalidValues(property, value);
+ return invalidValues;
+ }
+
+ /**
+ * Get ( or create ) {@link ClassValidator} for a given bean class.
+ *
+ * @param beanClass
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ protected ClassValidator<? extends Object> getValidator(
+ Class<? extends Object> beanClass, Locale locale) {
+ // TODO - localization support.
+ ValidatorKey key = new ValidatorKey(beanClass, locale);
+ ClassValidator result = classValidators.get(key);
+ if (null == result) {
+ result = createValidator(beanClass, locale);
+ classValidators.put(key, result);
+ }
+ return result;
+ }
+
+ /*
+ * This method determine ResourceBundle, used in current request @param
+ * locale - user locale @return ResourceBundle instance
+ */
+ private ResourceBundle getCurrentResourceBundle(Locale locale) {
+ if (null == FacesContext.getCurrentInstance()
+ || null == FacesContext.getCurrentInstance().getApplication()) {
+ throw new FacesException(FACES_CONTEXT_IS_NULL);
+ }
+ String appBundle = FacesContext.getCurrentInstance().getApplication()
+ .getMessageBundle();
+ if (null == appBundle || null == locale) {
+ return null;
+ }
+
+ ResourceBundle bundle;
+
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ if (classLoader != null) {
+ bundle = ResourceBundle.getBundle(appBundle, locale, classLoader);
+ } else {
+ bundle = ResourceBundle.getBundle(appBundle, locale);
+ }
+
+ return bundle;
+ }
+
+ /*
+ * Method for create new instance of ClassValidator, if same not in cache.
+ *
+ * @param beanClass - Class to validate @param locale - user Locale, used
+ * during validation process @return ClassValidator instance
+ */
+ @SuppressWarnings("unchecked")
+ private ClassValidator<? extends Object> createValidator(
+ Class<? extends Object> beanClass, Locale locale) {
+ ResourceBundle bundle = getCurrentResourceBundle(locale);
+ return bundle == null ? new ClassValidator(beanClass)
+ : new ClassValidator(beanClass, bundle);
+ }
+
+ /**
+ * Wrapper class for a {@link ELResolver}. For a setValue method, perform
+ * validation instead of real assignment.
+ *
+ * @author asmirnov
+ *
+ */
+ final class ValidationResolver extends ELResolver {
+
+ /**
+ * Original resolver.
+ */
+ private final ELResolver parent;
+
+ private boolean valid = true;
+
+ private String[] validationMessages = null;
+
+ private Locale locale = null;
+
+ /**
+ * @param parent
+ */
+ public ValidationResolver(ELResolver parent, Locale locale) {
+ this.parent = parent;
+ this.locale = locale;
+ }
+
+ public boolean isValid() {
+ // TODO Auto-generated method stub
+ return valid;
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext,
+ * java.lang.Object)
+ */
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ return parent.getCommonPropertyType(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext,
+ * java.lang.Object)
+ */
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(
+ ELContext context, Object base) {
+ return parent.getFeatureDescriptors(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getType(javax.el.ELContext,
+ * java.lang.Object, java.lang.Object)
+ */
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ return parent.getType(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext,
+ * java.lang.Object, java.lang.Object)
+ */
+ public Object getValue(ELContext context, Object base, Object property) {
+ return parent.getValue(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext,
+ * java.lang.Object, java.lang.Object)
+ */
+ public boolean isReadOnly(ELContext context, Object base,
+ Object property) {
+ return parent.isReadOnly(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @param value
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext,
+ * java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) {
+ if (null != base && null != property) {
+ context.setPropertyResolved(true);
+ //https://jira.jboss.org/jira/browse/RF-4034
+ //apache el looses locale information during value resolution,
+ //so we use our own
+ validationMessages = validate(base, property.toString(), value, locale);
+ valid = null == validationMessages
+ || 0 == validationMessages.length;
+ }
+ }
+
+ /**
+ * @return the validationMessages
+ */
+ public String[] getValidationMessages() {
+ return validationMessages;
+ }
+
+ }
+
+ /**
+ * Class for identify validator instance by locale
+ *
+ * @author amarkhel
+ *
+ */
+ static class ValidatorKey {
+ private final Class<? extends Object> validatableClass;
+ private final Locale locale;
+
+ /**
+ * Constructor for ValidatorKey object
+ *
+ * @param validatableClass
+ * - class to validate
+ * @param locale
+ * - User locale to determine Resource bundle, used during
+ * validation process
+ */
+ public ValidatorKey(Class<? extends Object> validatableClass,
+ Locale locale) {
+ this.validatableClass = validatableClass;
+ this.locale = locale;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((locale == null) ? 0 : locale.hashCode());
+ result = prime
+ * result
+ + ((validatableClass == null) ? 0 : validatableClass
+ .hashCode());
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof ValidatorKey))
+ return false;
+ ValidatorKey other = (ValidatorKey) obj;
+ if (locale == null) {
+ if (other.locale != null)
+ return false;
+ } else if (!locale.equals(other.locale))
+ return false;
+ if (validatableClass == null) {
+ if (other.validatableClass != null)
+ return false;
+ } else if (!validatableClass.equals(other.validatableClass))
+ return false;
+ return true;
+ }
+
+ }
+}
Modified: trunk/ui/beanValidator/src/main/templates/org/richfaces/ui/htmlBeanValidator.jspx
===================================================================
--- trunk/ui/beanValidator/src/main/templates/org/richfaces/ui/htmlBeanValidator.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/main/templates/org/richfaces/ui/htmlBeanValidator.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -14,4 +14,4 @@
x:passThruWithExclusions="value,name,type,id"
>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java
===================================================================
--- trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/test/java/org/richfaces/validator/BeanValidatorTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,81 +1,81 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.hibernate.validator.ClassValidator;
-import org.hibernate.validator.InvalidValue;
-
-public class BeanValidatorTest extends AbstractAjax4JsfTestCase {
-
- public BeanValidatorTest(String name) {
- super(name);
- }
-
- public void testValidate() {
-
- }
-
- public void setUp() throws Exception {
- super.setUp();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testGetValidator() throws Exception {
- BeanValidator beanValidator = BeanValidator.createInstance();
- ClassValidator<? extends Object> validator = beanValidator.getValidator(ValidableBean.class,Locale.ENGLISH);
- assertNotNull(validator);
- assertTrue(validator.hasValidationRules());
- validator = beanValidator.getValidator(String.class,Locale.getDefault());
- assertNotNull(validator);
- assertFalse(validator.hasValidationRules());
- }
-
- public void testValidateClass() throws Exception {
- BeanValidator beanValidator = BeanValidator.createInstance();
- InvalidValue[] invalidValues = beanValidator.validateClass(ValidableBean.class, "integerProperty", new Integer(3),Locale.getDefault());
- assertNotNull(invalidValues);
- assertEquals(0, invalidValues.length);
- invalidValues = beanValidator.validateClass(ValidableBean.class, "integerProperty", new Integer(-1),Locale.getDefault());
- assertNotNull(invalidValues);
- assertEquals(1, invalidValues.length);
- invalidValues = beanValidator.validateClass(UnValidableBean.class, "integerProperty", new Integer(-1),Locale.getDefault());
- assertNotNull(invalidValues);
- assertEquals(0, invalidValues.length);
- invalidValues = beanValidator.validateClass(ValidableBean.class, "nonExistentProperty", new Integer(-1),Locale.getDefault());
- assertNotNull(invalidValues);
- assertEquals(0, invalidValues.length);
-
- }
-
- public void testValidateBean() throws Exception {
- BeanValidator beanValidator = BeanValidator.createInstance();
- InvalidValue[] invalidValues = beanValidator.validateBean(new ValidableBean(), "integerProperty", new Integer(-1),Locale.getDefault());
- assertNotNull(invalidValues);
- assertEquals(1, invalidValues.length);
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.validator;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.hibernate.validator.ClassValidator;
+import org.hibernate.validator.InvalidValue;
+
+public class BeanValidatorTest extends AbstractAjax4JsfTestCase {
+
+ public BeanValidatorTest(String name) {
+ super(name);
+ }
+
+ public void testValidate() {
+
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testGetValidator() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ ClassValidator<? extends Object> validator = beanValidator.getValidator(ValidableBean.class,Locale.ENGLISH);
+ assertNotNull(validator);
+ assertTrue(validator.hasValidationRules());
+ validator = beanValidator.getValidator(String.class,Locale.getDefault());
+ assertNotNull(validator);
+ assertFalse(validator.hasValidationRules());
+ }
+
+ public void testValidateClass() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ InvalidValue[] invalidValues = beanValidator.validateClass(ValidableBean.class, "integerProperty", new Integer(3),Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(0, invalidValues.length);
+ invalidValues = beanValidator.validateClass(ValidableBean.class, "integerProperty", new Integer(-1),Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(1, invalidValues.length);
+ invalidValues = beanValidator.validateClass(UnValidableBean.class, "integerProperty", new Integer(-1),Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(0, invalidValues.length);
+ invalidValues = beanValidator.validateClass(ValidableBean.class, "nonExistentProperty", new Integer(-1),Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(0, invalidValues.length);
+
+ }
+
+ public void testValidateBean() throws Exception {
+ BeanValidator beanValidator = BeanValidator.createInstance();
+ InvalidValue[] invalidValues = beanValidator.validateBean(new ValidableBean(), "integerProperty", new Integer(-1),Locale.getDefault());
+ assertNotNull(invalidValues);
+ assertEquals(1, invalidValues.length);
+ }
+}
Modified: trunk/ui/beanValidator/src/test/java/org/richfaces/validator/UnValidableBean.java
===================================================================
--- trunk/ui/beanValidator/src/test/java/org/richfaces/validator/UnValidableBean.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/test/java/org/richfaces/validator/UnValidableBean.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,78 +1,78 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-
-/**
- * @author asmirnov
- *
- */
-public class UnValidableBean {
-
- private int integerProperty;
-
- private String text;
-
- private Object foo;
-
- /**
- * @return the integerProperty
- */
- public int getIntegerProperty() {
- return integerProperty;
- }
-
- /**
- * @param integerProperty the integerProperty to set
- */
- public void setIntegerProperty(int integerProperty) {
- this.integerProperty = integerProperty;
- }
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the foo
- */
- public Object getFoo() {
- return foo;
- }
-
- /**
- * @param foo the foo to set
- */
- public void setFoo(Object foo) {
- this.foo = foo;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.validator;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class UnValidableBean {
+
+ private int integerProperty;
+
+ private String text;
+
+ private Object foo;
+
+ /**
+ * @return the integerProperty
+ */
+ public int getIntegerProperty() {
+ return integerProperty;
+ }
+
+ /**
+ * @param integerProperty the integerProperty to set
+ */
+ public void setIntegerProperty(int integerProperty) {
+ this.integerProperty = integerProperty;
+ }
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the foo
+ */
+ public Object getFoo() {
+ return foo;
+ }
+
+ /**
+ * @param foo the foo to set
+ */
+ public void setFoo(Object foo) {
+ this.foo = foo;
+ }
+
+}
Modified: trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java
===================================================================
--- trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/beanValidator/src/test/java/org/richfaces/validator/ValidableBean.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,88 +1,88 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-import org.hibernate.validator.Length;
-import org.hibernate.validator.Max;
-import org.hibernate.validator.Min;
-import org.hibernate.validator.NotNull;
-
-/**
- * @author asmirnov
- *
- */
-public class ValidableBean {
-
- @Min(2)
- @Max(5)
- private int integerProperty;
-
- private String text;
-
- private Object foo;
-
- /**
- * @return the integerProperty
- */
- public int getIntegerProperty() {
- return integerProperty;
- }
-
- /**
- * @param integerProperty the integerProperty to set
- */
- @Min(2)
- @Max(5)
- public void setIntegerProperty(int integerProperty) {
- this.integerProperty = integerProperty;
- }
-
- /**
- * @return the text
- */
- public String getText() {
- return text;
- }
-
- /**
- * @param text the text to set
- */
- @Length(max=10,min=1,message="text size")
- public void setText(String text) {
- this.text = text;
- }
-
- /**
- * @return the foo
- */
- public Object getFoo() {
- return foo;
- }
-
- /**
- * @param foo the foo to set
- */
- @NotNull
- public void setFoo(Object foo) {
- this.foo = foo;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.validator;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Max;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotNull;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ValidableBean {
+
+ @Min(2)
+ @Max(5)
+ private int integerProperty;
+
+ private String text;
+
+ private Object foo;
+
+ /**
+ * @return the integerProperty
+ */
+ public int getIntegerProperty() {
+ return integerProperty;
+ }
+
+ /**
+ * @param integerProperty the integerProperty to set
+ */
+ @Min(2)
+ @Max(5)
+ public void setIntegerProperty(int integerProperty) {
+ this.integerProperty = integerProperty;
+ }
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ @Length(max=10,min=1,message="text size")
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ /**
+ * @return the foo
+ */
+ public Object getFoo() {
+ return foo;
+ }
+
+ /**
+ * @param foo the foo to set
+ */
+ @NotNull
+ public void setFoo(Object foo) {
+ this.foo = foo;
+ }
+
+}
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarSeparator.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarSeparator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/html/iconimages/CalendarSeparator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,121 +1,121 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.util.Date;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.GifRenderer;
-import org.ajax4jsf.resource.InternetResourceBuilder;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.resource.ResourceContext;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.Zipper2;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class CalendarSeparator extends Java2Dresource {
- private final static Dimension DIMENSIONS = new Dimension(1, 15);
- private final static String COLOR_SKIN_PARAM = "headerTextColor";
- private final static String DEFAULT_HTML_COLOR = "#FFFFFF";
-
- public CalendarSeparator() {
- setRenderer(new GifRenderer());
- setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
- }
-
- @Override
- public Dimension getDimensions(FacesContext facesContext, Object data) {
- return DIMENSIONS;
- }
-
- @Override
- protected Dimension getDimensions(ResourceContext resourceContext) {
- return DIMENSIONS;
- }
-
- @Override
- protected Object getDataToStore(FacesContext context, Object data) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
- Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
-
- byte [] ret = new byte[3];
- Color color = null;
- Zipper2 zipper = new Zipper2(ret);
-
- String htmlColor = (String) skin.getParameter(context, COLOR_SKIN_PARAM);
- if (null == htmlColor || "".equals(htmlColor))
- htmlColor = (String) defaultSkin.getParameter(context, COLOR_SKIN_PARAM);
-
- if (htmlColor == null) {
- htmlColor = DEFAULT_HTML_COLOR;
- }
-
- color = HtmlColor.decode(htmlColor);
-
- zipper.addColor(color);
-
- return ret;
- }
-
- @Override
- protected void paint(ResourceContext context, Graphics2D g2d) {
- Color color = (Color)restoreData(context);
-
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
- g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
- g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
-
- g2d.setColor(color);
- //TODO hans, need to be optimized
- for (int i = 0;i < DIMENSIONS.getHeight(); i += 2 ) {
- g2d.drawLine(0, i, 0, i);
- }
- }
-
- protected Object deserializeData(byte[] objectArray) {
- if (objectArray == null) {
- return null;
- }
-
- Zipper2 zipper = new Zipper2(objectArray);
-
- return zipper.nextColor();
- }
-
- public boolean isCacheable() {
- return true;
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.GifRenderer;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.resource.ResourceContext;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class CalendarSeparator extends Java2Dresource {
+ private final static Dimension DIMENSIONS = new Dimension(1, 15);
+ private final static String COLOR_SKIN_PARAM = "headerTextColor";
+ private final static String DEFAULT_HTML_COLOR = "#FFFFFF";
+
+ public CalendarSeparator() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ @Override
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return DIMENSIONS;
+ }
+
+ @Override
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return DIMENSIONS;
+ }
+
+ @Override
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+
+ byte [] ret = new byte[3];
+ Color color = null;
+ Zipper2 zipper = new Zipper2(ret);
+
+ String htmlColor = (String) skin.getParameter(context, COLOR_SKIN_PARAM);
+ if (null == htmlColor || "".equals(htmlColor))
+ htmlColor = (String) defaultSkin.getParameter(context, COLOR_SKIN_PARAM);
+
+ if (htmlColor == null) {
+ htmlColor = DEFAULT_HTML_COLOR;
+ }
+
+ color = HtmlColor.decode(htmlColor);
+
+ zipper.addColor(color);
+
+ return ret;
+ }
+
+ @Override
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ Color color = (Color)restoreData(context);
+
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
+ g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
+ g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
+
+ g2d.setColor(color);
+ //TODO hans, need to be optimized
+ for (int i = 0;i < DIMENSIONS.getHeight(); i += 2 ) {
+ g2d.drawLine(0, i, 0, i);
+ }
+ }
+
+ protected Object deserializeData(byte[] objectArray) {
+ if (objectArray == null) {
+ return null;
+ }
+
+ Zipper2 zipper = new Zipper2(objectArray);
+
+ return zipper.nextColor();
+ }
+
+ public boolean isCacheable() {
+ return true;
+ }
+}
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -92,7 +92,7 @@
variables.setVariable("buttonIcon",buttonIcon);
if(buttonLabel==null || buttonLabel.length()==0){
]]>
- </jsp:scriptlet> <img id="#{clientId}PopupButton" alt=" "
+ </jsp:scriptlet> <img id="#{clientId}PopupButton" alt=""
class="rich-calendar-button #{component.attributes['buttonClass']}"
accesskey="#{component.attributes['accesskey']}"
style="vertical-align: middle"
Modified: trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
===================================================================
--- trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -38,4 +38,4 @@
public abstract boolean isEnableManualInput();
public abstract void setEnableManualInput(boolean enableManualInput);
-}
\ No newline at end of file
+}
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -244,18 +244,18 @@
<table id="#{clientId}shadow" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="rich-combobox-shadow-tl">
- <img src="#{spacer}" width="10" height="1" alt=" " style="border:0"></img><br></br>
+ <img src="#{spacer}" width="10" height="1" alt="" style="border:0"></img><br></br>
</td>
<td class="rich-combobox-shadow-tr">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"></img><br></br>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"></img><br></br>
</td>
</tr>
<tr>
<td class="rich-combobox-shadow-bl">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"></img><br></br>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"></img><br></br>
</td>
<td class="rich-combobox-shadow-br">
- <img src="#{spacer}" width="10" height="10" alt=" " style="border:0"></img><br></br>
+ <img src="#{spacer}" width="10" height="10" alt="" style="border:0"></img><br></br>
</td>
</tr>
</table>
@@ -362,4 +362,4 @@
#{component.attributes["showDelay"]}, #{component.attributes["hideDelay"]});
</script>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx
===================================================================
--- trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -54,4 +54,4 @@
<![CDATA[ } ]]>
</jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/Lifo.java
===================================================================
--- trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/Lifo.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/contextMenu/src/main/java/org/richfaces/renderkit/html/Lifo.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -60,4 +60,4 @@
return top.content;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/KeepAlive.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,43 +1,43 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import javax.faces.component.UIComponentBase;
-
-/**
- * @author asmirnov
- *
- */
-public class KeepAlive extends UIComponentBase {
-
- public static final String COMPONENT_TYPE = "org.ajax4jsf.KeepAlive";
- public static final String COMPONENT_FAMILY = "org.ajax4jsf.KeepAlive";
-
- /* (non-Javadoc)
- * @see javax.faces.component.UIComponent#getFamily()
- */
- @Override
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import javax.faces.component.UIComponentBase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class KeepAlive extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.ajax4jsf.KeepAlive";
+ public static final String COMPONENT_FAMILY = "org.ajax4jsf.KeepAlive";
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getFamily()
+ */
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+}
Modified: trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java
===================================================================
--- trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/java/org/ajax4jsf/component/UIPortlet.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,73 +1,73 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.component;
-
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author asmirnov
- *
- */
-public class UIPortlet extends UIComponentBase implements NamingContainer {
-
-
- private static final Log _log = LogFactory.getLog(UIPortlet.class);
- /**
- * <p>The standard component type for this component.</p>
- */
- public static final String COMPONENT_TYPE = "org.ajax4jsf.Portlet";
-
-
- /**
- * <p>The standard component family for this component.</p>
- */
- public static final String COMPONENT_FAMILY = "org.ajax4jsf.Portlet";
-
- /* (non-Javadoc)
- * @see javax.faces.component.UIComponent#getFamily()
- */
- public String getFamily() {
- // TODO Auto-generated method stub
- return COMPONENT_FAMILY;
- }
-
- private String portletId = null;
-
- @Override
- public void setId(String id) {
- portletId = null;
- super.setId(id);
- }
-
- // ----------------------------------------------------- UIComponent Methods
- public String getClientId(FacesContext context) {
- if (portletId == null) {
- portletId = context.getExternalContext().encodeNamespace(super.getClientId(context));
- }
- return portletId;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.component;
+
+import javax.faces.component.NamingContainer;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class UIPortlet extends UIComponentBase implements NamingContainer {
+
+
+ private static final Log _log = LogFactory.getLog(UIPortlet.class);
+ /**
+ * <p>The standard component type for this component.</p>
+ */
+ public static final String COMPONENT_TYPE = "org.ajax4jsf.Portlet";
+
+
+ /**
+ * <p>The standard component family for this component.</p>
+ */
+ public static final String COMPONENT_FAMILY = "org.ajax4jsf.Portlet";
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getFamily()
+ */
+ public String getFamily() {
+ // TODO Auto-generated method stub
+ return COMPONENT_FAMILY;
+ }
+
+ private String portletId = null;
+
+ @Override
+ public void setId(String id) {
+ portletId = null;
+ super.setId(id);
+ }
+
+ // ----------------------------------------------------- UIComponent Methods
+ public String getClientId(FacesContext context) {
+ if (portletId == null) {
+ portletId = context.getExternalContext().encodeNamespace(super.getClientId(context));
+ }
+ return portletId;
+ }
+
+}
Modified: trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/button.jspx
===================================================================
--- trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/button.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/button.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -47,4 +47,4 @@
<jsp:scriptlet>encodeTypeAndImage(context,component);</jsp:scriptlet>
</input>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/function.jspx
===================================================================
--- trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/function.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/function.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -21,4 +21,4 @@
#{this:getFunction(context,component)};
//]]>
</script>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/link.jspx
===================================================================
--- trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/link.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/link.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -18,7 +18,7 @@
type="#{component.attributes['type']}"
x:passThruWithExclusions="value,name,onclick,type,href,id"
onclick="#{this:getOnClick(context,component)}"
- href="#"
+ href="#"
class="#{component.attributes['styleClass']}"
>
#{this:getValue(component)}
@@ -27,4 +27,4 @@
</vcp:body>
</a>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/log.jspx
===================================================================
--- trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/log.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/main/templates/org/ajax4jsf/renderkit/html/log.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -24,10 +24,10 @@
x:style='width:#{component.width};height:#{component.height};overflow:auto;#{component.attributes["style"]}'
x:passThruWithExclusions="value,name,id,style"
>
- <button onclick="LOG.clear()">Clear</button><br />
- <script type="text/javascript">
- LOG.LEVEL = LOG.#{component.level};
+ <button onclick="LOG.clear()">Clear</button><br />
+ <script type="text/javascript">
+ LOG.LEVEL = LOG.#{component.level};
</script>
</div>
<jsp:scriptlet> } </jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/IncludeComponentTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/IncludeComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/IncludeComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,86 +1,86 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-
-public class IncludeComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
- private UIInclude include = null;
- private UIForm form = null;
-
- public IncludeComponentTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- include = (UIInclude) application.createComponent(UIInclude.COMPONENT_TYPE);
- include.setId("include");
- include.setLayout(UIInclude.LAYOUT_NONE);
-
- form.getChildren().add(include);
-
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- form = null;
- include = null;
- }
-
- public void testState() throws Exception {
-
- }
-
- public void testViewId() throws Exception {
- include.setViewId(null);
- assertNull(include.getViewId());
-
- String viewId = "viewId";
- include.setViewId(viewId);
- String newViewId = include.getViewId();
- assertNotNull(newViewId);
- assertEquals(viewId, newViewId);
- }
-
- public void testLayout() throws Exception {
- include.setLayout(null);
- assertNull(include.getLayout());
-
- include.setLayout(UIInclude.LAYOUT_BLOCK);
- String newLayout = include.getLayout();
- assertNotNull(newLayout);
- assertEquals(UIInclude.LAYOUT_BLOCK, newLayout);
- }
-
- public void testAjaxRendered() throws Exception {
- assertFalse(include.isAjaxRendered());
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+
+public class IncludeComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+ private UIInclude include = null;
+ private UIForm form = null;
+
+ public IncludeComponentTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ include = (UIInclude) application.createComponent(UIInclude.COMPONENT_TYPE);
+ include.setId("include");
+ include.setLayout(UIInclude.LAYOUT_NONE);
+
+ form.getChildren().add(include);
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ form = null;
+ include = null;
+ }
+
+ public void testState() throws Exception {
+
+ }
+
+ public void testViewId() throws Exception {
+ include.setViewId(null);
+ assertNull(include.getViewId());
+
+ String viewId = "viewId";
+ include.setViewId(viewId);
+ String newViewId = include.getViewId();
+ assertNotNull(newViewId);
+ assertEquals(viewId, newViewId);
+ }
+
+ public void testLayout() throws Exception {
+ include.setLayout(null);
+ assertNull(include.getLayout());
+
+ include.setLayout(UIInclude.LAYOUT_BLOCK);
+ String newLayout = include.getLayout();
+ assertNotNull(newLayout);
+ assertEquals(UIInclude.LAYOUT_BLOCK, newLayout);
+ }
+
+ public void testAjaxRendered() throws Exception {
+ assertFalse(include.isAjaxRendered());
+ }
+
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadBundleComponentTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadBundleComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadBundleComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,144 +1,144 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.component;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class LoadBundleComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
- private UIForm form;
- private UILoadBundle bundle = null;
- private static final String BUNDLE_NAME = "testBundle";
-
- public LoadBundleComponentTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- bundle = (UILoadBundle) application.createComponent(UILoadBundle.COMPONENT_TYPE);
- if (null != bundle) {
- bundle.setId("loadBundle");
- bundle.setVar(BUNDLE_NAME);
- bundle.setBasename("org.ajax4jsf.component.test_skin");
- form.getChildren().add(bundle);
- }
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- form = null;
- bundle = null;
- }
-
- public void testLoadBundle() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
- assertNotNull(loadedMap);
-
- assertEquals("non-existent key", loadedMap.get("non-existent key"));
-
- assertEquals("#000000", loadedMap.get("shadowBackgroundColor"));
- }
-
- public void testSize() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
- assertNotNull(loadedMap);
-
- assertEquals(0, loadedMap.size());
- }
-
- public void testContainsKey() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
- assertNotNull(loadedMap);
-
- assertTrue(loadedMap.containsKey("shadowBackgroundColor"));
-
- assertFalse(loadedMap.containsKey("non-existent key"));
- }
-
- public void testFakeFunctions() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
- assertNotNull(loadedMap);
-
- assertFalse(loadedMap.isEmpty());
-
- assertFalse(loadedMap.containsValue(null));
- assertFalse(loadedMap.containsValue("any-string"));
-
- try {
- loadedMap.put("key1", "value1");
- assertFalse("UnsupportedOperationException was not thrown", true);
- } catch (UnsupportedOperationException e) {
-
- }
-
- try {
- loadedMap.putAll(new HashMap());
- assertFalse("UnsupportedOperationException was not thrown", true);
- } catch (UnsupportedOperationException e) {
-
- }
-
- try {
- loadedMap.remove("key1");
- assertFalse("UnsupportedOperationException was not thrown", true);
- } catch (UnsupportedOperationException e) {
-
- }
-
- try {
- loadedMap.clear();
- assertFalse("UnsupportedOperationException was not thrown", true);
- } catch (UnsupportedOperationException e) {
-
- }
-
- assertNull(loadedMap.keySet());
-
- assertNull(loadedMap.values());
-
- assertNull(loadedMap.entrySet());
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class LoadBundleComponentTest extends org.ajax4jsf.tests.AbstractAjax4JsfTestCase {
+ private UIForm form;
+ private UILoadBundle bundle = null;
+ private static final String BUNDLE_NAME = "testBundle";
+
+ public LoadBundleComponentTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ bundle = (UILoadBundle) application.createComponent(UILoadBundle.COMPONENT_TYPE);
+ if (null != bundle) {
+ bundle.setId("loadBundle");
+ bundle.setVar(BUNDLE_NAME);
+ bundle.setBasename("org.ajax4jsf.component.test_skin");
+ form.getChildren().add(bundle);
+ }
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ form = null;
+ bundle = null;
+ }
+
+ public void testLoadBundle() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
+ assertNotNull(loadedMap);
+
+ assertEquals("non-existent key", loadedMap.get("non-existent key"));
+
+ assertEquals("#000000", loadedMap.get("shadowBackgroundColor"));
+ }
+
+ public void testSize() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
+ assertNotNull(loadedMap);
+
+ assertEquals(0, loadedMap.size());
+ }
+
+ public void testContainsKey() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
+ assertNotNull(loadedMap);
+
+ assertTrue(loadedMap.containsKey("shadowBackgroundColor"));
+
+ assertFalse(loadedMap.containsKey("non-existent key"));
+ }
+
+ public void testFakeFunctions() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ Map loadedMap = (Map)facesContext.getExternalContext().getRequestMap().get(BUNDLE_NAME);
+ assertNotNull(loadedMap);
+
+ assertFalse(loadedMap.isEmpty());
+
+ assertFalse(loadedMap.containsValue(null));
+ assertFalse(loadedMap.containsValue("any-string"));
+
+ try {
+ loadedMap.put("key1", "value1");
+ assertFalse("UnsupportedOperationException was not thrown", true);
+ } catch (UnsupportedOperationException e) {
+
+ }
+
+ try {
+ loadedMap.putAll(new HashMap());
+ assertFalse("UnsupportedOperationException was not thrown", true);
+ } catch (UnsupportedOperationException e) {
+
+ }
+
+ try {
+ loadedMap.remove("key1");
+ assertFalse("UnsupportedOperationException was not thrown", true);
+ } catch (UnsupportedOperationException e) {
+
+ }
+
+ try {
+ loadedMap.clear();
+ assertFalse("UnsupportedOperationException was not thrown", true);
+ } catch (UnsupportedOperationException e) {
+
+ }
+
+ assertNull(loadedMap.keySet());
+
+ assertNull(loadedMap.values());
+
+ assertNull(loadedMap.entrySet());
+ }
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/component/LoadResourceComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -361,4 +361,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxFormRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxFormRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxFormRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,144 +1,144 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.ajax4jsf.component.UIAjaxForm;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-public class AjaxFormRendererTest extends AbstractAjax4JsfTestCase {
- private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
- private static Set javaScripts = new HashSet();
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
- }
-
- private UIAjaxForm form1;
- private UIAjaxForm form2;
-
- public AjaxFormRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form1 = (UIAjaxForm) application.createComponent(UIAjaxForm.COMPONENT_TYPE);
- form1.setId("form1");
- form1.setAjaxSubmit(true);
-
- form2 = (UIAjaxForm) application.createComponent(UIAjaxForm.COMPONENT_TYPE);
- form2.setId("form2");
- form2.setAjaxSubmit(false);
-
- facesContext.getViewRoot().getChildren().add(form1);
- facesContext.getViewRoot().getChildren().add(form2);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test script rendering
- *
- * @throws Exception
- */
- public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
- }
-
- /**
- * Test rendering
- *
- * @throws Exception
- */
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement htmlForm1 = page.getHtmlElementById(form1.getClientId(facesContext));
- assertNotNull(htmlForm1);
- assertEquals("form", htmlForm1.getTagName());
-
- String action = htmlForm1.getAttributeValue("action");
- assertNotNull(action);
- assertTrue(action.startsWith("javascript:A4J.AJAX.SubmitForm"));
-
- HtmlElement htmlForm2 = page.getHtmlElementById(form2.getClientId(facesContext));
- assertNotNull(htmlForm2);
- assertEquals("form", htmlForm2.getTagName());
-
- action = htmlForm2.getAttributeValue("action");
- assertNotNull(action);
- assertTrue(action.startsWith("/"));
- }
-
- /**
- * Test rendering hidden inputs
- *
- * @throws Exception
- */
- public void testRenderHiddenInputs() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement htmlForm1 = page.getHtmlElementById(form1.getClientId(facesContext));
- List inputs = htmlForm1.getHtmlElementsByTagName("input");
- assertNotNull(inputs);
- boolean foundId = false;
- boolean foundAutoscroll = false;
- for (Iterator it = inputs.iterator(); it.hasNext();) {
- HtmlElement input = (HtmlElement) it.next();
- String name = input.getAttributeValue("name");
- assertNotNull(name);
- if (!foundId && name.equals(form1.getClientId(facesContext))) {
- foundId = true;
- }
- if (!foundAutoscroll && name.equals("autoScroll")) {
- foundAutoscroll = true;
- }
- }
- assertTrue(foundId);
- assertTrue(foundAutoscroll);
-
- HtmlElement htmlForm2 = page.getHtmlElementById(form2.getClientId(facesContext));
- assertNotNull(htmlForm2);
- assertEquals("form", htmlForm2.getTagName());
-
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.ajax4jsf.component.UIAjaxForm;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class AjaxFormRendererTest extends AbstractAjax4JsfTestCase {
+ private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
+ private static Set javaScripts = new HashSet();
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
+ }
+
+ private UIAjaxForm form1;
+ private UIAjaxForm form2;
+
+ public AjaxFormRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form1 = (UIAjaxForm) application.createComponent(UIAjaxForm.COMPONENT_TYPE);
+ form1.setId("form1");
+ form1.setAjaxSubmit(true);
+
+ form2 = (UIAjaxForm) application.createComponent(UIAjaxForm.COMPONENT_TYPE);
+ form2.setId("form2");
+ form2.setAjaxSubmit(false);
+
+ facesContext.getViewRoot().getChildren().add(form1);
+ facesContext.getViewRoot().getChildren().add(form2);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test script rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
+ }
+
+ /**
+ * Test rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement htmlForm1 = page.getHtmlElementById(form1.getClientId(facesContext));
+ assertNotNull(htmlForm1);
+ assertEquals("form", htmlForm1.getTagName());
+
+ String action = htmlForm1.getAttributeValue("action");
+ assertNotNull(action);
+ assertTrue(action.startsWith("javascript:A4J.AJAX.SubmitForm"));
+
+ HtmlElement htmlForm2 = page.getHtmlElementById(form2.getClientId(facesContext));
+ assertNotNull(htmlForm2);
+ assertEquals("form", htmlForm2.getTagName());
+
+ action = htmlForm2.getAttributeValue("action");
+ assertNotNull(action);
+ assertTrue(action.startsWith("/"));
+ }
+
+ /**
+ * Test rendering hidden inputs
+ *
+ * @throws Exception
+ */
+ public void testRenderHiddenInputs() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement htmlForm1 = page.getHtmlElementById(form1.getClientId(facesContext));
+ List inputs = htmlForm1.getHtmlElementsByTagName("input");
+ assertNotNull(inputs);
+ boolean foundId = false;
+ boolean foundAutoscroll = false;
+ for (Iterator it = inputs.iterator(); it.hasNext();) {
+ HtmlElement input = (HtmlElement) it.next();
+ String name = input.getAttributeValue("name");
+ assertNotNull(name);
+ if (!foundId && name.equals(form1.getClientId(facesContext))) {
+ foundId = true;
+ }
+ if (!foundAutoscroll && name.equals("autoScroll")) {
+ foundAutoscroll = true;
+ }
+ }
+ assertTrue(foundId);
+ assertTrue(foundAutoscroll);
+
+ HtmlElement htmlForm2 = page.getHtmlElementById(form2.getClientId(facesContext));
+ assertNotNull(htmlForm2);
+ assertEquals("form", htmlForm2.getTagName());
+
+ }
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxIncludeRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxIncludeRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxIncludeRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,103 +1,103 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.component.UIInclude;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-import com.gargoylesoftware.htmlunit.ElementNotFoundException;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class AjaxIncludeRendererTest extends AbstractAjax4JsfTestCase {
- private UIInclude include1 = null;
- private UIInclude include2 = null;
- private UIInclude include3 = null;
- private UIForm form;
-
- public AjaxIncludeRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- include1 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
- include1.setId("include1");
- include1.setLayout(UIInclude.LAYOUT_NONE);
-
- UIOutput output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- output.setRendered(true);
- output.setId("output");
- output.setValue("output");
- include1.getChildren().add(output);
-
- include2 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
- include2.setId("include2");
- include2.setLayout(UIInclude.LAYOUT_BLOCK);
-
- include3 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
- include3.setId("include3");
- include3.setLayout(UIInclude.LAYOUT_INLINE);
-
- form.getChildren().add(include1);
- form.getChildren().add(include2);
- form.getChildren().add(include3);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- include1 = null;
- include2 = null;
- include3 = null;
- }
-
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- try {
- HtmlElement empty = page.getHtmlElementById(include1.getClientId(facesContext));
- assertFalse("ElementNotFoundException was not thrown", true);
- } catch (ElementNotFoundException e) {
-
- }
-
- HtmlElement div = page.getHtmlElementById(include2.getClientId(facesContext));
- assertNotNull(div);
- assertEquals("div", div.getNodeName());
-
- HtmlElement span = page.getHtmlElementById(include3.getClientId(facesContext));
- assertNotNull(span);
- assertEquals("span", span.getNodeName());
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.component.UIInclude;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.ElementNotFoundException;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AjaxIncludeRendererTest extends AbstractAjax4JsfTestCase {
+ private UIInclude include1 = null;
+ private UIInclude include2 = null;
+ private UIInclude include3 = null;
+ private UIForm form;
+
+ public AjaxIncludeRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ include1 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
+ include1.setId("include1");
+ include1.setLayout(UIInclude.LAYOUT_NONE);
+
+ UIOutput output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ output.setRendered(true);
+ output.setId("output");
+ output.setValue("output");
+ include1.getChildren().add(output);
+
+ include2 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
+ include2.setId("include2");
+ include2.setLayout(UIInclude.LAYOUT_BLOCK);
+
+ include3 = (UIInclude)application.createComponent(UIInclude.COMPONENT_TYPE);
+ include3.setId("include3");
+ include3.setLayout(UIInclude.LAYOUT_INLINE);
+
+ form.getChildren().add(include1);
+ form.getChildren().add(include2);
+ form.getChildren().add(include3);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ include1 = null;
+ include2 = null;
+ include3 = null;
+ }
+
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ try {
+ HtmlElement empty = page.getHtmlElementById(include1.getClientId(facesContext));
+ assertFalse("ElementNotFoundException was not thrown", true);
+ } catch (ElementNotFoundException e) {
+
+ }
+
+ HtmlElement div = page.getHtmlElementById(include2.getClientId(facesContext));
+ assertNotNull(div);
+ assertEquals("div", div.getNodeName());
+
+ HtmlElement span = page.getHtmlElementById(include3.getClientId(facesContext));
+ assertNotNull(span);
+ assertEquals("span", span.getNodeName());
+ }
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxOutputPanelRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,119 +1,119 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.component.UIAjaxOutputPanel;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-import com.gargoylesoftware.htmlunit.ElementNotFoundException;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class AjaxOutputPanelRendererTest extends AbstractAjax4JsfTestCase {
- private UIForm form = null;
- private UIAjaxOutputPanel panel1 = null;
- private UIAjaxOutputPanel panel2 = null;
- private UIAjaxOutputPanel panel3 = null;
- private UIAjaxOutputPanel panel4 = null;
- private UIOutput output = null;
-
- public AjaxOutputPanelRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- panel1 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
- panel1.setId("panel1");
- panel1.setLayout("none");
- form.getChildren().add(panel1);
-
- panel2 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
- panel2.setId("panel2");
- panel2.setLayout("block");
- form.getChildren().add(panel2);
-
- panel3 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
- panel3.setId("panel3");
- panel3.setLayout("inline");
- form.getChildren().add(panel3);
-
- panel4 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
- panel4.setId("panel4");
- panel4.setLayout("none");
-
- output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- output.setId("output");
- output.setValue("output");
- output.setTransient(true);
- panel4.getChildren().add(output);
-
- form.getChildren().add(panel4);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- output = null;
- panel1 = null;
- panel2 = null;
- panel3 = null;
- form = null;
- }
-
- public void testRender() throws Exception{
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- try {
- HtmlElement empty = page.getHtmlElementById(panel1.getClientId(facesContext));
- assertFalse("ElementNotFoundException was not thrown", true);
- } catch (ElementNotFoundException e) {
-
- }
-
- HtmlElement div = page.getHtmlElementById(panel2.getClientId(facesContext));
- assertNotNull(div);
- assertEquals("div", div.getNodeName());
-
- HtmlElement span = page.getHtmlElementById(panel3.getClientId(facesContext));
- assertNotNull(span);
- assertEquals("span", span.getNodeName());
-
- span = page.getHtmlElementById(output.getClientId(facesContext));
- assertNotNull(span);
- assertEquals("span", span.getNodeName());
-
- assertFalse(output.isTransient());
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.component.UIAjaxOutputPanel;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.ElementNotFoundException;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AjaxOutputPanelRendererTest extends AbstractAjax4JsfTestCase {
+ private UIForm form = null;
+ private UIAjaxOutputPanel panel1 = null;
+ private UIAjaxOutputPanel panel2 = null;
+ private UIAjaxOutputPanel panel3 = null;
+ private UIAjaxOutputPanel panel4 = null;
+ private UIOutput output = null;
+
+ public AjaxOutputPanelRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ panel1 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
+ panel1.setId("panel1");
+ panel1.setLayout("none");
+ form.getChildren().add(panel1);
+
+ panel2 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
+ panel2.setId("panel2");
+ panel2.setLayout("block");
+ form.getChildren().add(panel2);
+
+ panel3 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
+ panel3.setId("panel3");
+ panel3.setLayout("inline");
+ form.getChildren().add(panel3);
+
+ panel4 = (UIAjaxOutputPanel)application.createComponent(UIAjaxOutputPanel.COMPONENT_TYPE);
+ panel4.setId("panel4");
+ panel4.setLayout("none");
+
+ output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ output.setId("output");
+ output.setValue("output");
+ output.setTransient(true);
+ panel4.getChildren().add(output);
+
+ form.getChildren().add(panel4);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ output = null;
+ panel1 = null;
+ panel2 = null;
+ panel3 = null;
+ form = null;
+ }
+
+ public void testRender() throws Exception{
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ try {
+ HtmlElement empty = page.getHtmlElementById(panel1.getClientId(facesContext));
+ assertFalse("ElementNotFoundException was not thrown", true);
+ } catch (ElementNotFoundException e) {
+
+ }
+
+ HtmlElement div = page.getHtmlElementById(panel2.getClientId(facesContext));
+ assertNotNull(div);
+ assertEquals("div", div.getNodeName());
+
+ HtmlElement span = page.getHtmlElementById(panel3.getClientId(facesContext));
+ assertNotNull(span);
+ assertEquals("span", span.getNodeName());
+
+ span = page.getHtmlElementById(output.getClientId(facesContext));
+ assertNotNull(span);
+ assertEquals("span", span.getNodeName());
+
+ assertFalse(output.isTransient());
+ }
+
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPageRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPageRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPageRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,127 +1,127 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Set;
-
-import javax.faces.component.UIOutput;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class AjaxPageRendererTest extends AbstractAjax4JsfTestCase{
-
- private org.ajax4jsf.component.html.HtmlPage ajaxPage = null;
- private static Set<String> javaScripts = new HashSet<String>();
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- }
-
- private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
-
- public AjaxPageRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- ajaxPage = (org.ajax4jsf.component.html.HtmlPage) application.createComponent(org.ajax4jsf.component.html.HtmlPage.COMPONENT_TYPE);
- ajaxPage.setId("page");
-
- UIOutput head = new UIOutput();
- head.setValue("HEAD");
- ajaxPage.getFacets().put("head", head);
-
- UIOutput content = new UIOutput();
- content.setValue("content");
- ajaxPage.getChildren().add(content);
-
- ajaxPage.setFormat("xhtml");
- ajaxPage.setPageTitle("title");
-
- facesContext.getViewRoot().setLocale(new Locale("be", "BY"));
-
- facesContext.getViewRoot().getChildren().add(ajaxPage);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- HtmlElement html = (HtmlElement)page.getFirstChild();
- assertNotNull(html);
- assertEquals("html", html.getTagName());
-
- String lang = html.getAttributeValue("lang");
- assertNotNull(lang);
- assertEquals(lang, "be_BY");
-
- HtmlElement title = (HtmlElement) html.getHtmlElementsByTagName("title").get(0);
- assertNotNull(title);
-
- assertEquals("title", title.getFirstChild().asText());
-
- HtmlElement meta = (HtmlElement) html.getHtmlElementsByTagName("meta").get(0);
-
- assertNotNull(meta);
- String httpEquiv = meta.getAttributeValue("http-equiv");
- assertEquals(httpEquiv, "Content-Type");
-
- String content = meta.getAttributeValue("content");
- assertEquals(content, "application/xhtml+xml");
- }
-
- public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
- }
-
- @Override
- protected void encodeDocumentProlog(FacesContext context,
- UIViewRoot viewRoot, ResponseWriter writer) throws IOException {
-
- //do nothing as a4j:page encodes full page structure
- }
-
- @Override
- protected void encodeDocumentEpilog(FacesContext context,
- UIViewRoot viewRoot, ResponseWriter writer) throws IOException {
-
- //do nothing as a4j:page encodes full page structure
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AjaxPageRendererTest extends AbstractAjax4JsfTestCase{
+
+ private org.ajax4jsf.component.html.HtmlPage ajaxPage = null;
+ private static Set<String> javaScripts = new HashSet<String>();
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ }
+
+ private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
+
+ public AjaxPageRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ ajaxPage = (org.ajax4jsf.component.html.HtmlPage) application.createComponent(org.ajax4jsf.component.html.HtmlPage.COMPONENT_TYPE);
+ ajaxPage.setId("page");
+
+ UIOutput head = new UIOutput();
+ head.setValue("HEAD");
+ ajaxPage.getFacets().put("head", head);
+
+ UIOutput content = new UIOutput();
+ content.setValue("content");
+ ajaxPage.getChildren().add(content);
+
+ ajaxPage.setFormat("xhtml");
+ ajaxPage.setPageTitle("title");
+
+ facesContext.getViewRoot().setLocale(new Locale("be", "BY"));
+
+ facesContext.getViewRoot().getChildren().add(ajaxPage);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement html = (HtmlElement)page.getFirstChild();
+ assertNotNull(html);
+ assertEquals("html", html.getTagName());
+
+ String lang = html.getAttributeValue("lang");
+ assertNotNull(lang);
+ assertEquals(lang, "be_BY");
+
+ HtmlElement title = (HtmlElement) html.getHtmlElementsByTagName("title").get(0);
+ assertNotNull(title);
+
+ assertEquals("title", title.getFirstChild().asText());
+
+ HtmlElement meta = (HtmlElement) html.getHtmlElementsByTagName("meta").get(0);
+
+ assertNotNull(meta);
+ String httpEquiv = meta.getAttributeValue("http-equiv");
+ assertEquals(httpEquiv, "Content-Type");
+
+ String content = meta.getAttributeValue("content");
+ assertEquals(content, "application/xhtml+xml");
+ }
+
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
+ }
+
+ @Override
+ protected void encodeDocumentProlog(FacesContext context,
+ UIViewRoot viewRoot, ResponseWriter writer) throws IOException {
+
+ //do nothing as a4j:page encodes full page structure
+ }
+
+ @Override
+ protected void encodeDocumentEpilog(FacesContext context,
+ UIViewRoot viewRoot, ResponseWriter writer) throws IOException {
+
+ //do nothing as a4j:page encodes full page structure
+ }
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPushRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPushRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxPushRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,140 +1,140 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.component.UIPush;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-
-import com.gargoylesoftware.htmlunit.html.DomText;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-public class AjaxPushRendererTest extends AbstractAjax4JsfTestCase {
-
- private static Set<String> javaScripts = new HashSet<String>();
- private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- }
- private UIForm form = null;
- private UIPush push1 = null;
- private UIPush push2 = null;
-
- public AjaxPushRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- push1 = (UIPush) application.createComponent(UIPush.COMPONENT_TYPE);
- push1.setId("push1");
- push1.setEnabled(true);
- form.getChildren().add(push1);
-
- push2 = (UIPush) application.createComponent(UIPush.COMPONENT_TYPE);
- push2.setId("push2");
- push2.setEnabled(false);
- form.getChildren().add(push2);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- push1 = null;
- push2 = null;
- form = null;
- }
-
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- HtmlElement span1 = page.getHtmlElementById(push1.getClientId(facesContext));
- assertNotNull(span1);
- assertEquals("span", span1.getTagName());
- String style = span1.getAttributeValue("style");
- assertNotNull(style);
- assertTrue(style.matches("display\\s*\\:\\s*none\\s*\\;\\s*"));
-
- HtmlElement span2 = page.getHtmlElementById(push2.getClientId(facesContext));
- assertNotNull(span2);
- assertEquals("span", span2.getTagName());
- style = span2.getAttributeValue("style");
- assertNotNull(style);
- assertTrue(style.matches("display\\s*\\:\\s*none\\s*\\;\\s*"));
- }
-
- public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
- assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
-
- HtmlElement span1 = page.getHtmlElementById(push1.getClientId(facesContext));
- assertNotNull(span1);
- scripts = span1.getHtmlElementsByTagName("script");
- int i = 0;
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- DomText text = (DomText) item.getFirstChild();
-
- assertNotNull(text);
- assertTrue(text.asText().contains("A4J.AJAX.Push"));
-
- i++;
- }
- assertEquals(1, i);
-
- HtmlElement span2 = page.getHtmlElementById(push2.getClientId(facesContext));
- assertNotNull(span2);
- scripts = span2.getHtmlElementsByTagName("script");
- i = 0;
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- DomText text = (DomText) item.getFirstChild();
-
- assertNotNull(text);
- assertTrue(text.asText().contains("A4J.AJAX.StopPush"));
-
- i++;
- }
- assertEquals(1, i);
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.component.UIPush;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+
+import com.gargoylesoftware.htmlunit.html.DomText;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class AjaxPushRendererTest extends AbstractAjax4JsfTestCase {
+
+ private static Set<String> javaScripts = new HashSet<String>();
+ private static final boolean IS_PAGE_AVAILABILITY_CHECK = true;
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ }
+ private UIForm form = null;
+ private UIPush push1 = null;
+ private UIPush push2 = null;
+
+ public AjaxPushRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ push1 = (UIPush) application.createComponent(UIPush.COMPONENT_TYPE);
+ push1.setId("push1");
+ push1.setEnabled(true);
+ form.getChildren().add(push1);
+
+ push2 = (UIPush) application.createComponent(UIPush.COMPONENT_TYPE);
+ push2.setId("push2");
+ push2.setEnabled(false);
+ form.getChildren().add(push2);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ push1 = null;
+ push2 = null;
+ form = null;
+ }
+
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement span1 = page.getHtmlElementById(push1.getClientId(facesContext));
+ assertNotNull(span1);
+ assertEquals("span", span1.getTagName());
+ String style = span1.getAttributeValue("style");
+ assertNotNull(style);
+ assertTrue(style.matches("display\\s*\\:\\s*none\\s*\\;\\s*"));
+
+ HtmlElement span2 = page.getHtmlElementById(push2.getClientId(facesContext));
+ assertNotNull(span2);
+ assertEquals("span", span2.getTagName());
+ style = span2.getAttributeValue("style");
+ assertNotNull(style);
+ assertTrue(style.matches("display\\s*\\:\\s*none\\s*\\;\\s*"));
+ }
+
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ assertEquals(getCountValidScripts(page, javaScripts, IS_PAGE_AVAILABILITY_CHECK).intValue(), javaScripts.size());
+
+ HtmlElement span1 = page.getHtmlElementById(push1.getClientId(facesContext));
+ assertNotNull(span1);
+ scripts = span1.getHtmlElementsByTagName("script");
+ int i = 0;
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ DomText text = (DomText) item.getFirstChild();
+
+ assertNotNull(text);
+ assertTrue(text.asText().contains("A4J.AJAX.Push"));
+
+ i++;
+ }
+ assertEquals(1, i);
+
+ HtmlElement span2 = page.getHtmlElementById(push2.getClientId(facesContext));
+ assertNotNull(span2);
+ scripts = span2.getHtmlElementsByTagName("script");
+ i = 0;
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ DomText text = (DomText) item.getFirstChild();
+
+ assertNotNull(text);
+ assertTrue(text.asText().contains("A4J.AJAX.StopPush"));
+
+ i++;
+ }
+ assertEquals(1, i);
+ }
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxStatusRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxStatusRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/AjaxStatusRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,153 +1,153 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.UIGraphic;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.component.UIAjaxStatus;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class AjaxStatusRendererTest extends AbstractAjax4JsfTestCase {
- private UIForm form = null;
- private UIAjaxStatus status1 = null;
- private UIAjaxStatus status2 = null;
-
- public AjaxStatusRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- application.addComponent("org.ajax4jsf.AjaxStatus", "org.ajax4jsf.component.html.HtmlAjaxStatus");
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- status1 = (UIAjaxStatus)application.createComponent(UIAjaxStatus.COMPONENT_TYPE);
- status1.setId("status1");
- status1.setStartStyle("color: red;");
- status1.setStartStyleClass("A B C D");
- status1.setStopStyle("color: green;");
- status1.setStopStyleClass("X Y Z");
- status1.setStartText("startText");
- status1.setStopText("stopText");
- status1.getAttributes().put("layout", "block");
-
- status2 = (UIAjaxStatus)application.createComponent(UIAjaxStatus.COMPONENT_TYPE);
- status2.setId("status2");
- status2.setStartStyle("color: red;");
- status2.setStartStyleClass("A B C D");
- status2.setStopStyle("color: green;");
- status2.setStopStyleClass("X Y Z");
- status2.getAttributes().put("layout", "inline");
-
- UIGraphic startImage = new UIGraphic();
- startImage.setValue("start.png");
- startImage.getAttributes().put("alt", "alt");
- status2.getFacets().put("start", startImage);
-
- UIGraphic stopGraphic = new UIGraphic();
- stopGraphic.setValue("stop.png");
- stopGraphic.getAttributes().put("alt", "alt");
- status2.getFacets().put("stop", stopGraphic);
-
- form.getChildren().add(status1);
- form.getChildren().add(status2);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- status1 = null;
- status2 = null;
- form = null;
- }
-
- /**
- * Test rendering
- *
- * @throws Exception
- */
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement div = page.getHtmlElementById(status1.getClientId(facesContext));
- assertNotNull(div);
- assertEquals("div", div.getNodeName());
-
- Iterator childIterator = div.getChildIterator();
- int i = 0;
- while (childIterator.hasNext()) {
- i++;
- HtmlElement element = (HtmlElement) childIterator.next();
- assertEquals("div", element.getNodeName());
- }
- assertEquals(2, i);
-
- HtmlElement div1 = page.getHtmlElementById(status1.getClientId(facesContext) + ".start");
- assertNotNull(div1);
- String style1 = div1.getAttributeValue("style");
- assertNotNull(style1);
- assertTrue(style1.contains("color: red;"));
- String class1 = div1.getAttributeValue("class");
- assertNotNull(class1);
- assertEquals(class1, "A B C D");
-
- HtmlElement div2 = page.getHtmlElementById(status1.getClientId(facesContext) + ".stop");
- assertNotNull(div2);
- String style2 = div2.getAttributeValue("style");
- assertNotNull(style2);
- assertTrue(style2.contains("color: green;"));
- String class2 = div2.getAttributeValue("class");
- assertNotNull(class2);
- assertEquals(class2, "X Y Z");
-
- form.getChildren().remove(0);
- page = renderView();
- System.out.println(page.asXml());
-
- HtmlElement span = (HtmlElement) div.getNextSibling();
- assertNotNull(span);
- assertEquals("span", span.getNodeName());
-
- childIterator = span.getChildIterator();
- i = 0;
- while (childIterator.hasNext()) {
- i++;
- HtmlElement element = (HtmlElement) childIterator.next();
- assertEquals("span", element.getNodeName());
- assertEquals("img", element.getFirstChild().getNodeName());
- }
- assertEquals(2, i);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIGraphic;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.component.UIAjaxStatus;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class AjaxStatusRendererTest extends AbstractAjax4JsfTestCase {
+ private UIForm form = null;
+ private UIAjaxStatus status1 = null;
+ private UIAjaxStatus status2 = null;
+
+ public AjaxStatusRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent("org.ajax4jsf.AjaxStatus", "org.ajax4jsf.component.html.HtmlAjaxStatus");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ status1 = (UIAjaxStatus)application.createComponent(UIAjaxStatus.COMPONENT_TYPE);
+ status1.setId("status1");
+ status1.setStartStyle("color: red;");
+ status1.setStartStyleClass("A B C D");
+ status1.setStopStyle("color: green;");
+ status1.setStopStyleClass("X Y Z");
+ status1.setStartText("startText");
+ status1.setStopText("stopText");
+ status1.getAttributes().put("layout", "block");
+
+ status2 = (UIAjaxStatus)application.createComponent(UIAjaxStatus.COMPONENT_TYPE);
+ status2.setId("status2");
+ status2.setStartStyle("color: red;");
+ status2.setStartStyleClass("A B C D");
+ status2.setStopStyle("color: green;");
+ status2.setStopStyleClass("X Y Z");
+ status2.getAttributes().put("layout", "inline");
+
+ UIGraphic startImage = new UIGraphic();
+ startImage.setValue("start.png");
+ startImage.getAttributes().put("alt", "alt");
+ status2.getFacets().put("start", startImage);
+
+ UIGraphic stopGraphic = new UIGraphic();
+ stopGraphic.setValue("stop.png");
+ stopGraphic.getAttributes().put("alt", "alt");
+ status2.getFacets().put("stop", stopGraphic);
+
+ form.getChildren().add(status1);
+ form.getChildren().add(status2);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ status1 = null;
+ status2 = null;
+ form = null;
+ }
+
+ /**
+ * Test rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement div = page.getHtmlElementById(status1.getClientId(facesContext));
+ assertNotNull(div);
+ assertEquals("div", div.getNodeName());
+
+ Iterator childIterator = div.getChildIterator();
+ int i = 0;
+ while (childIterator.hasNext()) {
+ i++;
+ HtmlElement element = (HtmlElement) childIterator.next();
+ assertEquals("div", element.getNodeName());
+ }
+ assertEquals(2, i);
+
+ HtmlElement div1 = page.getHtmlElementById(status1.getClientId(facesContext) + ".start");
+ assertNotNull(div1);
+ String style1 = div1.getAttributeValue("style");
+ assertNotNull(style1);
+ assertTrue(style1.contains("color: red;"));
+ String class1 = div1.getAttributeValue("class");
+ assertNotNull(class1);
+ assertEquals(class1, "A B C D");
+
+ HtmlElement div2 = page.getHtmlElementById(status1.getClientId(facesContext) + ".stop");
+ assertNotNull(div2);
+ String style2 = div2.getAttributeValue("style");
+ assertNotNull(style2);
+ assertTrue(style2.contains("color: green;"));
+ String class2 = div2.getAttributeValue("class");
+ assertNotNull(class2);
+ assertEquals(class2, "X Y Z");
+
+ form.getChildren().remove(0);
+ page = renderView();
+ System.out.println(page.asXml());
+
+ HtmlElement span = (HtmlElement) div.getNextSibling();
+ assertNotNull(span);
+ assertEquals("span", span.getNodeName());
+
+ childIterator = span.getChildIterator();
+ i = 0;
+ while (childIterator.hasNext()) {
+ i++;
+ HtmlElement element = (HtmlElement) childIterator.next();
+ assertEquals("span", element.getNodeName());
+ assertEquals("img", element.getFirstChild().getNodeName());
+ }
+ assertEquals(2, i);
+ }
+
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/HtmlCommandLinkRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,139 +1,139 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlCommandLink;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-public class HtmlCommandLinkRendererTest extends AbstractAjax4JsfTestCase {
- /** Set with required javascripts for Editor */
- private static Set<String> javaScripts = new HashSet<String>();
-
- static {
- javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
- }
-
- private UIForm form = null;
- private HtmlCommandLink link1 = null;
- private HtmlCommandLink link2 = null;
-
- public HtmlCommandLinkRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- facesContext.getRenderKit().addRenderer(HtmlCommandLink.COMPONENT_FAMILY, "org.ajax4jsf.Link", new HtmlCommandLinkRenderer());
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- link1 = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
- link1.setId("link1");
- link1.setValue("link1");
- link1.getAttributes().put("disabled", Boolean.FALSE);
- link1.setRendererType("org.ajax4jsf.Link");
- form.getChildren().add(link1);
-
- link2 = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
- link2.setId("link2");
- link2.setValue("link2");
- link2.getAttributes().put("disabled", Boolean.TRUE);
- link2.setRendererType("org.ajax4jsf.Link");
- form.getChildren().add(link2);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- link1 = null;
- link2 = null;
- form = null;
- }
-
- public void testRendered() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- HtmlElement href = page.getHtmlElementById(link1.getClientId(facesContext));
- assertNotNull(href);
- assertEquals("a", href.getTagName());
-
- String onclick = href.getAttributeValue("onclick");
- assertNotNull(onclick);
- assertTrue(onclick.contains(AjaxFormRenderer.FORM_SUBMIT_FUNCTION_NAME));
-
- HtmlElement span = page.getHtmlElementById(link2.getClientId(facesContext));
- assertNotNull(span);
- assertEquals("span", span.getTagName());
-
- String disabled = span.getAttributeValue("disabled");
- assertNotNull(disabled);
- assertEquals("disabled", disabled);
- }
-
- /**
- * Method to test if required scripts is present on page
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- public void testLinkScripts() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- List scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName(
- "script");
-
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
- assertTrue(found);
- }
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlCommandLink;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class HtmlCommandLinkRendererTest extends AbstractAjax4JsfTestCase {
+ /** Set with required javascripts for Editor */
+ private static Set<String> javaScripts = new HashSet<String>();
+
+ static {
+ javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
+ }
+
+ private UIForm form = null;
+ private HtmlCommandLink link1 = null;
+ private HtmlCommandLink link2 = null;
+
+ public HtmlCommandLinkRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ facesContext.getRenderKit().addRenderer(HtmlCommandLink.COMPONENT_FAMILY, "org.ajax4jsf.Link", new HtmlCommandLinkRenderer());
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ link1 = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
+ link1.setId("link1");
+ link1.setValue("link1");
+ link1.getAttributes().put("disabled", Boolean.FALSE);
+ link1.setRendererType("org.ajax4jsf.Link");
+ form.getChildren().add(link1);
+
+ link2 = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
+ link2.setId("link2");
+ link2.setValue("link2");
+ link2.getAttributes().put("disabled", Boolean.TRUE);
+ link2.setRendererType("org.ajax4jsf.Link");
+ form.getChildren().add(link2);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ link1 = null;
+ link2 = null;
+ form = null;
+ }
+
+ public void testRendered() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement href = page.getHtmlElementById(link1.getClientId(facesContext));
+ assertNotNull(href);
+ assertEquals("a", href.getTagName());
+
+ String onclick = href.getAttributeValue("onclick");
+ assertNotNull(onclick);
+ assertTrue(onclick.contains(AjaxFormRenderer.FORM_SUBMIT_FUNCTION_NAME));
+
+ HtmlElement span = page.getHtmlElementById(link2.getClientId(facesContext));
+ assertNotNull(span);
+ assertEquals("span", span.getTagName());
+
+ String disabled = span.getAttributeValue("disabled");
+ assertNotNull(disabled);
+ assertEquals("disabled", disabled);
+ }
+
+ /**
+ * Method to test if required scripts is present on page
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public void testLinkScripts() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ List scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName(
+ "script");
+
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+ }
+ }
+
+}
Modified: trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/MediaOutputRendererTest.java
===================================================================
--- trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/MediaOutputRendererTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/core/src/test/java/org/ajax4jsf/renderkit/html/MediaOutputRendererTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,141 +1,141 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.renderkit.html;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIForm;
-import javax.faces.component.UIParameter;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.component.UIMediaOutput;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class MediaOutputRendererTest extends AbstractAjax4JsfTestCase {
- UIForm form = null;
- UIMediaOutput media1 = null;
- UIMediaOutput media2 = null;
- UIMediaOutput media3 = null;
- UIMediaOutput media4 = null;
- UIMediaOutput media5 = null;
-
- public MediaOutputRendererTest(String name) {
- super(name);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- application.addComponent("org.ajax4jsf.MMedia", "org.ajax4jsf.component.html.MediaOutput");
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- media1 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
- media1.setId("media1");
- media1.setElement("a");
- media1.setUriAttribute("href");
- form.getChildren().add(media1);
-
- media2 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
- media2.setId("media2");
- media2.setElement("img");
- media2.setUriAttribute("src");
- media2.getAttributes().put("alt", "Generated value");
- form.getChildren().add(media2);
-
- media3 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
- media3.setId("media3");
- media3.setElement("object");
- media3.setUriAttribute("data");
- form.getChildren().add(media3);
-
- media4 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
- media4.setId("media4");
- media4.setElement("a");
- UIParameter param = new UIParameter();
- param.setName("name");
- param.setValue("value");
- media4.getChildren().add(param);
- form.getChildren().add(media4);
-
- media5 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
- media5.setId("media5");
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- media1 = null;
- media2 = null;
- media3 = null;
- media4 = null;
- media5 = null;
- form = null;
- }
-
- public void testRender() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- System.out.println(page.asXml());
-
- HtmlElement a = page.getHtmlElementById(media1.getClientId(facesContext));
- assertNotNull(a);
- assertEquals("a", a.getTagName());
- String href = a.getAttributeValue("href");
- assertNotNull(href);
-
- HtmlElement img = page.getHtmlElementById(media2.getClientId(facesContext));
- assertNotNull(img);
- assertEquals("img", img.getTagName());
- String src = img.getAttributeValue("src");
- assertNotNull(src);
-
- HtmlElement object = page.getHtmlElementById(media3.getClientId(facesContext));
- assertNotNull(object);
- assertEquals("object", object.getTagName());
- String data = object.getAttributeValue("data");
- assertNotNull(data);
-
- // Rendering without uriAttribute
- HtmlElement a2 = page.getHtmlElementById(media4.getClientId(facesContext));
- assertNotNull(a2);
- assertEquals("a", a2.getTagName());
- String href2 = a2.getAttributeValue("href");
- assertNotNull(href2);
- assertTrue(href2.endsWith("name=value"));
- }
-
- public void testRenderWithoutElement() throws Exception {
- form.getChildren().add(media5);
- try {
- renderView();
- assertTrue("'element' is undefined but exception was not thrown", false);
- } catch (FacesException e) {
-
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.renderkit.html;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIParameter;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.component.UIMediaOutput;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class MediaOutputRendererTest extends AbstractAjax4JsfTestCase {
+ UIForm form = null;
+ UIMediaOutput media1 = null;
+ UIMediaOutput media2 = null;
+ UIMediaOutput media3 = null;
+ UIMediaOutput media4 = null;
+ UIMediaOutput media5 = null;
+
+ public MediaOutputRendererTest(String name) {
+ super(name);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent("org.ajax4jsf.MMedia", "org.ajax4jsf.component.html.MediaOutput");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ media1 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
+ media1.setId("media1");
+ media1.setElement("a");
+ media1.setUriAttribute("href");
+ form.getChildren().add(media1);
+
+ media2 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
+ media2.setId("media2");
+ media2.setElement("img");
+ media2.setUriAttribute("src");
+ media2.getAttributes().put("alt", "Generated value");
+ form.getChildren().add(media2);
+
+ media3 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
+ media3.setId("media3");
+ media3.setElement("object");
+ media3.setUriAttribute("data");
+ form.getChildren().add(media3);
+
+ media4 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
+ media4.setId("media4");
+ media4.setElement("a");
+ UIParameter param = new UIParameter();
+ param.setName("name");
+ param.setValue("value");
+ media4.getChildren().add(param);
+ form.getChildren().add(media4);
+
+ media5 = (UIMediaOutput)application.createComponent(UIMediaOutput.COMPONENT_TYPE);
+ media5.setId("media5");
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ media1 = null;
+ media2 = null;
+ media3 = null;
+ media4 = null;
+ media5 = null;
+ form = null;
+ }
+
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement a = page.getHtmlElementById(media1.getClientId(facesContext));
+ assertNotNull(a);
+ assertEquals("a", a.getTagName());
+ String href = a.getAttributeValue("href");
+ assertNotNull(href);
+
+ HtmlElement img = page.getHtmlElementById(media2.getClientId(facesContext));
+ assertNotNull(img);
+ assertEquals("img", img.getTagName());
+ String src = img.getAttributeValue("src");
+ assertNotNull(src);
+
+ HtmlElement object = page.getHtmlElementById(media3.getClientId(facesContext));
+ assertNotNull(object);
+ assertEquals("object", object.getTagName());
+ String data = object.getAttributeValue("data");
+ assertNotNull(data);
+
+ // Rendering without uriAttribute
+ HtmlElement a2 = page.getHtmlElementById(media4.getClientId(facesContext));
+ assertNotNull(a2);
+ assertEquals("a", a2.getTagName());
+ String href2 = a2.getAttributeValue("href");
+ assertNotNull(href2);
+ assertTrue(href2.endsWith("name=value"));
+ }
+
+ public void testRenderWithoutElement() throws Exception {
+ form.getChildren().add(media5);
+ try {
+ renderView();
+ assertTrue("'element' is undefined but exception was not thrown", false);
+ } catch (FacesException e) {
+
+ }
+ }
+
+}
Modified: trunk/ui/dataFilterSlider/src/main/templates/dataFilterSlider.jspx
===================================================================
--- trunk/ui/dataFilterSlider/src/main/templates/dataFilterSlider.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataFilterSlider/src/main/templates/dataFilterSlider.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -38,7 +38,7 @@
</jsp:scriptlet>
<div id="#{clientId}slider-track" class="track rich-dataFilterSlider-track #{component.trackStyleClass}" style="width:#{component.attributes['width']}">
<div id="#{clientId}slider-handle" class="handle rich-dataFilterSlider-handle #{component.handleStyleClass}">
- <img src="#{arrow}" width="7" height="8" alt=" " style="border:0" />
+ <img src="#{arrow}" width="7" height="8" alt="" style="border:0" />
</div>
</div>
@@ -100,4 +100,4 @@
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java
===================================================================
--- trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataFilterSlider/src/test/java/org/richfaces/component/DataFilterSliderComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -319,4 +319,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/ColumnsIterator.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/ColumnsIterator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/ColumnsIterator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,80 +1,80 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-
-/**
- * Iterator for all children table columns.
- * @author asmirnov
- *
- */
-class ColumnsIterator implements Iterator<UIComponent>{
-
-
- private UIComponent next;
-
- private boolean initialized = false;
-
- protected Iterator<UIComponent> childrenIterator;
-
- public ColumnsIterator(UIComponent dataTable) {
- this.childrenIterator = dataTable.getChildren().iterator();
- }
-
- public boolean hasNext() {
- if(!initialized){
- next = nextColumn();
- initialized = true;
- }
- return null != next;
- }
-
- public UIComponent next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- UIComponent result = next;
- next = nextColumn();
- return result;
- }
-
- public void remove() {
- throw new UnsupportedOperationException("Iterator is read-only");
- }
-
- protected UIComponent nextColumn(){
- UIComponent nextColumn = null;
- while (childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- if(child instanceof UIColumn || child instanceof Column){
- nextColumn = child;
- break;
- }
- }
- return nextColumn;
- }
-
-}
\ No newline at end of file
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+
+/**
+ * Iterator for all children table columns.
+ * @author asmirnov
+ *
+ */
+class ColumnsIterator implements Iterator<UIComponent>{
+
+
+ private UIComponent next;
+
+ private boolean initialized = false;
+
+ protected Iterator<UIComponent> childrenIterator;
+
+ public ColumnsIterator(UIComponent dataTable) {
+ this.childrenIterator = dataTable.getChildren().iterator();
+ }
+
+ public boolean hasNext() {
+ if(!initialized){
+ next = nextColumn();
+ initialized = true;
+ }
+ return null != next;
+ }
+
+ public UIComponent next() {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ UIComponent result = next;
+ next = nextColumn();
+ return result;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException("Iterator is read-only");
+ }
+
+ protected UIComponent nextColumn(){
+ UIComponent nextColumn = null;
+ while (childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ if(child instanceof UIColumn || child instanceof Column){
+ nextColumn = child;
+ break;
+ }
+ }
+ return nextColumn;
+ }
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/DataIterator.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/DataIterator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/DataIterator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,78 +1,78 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-
-import org.ajax4jsf.component.AjaxSupport;
-
-class DataIterator extends ColumnsIterator {
-
- protected Iterator<UIComponent> facetsIterator;
-
- public DataIterator(UIComponent dataTable) {
- super(dataTable);
- facetsIterator = dataTable.getFacets().values().iterator();
- }
-
- @Override
- protected UIComponent nextColumn() {
- UIComponent nextColumn = null;
- while (null == nextColumn && childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- if (child.isRendered()) {
- if (child instanceof UIColumn || child instanceof Column) {
- nextColumn = child;
- } else if (checkAjaxComponent(child)) {
- nextColumn = child;
- }
- }
- }
- while (null == nextColumn && facetsIterator.hasNext()) {
- UIComponent child = facetsIterator.next();
- if (checkAjaxComponent(child)) {
- nextColumn = child;
- break;
- }
- }
- return nextColumn;
- }
-
- /**
- * @param child
- * @return
- */
- protected Iterator<UIComponent> getColumnChildrenIterator(UIComponent child) {
- return child.getChildren().iterator();
- }
-
- /**
- * @param child
- * @return
- */
- protected boolean checkAjaxComponent(UIComponent child) {
- return child instanceof AjaxSupport || child instanceof Dropzone;
- }
-
-}
\ No newline at end of file
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.component.AjaxSupport;
+
+class DataIterator extends ColumnsIterator {
+
+ protected Iterator<UIComponent> facetsIterator;
+
+ public DataIterator(UIComponent dataTable) {
+ super(dataTable);
+ facetsIterator = dataTable.getFacets().values().iterator();
+ }
+
+ @Override
+ protected UIComponent nextColumn() {
+ UIComponent nextColumn = null;
+ while (null == nextColumn && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ if (child.isRendered()) {
+ if (child instanceof UIColumn || child instanceof Column) {
+ nextColumn = child;
+ } else if (checkAjaxComponent(child)) {
+ nextColumn = child;
+ }
+ }
+ }
+ while (null == nextColumn && facetsIterator.hasNext()) {
+ UIComponent child = facetsIterator.next();
+ if (checkAjaxComponent(child)) {
+ nextColumn = child;
+ break;
+ }
+ }
+ return nextColumn;
+ }
+
+ /**
+ * @param child
+ * @return
+ */
+ protected Iterator<UIComponent> getColumnChildrenIterator(UIComponent child) {
+ return child.getChildren().iterator();
+ }
+
+ /**
+ * @param child
+ * @return
+ */
+ protected boolean checkAjaxComponent(UIComponent child) {
+ return child instanceof AjaxSupport || child instanceof Dropzone;
+ }
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/FixedChildrenIterator.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,106 +1,106 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-
-class FixedChildrenIterator extends DataIterator {
-
- private Iterator<UIComponent> currentColumnIterator;
-
- public FixedChildrenIterator(UIComponent dataTable) {
- super(dataTable);
- }
-
- @Override
- protected UIComponent nextColumn() {
- UIComponent nextColumn = null;
- if (null != currentColumnIterator) {
- nextColumn = currentColumnIterator.next();
- checkNextColumnChild();
- } else {
- while (null == nextColumn && childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- if (child instanceof UIColumn || child instanceof Column) {
- boolean rendered = true;
- try {
- rendered = child.isRendered();
- } catch (Exception e) {
- // This exception can be thrown for a header/footer
- // facets
- // there column rendered attribute was binded to a row
- // variable.
- }
- if (rendered) {
- Iterator<UIComponent> iterator = getColumnChildrenIterator(child);
- if (iterator.hasNext()) {
- currentColumnIterator = iterator;
- nextColumn = currentColumnIterator.next();
- checkNextColumnChild();
- }
-
- }
- } else if (checkAjaxComponent(child)) {
- nextColumn = child;
- }
- }
- }
- if (null == nextColumn) {
- nextColumn = getNextFacet();
- }
- return nextColumn;
- }
-
- /**
- * @param nextColumn
- * @return
- */
- protected UIComponent getNextFacet() {
- UIComponent nextColumn = null;
- while (null == nextColumn && facetsIterator.hasNext()) {
- UIComponent child = facetsIterator.next();
- if (checkAjaxComponent(child)) {
- nextColumn = child;
- }
- }
- return nextColumn;
- }
-
- @Override
- protected boolean checkAjaxComponent(UIComponent child) {
- return !super.checkAjaxComponent(child);
- }
-
- @Override
- protected Iterator<UIComponent> getColumnChildrenIterator(UIComponent child) {
- return child.getFacets().values().iterator();
- }
-
- protected void checkNextColumnChild() {
- if (!currentColumnIterator.hasNext()) {
- currentColumnIterator = null;
- }
- }
-
-}
\ No newline at end of file
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+
+class FixedChildrenIterator extends DataIterator {
+
+ private Iterator<UIComponent> currentColumnIterator;
+
+ public FixedChildrenIterator(UIComponent dataTable) {
+ super(dataTable);
+ }
+
+ @Override
+ protected UIComponent nextColumn() {
+ UIComponent nextColumn = null;
+ if (null != currentColumnIterator) {
+ nextColumn = currentColumnIterator.next();
+ checkNextColumnChild();
+ } else {
+ while (null == nextColumn && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ if (child instanceof UIColumn || child instanceof Column) {
+ boolean rendered = true;
+ try {
+ rendered = child.isRendered();
+ } catch (Exception e) {
+ // This exception can be thrown for a header/footer
+ // facets
+ // there column rendered attribute was binded to a row
+ // variable.
+ }
+ if (rendered) {
+ Iterator<UIComponent> iterator = getColumnChildrenIterator(child);
+ if (iterator.hasNext()) {
+ currentColumnIterator = iterator;
+ nextColumn = currentColumnIterator.next();
+ checkNextColumnChild();
+ }
+
+ }
+ } else if (checkAjaxComponent(child)) {
+ nextColumn = child;
+ }
+ }
+ }
+ if (null == nextColumn) {
+ nextColumn = getNextFacet();
+ }
+ return nextColumn;
+ }
+
+ /**
+ * @param nextColumn
+ * @return
+ */
+ protected UIComponent getNextFacet() {
+ UIComponent nextColumn = null;
+ while (null == nextColumn && facetsIterator.hasNext()) {
+ UIComponent child = facetsIterator.next();
+ if (checkAjaxComponent(child)) {
+ nextColumn = child;
+ }
+ }
+ return nextColumn;
+ }
+
+ @Override
+ protected boolean checkAjaxComponent(UIComponent child) {
+ return !super.checkAjaxComponent(child);
+ }
+
+ @Override
+ protected Iterator<UIComponent> getColumnChildrenIterator(UIComponent child) {
+ return child.getFacets().values().iterator();
+ }
+
+ protected void checkNextColumnChild() {
+ if (!currentColumnIterator.hasNext()) {
+ currentColumnIterator = null;
+ }
+ }
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import javax.faces.component.UIComponent;
-
-/**
- * @author asmirnov
- *
- */
-public class SubtableFixedChildrenIterator extends FixedChildrenIterator {
-
- public SubtableFixedChildrenIterator(UIComponent dataTable) {
- super(dataTable);
- }
-
- @Override
- protected UIComponent getNextFacet() {
- return null;
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class SubtableFixedChildrenIterator extends FixedChildrenIterator {
+
+ public SubtableFixedChildrenIterator(UIComponent dataTable) {
+ super(dataTable);
+ }
+
+ @Override
+ protected UIComponent getNextFacet() {
+ return null;
+ }
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/component/UIDataTable.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -195,4 +195,4 @@
super.restoreState(context, states[0]);
sortPriority = (Collection<Object>)states[1];
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -764,4 +764,4 @@
utils2.encodeAttribute(context, table, "onRowContextMenu", "oncontextmenu" );
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,38 +1,38 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-public interface HeaderEncodeStrategy {
-
- public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
- UIComponent column, String facetName, boolean sortableColumn) throws IOException;
-
- public abstract void encodeEnd(FacesContext context, ResponseWriter writer,
- UIComponent column, String facetName, boolean sortableColumn) throws IOException;
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+public interface HeaderEncodeStrategy {
+
+ public abstract void encodeBegin(FacesContext context, ResponseWriter writer,
+ UIComponent column, String facetName, boolean sortableColumn) throws IOException;
+
+ public abstract void encodeEnd(FacesContext context, ResponseWriter writer,
+ UIComponent column, String facetName, boolean sortableColumn) throws IOException;
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/TableHolder.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -111,4 +111,4 @@
public void setGridRowCounter(int gridRowCounter) {
this.gridRowCounter = gridRowCounter;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconConstants.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconConstants.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconConstants.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,30 +1,30 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-
-class DataTableIconConstants {
-
- public static final String SORT_ICON_COLOR = "dataTableSortIconColor";
- public static final String SORT_ICON_BORDER_COLOR = "dataTableSortIconBorderColor";
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+
+class DataTableIconConstants {
+
+ public static final String SORT_ICON_COLOR = "dataTableSortIconColor";
+ public static final String SORT_ICON_BORDER_COLOR = "dataTableSortIconBorderColor";
+
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortAsc.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortAsc.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortAsc.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,37 +1,37 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-import org.richfaces.renderkit.html.images.TriangleIconUp;
-
-public class DataTableIconSortAsc extends TriangleIconUp {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
- SORT_ICON_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.html.images.TriangleIconUp;
+
+public class DataTableIconSortAsc extends TriangleIconUp {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
+ SORT_ICON_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortDesc.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortDesc.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortDesc.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,37 +1,37 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-import org.richfaces.renderkit.html.images.TriangleIconDown;
-
-public class DataTableIconSortDesc extends TriangleIconDown {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
- SORT_ICON_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.html.images.TriangleIconDown;
+
+public class DataTableIconSortDesc extends TriangleIconDown {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
+ SORT_ICON_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortNone.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortNone.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/html/iconimages/DataTableIconSortNone.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,68 +1,68 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
-import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.ResourceContext;
-import org.richfaces.renderkit.html.images.TriangleIconBase;
-
-public class DataTableIconSortNone extends TriangleIconBase {
-
- public Dimension calculateDimensions() {
- return new Dimension(13, 4);
- }
-
- protected void paintImage(ResourceContext context, Graphics2D g2d,
- Color textColor, Color borderColor) {
- g2d.translate(4, 3);
-
- g2d.setColor(textColor);
- g2d.drawLine(3, 1, 3, 1);
- g2d.drawLine(2, 2, 4, 2);
- g2d.drawLine(1, 3, 5, 3);
-
- g2d.drawLine(3, 7, 3, 7);
- g2d.drawLine(2, 6, 4, 6);
- g2d.drawLine(1, 5, 5, 5);
-
- g2d.setColor(borderColor);
- g2d.drawLine(0, 3, 3, 0);
- g2d.drawLine(3, 0, 6, 3);
- g2d.drawLine(5, 4, 1, 4);
-
- g2d.drawLine(0, 5, 3, 8);
- g2d.drawLine(3, 8, 6, 5);
- }
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
- SORT_ICON_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_BORDER_COLOR;
+import static org.richfaces.renderkit.html.iconimages.DataTableIconConstants.SORT_ICON_COLOR;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.ResourceContext;
+import org.richfaces.renderkit.html.images.TriangleIconBase;
+
+public class DataTableIconSortNone extends TriangleIconBase {
+
+ public Dimension calculateDimensions() {
+ return new Dimension(13, 4);
+ }
+
+ protected void paintImage(ResourceContext context, Graphics2D g2d,
+ Color textColor, Color borderColor) {
+ g2d.translate(4, 3);
+
+ g2d.setColor(textColor);
+ g2d.drawLine(3, 1, 3, 1);
+ g2d.drawLine(2, 2, 4, 2);
+ g2d.drawLine(1, 3, 5, 3);
+
+ g2d.drawLine(3, 7, 3, 7);
+ g2d.drawLine(2, 6, 4, 6);
+ g2d.drawLine(1, 5, 5, 5);
+
+ g2d.setColor(borderColor);
+ g2d.drawLine(0, 3, 3, 0);
+ g2d.drawLine(3, 0, 6, 3);
+ g2d.drawLine(5, 4, 1, 4);
+
+ g2d.drawLine(0, 5, 3, 8);
+ g2d.drawLine(3, 8, 6, 5);
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SORT_ICON_COLOR, ICON_COLOR,
+ SORT_ICON_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlColgroup.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlColgroup.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlColgroup.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -11,8 +11,8 @@
component="org.richfaces.component.UIColumnGroup"
>
<f:clientid var="clientId"/>
- <tr id="#{clientId}"
+ <tr id="#{clientId}"
x:passThruWithExclusions="id" >
<vcp:body />
</tr>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataDefinitionList.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataDefinitionList.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataDefinitionList.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -19,4 +19,4 @@
<f:call name="encodeRows"/>
</vcp:body>
</dl>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataGrid.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataGrid.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataGrid.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -16,7 +16,7 @@
<table id="#{clientId}"
class="dr-table rich-table #{component.attributes['styleClass']}"
x:passThruWithExclusions="value,name,type,class,id"
- >
+ >
<f:call name="encodeCaption" />
<colgroup span="#{component.attributes['columns']}">
</colgroup>
@@ -28,4 +28,4 @@
</vcp:body>
</tbody>
</table>
-</f:root>
+</f:root>
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlDataTable.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -13,17 +13,17 @@
component="org.richfaces.component.UIDataTable"
>
<h:styles>css/table.xcss</h:styles>
- <h:scripts>
- new org.ajax4jsf.javascript.AjaxScript(),
- new org.ajax4jsf.javascript.PrototypeScript(),
- /org/richfaces/renderkit/html/scripts/data-table.js
+ <h:scripts>
+ new org.ajax4jsf.javascript.AjaxScript(),
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ /org/richfaces/renderkit/html/scripts/data-table.js
</h:scripts>
<f:clientid var="clientId"/>
<table id="#{clientId}"
class="dr-table rich-table #{component.attributes['styleClass']}" style="#{component.attributes['style']}" >
-
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="value,name,type,id,class,rows,style" />
+
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="value,name,type,id,class,rows,style" />
</f:call>
<f:call name="encodeTableStructure"/>
@@ -32,4 +32,4 @@
<f:call name="encodeTBody"/>
</vcp:body>
</table>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/dataTable/src/main/templates/org/richfaces/htmlSubTable.jspx
===================================================================
--- trunk/ui/dataTable/src/main/templates/org/richfaces/htmlSubTable.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/main/templates/org/richfaces/htmlSubTable.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -15,4 +15,4 @@
x:passThruWithExclusions="value,name,type,id"
>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/dataTable/src/test/java/org/richfaces/component/DataTableComponentTest.java
===================================================================
--- trunk/ui/dataTable/src/test/java/org/richfaces/component/DataTableComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/test/java/org/richfaces/component/DataTableComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -294,4 +294,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java
===================================================================
--- trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,406 +1,406 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.el.ELContext;
-import javax.el.ValueExpression;
-import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.component.html.HtmlOutputLink;
-import javax.faces.component.html.HtmlOutputText;
-import javax.faces.model.ListDataModel;
-
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.UIColumn;
-import org.richfaces.component.UIColumnGroup;
-import org.richfaces.component.UIDataTable;
-
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-
-public class DataTableRenderingTest extends AbstractAjax4JsfTestCase {
-
- private UIDataTable dataTable;
-
- private UIColumn column1;
-
- private UIColumn column2;
-
- private UIForm form = null;
-
- private UIColumnGroup columnGroup;
-
- /**
- * Create the test case
- *
- * @param testName
- * name of the test case
- */
- public DataTableRenderingTest(String name) {
- super(name);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
- */
- public void setUp() throws Exception {
- super.setUp();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
- dataTable = (UIDataTable) application
- .createComponent("org.richfaces.DataTable");
- dataTable.setId("dataTable");
-
- List<Date> list = new ArrayList<Date>();
- for (int i = 1; i <= 5; i++) {
- list.add(new Date((long) Math.random()));
- }
- dataTable.setValue(new ListDataModel(list));
-
- columnGroup = (UIColumnGroup) application
- .createComponent("org.richfaces.ColumnGroup");
- dataTable.getChildren().add(columnGroup);
-
- column1 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput cellElement1 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- cellElement1.setValueExpression("column", new ColumnValueExpression());
- column1.getChildren().add(cellElement1);
- columnGroup.getChildren().add(column1);
-
- column2 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput cellElement2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputLink.class.getName(),
- null, null, null);
- cellElement2.setValueExpression("value", new ColumnValueExpression());
- column2.getChildren().add(cellElement2);
- columnGroup.getChildren().add(column2);
-
- javax.faces.component.UIColumn column3 = new javax.faces.component.UIColumn();
- UIOutput cellElement3 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- cellElement3.setValue("value");
- column3.getChildren().add(cellElement3);
- dataTable.getChildren().add(column3);
-
- form.getChildren().add(dataTable);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
- */
- public void tearDown() throws Exception {
- super.tearDown();
-
- column1 = null;
- column2 = null;
- columnGroup = null;
- dataTable = null;
- }
-
- /**
- * Test DataTable component rendering.
- *
- * @throws Exception
- */
- public void testRenderDataTable() throws Exception {
-
- dataTable.getAttributes().put("columnsWidth", "400px,200px");
-
- UIColumn column3 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- dataTable.getChildren().add(column3);
- UIOutput text = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- text.setValue("Column");
- column3.getChildren().add(text);
- column3.setBreakBefore(true);
-
- UIColumn column4 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- dataTable.getChildren().add(column4);
- UIOutput text2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- text.setValue("Column2");
- column4.getChildren().add(text2);
- column4.setRendered(false);
-
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement table = page.getHtmlElementById(dataTable
- .getClientId(facesContext));
- assertNotNull(table);
- assertEquals("table", table.getNodeName());
- String classAttr = table.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table rich-table"));
-
- List<HtmlElement> elements = table.getHtmlElementsByTagName("col");
- assertEquals(2, elements.size());
- classAttr = ((HtmlElement) elements.get(0)).getAttributeValue("width");
- assertTrue(classAttr.contains("400px"));
- classAttr = ((HtmlElement) elements.get(1)).getAttributeValue("width");
- assertTrue(classAttr.contains("200px"));
-
- List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
- assertEquals(1, bodies.size());
- List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
- assertTrue(trs.size() > 0);
- HtmlElement tr = (HtmlElement) trs.get(0);
- assertNotNull(tr);
- classAttr = tr.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-firstrow rich-table-firstrow"));
-
- Iterator<HtmlElement> tds = tr.getChildIterator();
- assertTrue(tds.hasNext());
- HtmlElement td = (HtmlElement) tds.next();
- assertNotNull(td);
- classAttr = td.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-cell rich-table-cell"));
- }
-
- /**
- * Test DataTable component facets rendering.
- *
- * @throws Exception
- */
- public void testRenderDataTableFacets() throws Exception {
-
- UIColumnGroup header1 = (UIColumnGroup) application
- .createComponent("org.richfaces.ColumnGroup");
- header1.getAttributes().put("columnClasses", "cola, colb");
- dataTable.getFacets().put("header", header1);
-
- UIColumn headerColumn1 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput headerText1 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- headerText1.setValue("Header Column1");
- headerColumn1.getChildren().add(headerText1);
- header1.getChildren().add(headerColumn1);
-
- UIOutput column1header = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- column1header.setValue("Column1 Header");
- headerColumn1.getFacets().put("header", column1header);
-
- UIColumn headerColumn2 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput headerText2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- headerText2.setValue("Header Column2");
- headerColumn2.getChildren().add(headerText2);
- header1.getChildren().add(headerColumn2);
-
- UIOutput column2header = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- column2header.setValue("Column2 Header");
- headerColumn2.getFacets().put("header", column2header);
-
- UIOutput caption = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- dataTable.getFacets().put("caption", caption);
- caption.setValue("Caption");
-
- UIOutput footer = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- dataTable.getFacets().put("footer", footer);
- footer.setValue("Footer");
-
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement table = page.getHtmlElementById(dataTable
- .getClientId(facesContext));
- assertNotNull(table);
-
- List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
- assertNotNull(captions);
- assertEquals(1, captions.size());
- String classAttr = ((HtmlElement) captions.get(0))
- .getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-caption rich-table-caption"));
-
- List<HtmlElement> headers = table.getHtmlElementsByTagName("thead");
- assertNotNull(headers);
- assertEquals(1, headers.size());
- List<HtmlElement> trs = ((HtmlElement) headers.get(0))
- .getHtmlElementsByTagName("tr");
- assertTrue(trs.size() > 0);
- HtmlElement tr = (HtmlElement) trs.get(0);
- assertNotNull(tr);
- classAttr = tr.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-header rich-table-header"));
-
- Iterator<HtmlElement> tds = tr.getChildIterator();
- assertNotNull(tds);
- assertTrue(tds.hasNext());
- HtmlElement td = tds.next();
- assertNotNull(td);
- classAttr = td.getAttributeValue("class");
- assertTrue(classAttr
- .contains("dr-table-headercell rich-table-headercell"));
- assertTrue(classAttr.contains("cola"));
-
- List<HtmlElement> footers = table.getHtmlElementsByTagName("tfoot");
- assertNotNull(footers);
- assertEquals(1, footers.size());
- trs = ((HtmlElement) footers.get(0)).getHtmlElementsByTagName("tr");
- assertTrue(trs.size() > 0);
- tr = (HtmlElement) trs.get(0);
- assertNotNull(tr);
- classAttr = tr.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-footer rich-table-footer "));
-
- tds = tr.getChildIterator();
- assertTrue(tds.hasNext());
- td = tds.next();
- assertNotNull(td);
- classAttr = td.getAttributeValue("class");
- assertTrue(classAttr.contains("dr-table-footercell rich-table-footercell "));
-
- Iterator fixedChildren = dataTable.fixedChildren();
- assertNotNull(fixedChildren);
- assertTrue(fixedChildren.hasNext());
- }
-
- /**
- * Test DataTable component rows and columns rendering.
- *
- * @throws Exception
- */
- public void testRenderDataTableRowsAndColumns() throws Exception {
-
- UIOutput caption = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
- dataTable.getFacets().put("caption", caption);
- caption.setValue("Caption");
- dataTable.getAttributes().put("captionClass", "captionClass");
- dataTable.getAttributes().put("captionStyle", "captionStyle");
-
- dataTable.getAttributes().put("rowClasses", "row1,row2");
- dataTable.getAttributes().put("columnClasses", "column1,column2");
-
- column1.getAttributes().put("styleClass", "column1StyleClass");
- column2.getAttributes().put("styleClass", "");
-
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement table = page.getHtmlElementById(dataTable
- .getClientId(facesContext));
- assertNotNull(table);
-
- List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
- assertNotNull(captions);
- assertEquals(1, captions.size());
- String classAttr = ((HtmlElement) captions.get(0))
- .getAttributeValue("class");
- assertTrue(classAttr.contains("captionClass"));
- classAttr = ((HtmlElement) captions.get(0)).getAttributeValue("style");
- assertTrue(classAttr.contains("captionStyle"));
-
- List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
- assertTrue(bodies.size() > 0);
- List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
- assertTrue(trs.size() > 0);
- HtmlElement tr = (HtmlElement) trs.get(0);
- assertNotNull(tr);
- classAttr = tr.getAttributeValue("class");
- assertTrue(classAttr.contains("row1"));
-
- List<HtmlElement> tds = tr.getHtmlElementsByTagName("td");
- assertTrue(tds.size() > 0);
- HtmlElement td = (HtmlElement) tds.get(0);
- assertNotNull(td);
- classAttr = td.getAttributeValue("class");
- assertTrue(classAttr.contains("column1"));
- assertTrue(classAttr.contains("column1StyleClass"));
- }
-
- protected class ColumnValueExpression extends ValueExpression {
-
- private static final long serialVersionUID = -4572752019634445014L;
-
- public Class<?> getExpectedType() {
- return null;
- }
-
- public Class<?> getType(ELContext context) {
- return String.class;
- }
-
- public Object getValue(ELContext context) {
- return Long.toString(((Date) dataTable.getValue()).getTime());
- }
-
- public boolean isReadOnly(ELContext context) {
- return false;
- }
-
- public void setValue(ELContext context, Object value) {
-
- }
-
- public boolean equals(Object obj) {
- return false;
- }
-
- public String getExpressionString() {
- return null;
- }
-
- public int hashCode() {
- return 0;
- }
-
- public boolean isLiteralText() {
- return false;
- }
-
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputLink;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.model.ListDataModel;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIColumn;
+import org.richfaces.component.UIColumnGroup;
+import org.richfaces.component.UIDataTable;
+
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+public class DataTableRenderingTest extends AbstractAjax4JsfTestCase {
+
+ private UIDataTable dataTable;
+
+ private UIColumn column1;
+
+ private UIColumn column2;
+
+ private UIForm form = null;
+
+ private UIColumnGroup columnGroup;
+
+ /**
+ * Create the test case
+ *
+ * @param testName
+ * name of the test case
+ */
+ public DataTableRenderingTest(String name) {
+ super(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+ dataTable = (UIDataTable) application
+ .createComponent("org.richfaces.DataTable");
+ dataTable.setId("dataTable");
+
+ List<Date> list = new ArrayList<Date>();
+ for (int i = 1; i <= 5; i++) {
+ list.add(new Date((long) Math.random()));
+ }
+ dataTable.setValue(new ListDataModel(list));
+
+ columnGroup = (UIColumnGroup) application
+ .createComponent("org.richfaces.ColumnGroup");
+ dataTable.getChildren().add(columnGroup);
+
+ column1 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ UIOutput cellElement1 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ cellElement1.setValueExpression("column", new ColumnValueExpression());
+ column1.getChildren().add(cellElement1);
+ columnGroup.getChildren().add(column1);
+
+ column2 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ UIOutput cellElement2 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputLink.class.getName(),
+ null, null, null);
+ cellElement2.setValueExpression("value", new ColumnValueExpression());
+ column2.getChildren().add(cellElement2);
+ columnGroup.getChildren().add(column2);
+
+ javax.faces.component.UIColumn column3 = new javax.faces.component.UIColumn();
+ UIOutput cellElement3 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ cellElement3.setValue("value");
+ column3.getChildren().add(cellElement3);
+ dataTable.getChildren().add(column3);
+
+ form.getChildren().add(dataTable);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ column1 = null;
+ column2 = null;
+ columnGroup = null;
+ dataTable = null;
+ }
+
+ /**
+ * Test DataTable component rendering.
+ *
+ * @throws Exception
+ */
+ public void testRenderDataTable() throws Exception {
+
+ dataTable.getAttributes().put("columnsWidth", "400px,200px");
+
+ UIColumn column3 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ dataTable.getChildren().add(column3);
+ UIOutput text = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ text.setValue("Column");
+ column3.getChildren().add(text);
+ column3.setBreakBefore(true);
+
+ UIColumn column4 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ dataTable.getChildren().add(column4);
+ UIOutput text2 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ text.setValue("Column2");
+ column4.getChildren().add(text2);
+ column4.setRendered(false);
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement table = page.getHtmlElementById(dataTable
+ .getClientId(facesContext));
+ assertNotNull(table);
+ assertEquals("table", table.getNodeName());
+ String classAttr = table.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table rich-table"));
+
+ List<HtmlElement> elements = table.getHtmlElementsByTagName("col");
+ assertEquals(2, elements.size());
+ classAttr = ((HtmlElement) elements.get(0)).getAttributeValue("width");
+ assertTrue(classAttr.contains("400px"));
+ classAttr = ((HtmlElement) elements.get(1)).getAttributeValue("width");
+ assertTrue(classAttr.contains("200px"));
+
+ List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
+ assertEquals(1, bodies.size());
+ List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
+ assertTrue(trs.size() > 0);
+ HtmlElement tr = (HtmlElement) trs.get(0);
+ assertNotNull(tr);
+ classAttr = tr.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-firstrow rich-table-firstrow"));
+
+ Iterator<HtmlElement> tds = tr.getChildIterator();
+ assertTrue(tds.hasNext());
+ HtmlElement td = (HtmlElement) tds.next();
+ assertNotNull(td);
+ classAttr = td.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-cell rich-table-cell"));
+ }
+
+ /**
+ * Test DataTable component facets rendering.
+ *
+ * @throws Exception
+ */
+ public void testRenderDataTableFacets() throws Exception {
+
+ UIColumnGroup header1 = (UIColumnGroup) application
+ .createComponent("org.richfaces.ColumnGroup");
+ header1.getAttributes().put("columnClasses", "cola, colb");
+ dataTable.getFacets().put("header", header1);
+
+ UIColumn headerColumn1 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ UIOutput headerText1 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ headerText1.setValue("Header Column1");
+ headerColumn1.getChildren().add(headerText1);
+ header1.getChildren().add(headerColumn1);
+
+ UIOutput column1header = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ column1header.setValue("Column1 Header");
+ headerColumn1.getFacets().put("header", column1header);
+
+ UIColumn headerColumn2 = (UIColumn) application
+ .createComponent("org.richfaces.Column");
+ UIOutput headerText2 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ headerText2.setValue("Header Column2");
+ headerColumn2.getChildren().add(headerText2);
+ header1.getChildren().add(headerColumn2);
+
+ UIOutput column2header = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ column2header.setValue("Column2 Header");
+ headerColumn2.getFacets().put("header", column2header);
+
+ UIOutput caption = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ dataTable.getFacets().put("caption", caption);
+ caption.setValue("Caption");
+
+ UIOutput footer = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ dataTable.getFacets().put("footer", footer);
+ footer.setValue("Footer");
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement table = page.getHtmlElementById(dataTable
+ .getClientId(facesContext));
+ assertNotNull(table);
+
+ List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
+ assertNotNull(captions);
+ assertEquals(1, captions.size());
+ String classAttr = ((HtmlElement) captions.get(0))
+ .getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-caption rich-table-caption"));
+
+ List<HtmlElement> headers = table.getHtmlElementsByTagName("thead");
+ assertNotNull(headers);
+ assertEquals(1, headers.size());
+ List<HtmlElement> trs = ((HtmlElement) headers.get(0))
+ .getHtmlElementsByTagName("tr");
+ assertTrue(trs.size() > 0);
+ HtmlElement tr = (HtmlElement) trs.get(0);
+ assertNotNull(tr);
+ classAttr = tr.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-header rich-table-header"));
+
+ Iterator<HtmlElement> tds = tr.getChildIterator();
+ assertNotNull(tds);
+ assertTrue(tds.hasNext());
+ HtmlElement td = tds.next();
+ assertNotNull(td);
+ classAttr = td.getAttributeValue("class");
+ assertTrue(classAttr
+ .contains("dr-table-headercell rich-table-headercell"));
+ assertTrue(classAttr.contains("cola"));
+
+ List<HtmlElement> footers = table.getHtmlElementsByTagName("tfoot");
+ assertNotNull(footers);
+ assertEquals(1, footers.size());
+ trs = ((HtmlElement) footers.get(0)).getHtmlElementsByTagName("tr");
+ assertTrue(trs.size() > 0);
+ tr = (HtmlElement) trs.get(0);
+ assertNotNull(tr);
+ classAttr = tr.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-footer rich-table-footer "));
+
+ tds = tr.getChildIterator();
+ assertTrue(tds.hasNext());
+ td = tds.next();
+ assertNotNull(td);
+ classAttr = td.getAttributeValue("class");
+ assertTrue(classAttr.contains("dr-table-footercell rich-table-footercell "));
+
+ Iterator fixedChildren = dataTable.fixedChildren();
+ assertNotNull(fixedChildren);
+ assertTrue(fixedChildren.hasNext());
+ }
+
+ /**
+ * Test DataTable component rows and columns rendering.
+ *
+ * @throws Exception
+ */
+ public void testRenderDataTableRowsAndColumns() throws Exception {
+
+ UIOutput caption = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
+ null, null, null);
+ dataTable.getFacets().put("caption", caption);
+ caption.setValue("Caption");
+ dataTable.getAttributes().put("captionClass", "captionClass");
+ dataTable.getAttributes().put("captionStyle", "captionStyle");
+
+ dataTable.getAttributes().put("rowClasses", "row1,row2");
+ dataTable.getAttributes().put("columnClasses", "column1,column2");
+
+ column1.getAttributes().put("styleClass", "column1StyleClass");
+ column2.getAttributes().put("styleClass", "");
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement table = page.getHtmlElementById(dataTable
+ .getClientId(facesContext));
+ assertNotNull(table);
+
+ List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
+ assertNotNull(captions);
+ assertEquals(1, captions.size());
+ String classAttr = ((HtmlElement) captions.get(0))
+ .getAttributeValue("class");
+ assertTrue(classAttr.contains("captionClass"));
+ classAttr = ((HtmlElement) captions.get(0)).getAttributeValue("style");
+ assertTrue(classAttr.contains("captionStyle"));
+
+ List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
+ assertTrue(bodies.size() > 0);
+ List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
+ assertTrue(trs.size() > 0);
+ HtmlElement tr = (HtmlElement) trs.get(0);
+ assertNotNull(tr);
+ classAttr = tr.getAttributeValue("class");
+ assertTrue(classAttr.contains("row1"));
+
+ List<HtmlElement> tds = tr.getHtmlElementsByTagName("td");
+ assertTrue(tds.size() > 0);
+ HtmlElement td = (HtmlElement) tds.get(0);
+ assertNotNull(td);
+ classAttr = td.getAttributeValue("class");
+ assertTrue(classAttr.contains("column1"));
+ assertTrue(classAttr.contains("column1StyleClass"));
+ }
+
+ protected class ColumnValueExpression extends ValueExpression {
+
+ private static final long serialVersionUID = -4572752019634445014L;
+
+ public Class<?> getExpectedType() {
+ return null;
+ }
+
+ public Class<?> getType(ELContext context) {
+ return String.class;
+ }
+
+ public Object getValue(ELContext context) {
+ return Long.toString(((Date) dataTable.getValue()).getTime());
+ }
+
+ public boolean isReadOnly(ELContext context) {
+ return false;
+ }
+
+ public void setValue(ELContext context, Object value) {
+
+ }
+
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ public String getExpressionString() {
+ return null;
+ }
+
+ public int hashCode() {
+ return 0;
+ }
+
+ public boolean isLiteralText() {
+ return false;
+ }
+
+ }
+
+}
Modified: trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/SortableHeaderRenderingTest.java
===================================================================
--- trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/SortableHeaderRenderingTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/SortableHeaderRenderingTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,383 +1,383 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.el.ELContext;
-import javax.el.ValueExpression;
-import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.component.html.HtmlOutputText;
-import javax.faces.model.ListDataModel;
-
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-import org.richfaces.component.UIColumn;
-import org.richfaces.component.UIDataTable;
-import org.richfaces.model.Ordering;
-import org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc;
-
-import com.gargoylesoftware.htmlunit.html.DomText;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-public class SortableHeaderRenderingTest extends AbstractAjax4JsfTestCase {
- private static final int ROWS_COUNT = 10;
-
- private static Set<String> javaScripts = new HashSet<String>();
- static {
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- javaScripts.add("org/richfaces/renderkit/html/scripts/data-table.js");
- javaScripts.add("scripts/inplaceinput.js");
- javaScripts.add("scripts/utils.js");
- }
-
- ListDataModel model;
-
- private UIDataTable dataTable;
-
- private UIColumn column1;
-
- private UIColumn column2;
-
- private UIForm form = null;
-
- private Comparator<Date> comparator;
-
- /**
- * Create the test case
- *
- * @param testName
- * name of the test case
- */
- public SortableHeaderRenderingTest(String name) {
- super(name);
- }
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
-
- comparator = new SortComparator();
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
- dataTable = (UIDataTable) application
- .createComponent("org.richfaces.DataTable");
- dataTable.setId("dataTable");
-
- List<Date> list = new ArrayList<Date>();
- for (int i = 0; i < ROWS_COUNT; i++) {
- list.add(new Date((long) Math.random()));
- }
- model = new ListDataModel(list);
- dataTable.setValue(model);
- dataTable.setVar("var");
-
- column1 = (UIColumn) application.createComponent("org.richfaces.Column");
- UIOutput cellElement1 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
- cellElement1.setValueExpression("value", new ColumnOneExpression());
-
- column1.getChildren().add(cellElement1);
- column1.setId("column1");
- column1.setSortOrder(Ordering.ASCENDING);
- column1.setValueExpression("comparator", new ComparatorExpression());
-
- UIOutput facet1 = new HtmlOutputText();
- facet1.setValue("sort");
- column1.getFacets().put("header", facet1);
-
- dataTable.getChildren().add(column1);
-
- column2 = (UIColumn) application.createComponent("org.richfaces.Column");
- column2.setId("column2");
- UIOutput cellElement2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
- cellElement2.setValueExpression("value", new ColumnTwoExpression());
- column2.setFilterValue("filterValue");
- column2.setValueExpression("filterBy", new ColumnTwoExpression());
-
-
- column2.getChildren().add(cellElement2);
- dataTable.getChildren().add(column2);
-
- form.getChildren().add(dataTable);
- }
-
- @Override
- public void tearDown() throws Exception {
- model = null;
- form = null;
- column1 = null;
- column2 = null;
- dataTable = null;
-
- super.tearDown();
- }
-
- /**
- * Test sortable header rendering.
- *
- * @throws Exception
- */
- public void testRenderSortableHeader() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- List<HtmlElement> headers = page.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.th_ELEM);
- assertNotNull(headers);
- assertEquals(2, headers.size());
-
- HtmlElement th = headers.get(0);
- assertNotNull(th);
- String onclick = th.getAttributeValue(HTML.onclick_ATTRIBUTE);
- assertNotNull(onclick);
- assertTrue(onclick.startsWith("A4J.AJAX.Submit"));
-
- HtmlElement div = (HtmlElement) th.getFirstDomChild();
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getTagName());
- assertNull(div.getNextDomSibling());
-
- HtmlElement span = (HtmlElement) div.getFirstDomChild();
- assertNotNull(span);
- assertEquals(HTML.SPAN_ELEM, span.getTagName());
- assertNull(span.getNextDomSibling());
-
- String clazz = span.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- //assertTrue(clazz.contains("dr-table-header-sort-up"));
- assertTrue(clazz.contains("dr-table-sortable-header"));
-
- DomText text = (DomText) span.getFirstDomChild();
- assertNotNull(text);
-
- HtmlElement img = (HtmlElement) text.getNextDomSibling();
- assertNotNull(img);
- assertEquals(HTML.IMG_ELEMENT, img.getTagName());
- assertNull(img.getNextDomSibling());
-
- String src = img.getAttributeValue(HTML.src_ATTRIBUTE);
- assertNotNull(src);
- assertTrue(src.contains(DataTableIconSortAsc.class.getName()));
- }
-
- /**
- * Test filtered header rendering.
- *
- * @throws Exception
- */
- public void testRenderFilteredHeader() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- List<HtmlElement> headers = page.getDocumentElement().getHtmlElementsByTagName(HTML.th_ELEM);
- assertNotNull(headers);
- assertEquals(2, headers.size());
-
- HtmlElement th = headers.get(1);
- assertNotNull(th);
-
- HtmlElement div = (HtmlElement) th.getFirstChild();
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getTagName());
- assertNull(div.getFirstChild());
-
- div = (HtmlElement) div.getNextSibling();
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getTagName());
- assertNull(div.getNextSibling());
-
- List<HtmlElement> spans= div.getHtmlElementsByTagName(HTML.SPAN_ELEM);
- assertNotNull(spans);
- if (1 == spans.size()) { // inplace input is used
- HtmlElement span = spans.get(0);
- String clazz = span.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-inplace-view"));
- } else { // simple inputText
- HtmlElement input = (HtmlElement) div.getFirstChild();
- assertNotNull(input);
- assertEquals(HTML.INPUT_ELEM, input.getTagName());
- }
- }
-
- /**
- * Test filtered data rendering
- *
- * @throws Exception
- */
- public void testRenderFilteredData() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement table = page.getHtmlElementById(dataTable.getClientId(facesContext));
- assertNotNull(table);
-
- HtmlElement tbody = table.getHtmlElementById(dataTable.getClientId(facesContext)+ ":tb");
- assertNotNull(tbody);
- assertNull(tbody.getFirstChild());
-
- tearDown();
- setUp();
-
- column2.setFilterValue(null);
- column2.setValueExpression("filterBy", null);
-
- page = renderView();
- assertNotNull(page);
-
- table = page.getHtmlElementById(dataTable.getClientId(facesContext));
- assertNotNull(table);
-
- tbody = table.getHtmlElementById(dataTable.getClientId(facesContext)+ ":tb");
- assertNotNull(tbody);
- assertNotNull(tbody.getFirstChild());
-
- int count = 0;
- Iterator<HtmlElement> it = tbody.getChildElementsIterator();
- while (it.hasNext()) {
- HtmlElement tr = it.next();
- count++;
- }
- assertEquals(ROWS_COUNT, count);
- }
-
- public void testScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List<HtmlScript> scripts = page.getDocumentElement().getHtmlElementsByTagName(
- "script");
- int foundCount = 0;
- for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- foundCount++;
- break;
- }
- }
-
- assertTrue(found);
- }
- }
- }
-
- protected class ColumnOneExpression extends ValueExpression {
-
- private static final long serialVersionUID = -60617505361080421L;
-
- @Override
- public Class<?> getExpectedType() {
- return String.class;
- }
-
- @Override
- public Class<?> getType(ELContext context) {
- return String.class;
- }
-
- @Override
- public Object getValue(ELContext context) {
- return ((Date)model.getRowData()).getTime();
- }
-
- @Override
- public boolean isReadOnly(ELContext context) {
- return false;
- }
-
- @Override
- public void setValue(ELContext context, Object value) {
-
- }
-
- @Override
- public boolean equals(Object obj) {
- return false;
- }
-
- @Override
- public String getExpressionString() {
- return null;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public boolean isLiteralText() {
- return false;
- }
- }
-
- protected class ColumnTwoExpression extends ColumnOneExpression {
-
- private static final long serialVersionUID = -865017340246458449L;
-
- @Override
- public Object getValue(ELContext context) {
- return ((Date)model.getRowData()).getTimezoneOffset();
- }
- }
-
- protected class ComparatorExpression extends ColumnOneExpression {
-
- private static final long serialVersionUID = -865017340246458449L;
-
- @Override
- public Object getValue(ELContext context) {
- return comparator;
- }
- }
-
- protected class SortComparator implements Comparator<Date> {
-
- public int compare(Date o1, Date o2) {
- return o1.compareTo(o2);
- }
-
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.model.ListDataModel;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIColumn;
+import org.richfaces.component.UIDataTable;
+import org.richfaces.model.Ordering;
+import org.richfaces.renderkit.html.iconimages.DataTableIconSortAsc;
+
+import com.gargoylesoftware.htmlunit.html.DomText;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class SortableHeaderRenderingTest extends AbstractAjax4JsfTestCase {
+ private static final int ROWS_COUNT = 10;
+
+ private static Set<String> javaScripts = new HashSet<String>();
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/data-table.js");
+ javaScripts.add("scripts/inplaceinput.js");
+ javaScripts.add("scripts/utils.js");
+ }
+
+ ListDataModel model;
+
+ private UIDataTable dataTable;
+
+ private UIColumn column1;
+
+ private UIColumn column2;
+
+ private UIForm form = null;
+
+ private Comparator<Date> comparator;
+
+ /**
+ * Create the test case
+ *
+ * @param testName
+ * name of the test case
+ */
+ public SortableHeaderRenderingTest(String name) {
+ super(name);
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ comparator = new SortComparator();
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+ dataTable = (UIDataTable) application
+ .createComponent("org.richfaces.DataTable");
+ dataTable.setId("dataTable");
+
+ List<Date> list = new ArrayList<Date>();
+ for (int i = 0; i < ROWS_COUNT; i++) {
+ list.add(new Date((long) Math.random()));
+ }
+ model = new ListDataModel(list);
+ dataTable.setValue(model);
+ dataTable.setVar("var");
+
+ column1 = (UIColumn) application.createComponent("org.richfaces.Column");
+ UIOutput cellElement1 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
+ cellElement1.setValueExpression("value", new ColumnOneExpression());
+
+ column1.getChildren().add(cellElement1);
+ column1.setId("column1");
+ column1.setSortOrder(Ordering.ASCENDING);
+ column1.setValueExpression("comparator", new ComparatorExpression());
+
+ UIOutput facet1 = new HtmlOutputText();
+ facet1.setValue("sort");
+ column1.getFacets().put("header", facet1);
+
+ dataTable.getChildren().add(column1);
+
+ column2 = (UIColumn) application.createComponent("org.richfaces.Column");
+ column2.setId("column2");
+ UIOutput cellElement2 = (UIOutput) createComponent(
+ HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
+ cellElement2.setValueExpression("value", new ColumnTwoExpression());
+ column2.setFilterValue("filterValue");
+ column2.setValueExpression("filterBy", new ColumnTwoExpression());
+
+
+ column2.getChildren().add(cellElement2);
+ dataTable.getChildren().add(column2);
+
+ form.getChildren().add(dataTable);
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ model = null;
+ form = null;
+ column1 = null;
+ column2 = null;
+ dataTable = null;
+
+ super.tearDown();
+ }
+
+ /**
+ * Test sortable header rendering.
+ *
+ * @throws Exception
+ */
+ public void testRenderSortableHeader() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ List<HtmlElement> headers = page.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.th_ELEM);
+ assertNotNull(headers);
+ assertEquals(2, headers.size());
+
+ HtmlElement th = headers.get(0);
+ assertNotNull(th);
+ String onclick = th.getAttributeValue(HTML.onclick_ATTRIBUTE);
+ assertNotNull(onclick);
+ assertTrue(onclick.startsWith("A4J.AJAX.Submit"));
+
+ HtmlElement div = (HtmlElement) th.getFirstDomChild();
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getTagName());
+ assertNull(div.getNextDomSibling());
+
+ HtmlElement span = (HtmlElement) div.getFirstDomChild();
+ assertNotNull(span);
+ assertEquals(HTML.SPAN_ELEM, span.getTagName());
+ assertNull(span.getNextDomSibling());
+
+ String clazz = span.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ //assertTrue(clazz.contains("dr-table-header-sort-up"));
+ assertTrue(clazz.contains("dr-table-sortable-header"));
+
+ DomText text = (DomText) span.getFirstDomChild();
+ assertNotNull(text);
+
+ HtmlElement img = (HtmlElement) text.getNextDomSibling();
+ assertNotNull(img);
+ assertEquals(HTML.IMG_ELEMENT, img.getTagName());
+ assertNull(img.getNextDomSibling());
+
+ String src = img.getAttributeValue(HTML.src_ATTRIBUTE);
+ assertNotNull(src);
+ assertTrue(src.contains(DataTableIconSortAsc.class.getName()));
+ }
+
+ /**
+ * Test filtered header rendering.
+ *
+ * @throws Exception
+ */
+ public void testRenderFilteredHeader() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ List<HtmlElement> headers = page.getDocumentElement().getHtmlElementsByTagName(HTML.th_ELEM);
+ assertNotNull(headers);
+ assertEquals(2, headers.size());
+
+ HtmlElement th = headers.get(1);
+ assertNotNull(th);
+
+ HtmlElement div = (HtmlElement) th.getFirstChild();
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getTagName());
+ assertNull(div.getFirstChild());
+
+ div = (HtmlElement) div.getNextSibling();
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getTagName());
+ assertNull(div.getNextSibling());
+
+ List<HtmlElement> spans= div.getHtmlElementsByTagName(HTML.SPAN_ELEM);
+ assertNotNull(spans);
+ if (1 == spans.size()) { // inplace input is used
+ HtmlElement span = spans.get(0);
+ String clazz = span.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-inplace-view"));
+ } else { // simple inputText
+ HtmlElement input = (HtmlElement) div.getFirstChild();
+ assertNotNull(input);
+ assertEquals(HTML.INPUT_ELEM, input.getTagName());
+ }
+ }
+
+ /**
+ * Test filtered data rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderFilteredData() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement table = page.getHtmlElementById(dataTable.getClientId(facesContext));
+ assertNotNull(table);
+
+ HtmlElement tbody = table.getHtmlElementById(dataTable.getClientId(facesContext)+ ":tb");
+ assertNotNull(tbody);
+ assertNull(tbody.getFirstChild());
+
+ tearDown();
+ setUp();
+
+ column2.setFilterValue(null);
+ column2.setValueExpression("filterBy", null);
+
+ page = renderView();
+ assertNotNull(page);
+
+ table = page.getHtmlElementById(dataTable.getClientId(facesContext));
+ assertNotNull(table);
+
+ tbody = table.getHtmlElementById(dataTable.getClientId(facesContext)+ ":tb");
+ assertNotNull(tbody);
+ assertNotNull(tbody.getFirstChild());
+
+ int count = 0;
+ Iterator<HtmlElement> it = tbody.getChildElementsIterator();
+ while (it.hasNext()) {
+ HtmlElement tr = it.next();
+ count++;
+ }
+ assertEquals(ROWS_COUNT, count);
+ }
+
+ public void testScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List<HtmlScript> scripts = page.getDocumentElement().getHtmlElementsByTagName(
+ "script");
+ int foundCount = 0;
+ for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ foundCount++;
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+ }
+
+ protected class ColumnOneExpression extends ValueExpression {
+
+ private static final long serialVersionUID = -60617505361080421L;
+
+ @Override
+ public Class<?> getExpectedType() {
+ return String.class;
+ }
+
+ @Override
+ public Class<?> getType(ELContext context) {
+ return String.class;
+ }
+
+ @Override
+ public Object getValue(ELContext context) {
+ return ((Date)model.getRowData()).getTime();
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context) {
+ return false;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object value) {
+
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ @Override
+ public String getExpressionString() {
+ return null;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public boolean isLiteralText() {
+ return false;
+ }
+ }
+
+ protected class ColumnTwoExpression extends ColumnOneExpression {
+
+ private static final long serialVersionUID = -865017340246458449L;
+
+ @Override
+ public Object getValue(ELContext context) {
+ return ((Date)model.getRowData()).getTimezoneOffset();
+ }
+ }
+
+ protected class ComparatorExpression extends ColumnOneExpression {
+
+ private static final long serialVersionUID = -865017340246458449L;
+
+ @Override
+ public Object getValue(ELContext context) {
+ return comparator;
+ }
+ }
+
+ protected class SortComparator implements Comparator<Date> {
+
+ public int compare(Date o1, Date o2) {
+ return o1.compareTo(o2);
+ }
+
+ }
+
+}
Modified: trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx
===================================================================
--- trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/datascroller/src/main/templates/org/richfaces/htmlDatascroller.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -360,4 +360,4 @@
Event.observe('#{clientId}', 'rich:datascroller:onscroll', #{this:getSubmitFunction(context,component)});
</script>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
===================================================================
--- trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -17,7 +17,7 @@
new org.ajax4jsf.javascript.DnDScript(),
/org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/json/json-dom.js,
- /org/richfaces/renderkit/html/scripts/dnd/dnd-common.js,
+ /org/richfaces/renderkit/html/scripts/dnd/dnd-common.js,
/org/richfaces/renderkit/html/scripts/browser_info.js,
scripts/drag-indicator.js
</h:scripts>
Modified: trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
===================================================================
--- trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,260 +1,260 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIPanel;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.PhaseId;
-import javax.servlet.http.HttpServletResponse;
-
-import org.ajax4jsf.event.EventsQueue;
-import org.ajax4jsf.resource.InternetResource;
-import org.ajax4jsf.resource.InternetResourceBuilder;
-import org.ajax4jsf.resource.ResourceBuilderImpl;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.ajax4jsf.tests.MockViewRoot;
-import org.apache.commons.collections.Buffer;
-import org.apache.commons.lang.StringUtils;
-import org.richfaces.renderkit.DraggableRendererContributor;
-import org.richfaces.renderkit.DropzoneRendererContributor;
-
-import com.gargoylesoftware.htmlunit.Page;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-/**
- * Unit test for simple Component.
- */
-public class DragDropTest extends AbstractAjax4JsfTestCase {
-
- private UIDndParam dndparam;
-
- private UIDragIndicator dndindicator;
-
- private UIDragSupport dragsupport;
-
- private UIDropSupport dropsupport;
-
- private UIPanel panel1, panel2;
-
- private UIComponent form;
-
- private static final String CSS_FILE_PATH = "org/richfaces/renderkit/html/css/dragIndicator.xcss";
-
- private static Set javaScripts = new HashSet();
- static {
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- javaScripts.add("scripts/browser_info.js");
- javaScripts.add("org.ajax4jsf.javascript.DnDScript");
- javaScripts.add("scripts/events.js");
- javaScripts.add("scripts/utils.js");
- javaScripts.add("scripts/simple-draggable.js");
- javaScripts.add("scripts/simple-dropzone.js");
- javaScripts.add("scripts/json/json-mini.js");
- javaScripts.add("scripts/json/json-dom.js");
- javaScripts.add("scripts/dnd/dnd-common.js");
- javaScripts.add("scripts/dnd/dnd-dropzone.js");
- javaScripts.add("scripts/dnd/dnd-draggable.js");
- javaScripts.add("scripts/drag-indicator.js");
- }
- private static Set eventsSet = new HashSet();
- static {
- eventsSet.add("org.richfaces.component.html.HtmlDragSupport");
- eventsSet.add("org.richfaces.component.html.HtmlDropSupport");
-
- }
-
- public DragDropTest(String testName) {
- super(testName);
- }
-
- public void setUp() throws Exception {
-
- super.setUp();
-
- form = new HtmlForm();
- assertNotNull(form);
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- panel1 = new UIPanel();
- panel1.setId("panel1");
-
- panel2 = new UIPanel();
- panel2.setId("panel2");
-
- dndparam = (UIDndParam) application
- .createComponent("org.richfaces.DndParam");
- dndparam.setId("dndparam");
-
- dndindicator = (UIDragIndicator) application
- .createComponent(UIDragIndicator.COMPONENT_TYPE);
- dndindicator.setId("dndindicator");
-
- dragsupport = (UIDragSupport) application
- .createComponent("org.richfaces.DragSupport");
- dragsupport.setId("dragsupport");
- dragsupport.setDragType("foto");
- // panel1.getChildren().add(dragsupport);
-
- dropsupport = (UIDropSupport) application
- .createComponent("org.richfaces.DropSupport");
- dropsupport.setId("dropsupport");
- dropsupport.setAcceptedTypes("foto");
- // panel2.getChildren().add(dropsupport);
-
- form.getChildren().add(panel1);
- form.getChildren().add(dndindicator);
- form.getChildren().add(dndparam);
- form.getChildren().add(dragsupport);
- form.getChildren().add(dropsupport);
-
- form.getChildren().add(panel2);
-
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- this.form = null;
- this.dndindicator = null;
- this.dragsupport = null;
- this.dropsupport = null;
- this.dndparam = null;
- }
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- HtmlElement htmlDnDIndicator = page.getHtmlElementById(dndindicator
- .getClientId(facesContext));
- assertTrue(htmlDnDIndicator.getAttributeValue("class").contains(
- "drag_indicator"));
-
- // HtmlElement htmlDnDParam =
- // page.getHtmlElementById(dndparam.getClientId(facesContext));
- // assertTrue(htmlDnDParam.getNodeName().equals("script"));
-
- HtmlElement htmlDragSupport = page.getHtmlElementById(dragsupport
- .getClientId(facesContext));
- assertTrue(htmlDragSupport.getNodeName().equals("script"));
- assertTrue(dragsupport.getDragType().equals("foto"));
-
- HtmlElement htmlDropSupport = page.getHtmlElementById(dropsupport
- .getClientId(facesContext));
- assertTrue(htmlDropSupport.getNodeName().equals("script"));
- assertTrue(dropsupport.getAcceptedTypes().equals("foto"));
- }
-
- public void testScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List scripts = page.getDocumentElement().getHtmlElementsByTagName(
- "script");
- //System.out.println(page.asXml());
- for (Iterator it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = (HtmlScript) it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- break;
- }
- }
-
- assertTrue(found);
- }
- }
-
- }
-
- public void testDecode() throws Exception {
- externalContext.addRequestParameterMap(
- DraggableRendererContributor.DRAG_SOURCE_ID, dragsupport
- .getClientId(facesContext));
- externalContext.addRequestParameterMap(
- DropzoneRendererContributor.DROP_TARGET_ID, dropsupport
- .getClientId(facesContext));
-
- dragsupport.decode(facesContext);
- dropsupport.decode(facesContext);
-
-
-
-
- MockViewRoot root = (MockViewRoot) facesContext.getViewRoot();
- EventsQueue queue = root
- .getEventsQueue(PhaseId.ANY_PHASE);
- assertNotNull(queue);
- while (true) {
- try {
- FacesEvent event = queue.remove();
- boolean found = false;
- for (Iterator srcIt = eventsSet.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
- found = event.toString().contains(src);
- if (found) {
- break;
- }
- }
- assertTrue(found);
- } catch (NoSuchElementException e) {
- break;
- }
- }
-
- }
-
- /**
- * Test style rendering
- *
- * @throws Exception
- */
- public void testRenderStyle() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List links = page.getDocumentElement().getHtmlElementsByTagName("link");
- assertEquals(1, links.size());
- HtmlElement link = (HtmlElement) links.get(0);
- assertTrue(link.getAttributeValue("href").contains(CSS_FILE_PATH));
-
- assertNotNull(getResourceIfPresent(CSS_FILE_PATH));
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.PhaseId;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.event.EventsQueue;
+import org.ajax4jsf.resource.InternetResource;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.ResourceBuilderImpl;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.ajax4jsf.tests.MockViewRoot;
+import org.apache.commons.collections.Buffer;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.renderkit.DraggableRendererContributor;
+import org.richfaces.renderkit.DropzoneRendererContributor;
+
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+/**
+ * Unit test for simple Component.
+ */
+public class DragDropTest extends AbstractAjax4JsfTestCase {
+
+ private UIDndParam dndparam;
+
+ private UIDragIndicator dndindicator;
+
+ private UIDragSupport dragsupport;
+
+ private UIDropSupport dropsupport;
+
+ private UIPanel panel1, panel2;
+
+ private UIComponent form;
+
+ private static final String CSS_FILE_PATH = "org/richfaces/renderkit/html/css/dragIndicator.xcss";
+
+ private static Set javaScripts = new HashSet();
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("scripts/browser_info.js");
+ javaScripts.add("org.ajax4jsf.javascript.DnDScript");
+ javaScripts.add("scripts/events.js");
+ javaScripts.add("scripts/utils.js");
+ javaScripts.add("scripts/simple-draggable.js");
+ javaScripts.add("scripts/simple-dropzone.js");
+ javaScripts.add("scripts/json/json-mini.js");
+ javaScripts.add("scripts/json/json-dom.js");
+ javaScripts.add("scripts/dnd/dnd-common.js");
+ javaScripts.add("scripts/dnd/dnd-dropzone.js");
+ javaScripts.add("scripts/dnd/dnd-draggable.js");
+ javaScripts.add("scripts/drag-indicator.js");
+ }
+ private static Set eventsSet = new HashSet();
+ static {
+ eventsSet.add("org.richfaces.component.html.HtmlDragSupport");
+ eventsSet.add("org.richfaces.component.html.HtmlDropSupport");
+
+ }
+
+ public DragDropTest(String testName) {
+ super(testName);
+ }
+
+ public void setUp() throws Exception {
+
+ super.setUp();
+
+ form = new HtmlForm();
+ assertNotNull(form);
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ panel1 = new UIPanel();
+ panel1.setId("panel1");
+
+ panel2 = new UIPanel();
+ panel2.setId("panel2");
+
+ dndparam = (UIDndParam) application
+ .createComponent("org.richfaces.DndParam");
+ dndparam.setId("dndparam");
+
+ dndindicator = (UIDragIndicator) application
+ .createComponent(UIDragIndicator.COMPONENT_TYPE);
+ dndindicator.setId("dndindicator");
+
+ dragsupport = (UIDragSupport) application
+ .createComponent("org.richfaces.DragSupport");
+ dragsupport.setId("dragsupport");
+ dragsupport.setDragType("foto");
+ // panel1.getChildren().add(dragsupport);
+
+ dropsupport = (UIDropSupport) application
+ .createComponent("org.richfaces.DropSupport");
+ dropsupport.setId("dropsupport");
+ dropsupport.setAcceptedTypes("foto");
+ // panel2.getChildren().add(dropsupport);
+
+ form.getChildren().add(panel1);
+ form.getChildren().add(dndindicator);
+ form.getChildren().add(dndparam);
+ form.getChildren().add(dragsupport);
+ form.getChildren().add(dropsupport);
+
+ form.getChildren().add(panel2);
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ this.form = null;
+ this.dndindicator = null;
+ this.dragsupport = null;
+ this.dropsupport = null;
+ this.dndparam = null;
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ HtmlElement htmlDnDIndicator = page.getHtmlElementById(dndindicator
+ .getClientId(facesContext));
+ assertTrue(htmlDnDIndicator.getAttributeValue("class").contains(
+ "drag_indicator"));
+
+ // HtmlElement htmlDnDParam =
+ // page.getHtmlElementById(dndparam.getClientId(facesContext));
+ // assertTrue(htmlDnDParam.getNodeName().equals("script"));
+
+ HtmlElement htmlDragSupport = page.getHtmlElementById(dragsupport
+ .getClientId(facesContext));
+ assertTrue(htmlDragSupport.getNodeName().equals("script"));
+ assertTrue(dragsupport.getDragType().equals("foto"));
+
+ HtmlElement htmlDropSupport = page.getHtmlElementById(dropsupport
+ .getClientId(facesContext));
+ assertTrue(htmlDropSupport.getNodeName().equals("script"));
+ assertTrue(dropsupport.getAcceptedTypes().equals("foto"));
+ }
+
+ public void testScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName(
+ "script");
+ //System.out.println(page.asXml());
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+
+ }
+
+ public void testDecode() throws Exception {
+ externalContext.addRequestParameterMap(
+ DraggableRendererContributor.DRAG_SOURCE_ID, dragsupport
+ .getClientId(facesContext));
+ externalContext.addRequestParameterMap(
+ DropzoneRendererContributor.DROP_TARGET_ID, dropsupport
+ .getClientId(facesContext));
+
+ dragsupport.decode(facesContext);
+ dropsupport.decode(facesContext);
+
+
+
+
+ MockViewRoot root = (MockViewRoot) facesContext.getViewRoot();
+ EventsQueue queue = root
+ .getEventsQueue(PhaseId.ANY_PHASE);
+ assertNotNull(queue);
+ while (true) {
+ try {
+ FacesEvent event = queue.remove();
+ boolean found = false;
+ for (Iterator srcIt = eventsSet.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+ found = event.toString().contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ } catch (NoSuchElementException e) {
+ break;
+ }
+ }
+
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
+ assertTrue(link.getAttributeValue("href").contains(CSS_FILE_PATH));
+
+ assertNotNull(getResourceIfPresent(CSS_FILE_PATH));
+ }
+}
Modified: trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx
===================================================================
--- trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dropdown-menu/src/main/templates/org/richfaces/htmlDropDownMenu.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,64 +1,64 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- baseclass="org.richfaces.renderkit.html.DropDownMenuRendererBase"
- class="org.richfaces.renderkit.html.DropDownMenuRenderer"
- component="org.richfaces.component.UIDropDownMenu">
- <h:styles>css/dropdownmenu.xcss</h:styles>
-
- <f:clientid var="clientId" />
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ baseclass="org.richfaces.renderkit.html.DropDownMenuRendererBase"
+ class="org.richfaces.renderkit.html.DropDownMenuRenderer"
+ component="org.richfaces.component.UIDropDownMenu">
+ <h:styles>css/dropdownmenu.xcss</h:styles>
+
+ <f:clientid var="clientId" />
<jsp:scriptlet>
- <![CDATA[ org.richfaces.component.UIDropDownMenu menu = (org.richfaces.component.UIDropDownMenu) component;
- if (!menu.getSubmitMode().equalsIgnoreCase("none"))
- org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(context,component);
+ <![CDATA[ org.richfaces.component.UIDropDownMenu menu = (org.richfaces.component.UIDropDownMenu) component;
+ if (!menu.getSubmitMode().equalsIgnoreCase("none"))
+ org.richfaces.component.util.FormUtil.throwEnclFormReqExceptionIfNeed(context,component);
- if (!menu.isDisabled()) {]]>
- </jsp:scriptlet>
- <div id="#{clientId}" style="#{component.attributes['style']}"
- class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect #{component.attributes['styleClass']}"
- onmouseover="#{component.attributes['onmouseover']}"
- onmouseout="#{component.attributes['onmouseout']}"
- onmousemove="#{component.attributes['onmousemove']}">
- <jsp:scriptlet>
- <![CDATA[ } else { ]]>
- </jsp:scriptlet>
- <div id="#{clientId}" style="#{component.attributes['style']}"
- class="dr-menu-label dr-menu-label-unselect dr-ddmenu-label-disabled rich-ddmenu-label-disabled rich-ddmenu-label-unselect #{component.attributes['styleClass']} #{component.attributes['disabledLabelClass']}"
- onmouseover="#{component.attributes['onmouseover']}"
- onmouseout="#{component.attributes['onmouseout']}"
- onmousemove="#{component.attributes['onmousemove']}">
+ if (!menu.isDisabled()) {]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}" style="#{component.attributes['style']}"
+ class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect #{component.attributes['styleClass']}"
+ onmouseover="#{component.attributes['onmouseover']}"
+ onmouseout="#{component.attributes['onmouseout']}"
+ onmousemove="#{component.attributes['onmousemove']}">
+ <jsp:scriptlet>
+ <![CDATA[ } else { ]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}" style="#{component.attributes['style']}"
+ class="dr-menu-label dr-menu-label-unselect dr-ddmenu-label-disabled rich-ddmenu-label-disabled rich-ddmenu-label-unselect #{component.attributes['styleClass']} #{component.attributes['disabledLabelClass']}"
+ onmouseover="#{component.attributes['onmouseover']}"
+ onmouseout="#{component.attributes['onmouseout']}"
+ onmousemove="#{component.attributes['onmousemove']}">
<jsp:scriptlet>
- <![CDATA[ } if (menu.isDisabled() &&
- (component.getFacet("labelDisabled")!=null && component.getFacet("labelDisabled").isRendered())) {]]>
- </jsp:scriptlet> <div class="dr-label-text-decor rich-label-text-decor"> <u:insertFacet
- name="labelDisabled" /> </div> <jsp:scriptlet>
+ <![CDATA[ } if (menu.isDisabled() &&
+ (component.getFacet("labelDisabled")!=null && component.getFacet("labelDisabled").isRendered())) {]]>
+ </jsp:scriptlet> <div class="dr-label-text-decor rich-label-text-decor"> <u:insertFacet
+ name="labelDisabled" /> </div> <jsp:scriptlet>
<![CDATA[} else if(component.getFacet("label")!=null && component.getFacet("label").isRendered()) {]]>
- </jsp:scriptlet> <div class="dr-label-text-decor rich-label-text-decor"> <u:insertFacet
+ </jsp:scriptlet> <div class="dr-label-text-decor rich-label-text-decor"> <u:insertFacet
name="label" /> </div> <jsp:scriptlet>
<![CDATA[} else {]]>
- </jsp:scriptlet> <div id="#{clientId}_span" class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</div>
+ </jsp:scriptlet> <div id="#{clientId}_span" class="dr-label-text-decor rich-label-text-decor">#{component.attributes['value']}</div>
<jsp:scriptlet>
<![CDATA[}]]>
- </jsp:scriptlet>
-
- <div
- style="margin: 0px; padding: 0px; border: 0px; position: absolute; z-index: 100;">
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body></div>
-
- <jsp:scriptlet>
- <![CDATA[if (!((org.richfaces.component.UIDropDownMenu) component).isDisabled()) {]]>
- </jsp:scriptlet>
- </div>
- <jsp:scriptlet>
- <![CDATA[} else {]]>
- </jsp:scriptlet>
- </div>
- <jsp:scriptlet>
+ </jsp:scriptlet>
+
+ <div
+ style="margin: 0px; padding: 0px; border: 0px; position: absolute; z-index: 100;">
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body></div>
+
+ <jsp:scriptlet>
+ <![CDATA[if (!((org.richfaces.component.UIDropDownMenu) component).isDisabled()) {]]>
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[} else {]]>
+ </jsp:scriptlet>
+ </div>
+ <jsp:scriptlet>
<![CDATA[}]]>
- </jsp:scriptlet>
-</f:root>
\ No newline at end of file
+ </jsp:scriptlet>
+</f:root>
Modified: trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java
===================================================================
--- trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/dropdown-menu/src/test/java/org/richfaces/component/DropDownMenuComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -217,4 +217,4 @@
assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/effect/src/main/templates/effect.jspx
===================================================================
--- trunk/ui/effect/src/main/templates/effect.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/effect/src/main/templates/effect.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -110,4 +110,4 @@
</script>
</c:if>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
--- trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1784,4 +1784,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx
===================================================================
--- trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/extendedDataTable/src/main/templates/org/richfaces/htmlExtendedDataTable.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -51,7 +51,7 @@
<div
id="#{clientId}"
- class="extdt-maindiv rich-extdt-maindiv"
+ class="extdt-maindiv rich-extdt-maindiv"
style="#{component.attributes['style']};width:#{component.attributes['width']};height:#{component.attributes['height']}"
>
@@ -71,8 +71,8 @@
<div id="#{clientId}:innerd" class="extdt-innerdiv" style="height:100%;width:100%;">
<div id="#{clientId}:cs" class="extdt-hsplit" style="display: none;"/>
<table id="#{clientId}:tu"
- class="extdt-table-layout rich-table #{component.attributes['styleClass']}"
- cellpadding="0"
+ class="extdt-table-layout rich-table #{component.attributes['styleClass']}"
+ cellpadding="0"
cellspacing="0"
width="100%"
>
@@ -121,4 +121,4 @@
</div>
<f:call name="encodeTableMenu"/>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,281 +1,281 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.component;
-
-import java.io.InputStream;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ExpressionFactory;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
-import javax.faces.event.FacesEvent;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.AjaxContextImpl;
-import org.ajax4jsf.request.MultipartRequest;
-import org.richfaces.event.FileUploadListener;
-import org.richfaces.event.UploadEvent;
-import org.richfaces.renderkit.FileUploadRendererBase;
-
-
-
-/**
- * JSF component class
- *
- */
-public abstract class UIFileUpload extends UIInput {
-
- /**
- * <p>
- * The standard component type for this component.
- * </p>
- */
- public static final String COMPONENT_TYPE = "org.richfaces.component.FileUpload";
-
- /**
- * <p>
- * The standard component family for this component.
- * </p>
- */
- public static final String COMPONENT_FAMILY = "org.richfaces.component.FileUpload";
-
- private String localContentType;
-
- private String localFileName;
-
- private Integer localFileSize;
-
- private InputStream localInputStream;
-
- private void setupProgressBarValueExpression(FacesContext context, String uid) {
- FileUploadRendererBase renderer = (FileUploadRendererBase)this.getRenderer(context);
- UIComponent progressBar = renderer.getProgressBar(context, this);
- String percentExpression = FileUploadConstants.PERCENT_BEAN_NAME + "['"+uid+"']";
- ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
- ELContext elContext = context.getELContext();
-
- ValueExpression value = expressionFactory
- .createValueExpression(elContext, "#{" + percentExpression + "}",
- Integer.class);
- progressBar.setValueExpression("value", value);
-
- ValueExpression enabled = expressionFactory
- .createValueExpression(elContext,
- "#{" + percentExpression + " < 100}", //100 - disable progress when upload reaches 100%
- Boolean.class);
-
- progressBar.setValueExpression("enabled", enabled);
- }
-
-
-
- public String getLocalContentType() {
- return localContentType;
- }
-
- public void setLocalContentType(String localContentType) {
- this.localContentType = localContentType;
- }
-
- public String getLocalFileName() {
- return localFileName;
- }
-
- public void setLocalFileName(String localFileName) {
- this.localFileName = localFileName;
- }
-
- public Integer getLocalFileSize() {
- return localFileSize;
- }
-
- public void setLocalFileSize(Integer localFileSize) {
- this.localFileSize = localFileSize;
- }
-
- public InputStream getLocalInputStream() {
- return localInputStream;
- }
-
- public void setLocalInputStream(InputStream localInputStream) {
- this.localInputStream = localInputStream;
- }
-
- public abstract void setAcceptedTypes(String acceptedTypes);
-
- public abstract String getAcceptedTypes();
-
- public abstract Integer getMaxFilesQuantity();
-
- public abstract void setMaxFilesQuantity(Integer maxFilesQuantity);
-
- public abstract String getListHeight();
-
- public abstract void setListHeight(String listHeight);
-
- public abstract String getListWidth();
-
- public abstract void setListWidth(String listWidth);
-
- public abstract String getStyleClass();
-
- public abstract String getStyle();
-
- public abstract void setStyleClass(String styleClass);
-
- public abstract void setStyle(String style);
-
- public abstract Object getLocale();
-
- public abstract void setLocale(Object locale);
-
- public abstract MethodBinding getFileUploadListener();
-
- public abstract void setFileUploadListener(MethodBinding scrollerListener);
-
- public void addFileUploadListener(FileUploadListener listener) {
- addFacesListener(listener);
- }
-
- public FileUploadListener[] getFileUploadListeners() {
- return (FileUploadListener[]) getFacesListeners(FileUploadListener.class);
- }
-
- public void removeFileUploadListener(FileUploadListener listener) {
- removeFacesListener(listener);
- }
-
- public void reset () {
- this.localContentType = null;
- this.localContentType = null;
- this.localFileName = null;
- this.localFileSize = null;
- this.localInputStream = null;
- }
-
- public void broadcast(FacesEvent e) {
-
- if (e instanceof UploadEvent) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- MethodBinding binding = getFileUploadListener();
- if (binding != null) {
- binding.invoke(facesContext, new Object[] { e });
- }
-
- } else {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ExternalContext externalContext = facesContext.getExternalContext();
- Map<String, String> requestParameterMap = externalContext.getRequestParameterMap();
-
- String actionString = requestParameterMap.get("action");
-
- if (actionString != null && requestParameterMap.containsKey(this.getClientId(facesContext))) {
- AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(facesContext);
- String uid = requestParameterMap.get(FileUploadConstants.UPLOAD_FILES_ID);
-
- Map<String, Object> sessionMap = externalContext.getSessionMap();
-
- Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) sessionMap
- .get(FileUploadConstants.REQUESTS_SESSIONS_BEAN_NAME);
- if (sessions != null) {
- MultipartRequest multipartRequest = sessions.get(uid);
- if (multipartRequest != null) {
- if ("progress".equals(actionString)) {
- setupProgressBarValueExpression(facesContext, uid);
- ajaxContext.setResponseData(multipartRequest.getSize());
- } else if ("richfaces_file_upload_action_stop".equals(actionString)) {
- multipartRequest.stop();
- }
- }
- }
- }
- }
-
- }
-
- /**
- *Parse Locale from String.
- *String must be represented as Locale.toString(); xx_XX_XXXX
-*/
-
- public Locale parseLocale(String localeStr){
-
- int length = localeStr.length();
- if(null==localeStr||length<2){
- return Locale.getDefault();
- }
-
- //Lookup index of first '_' in string locale representation.
- int index1 = localeStr.indexOf("_");
- //Get first charters (if exist) from string
- String language = null;
- if(index1!=-1){
- language = localeStr.substring(0, index1);
- }else{
- return new Locale(localeStr);
- }
- //Lookup index of second '_' in string locale representation.
- int index2 = localeStr.indexOf("_", index1+1);
- String country = null;
- if(index2!=-1){
- country = localeStr.substring(index1+1, index2);
- String variant = localeStr.substring(index2+1);
- return new Locale(language, country, variant);
- }else{
- country = localeStr.substring(index1+1);
- return new Locale(language, country);
- }
- }
-
- public Locale getAsLocale(Object locale) {
-
- if (locale instanceof Locale) {
-
- return (Locale) locale;
-
- } else if (locale instanceof String) {
-
- return parseLocale((String) locale);
-
- } else {
-
- FacesContext context = FacesContext.getCurrentInstance();
- Application application = context.getApplication();
- Converter converter = application
- .createConverter(locale.getClass());
- if (null != converter) {
- return parseLocale(converter.getAsString(context, this, locale));
- } else {
- throw new FacesException(
- "Wrong locale attibute type or there is no converter for custom attibute type");
- }
- }
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.io.InputStream;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.FacesEvent;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.AjaxContextImpl;
+import org.ajax4jsf.request.MultipartRequest;
+import org.richfaces.event.FileUploadListener;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.renderkit.FileUploadRendererBase;
+
+
+
+/**
+ * JSF component class
+ *
+ */
+public abstract class UIFileUpload extends UIInput {
+
+ /**
+ * <p>
+ * The standard component type for this component.
+ * </p>
+ */
+ public static final String COMPONENT_TYPE = "org.richfaces.component.FileUpload";
+
+ /**
+ * <p>
+ * The standard component family for this component.
+ * </p>
+ */
+ public static final String COMPONENT_FAMILY = "org.richfaces.component.FileUpload";
+
+ private String localContentType;
+
+ private String localFileName;
+
+ private Integer localFileSize;
+
+ private InputStream localInputStream;
+
+ private void setupProgressBarValueExpression(FacesContext context, String uid) {
+ FileUploadRendererBase renderer = (FileUploadRendererBase)this.getRenderer(context);
+ UIComponent progressBar = renderer.getProgressBar(context, this);
+ String percentExpression = FileUploadConstants.PERCENT_BEAN_NAME + "['"+uid+"']";
+ ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
+ ELContext elContext = context.getELContext();
+
+ ValueExpression value = expressionFactory
+ .createValueExpression(elContext, "#{" + percentExpression + "}",
+ Integer.class);
+ progressBar.setValueExpression("value", value);
+
+ ValueExpression enabled = expressionFactory
+ .createValueExpression(elContext,
+ "#{" + percentExpression + " < 100}", //100 - disable progress when upload reaches 100%
+ Boolean.class);
+
+ progressBar.setValueExpression("enabled", enabled);
+ }
+
+
+
+ public String getLocalContentType() {
+ return localContentType;
+ }
+
+ public void setLocalContentType(String localContentType) {
+ this.localContentType = localContentType;
+ }
+
+ public String getLocalFileName() {
+ return localFileName;
+ }
+
+ public void setLocalFileName(String localFileName) {
+ this.localFileName = localFileName;
+ }
+
+ public Integer getLocalFileSize() {
+ return localFileSize;
+ }
+
+ public void setLocalFileSize(Integer localFileSize) {
+ this.localFileSize = localFileSize;
+ }
+
+ public InputStream getLocalInputStream() {
+ return localInputStream;
+ }
+
+ public void setLocalInputStream(InputStream localInputStream) {
+ this.localInputStream = localInputStream;
+ }
+
+ public abstract void setAcceptedTypes(String acceptedTypes);
+
+ public abstract String getAcceptedTypes();
+
+ public abstract Integer getMaxFilesQuantity();
+
+ public abstract void setMaxFilesQuantity(Integer maxFilesQuantity);
+
+ public abstract String getListHeight();
+
+ public abstract void setListHeight(String listHeight);
+
+ public abstract String getListWidth();
+
+ public abstract void setListWidth(String listWidth);
+
+ public abstract String getStyleClass();
+
+ public abstract String getStyle();
+
+ public abstract void setStyleClass(String styleClass);
+
+ public abstract void setStyle(String style);
+
+ public abstract Object getLocale();
+
+ public abstract void setLocale(Object locale);
+
+ public abstract MethodBinding getFileUploadListener();
+
+ public abstract void setFileUploadListener(MethodBinding scrollerListener);
+
+ public void addFileUploadListener(FileUploadListener listener) {
+ addFacesListener(listener);
+ }
+
+ public FileUploadListener[] getFileUploadListeners() {
+ return (FileUploadListener[]) getFacesListeners(FileUploadListener.class);
+ }
+
+ public void removeFileUploadListener(FileUploadListener listener) {
+ removeFacesListener(listener);
+ }
+
+ public void reset () {
+ this.localContentType = null;
+ this.localContentType = null;
+ this.localFileName = null;
+ this.localFileSize = null;
+ this.localInputStream = null;
+ }
+
+ public void broadcast(FacesEvent e) {
+
+ if (e instanceof UploadEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ MethodBinding binding = getFileUploadListener();
+ if (binding != null) {
+ binding.invoke(facesContext, new Object[] { e });
+ }
+
+ } else {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+ Map<String, String> requestParameterMap = externalContext.getRequestParameterMap();
+
+ String actionString = requestParameterMap.get("action");
+
+ if (actionString != null && requestParameterMap.containsKey(this.getClientId(facesContext))) {
+ AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(facesContext);
+ String uid = requestParameterMap.get(FileUploadConstants.UPLOAD_FILES_ID);
+
+ Map<String, Object> sessionMap = externalContext.getSessionMap();
+
+ Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) sessionMap
+ .get(FileUploadConstants.REQUESTS_SESSIONS_BEAN_NAME);
+ if (sessions != null) {
+ MultipartRequest multipartRequest = sessions.get(uid);
+ if (multipartRequest != null) {
+ if ("progress".equals(actionString)) {
+ setupProgressBarValueExpression(facesContext, uid);
+ ajaxContext.setResponseData(multipartRequest.getSize());
+ } else if ("richfaces_file_upload_action_stop".equals(actionString)) {
+ multipartRequest.stop();
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ *Parse Locale from String.
+ *String must be represented as Locale.toString(); xx_XX_XXXX
+*/
+
+ public Locale parseLocale(String localeStr){
+
+ int length = localeStr.length();
+ if(null==localeStr||length<2){
+ return Locale.getDefault();
+ }
+
+ //Lookup index of first '_' in string locale representation.
+ int index1 = localeStr.indexOf("_");
+ //Get first charters (if exist) from string
+ String language = null;
+ if(index1!=-1){
+ language = localeStr.substring(0, index1);
+ }else{
+ return new Locale(localeStr);
+ }
+ //Lookup index of second '_' in string locale representation.
+ int index2 = localeStr.indexOf("_", index1+1);
+ String country = null;
+ if(index2!=-1){
+ country = localeStr.substring(index1+1, index2);
+ String variant = localeStr.substring(index2+1);
+ return new Locale(language, country, variant);
+ }else{
+ country = localeStr.substring(index1+1);
+ return new Locale(language, country);
+ }
+ }
+
+ public Locale getAsLocale(Object locale) {
+
+ if (locale instanceof Locale) {
+
+ return (Locale) locale;
+
+ } else if (locale instanceof String) {
+
+ return parseLocale((String) locale);
+
+ } else {
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ Application application = context.getApplication();
+ Converter converter = application
+ .createConverter(locale.getClass());
+ if (null != converter) {
+ return parseLocale(converter.getAsString(context, this, locale));
+ } else {
+ throw new FacesException(
+ "Wrong locale attibute type or there is no converter for custom attibute type");
+ }
+ }
+ }
+}
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/FileUploadRendererBase.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,776 +1,776 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.el.ExpressionFactory;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.FactoryFinder;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIParameter;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.RenderKit;
-import javax.faces.render.RenderKitFactory;
-import javax.servlet.http.HttpSession;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.event.AjaxEvent;
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.javascript.JSFunctionDefinition;
-import org.ajax4jsf.javascript.JSLiteral;
-import org.ajax4jsf.javascript.JSReference;
-import org.ajax4jsf.javascript.ScriptUtils;
-import org.ajax4jsf.renderkit.AjaxRendererUtils;
-import org.ajax4jsf.renderkit.ComponentVariables;
-import org.ajax4jsf.renderkit.ComponentsVariableResolver;
-import org.ajax4jsf.renderkit.RendererUtils;
-import org.ajax4jsf.request.MultipartRequest;
-import org.ajax4jsf.resource.CountingOutputWriter;
-import org.richfaces.component.FileUploadConstants;
-import org.richfaces.component.UIFileUpload;
-import org.richfaces.component.UIProgressBar;
-import org.richfaces.component.util.HtmlUtil;
-import org.richfaces.event.UploadEvent;
-import org.richfaces.model.UploadItem;
-
-/**
- * Class provides base renderer for upload file component
- *
- * @author "Andrey Markavtsov"
- *
- */
-public abstract class FileUploadRendererBase extends
- TemplateEncoderRendererBase {
-
- /** Attribute name where collection of files uploaded will be stored */
- private static final String _FILES_UPLOADED_ATTRIBUTE_NAME = "uploadData";
-
- /** File upload bundle name */
- private static final String FILE_UPLOAD_BUNDLE = "org.richfaces.renderkit.fileUpload";
-
- /** Bundle prefix */
- private static final String bundlePrefix = "RICH_FILE_UPLOAD_";
-
- /** Bundle postfix */
- private static final String bundlePostfix = "_LABEL";
-
- /** Set of bundles that can be defined */
- private static final String[] bundlesLables = { "add", "upload", "stop",
- "clear_all", "entry_cancel", "entry_clear", "entry_stop", "done",
- "size_error", "transfer_error","progress" };
-
- /** Default labels values */
- private static final String[] defaultLables = { "Add...", "<b>Upload</b>",
- "<b>Stop</b>", "Clear All", "Cancel", "Clear", "Stop",
- "<b>Done</b>", "File size restricted", "Transfer error occurred","uploading"};
-
- /** Set of attributes that can define label's value */
- private static final String[] labelAttribues = { "addControlLabel",
- "uploadControlLabel", "stopControlLabel", "clearAllControlLabel",
- "cancelEntryControlLabel", "clearControlLabel",
- "stopEntryControlLabel", "doneLabel", "sizeErrorLabel", "transferErrorLabel", "progressLabel" };
-
- /**
- * Overrides standard JSF component method.
- *
- * @param context
- * faces context
- * @param component
- * file upload component
- */
- @Override
- @SuppressWarnings("unchecked")
- protected void doDecode(FacesContext context, UIComponent component) {
-
- new AjaxEvent(component).queue();
-
- ExternalContext externalContext = context.getExternalContext();
- Map<String, String> requestParameterMap = externalContext.getRequestParameterMap();
- String fileUploadIndicator = requestParameterMap.get(FileUploadConstants.FILE_UPLOAD_INDICATOR);
-
- if (fileUploadIndicator != null && Boolean.TRUE.toString().equals(fileUploadIndicator)) {
- UIFileUpload fileUpload = (UIFileUpload) component;
- String clientId = component.getClientId(context);
- String id = requestParameterMap.get("id");
-
- if (!clientId.equals(id)) {
- return; // Avoid listener calling for another fileUpload
- }
-
- String uid = requestParameterMap.get(FileUploadConstants.UPLOAD_FILES_ID);
- decreaseFileCounter(context, id);
- Map<String, MultipartRequest> map = (Map<String, MultipartRequest>) externalContext.getSessionMap()
- .get(FileUploadConstants.REQUESTS_SESSIONS_BEAN_NAME);
-
- MultipartRequest multipartRequest = map.get(uid);
-
- boolean isFlash = (requestParameterMap.get("_richfaces_send_http_error") != null);
-
- List<UploadItem> fileList = multipartRequest.getUploadItems();
-
- if (fileList == null || fileList.size() == 0) {
- return;
- }
-
- boolean formUpload = multipartRequest.isFormUpload();
-
- if (isFlash && !formUpload && fileList.size() > 0) {
- try {
- UploadItem item = fileList.get(0);
- int actualSize = item.getFileSize();
- int clientSize = Integer.parseInt(requestParameterMap.get("_richfaces_size"));
-
- if (actualSize != clientSize) {
- return; // File uploading has been stopped on the client side
- }
- }catch (Exception e) {
- return;
- }
- }
- onUploadComplete(context, fileList, fileUpload, formUpload);
- }
-
- }
-
- /**
- * Put max file count into session scope
- *
- * @param context
- * @param component
- * @param clientId
- * @return
- */
- @SuppressWarnings("unchecked")
- public Integer initMaxFilesCount(FacesContext context,
- UIComponent component, String clientId) {
- Integer max = (Integer) component.getAttributes().get(
- "maxFilesQuantity");
- Object session = context.getExternalContext()
- .getSession(false);
- synchronized (session) {
- Map<String, Integer> map = (Map<String, Integer>) context.getExternalContext().getSessionMap().get(FileUploadConstants.UPLOADED_COUNTER);
- if (map == null) {
- map = Collections
- .synchronizedMap(new HashMap<String, Integer>());
- }
- map.put(clientId, max);
- }
- return max;
- }
-
- /**
- * Gets form id
- *
- * @param context -
- * faces context
- * @param component -
- * component
- * @return String form id
- */
- public String getFormId(FacesContext context, UIComponent component) {
- UIComponent form = AjaxRendererUtils.getNestingForm(component);
- if (form != null) {
- return form.getClientId(context);
- }
- return "";
- }
-
- /**
- * Gets container id
- *
- * @param context -
- * faces context
- * @param component -
- * component
- * @return String container id
- */
- public String getContainerId(FacesContext context, UIComponent component) {
- UIComponent container = (UIComponent) AjaxRendererUtils
- .findAjaxContainer(context, component);
- if (container != null) {
- return container.getClientId(context);
- }
- return null;
- }
-
- /**
- * Generates map with internalized labels to be put into JS
- *
- * @param o
- * map of labels
- * @return javascript hash map
- */
- public Object _getLabels(Object o) {
- return ScriptUtils.toScript(o);
- }
-
- /**
- * Gets internalized labels. At the first system is looking for them in
- * appropriate attributes if they are defined. Next search place is
- * application and file upload bundles. If no result - default label value
- * will be set up.
- *
- * @param context
- * facesContext instance
- * @param component
- * UIComponent
- * @return map of labels
- */
- public Map<String, String> getLabels(FacesContext context,
- UIComponent component) {
- Map<String, String> labelsMap = new HashMap<String, String>();
- ResourceBundle bundle1 = null;
- ResourceBundle bundle2 = null;
- UIFileUpload fileUpload = (UIFileUpload) component;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- String messageBundle = context.getApplication().getMessageBundle();
- Object locale = fileUpload.getLocale();
- if (locale == null) {
- locale = context.getExternalContext().getRequestLocale();
- }
- if (null != messageBundle) {
- bundle1 = ResourceBundle.getBundle(messageBundle, fileUpload
- .getAsLocale(locale), loader);
- }
- try {
- bundle2 = ResourceBundle.getBundle(FILE_UPLOAD_BUNDLE, fileUpload
- .getAsLocale(locale), loader);
-
- } catch (MissingResourceException e) {
- // No external bundle was found, ignore this exception.
- }
- initLabels(labelsMap, bundle1, bundle2, fileUpload);
- return labelsMap;
- }
-
- /**
- * Sets values for labels.
- *
- * @param map
- * map of labels
- * @param bundle1
- * application bundle
- * @param bundle2
- * file upload bundle
- * @param fileUpload
- */
- private void initLabels(Map<String, String> map, ResourceBundle bundle1,
- ResourceBundle bundle2, UIFileUpload fileUpload) {
- int i = 0;
- for (String name : bundlesLables) {
- boolean found = false;
- if (labelAttribues[i] != null) {
- String attributeName = labelAttribues[i];
- if (fileUpload.getAttributes().get(attributeName) != null) {
- map.put(name, (String) fileUpload.getAttributes().get(
- attributeName));
- found = true;
- }
- }
- if (!found && (bundle1 != null || bundle2 != null)) {
- String label = getFromBundle(name, bundle1, bundle2);
- if (label != null) {
- map.put(name, getFromBundle(name, bundle1, bundle2));
- found = true;
- }
- }
- if (!found) {
- map.put(name, defaultLables[i]);
- }
- i++;
- }
- }
-
- /**
- * Looking for labels name in bundles provided.
- *
- * @param bundle1
- * application bundle
- * @param bundle2
- * file upload bundle
- * @return String label value
- */
- private String getFromBundle(String name, ResourceBundle bundle1,
- ResourceBundle bundle2) {
- name = bundlePrefix + name.toUpperCase() + bundlePostfix;
- String v = null;
- if (bundle1 != null) {
- try {
- v = bundle1.getString(name);
- } catch (Exception e) {
- if (bundle2 != null) {
- try {
- v = bundle2.getString(name);
- } catch (Exception ex) {
- // no value has been found
- }
- }
-
- }
-
- } else if (bundle2 != null) {
- try {
- v = bundle2.getString(name);
- ByteArrayOutputStream b = new ByteArrayOutputStream();
- b.write(v.getBytes());
- b.toString("UTF-8");
- } catch (Exception e) {
- // no value has been found
- }
- }
- return v;
- }
-
- /**
- * Method decrease file counter
- *
- * @param context
- * @param id
- */
- @SuppressWarnings("unchecked")
- private void decreaseFileCounter(FacesContext context, String id) {
- Map<String, Integer> map = (Map<String, Integer>) context.getExternalContext().getSessionMap()
- .get(FileUploadConstants.UPLOADED_COUNTER);
- if (map != null) {
- Integer i = map.get(id);
- if (i == null) {
- i = 0;
- } else {
- i--;
- }
- map.put(id, i);
- }
- }
-
- /**
- * Put uploaded file into data attribute defined
- *
- * @param context
- * @param fileUpload
- * @param file
- */
- @SuppressWarnings("unchecked")
- private void storeData(FacesContext context, UIFileUpload fileUpload,
- List<UploadItem> fileList) {
- ValueExpression data = fileUpload
- .getValueExpression(_FILES_UPLOADED_ATTRIBUTE_NAME);
- if (data != null) {
- if (data.getValue(context.getELContext()) instanceof Collection) {
- Collection collection = (Collection) data.getValue(context
- .getELContext());
- collection.addAll(fileList);
- }
- }
- new UploadEvent(fileUpload, fileList).queue();
- }
-
- /**
- * Call with method after uploading completed
- *
- * @param context
- * @param file
- * @param fileUpload
- */
- private void onUploadComplete(FacesContext context, List<UploadItem> fileList,
- UIFileUpload fileUpload, boolean formUpload) {
- storeData(context, fileUpload, fileList);
- try {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- if ((Boolean)fileUpload.getAttributes().get(AjaxRendererUtils.AJAX_SINGLE_ATTR)) {
- ajaxContext.setAjaxSingleClientId(fileUpload.getClientId(context));
- }
-
- ajaxContext.setAjaxRequest(!formUpload);
- } catch (Exception e) {
- e.getMessage();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
- @Override
- protected Class<? extends UIComponent> getComponentClass() {
- return UIFileUpload.class;
- }
-
- /**
- * Generates common JS script by action value
- *
- * @param context
- * @param component
- * @param action
- * @param oncomplete
- * @return
- * @throws IOException
- */
- @SuppressWarnings("unchecked")
- private String getActionScript(FacesContext context, UIComponent component,
- String action, Object oncomplete) throws IOException {
- ComponentVariables variables = ComponentsVariableResolver.getVariables(
- this, component);
- String clientId = component.getClientId(context);
- String containerId = (String) variables.getVariable("containerId");
- JSFunction ajaxFunction = new JSFunction(
- AjaxRendererUtils.AJAX_FUNCTION_NAME);
- ajaxFunction.addParameter(containerId);
- ajaxFunction.addParameter(new JSReference("formId"));
- ajaxFunction.addParameter(new JSReference("event"));
- // AjaxRendererUtils.buildAjaxFunction(
- // component, context);
-
- Map options = AjaxRendererUtils.buildEventOptions(context, component);
- Map parameters = (Map) options.get("parameters");
- parameters.put("action", action);
- parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
- parameters.put(clientId, clientId);
- parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
- if (oncomplete != null) {
- options.put("onbeforedomupdate", oncomplete);
- }
- ajaxFunction.addParameter(options);
-
- JSFunctionDefinition function = new JSFunctionDefinition("uid");
- function.addParameter("formId");
- function.addParameter("event");
- function.addToBody(ajaxFunction.toScript());
-
- return function.toScript();
- }
-
- /**
- * Return accepted types map
- *
- * @param context
- * @param component
- * @return
- */
- public Object getAcceptedTypes(FacesContext context, UIComponent component) {
- String acceptedTypes = (String) component.getAttributes().get(
- "acceptedTypes");
- Map<String, Boolean> accepted = new HashMap<String, Boolean>();
- if (acceptedTypes != null && acceptedTypes.length() > 0) {
- acceptedTypes = acceptedTypes.replaceAll("[\\s]", "");
- String[] types = acceptedTypes.split("[,;|]");
- if (types != null) {
- for (String type : types) {
- accepted.put(type.toLowerCase(), true);
- }
- return ScriptUtils.toScript(accepted);
- }
- }else {
- accepted.put("*", true);
- }
- return ScriptUtils.toScript(accepted);
- }
-
- /**
- * Generates JS script for stopping uploading process
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public String getStopScript(FacesContext context, UIComponent component)
- throws IOException {
- return getActionScript(context, component, "richfaces_file_upload_action_stop", null);
- }
-
- /**
- * Generates JS script for getting file size from server
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public String getFileSizeScript(FacesContext context, UIComponent component)
- throws IOException {
- JSFunctionDefinition oncomplete = new JSFunctionDefinition();
- oncomplete.addParameter("request");
- oncomplete.addParameter("event");
- oncomplete.addParameter("data");
- StringBuffer body = new StringBuffer("$('");
- body.append(component.getClientId(context));
- body.append("').component.getFileSize(data);");
- oncomplete.addToBody(body);
- return getActionScript(context, component, "progress", oncomplete);
-
- }
-
- /**
- * Generates progress label markup
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public Object getLabelMarkup(FacesContext context, UIComponent component)
- throws IOException {
- CountingOutputWriter customWriter = new CountingOutputWriter();
- StringBuffer result = null;
- UIComponent label = component.getFacet("label");
- try {
- if (label != null) {
-
- ResponseWriter writer = context.getResponseWriter();
-
- String defaultRenderKitId = context.getApplication()
- .getDefaultRenderKitId();
- if (null == defaultRenderKitId) {
- defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
- }
- RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
- .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
- RenderKit renderKit = renderKitFactory.getRenderKit(context,
- defaultRenderKitId);
-
- ResponseWriter responseWriter = renderKit.createResponseWriter(
- customWriter, null, "UTF-8");
- context.setResponseWriter(responseWriter);
- writeScriptBody(context, label, false);
- if (writer != null) {
- context.setResponseWriter(writer);
- }
- result = customWriter.getContent();
- }
-
- } catch (Exception e) {
- e.getMessage();
- }
- return (result != null) ? new JSLiteral(result.toString())
- : JSReference.NULL;
- }
-
- /**
- * Gets a string representing css specific height of downloaded file list
- * panel.
- *
- * @param component
- * file upload component
- * @return a string representing css specific height of downloaded file list
- * panel
- */
- public String getFileListHeight(UIFileUpload component) {
- return HtmlUtil.qualifySize(component.getListHeight());
- }
-
- /**
- * Gets a string representing css specific width of downloaded file list
- * panel.
- *
- * @param component
- * file upload component
- * @return a string representing css specific width of downloaded file list
- * panel
- */
- public String getFileListWidth(UIFileUpload component) {
- return HtmlUtil.qualifySize(component.getListWidth());
- }
-
- /**
- * Generate component custom events functions
- *
- * @param context
- * @param component
- * @param attributeName
- * @return
- */
- public String getAsEventHandler(FacesContext context,
- UIComponent component, String attributeName) {
- Object eventHandler = RendererUtils.getInstance().getAsEventHandler(
- context, component, attributeName, "");
- if (eventHandler != null) {
- return eventHandler.toString();
- }
- return JSReference.NULL.toScript();
- }
-
- /**
- * Gets progress bar Id
- *
- * @param context
- * @param component
- * @return
- * @throws IOException
- */
- public String getProgressBarId(FacesContext context, UIComponent component)
- throws IOException {
- return getProgressBar(context, component).getClientId(context);
- }
-
- /**
- * Renders progress bar
- *
- * @param context
- * @param component
- * @throws IOException
- */
- public void renderProgress(FacesContext context, UIComponent component)
- throws IOException {
- UIComponent progressBar = getProgressBar(context, component);
- renderChild(context, progressBar);
- }
-
- /**
- * Creates progress bar component
- *
- * @param context
- * @param fileUpload
- * @return
- */
- private UIComponent createProgressBar(FacesContext context,
- UIComponent fileUpload) {
- UIComponent progressBar = fileUpload.getFacet("progress");
- if (null == progressBar) {
- progressBar = context.getApplication().createComponent(
- UIProgressBar.COMPONENT_TYPE);
- }
- fileUpload.getFacets().put("progress", progressBar);
- return progressBar;
- }
-
- /**
- * Returns progress bar
- *
- * @param context
- * @param component
- * @return
- */
- public UIComponent getProgressBar(FacesContext context,
- UIComponent component) {
- UIComponent progressBar = component.getFacet("progress");
- if (null == progressBar) {
- progressBar = createProgressBar(context, component);
- }
- progressBar.getAttributes().put("minValue", -1);
-
- ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
- ValueExpression falseExpression = expressionFactory.createValueExpression(
- context.getELContext(),
- "#{" + Boolean.FALSE + "}",
- Boolean.class);
-
- progressBar.setValueExpression("enabled", falseExpression);
- progressBar.setTransient(false);
- return progressBar;
- }
-
-
- /**
- * Returns set of children UIParameters
- * @param context
- * @param component
- * @return
- */
- public Object getChildrenParams(FacesContext context, UIComponent component) {
- Map<String, Object> parameters = new HashMap<String, Object>();
- for (Iterator<UIComponent> iterator = component.getChildren().iterator(); iterator.hasNext();) {
- UIComponent child = iterator.next();
- if (child instanceof UIParameter) {
- UIParameter p = (UIParameter)child;
- parameters.put(p.getName(), p.getValue());
- }
- }
-
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- Map<String, Object> commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
- if (commonAjaxParameters != null) {
- parameters.putAll(commonAjaxParameters);
- }
-
- return ((parameters.size() > 0) ? ScriptUtils.toScript(parameters) : JSReference.NULL);
- }
-
- public String getSessionId(FacesContext context, UIComponent component) {
- String id = null;
- Object session = context.getExternalContext().getSession(false);
- if (session != null) {
- if (session instanceof HttpSession) {
- id = ((HttpSession) session).getId();
- } else {
- Class<? extends Object> sesssionClass = session.getClass();
- try {
- Method getIdMethod = sesssionClass.getMethod("getId");
- id = (String) getIdMethod.invoke(session);
- } catch (SecurityException e) {
- throw new FacesException(e.getMessage(), e);
- } catch (NoSuchMethodException e) {
- throw new FacesException(e.getMessage(), e);
- } catch (IllegalArgumentException e) {
- throw new FacesException(e.getMessage(), e);
- } catch (IllegalAccessException e) {
- throw new FacesException(e.getMessage(), e);
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- throw new FacesException(cause.getMessage(), cause);
- }
- }
- }
-
- return id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent)
- */
- @Override
- public void encodeChildren(FacesContext context, UIComponent component)
- throws IOException {
- ; // We should not render children
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeChildren(javax.faces.context.ResponseWriter,
- * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- @Override
- public void doEncodeChildren(ResponseWriter writer, FacesContext context,
- UIComponent component) throws IOException {
- ; // We should not render children
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import javax.servlet.http.HttpSession;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.javascript.JSFunction;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.JSLiteral;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.ComponentsVariableResolver;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.ajax4jsf.request.MultipartRequest;
+import org.ajax4jsf.resource.CountingOutputWriter;
+import org.richfaces.component.FileUploadConstants;
+import org.richfaces.component.UIFileUpload;
+import org.richfaces.component.UIProgressBar;
+import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+
+/**
+ * Class provides base renderer for upload file component
+ *
+ * @author "Andrey Markavtsov"
+ *
+ */
+public abstract class FileUploadRendererBase extends
+ TemplateEncoderRendererBase {
+
+ /** Attribute name where collection of files uploaded will be stored */
+ private static final String _FILES_UPLOADED_ATTRIBUTE_NAME = "uploadData";
+
+ /** File upload bundle name */
+ private static final String FILE_UPLOAD_BUNDLE = "org.richfaces.renderkit.fileUpload";
+
+ /** Bundle prefix */
+ private static final String bundlePrefix = "RICH_FILE_UPLOAD_";
+
+ /** Bundle postfix */
+ private static final String bundlePostfix = "_LABEL";
+
+ /** Set of bundles that can be defined */
+ private static final String[] bundlesLables = { "add", "upload", "stop",
+ "clear_all", "entry_cancel", "entry_clear", "entry_stop", "done",
+ "size_error", "transfer_error","progress" };
+
+ /** Default labels values */
+ private static final String[] defaultLables = { "Add...", "<b>Upload</b>",
+ "<b>Stop</b>", "Clear All", "Cancel", "Clear", "Stop",
+ "<b>Done</b>", "File size restricted", "Transfer error occurred","uploading"};
+
+ /** Set of attributes that can define label's value */
+ private static final String[] labelAttribues = { "addControlLabel",
+ "uploadControlLabel", "stopControlLabel", "clearAllControlLabel",
+ "cancelEntryControlLabel", "clearControlLabel",
+ "stopEntryControlLabel", "doneLabel", "sizeErrorLabel", "transferErrorLabel", "progressLabel" };
+
+ /**
+ * Overrides standard JSF component method.
+ *
+ * @param context
+ * faces context
+ * @param component
+ * file upload component
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ protected void doDecode(FacesContext context, UIComponent component) {
+
+ new AjaxEvent(component).queue();
+
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, String> requestParameterMap = externalContext.getRequestParameterMap();
+ String fileUploadIndicator = requestParameterMap.get(FileUploadConstants.FILE_UPLOAD_INDICATOR);
+
+ if (fileUploadIndicator != null && Boolean.TRUE.toString().equals(fileUploadIndicator)) {
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ String clientId = component.getClientId(context);
+ String id = requestParameterMap.get("id");
+
+ if (!clientId.equals(id)) {
+ return; // Avoid listener calling for another fileUpload
+ }
+
+ String uid = requestParameterMap.get(FileUploadConstants.UPLOAD_FILES_ID);
+ decreaseFileCounter(context, id);
+ Map<String, MultipartRequest> map = (Map<String, MultipartRequest>) externalContext.getSessionMap()
+ .get(FileUploadConstants.REQUESTS_SESSIONS_BEAN_NAME);
+
+ MultipartRequest multipartRequest = map.get(uid);
+
+ boolean isFlash = (requestParameterMap.get("_richfaces_send_http_error") != null);
+
+ List<UploadItem> fileList = multipartRequest.getUploadItems();
+
+ if (fileList == null || fileList.size() == 0) {
+ return;
+ }
+
+ boolean formUpload = multipartRequest.isFormUpload();
+
+ if (isFlash && !formUpload && fileList.size() > 0) {
+ try {
+ UploadItem item = fileList.get(0);
+ int actualSize = item.getFileSize();
+ int clientSize = Integer.parseInt(requestParameterMap.get("_richfaces_size"));
+
+ if (actualSize != clientSize) {
+ return; // File uploading has been stopped on the client side
+ }
+ }catch (Exception e) {
+ return;
+ }
+ }
+ onUploadComplete(context, fileList, fileUpload, formUpload);
+ }
+
+ }
+
+ /**
+ * Put max file count into session scope
+ *
+ * @param context
+ * @param component
+ * @param clientId
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public Integer initMaxFilesCount(FacesContext context,
+ UIComponent component, String clientId) {
+ Integer max = (Integer) component.getAttributes().get(
+ "maxFilesQuantity");
+ Object session = context.getExternalContext()
+ .getSession(false);
+ synchronized (session) {
+ Map<String, Integer> map = (Map<String, Integer>) context.getExternalContext().getSessionMap().get(FileUploadConstants.UPLOADED_COUNTER);
+ if (map == null) {
+ map = Collections
+ .synchronizedMap(new HashMap<String, Integer>());
+ }
+ map.put(clientId, max);
+ }
+ return max;
+ }
+
+ /**
+ * Gets form id
+ *
+ * @param context -
+ * faces context
+ * @param component -
+ * component
+ * @return String form id
+ */
+ public String getFormId(FacesContext context, UIComponent component) {
+ UIComponent form = AjaxRendererUtils.getNestingForm(component);
+ if (form != null) {
+ return form.getClientId(context);
+ }
+ return "";
+ }
+
+ /**
+ * Gets container id
+ *
+ * @param context -
+ * faces context
+ * @param component -
+ * component
+ * @return String container id
+ */
+ public String getContainerId(FacesContext context, UIComponent component) {
+ UIComponent container = (UIComponent) AjaxRendererUtils
+ .findAjaxContainer(context, component);
+ if (container != null) {
+ return container.getClientId(context);
+ }
+ return null;
+ }
+
+ /**
+ * Generates map with internalized labels to be put into JS
+ *
+ * @param o
+ * map of labels
+ * @return javascript hash map
+ */
+ public Object _getLabels(Object o) {
+ return ScriptUtils.toScript(o);
+ }
+
+ /**
+ * Gets internalized labels. At the first system is looking for them in
+ * appropriate attributes if they are defined. Next search place is
+ * application and file upload bundles. If no result - default label value
+ * will be set up.
+ *
+ * @param context
+ * facesContext instance
+ * @param component
+ * UIComponent
+ * @return map of labels
+ */
+ public Map<String, String> getLabels(FacesContext context,
+ UIComponent component) {
+ Map<String, String> labelsMap = new HashMap<String, String>();
+ ResourceBundle bundle1 = null;
+ ResourceBundle bundle2 = null;
+ UIFileUpload fileUpload = (UIFileUpload) component;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ String messageBundle = context.getApplication().getMessageBundle();
+ Object locale = fileUpload.getLocale();
+ if (locale == null) {
+ locale = context.getExternalContext().getRequestLocale();
+ }
+ if (null != messageBundle) {
+ bundle1 = ResourceBundle.getBundle(messageBundle, fileUpload
+ .getAsLocale(locale), loader);
+ }
+ try {
+ bundle2 = ResourceBundle.getBundle(FILE_UPLOAD_BUNDLE, fileUpload
+ .getAsLocale(locale), loader);
+
+ } catch (MissingResourceException e) {
+ // No external bundle was found, ignore this exception.
+ }
+ initLabels(labelsMap, bundle1, bundle2, fileUpload);
+ return labelsMap;
+ }
+
+ /**
+ * Sets values for labels.
+ *
+ * @param map
+ * map of labels
+ * @param bundle1
+ * application bundle
+ * @param bundle2
+ * file upload bundle
+ * @param fileUpload
+ */
+ private void initLabels(Map<String, String> map, ResourceBundle bundle1,
+ ResourceBundle bundle2, UIFileUpload fileUpload) {
+ int i = 0;
+ for (String name : bundlesLables) {
+ boolean found = false;
+ if (labelAttribues[i] != null) {
+ String attributeName = labelAttribues[i];
+ if (fileUpload.getAttributes().get(attributeName) != null) {
+ map.put(name, (String) fileUpload.getAttributes().get(
+ attributeName));
+ found = true;
+ }
+ }
+ if (!found && (bundle1 != null || bundle2 != null)) {
+ String label = getFromBundle(name, bundle1, bundle2);
+ if (label != null) {
+ map.put(name, getFromBundle(name, bundle1, bundle2));
+ found = true;
+ }
+ }
+ if (!found) {
+ map.put(name, defaultLables[i]);
+ }
+ i++;
+ }
+ }
+
+ /**
+ * Looking for labels name in bundles provided.
+ *
+ * @param bundle1
+ * application bundle
+ * @param bundle2
+ * file upload bundle
+ * @return String label value
+ */
+ private String getFromBundle(String name, ResourceBundle bundle1,
+ ResourceBundle bundle2) {
+ name = bundlePrefix + name.toUpperCase() + bundlePostfix;
+ String v = null;
+ if (bundle1 != null) {
+ try {
+ v = bundle1.getString(name);
+ } catch (Exception e) {
+ if (bundle2 != null) {
+ try {
+ v = bundle2.getString(name);
+ } catch (Exception ex) {
+ // no value has been found
+ }
+ }
+
+ }
+
+ } else if (bundle2 != null) {
+ try {
+ v = bundle2.getString(name);
+ ByteArrayOutputStream b = new ByteArrayOutputStream();
+ b.write(v.getBytes());
+ b.toString("UTF-8");
+ } catch (Exception e) {
+ // no value has been found
+ }
+ }
+ return v;
+ }
+
+ /**
+ * Method decrease file counter
+ *
+ * @param context
+ * @param id
+ */
+ @SuppressWarnings("unchecked")
+ private void decreaseFileCounter(FacesContext context, String id) {
+ Map<String, Integer> map = (Map<String, Integer>) context.getExternalContext().getSessionMap()
+ .get(FileUploadConstants.UPLOADED_COUNTER);
+ if (map != null) {
+ Integer i = map.get(id);
+ if (i == null) {
+ i = 0;
+ } else {
+ i--;
+ }
+ map.put(id, i);
+ }
+ }
+
+ /**
+ * Put uploaded file into data attribute defined
+ *
+ * @param context
+ * @param fileUpload
+ * @param file
+ */
+ @SuppressWarnings("unchecked")
+ private void storeData(FacesContext context, UIFileUpload fileUpload,
+ List<UploadItem> fileList) {
+ ValueExpression data = fileUpload
+ .getValueExpression(_FILES_UPLOADED_ATTRIBUTE_NAME);
+ if (data != null) {
+ if (data.getValue(context.getELContext()) instanceof Collection) {
+ Collection collection = (Collection) data.getValue(context
+ .getELContext());
+ collection.addAll(fileList);
+ }
+ }
+ new UploadEvent(fileUpload, fileList).queue();
+ }
+
+ /**
+ * Call with method after uploading completed
+ *
+ * @param context
+ * @param file
+ * @param fileUpload
+ */
+ private void onUploadComplete(FacesContext context, List<UploadItem> fileList,
+ UIFileUpload fileUpload, boolean formUpload) {
+ storeData(context, fileUpload, fileList);
+ try {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ if ((Boolean)fileUpload.getAttributes().get(AjaxRendererUtils.AJAX_SINGLE_ATTR)) {
+ ajaxContext.setAjaxSingleClientId(fileUpload.getClientId(context));
+ }
+
+ ajaxContext.setAjaxRequest(!formUpload);
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
+ */
+ @Override
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIFileUpload.class;
+ }
+
+ /**
+ * Generates common JS script by action value
+ *
+ * @param context
+ * @param component
+ * @param action
+ * @param oncomplete
+ * @return
+ * @throws IOException
+ */
+ @SuppressWarnings("unchecked")
+ private String getActionScript(FacesContext context, UIComponent component,
+ String action, Object oncomplete) throws IOException {
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ String clientId = component.getClientId(context);
+ String containerId = (String) variables.getVariable("containerId");
+ JSFunction ajaxFunction = new JSFunction(
+ AjaxRendererUtils.AJAX_FUNCTION_NAME);
+ ajaxFunction.addParameter(containerId);
+ ajaxFunction.addParameter(new JSReference("formId"));
+ ajaxFunction.addParameter(new JSReference("event"));
+ // AjaxRendererUtils.buildAjaxFunction(
+ // component, context);
+
+ Map options = AjaxRendererUtils.buildEventOptions(context, component);
+ Map parameters = (Map) options.get("parameters");
+ parameters.put("action", action);
+ parameters.put(FileUploadConstants.UPLOAD_FILES_ID, new JSReference("uid"));
+ parameters.put(clientId, clientId);
+ parameters.put(AjaxRendererUtils.AJAX_SINGLE_ATTR, clientId);
+ if (oncomplete != null) {
+ options.put("onbeforedomupdate", oncomplete);
+ }
+ ajaxFunction.addParameter(options);
+
+ JSFunctionDefinition function = new JSFunctionDefinition("uid");
+ function.addParameter("formId");
+ function.addParameter("event");
+ function.addToBody(ajaxFunction.toScript());
+
+ return function.toScript();
+ }
+
+ /**
+ * Return accepted types map
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public Object getAcceptedTypes(FacesContext context, UIComponent component) {
+ String acceptedTypes = (String) component.getAttributes().get(
+ "acceptedTypes");
+ Map<String, Boolean> accepted = new HashMap<String, Boolean>();
+ if (acceptedTypes != null && acceptedTypes.length() > 0) {
+ acceptedTypes = acceptedTypes.replaceAll("[\\s]", "");
+ String[] types = acceptedTypes.split("[,;|]");
+ if (types != null) {
+ for (String type : types) {
+ accepted.put(type.toLowerCase(), true);
+ }
+ return ScriptUtils.toScript(accepted);
+ }
+ }else {
+ accepted.put("*", true);
+ }
+ return ScriptUtils.toScript(accepted);
+ }
+
+ /**
+ * Generates JS script for stopping uploading process
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getStopScript(FacesContext context, UIComponent component)
+ throws IOException {
+ return getActionScript(context, component, "richfaces_file_upload_action_stop", null);
+ }
+
+ /**
+ * Generates JS script for getting file size from server
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getFileSizeScript(FacesContext context, UIComponent component)
+ throws IOException {
+ JSFunctionDefinition oncomplete = new JSFunctionDefinition();
+ oncomplete.addParameter("request");
+ oncomplete.addParameter("event");
+ oncomplete.addParameter("data");
+ StringBuffer body = new StringBuffer("$('");
+ body.append(component.getClientId(context));
+ body.append("').component.getFileSize(data);");
+ oncomplete.addToBody(body);
+ return getActionScript(context, component, "progress", oncomplete);
+
+ }
+
+ /**
+ * Generates progress label markup
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public Object getLabelMarkup(FacesContext context, UIComponent component)
+ throws IOException {
+ CountingOutputWriter customWriter = new CountingOutputWriter();
+ StringBuffer result = null;
+ UIComponent label = component.getFacet("label");
+ try {
+ if (label != null) {
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ String defaultRenderKitId = context.getApplication()
+ .getDefaultRenderKitId();
+ if (null == defaultRenderKitId) {
+ defaultRenderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
+ }
+ RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder
+ .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ RenderKit renderKit = renderKitFactory.getRenderKit(context,
+ defaultRenderKitId);
+
+ ResponseWriter responseWriter = renderKit.createResponseWriter(
+ customWriter, null, "UTF-8");
+ context.setResponseWriter(responseWriter);
+ writeScriptBody(context, label, false);
+ if (writer != null) {
+ context.setResponseWriter(writer);
+ }
+ result = customWriter.getContent();
+ }
+
+ } catch (Exception e) {
+ e.getMessage();
+ }
+ return (result != null) ? new JSLiteral(result.toString())
+ : JSReference.NULL;
+ }
+
+ /**
+ * Gets a string representing css specific height of downloaded file list
+ * panel.
+ *
+ * @param component
+ * file upload component
+ * @return a string representing css specific height of downloaded file list
+ * panel
+ */
+ public String getFileListHeight(UIFileUpload component) {
+ return HtmlUtil.qualifySize(component.getListHeight());
+ }
+
+ /**
+ * Gets a string representing css specific width of downloaded file list
+ * panel.
+ *
+ * @param component
+ * file upload component
+ * @return a string representing css specific width of downloaded file list
+ * panel
+ */
+ public String getFileListWidth(UIFileUpload component) {
+ return HtmlUtil.qualifySize(component.getListWidth());
+ }
+
+ /**
+ * Generate component custom events functions
+ *
+ * @param context
+ * @param component
+ * @param attributeName
+ * @return
+ */
+ public String getAsEventHandler(FacesContext context,
+ UIComponent component, String attributeName) {
+ Object eventHandler = RendererUtils.getInstance().getAsEventHandler(
+ context, component, attributeName, "");
+ if (eventHandler != null) {
+ return eventHandler.toString();
+ }
+ return JSReference.NULL.toScript();
+ }
+
+ /**
+ * Gets progress bar Id
+ *
+ * @param context
+ * @param component
+ * @return
+ * @throws IOException
+ */
+ public String getProgressBarId(FacesContext context, UIComponent component)
+ throws IOException {
+ return getProgressBar(context, component).getClientId(context);
+ }
+
+ /**
+ * Renders progress bar
+ *
+ * @param context
+ * @param component
+ * @throws IOException
+ */
+ public void renderProgress(FacesContext context, UIComponent component)
+ throws IOException {
+ UIComponent progressBar = getProgressBar(context, component);
+ renderChild(context, progressBar);
+ }
+
+ /**
+ * Creates progress bar component
+ *
+ * @param context
+ * @param fileUpload
+ * @return
+ */
+ private UIComponent createProgressBar(FacesContext context,
+ UIComponent fileUpload) {
+ UIComponent progressBar = fileUpload.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = context.getApplication().createComponent(
+ UIProgressBar.COMPONENT_TYPE);
+ }
+ fileUpload.getFacets().put("progress", progressBar);
+ return progressBar;
+ }
+
+ /**
+ * Returns progress bar
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ public UIComponent getProgressBar(FacesContext context,
+ UIComponent component) {
+ UIComponent progressBar = component.getFacet("progress");
+ if (null == progressBar) {
+ progressBar = createProgressBar(context, component);
+ }
+ progressBar.getAttributes().put("minValue", -1);
+
+ ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
+ ValueExpression falseExpression = expressionFactory.createValueExpression(
+ context.getELContext(),
+ "#{" + Boolean.FALSE + "}",
+ Boolean.class);
+
+ progressBar.setValueExpression("enabled", falseExpression);
+ progressBar.setTransient(false);
+ return progressBar;
+ }
+
+
+ /**
+ * Returns set of children UIParameters
+ * @param context
+ * @param component
+ * @return
+ */
+ public Object getChildrenParams(FacesContext context, UIComponent component) {
+ Map<String, Object> parameters = new HashMap<String, Object>();
+ for (Iterator<UIComponent> iterator = component.getChildren().iterator(); iterator.hasNext();) {
+ UIComponent child = iterator.next();
+ if (child instanceof UIParameter) {
+ UIParameter p = (UIParameter)child;
+ parameters.put(p.getName(), p.getValue());
+ }
+ }
+
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ Map<String, Object> commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
+ if (commonAjaxParameters != null) {
+ parameters.putAll(commonAjaxParameters);
+ }
+
+ return ((parameters.size() > 0) ? ScriptUtils.toScript(parameters) : JSReference.NULL);
+ }
+
+ public String getSessionId(FacesContext context, UIComponent component) {
+ String id = null;
+ Object session = context.getExternalContext().getSession(false);
+ if (session != null) {
+ if (session instanceof HttpSession) {
+ id = ((HttpSession) session).getId();
+ } else {
+ Class<? extends Object> sesssionClass = session.getClass();
+ try {
+ Method getIdMethod = sesssionClass.getMethod("getId");
+ id = (String) getIdMethod.invoke(session);
+ } catch (SecurityException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (NoSuchMethodException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (IllegalArgumentException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (IllegalAccessException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ throw new FacesException(cause.getMessage(), cause);
+ }
+ }
+ }
+
+ return id;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
+ */
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException {
+ ; // We should not render children
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.renderkit.RendererBase#doEncodeChildren(javax.faces.context.ResponseWriter,
+ * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
+ */
+ @Override
+ public void doEncodeChildren(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+ ; // We should not render children
+ }
+
+}
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/renderkit/html/images/UploadButtonBgLightGradient.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -27,4 +27,4 @@
public UploadButtonBgLightGradient() {
super(8, 30, 30, "additionalBackgroundColor", "headerGradientColor");
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -203,4 +203,4 @@
<f:call name="utils.encodeEndFormIfNessesary" />
</div>
</f:root>
-
\ No newline at end of file
+
Modified: trunk/ui/gmap/src/main/templates/gmap.jspx
===================================================================
--- trunk/ui/gmap/src/main/templates/gmap.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/gmap/src/main/templates/gmap.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -29,8 +29,8 @@
<h:styles>css/gmap.xcss</h:styles>
<h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),script/gmap.js</h:scripts>
-<div id="#{clientId}" class="dr-gmap rich-gmap #{component.attributes['styleClass']}" x:passThruWithExclusions="id,class,styleClass">
-
+<div id="#{clientId}" class="dr-gmap rich-gmap #{component.attributes['styleClass']}" x:passThruWithExclusions="id,class,styleClass">
+
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=#{key}&hl=#{locale}" />
<script type="text/javascript">
//<![CDATA[
@@ -41,4 +41,4 @@
//]]>
</script>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx
===================================================================
--- trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/hotKey/src/main/templates/org/richfaces/htmlHotKey.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -115,4 +115,4 @@
new Richfaces.hotKey('#{clientId}','#{key}','#{selector}', #{options}, function(event) { #{attributes['handler']} });
</script>
</span>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/inplaceInput/src/main/java/org/richfaces/component/UIInplaceInput.java
===================================================================
--- trunk/ui/inplaceInput/src/main/java/org/richfaces/component/UIInplaceInput.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inplaceInput/src/main/java/org/richfaces/component/UIInplaceInput.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -40,4 +40,4 @@
// public static final String VALUE_SUFFIX = "value";
public abstract String getDefaultLabel();
public abstract void setDefaultLabel(String label);
-}
\ No newline at end of file
+}
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -137,18 +137,18 @@
<tbody>
<tr>
<td class="rich-inplace-shadow-tl">
- <img width="10" height="1" style="border:0" alt=" " src="#{spacer}"/>
+ <img width="10" height="1" style="border:0" alt="" src="#{spacer}"/>
</td>
<td class="rich-inplace-shadow-tr">
- <img width="1" height="10" style="border:0" alt=" " src="#{spacer}"/>
+ <img width="1" height="10" style="border:0" alt="" src="#{spacer}"/>
</td>
</tr>
<tr>
<td class="rich-inplace-shadow-bl">
- <img width="1" height="10" style="border:0" alt=" " src="#{spacer}"/>
+ <img width="1" height="10" style="border:0" alt="" src="#{spacer}"/>
</td>
<td class="rich-inplace-shadow-br">
- <img width="10" height="1" style="border:0" alt=" " src="#{spacer}"/>
+ <img width="10" height="1" style="border:0" alt="" src="#{spacer}"/>
</td>
</tr>
</tbody>
@@ -218,4 +218,4 @@
<jsp:scriptlet>
}
</jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -156,18 +156,18 @@
<table cellpadding="0" cellspacing="0" border="0" class="rich-inplace-select-shadow-size">
<tr>
<td class="rich-inplace-select-shadow-tl">
- <img src="#{spacer}" width="10" height="1" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="10" height="1" alt="" style="border:0"/><br/>
</td>
<td class="rich-inplace-select-shadow-tr">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"/><br/>
</td>
</tr>
<tr>
<td class="rich-inplace-select-shadow-bl">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"/><br/>
</td>
<td class="rich-inplace-select-shadow-br">
- <img src="#{spacer}" width="10" height="1" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="10" height="1" alt="" style="border:0"/><br/>
</td>
</tr>
</table>
@@ -200,18 +200,18 @@
<table id="#{clientId}shadow" cellpadding="0" cellspacing="0" border="0" width="257" height="109">
<tr>
<td class="rich-inplace-select-shadow-tl">
- <img src="#{spacer}" width="10" height="1" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="10" height="1" alt="" style="border:0"/><br/>
</td>
<td class="rich-inplace-select-shadow-tr">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"/><br/>
</td>
</tr>
<tr>
<td class="rich-inplace-select-shadow-bl">
- <img src="#{spacer}" width="1" height="10" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="1" height="10" alt="" style="border:0"/><br/>
</td>
<td class="rich-inplace-select-shadow-br">
- <img src="#{spacer}" width="10" height="10" alt=" " style="border:0"/><br/>
+ <img src="#{spacer}" width="10" height="10" alt="" style="border:0"/><br/>
</td>
</tr>
</table>
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -494,7 +494,7 @@
<tbody>
<tr>
<td class="dr-insldr-track-decor-2">
- <img src="#{spacer}" alt=" " style="display: block;" />
+ <img src="#{spacer}" alt="" style="display: block;" />
</td>
</tr>
</tbody>
Modified: trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java
===================================================================
--- trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inputnumber-slider/src/test/java/org/richfaces/component/InputNumberSliderComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -543,4 +543,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -42,27 +42,27 @@
<input
class="dr-spnr-i rich-spinner-input #{component.attributes['inputClass']}"
- onchange="#{component.attributes['onchange']}"
- onselect="#{component.attributes['onselect']}"
- onfocus="#{component.attributes['onfocus']}"
+ onchange="#{component.attributes['onchange']}"
+ onselect="#{component.attributes['onselect']}"
+ onfocus="#{component.attributes['onfocus']}"
onblur="#{component.attributes['onblur']}"
- type="text"
- size="#{component.attributes['inputSize']}"
- name="#{clientId}"
+ type="text"
+ size="#{component.attributes['inputSize']}"
+ name="#{clientId}"
value="#{this:getInputValue(context, component)}"
- style="#{component.inputStyle}"
- accesskey="#{component.attributes['accesskey']}"
- tabindex="#{component.attributes['tabindex']}"
-
- onclick='#{component.attributes["oninputclick"]}'
- ondblclick='#{component.attributes["oninputdblclick"]}'
- onkeydown='#{component.attributes["oninputkeydown"]}'
- onkeypress='#{component.attributes["oninputkeypress"]}'
- onkeyup='#{component.attributes["oninputkeyup"]}'
- onmousedown='#{component.attributes["oninputmousedown"]}'
- onmousemove='#{component.attributes["oninputmousemove"]}'
- onmouseout='#{component.attributes["oninputmouseout"]}'
- onmouseover='#{component.attributes["oninputmouseover"]}'
+ style="#{component.inputStyle}"
+ accesskey="#{component.attributes['accesskey']}"
+ tabindex="#{component.attributes['tabindex']}"
+
+ onclick='#{component.attributes["oninputclick"]}'
+ ondblclick='#{component.attributes["oninputdblclick"]}'
+ onkeydown='#{component.attributes["oninputkeydown"]}'
+ onkeypress='#{component.attributes["oninputkeypress"]}'
+ onkeyup='#{component.attributes["oninputkeyup"]}'
+ onmousedown='#{component.attributes["oninputmousedown"]}'
+ onmousemove='#{component.attributes["oninputmousemove"]}'
+ onmouseout='#{component.attributes["oninputmouseout"]}'
+ onmouseover='#{component.attributes["oninputmouseover"]}'
onmouseup='#{component.attributes["oninputmouseup"]}'
autocomplete='#{autocomplete}'
/>
@@ -76,25 +76,25 @@
boolean disabled = ((Boolean) component.getAttributes().get("disabled")).booleanValue();
if (! disabled) {
]]></jsp:scriptlet>
- <input
- type="image"
- src="#{up_arrow}"
- class="dr-spnr-bn rich-spinner-button"
- style="border:0"
+ <input
+ type="image"
+ src="#{up_arrow}"
+ class="dr-spnr-bn rich-spinner-button"
+ style="border:0"
onclick="return false"
- onmousedown="this.className='dr-spnr-bp rich-spinner-button'"
- onmouseup="this.className='dr-spnr-bn rich-spinner-button'"
- onmouseout="this.className='dr-spnr-bn rich-spinner-button'"
+ onmousedown="this.className='dr-spnr-bp rich-spinner-button'"
+ onmouseup="this.className='dr-spnr-bn rich-spinner-button'"
+ onmouseout="this.className='dr-spnr-bn rich-spinner-button'"
tabindex="#{component.attributes['tabindex']}" />
<jsp:scriptlet><![CDATA[
} else {
]]></jsp:scriptlet>
- <input
- type="image"
- src="#{up_arrow}"
- class="dr-spnr-bn rich-spinner-button"
- style="border:0"
- onclick="return false"
+ <input
+ type="image"
+ src="#{up_arrow}"
+ class="dr-spnr-bn rich-spinner-button"
+ style="border:0"
+ onclick="return false"
tabindex="#{component.attributes['tabindex']}" />
<jsp:scriptlet><![CDATA[
}
@@ -130,7 +130,7 @@
cycled:#{component.attributes['cycled']},
edited:#{component.attributes['enableManualInput']},
disabled:#{component.attributes['disabled']},
- chameleon:false,
+ chameleon:false,
required: #{component.attributes['required']},
clientErrorMsg: "#{component.attributes['clientErrorMessage']}"
},
Modified: trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java
===================================================================
--- trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/insert/src/main/java/org/ajax4jsf/renderkit/AbstractInsertRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,165 +1,165 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.renderkit;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.StringBufferInputStream;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.ui.component.DummyHighLight;
-import org.richfaces.ui.component.Highlight;
-import org.richfaces.ui.component.HighlightImpl;
-import org.richfaces.ui.component.UIInsert;
-
-/**
- * @author asmirnov
- *
- */
-public abstract class AbstractInsertRenderer extends
- HeaderResourcesRendererBase {
-
- private static final Object ERROR_MESSAGE_CLASS = "dr-insert-error";
-
-
-
- public void renderContent(FacesContext context, UIInsert component)
- throws IOException {
- boolean isSrcAvailable = (component.getSrc() != null);
- boolean isContentAvailable = (component.getContent() != null);
- if (isSrcAvailable && isContentAvailable) {
- throw new FacesException(UIInsert.ILLEGAL_ATTRIBUTE_VALUE_MESSAGE);
- }
-
- if (isSrcAvailable || isContentAvailable) {
- ExternalContext externalContext = context.getExternalContext();
- InputStream inputStream = null;
-
- if (isSrcAvailable) {
- inputStream = externalContext.getResourceAsStream(component.getSrc());
- } else if (isContentAvailable) {
- inputStream = new ByteArrayInputStream(component.getContent().getBytes());
- }
- if (null != inputStream) {
- renderStream(context, component, inputStream);
- } else {
- String errorContent = component.getErrorContent();
- if ((null != errorContent)
- && (null != (inputStream = externalContext.getResourceAsStream(errorContent)))) {
- // Render default content, if src not found.
- renderStream(context, component, inputStream);
- } else {
- // Render error message for a not found resource.
- renderErrorMessage(context, component, "UI_INSERT_RESOURCE_NOT_FOUND");
- }
- }
- } else {
- throw new FacesException("Attribute 'scr' for a component <rich:insert> " + component.getClientId(context)
- + " must be set");
- }
-
- }
-
- /**
- * @param context
- * @param component
- * @param message
- * TODO
- * @throws IOException
- */
- private void renderErrorMessage(FacesContext context, UIInsert component, String message)
- throws IOException {
- ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.SPAN_ELEM, component);
- writer.writeAttribute(HTML.class_ATTRIBUTE,
- ERROR_MESSAGE_CLASS, null);
- writer.write(Messages.getMessage(
- message, new Object[] {
- component.getClientId(context),
- component.getSrc() }));
- writer.endElement(HTML.SPAN_ELEM);
- }
-
- /**
- * @param context
- * @param component
- * @param inputStream
- * @throws UnsupportedEncodingException
- * @throws FacesException
- * @throws IOException
- */
- private void renderStream(FacesContext context, UIInsert component,
- InputStream inputStream) throws UnsupportedEncodingException,
- FacesException, IOException {
- ResponseWriter writer = context.getResponseWriter();
- String encoding = component.getEncoding();
- if (null == component.getHighlight()) {
- InputStreamReader in;
- if (null != encoding) {
- in = new InputStreamReader(inputStream, encoding);
- } else {
- in = new InputStreamReader(inputStream);
- }
- char[] temp = new char[1024];
- try {
- int bytes;
- while ((bytes = in.read(temp)) > 0) {
- writer.write(temp, 0, bytes);
- }
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- in.close();
- }
- } else {
- Highlight highlighter;
- try {
- highlighter = new HighlightImpl(component.getHighlight());
-
- } catch (NoClassDefFoundError e) {
- renderErrorMessage(context, component, "HIGHLIGHT_LIBRARY_NOT_FOUND");
- highlighter = new DummyHighLight();
- }
- try {
- highlighter.highlight(component.getSrc(), inputStream, writer,
- encoding);
- } catch (IOException e) {
- throw new FacesException(e);
- } finally {
- inputStream.close();
- }
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.renderkit;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.StringBufferInputStream;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.richfaces.ui.component.DummyHighLight;
+import org.richfaces.ui.component.Highlight;
+import org.richfaces.ui.component.HighlightImpl;
+import org.richfaces.ui.component.UIInsert;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class AbstractInsertRenderer extends
+ HeaderResourcesRendererBase {
+
+ private static final Object ERROR_MESSAGE_CLASS = "dr-insert-error";
+
+
+
+ public void renderContent(FacesContext context, UIInsert component)
+ throws IOException {
+ boolean isSrcAvailable = (component.getSrc() != null);
+ boolean isContentAvailable = (component.getContent() != null);
+ if (isSrcAvailable && isContentAvailable) {
+ throw new FacesException(UIInsert.ILLEGAL_ATTRIBUTE_VALUE_MESSAGE);
+ }
+
+ if (isSrcAvailable || isContentAvailable) {
+ ExternalContext externalContext = context.getExternalContext();
+ InputStream inputStream = null;
+
+ if (isSrcAvailable) {
+ inputStream = externalContext.getResourceAsStream(component.getSrc());
+ } else if (isContentAvailable) {
+ inputStream = new ByteArrayInputStream(component.getContent().getBytes());
+ }
+ if (null != inputStream) {
+ renderStream(context, component, inputStream);
+ } else {
+ String errorContent = component.getErrorContent();
+ if ((null != errorContent)
+ && (null != (inputStream = externalContext.getResourceAsStream(errorContent)))) {
+ // Render default content, if src not found.
+ renderStream(context, component, inputStream);
+ } else {
+ // Render error message for a not found resource.
+ renderErrorMessage(context, component, "UI_INSERT_RESOURCE_NOT_FOUND");
+ }
+ }
+ } else {
+ throw new FacesException("Attribute 'scr' for a component <rich:insert> " + component.getClientId(context)
+ + " must be set");
+ }
+
+ }
+
+ /**
+ * @param context
+ * @param component
+ * @param message
+ * TODO
+ * @throws IOException
+ */
+ private void renderErrorMessage(FacesContext context, UIInsert component, String message)
+ throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE,
+ ERROR_MESSAGE_CLASS, null);
+ writer.write(Messages.getMessage(
+ message, new Object[] {
+ component.getClientId(context),
+ component.getSrc() }));
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+
+ /**
+ * @param context
+ * @param component
+ * @param inputStream
+ * @throws UnsupportedEncodingException
+ * @throws FacesException
+ * @throws IOException
+ */
+ private void renderStream(FacesContext context, UIInsert component,
+ InputStream inputStream) throws UnsupportedEncodingException,
+ FacesException, IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ String encoding = component.getEncoding();
+ if (null == component.getHighlight()) {
+ InputStreamReader in;
+ if (null != encoding) {
+ in = new InputStreamReader(inputStream, encoding);
+ } else {
+ in = new InputStreamReader(inputStream);
+ }
+ char[] temp = new char[1024];
+ try {
+ int bytes;
+ while ((bytes = in.read(temp)) > 0) {
+ writer.write(temp, 0, bytes);
+ }
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ in.close();
+ }
+ } else {
+ Highlight highlighter;
+ try {
+ highlighter = new HighlightImpl(component.getHighlight());
+
+ } catch (NoClassDefFoundError e) {
+ renderErrorMessage(context, component, "HIGHLIGHT_LIBRARY_NOT_FOUND");
+ highlighter = new DummyHighLight();
+ }
+ try {
+ highlighter.highlight(component.getSrc(), inputStream, writer,
+ encoding);
+ } catch (IOException e) {
+ throw new FacesException(e);
+ } finally {
+ inputStream.close();
+ }
+ }
+ }
+
+}
Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/DummyHighLight.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/DummyHighLight.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/DummyHighLight.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,58 +1,58 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.component;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import javax.faces.context.ResponseWriter;
-
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-
-/**
- * @author asmirnov
- *
- */
-public class DummyHighLight implements Highlight {
-
- /* (non-Javadoc)
- * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
- */
- public void highlight(String name, InputStream in, ResponseWriter out,
- String encoding) throws IOException {
- out.startElement("pre",null);
- InputStreamReader reader;
- if (null != encoding) {
- reader = new InputStreamReader(in, encoding);
- } else {
- reader = new InputStreamReader(in);
- }
- char[] temp = new char[1024];
- int bytes;
- while ((bytes = reader.read(temp)) > 0) {
- out.writeText(temp, 0, bytes);
- }
- out.endElement("pre");
- }
-
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.component;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DummyHighLight implements Highlight {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
+ */
+ public void highlight(String name, InputStream in, ResponseWriter out,
+ String encoding) throws IOException {
+ out.startElement("pre",null);
+ InputStreamReader reader;
+ if (null != encoding) {
+ reader = new InputStreamReader(in, encoding);
+ } else {
+ reader = new InputStreamReader(in);
+ }
+ char[] temp = new char[1024];
+ int bytes;
+ while ((bytes = reader.read(temp)) > 0) {
+ out.writeText(temp, 0, bytes);
+ }
+ out.endElement("pre");
+ }
+
+
+}
Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/Highlight.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/Highlight.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/Highlight.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,44 +1,44 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.ui.component;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.faces.context.ResponseWriter;
-
-public interface Highlight {
-
- /**
- * @param name
- * @param in
- * @param out
- * @param encoding
- * @throws IOException
- * @see com.uwyn.jhighlight.renderer.Renderer#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
- */
- public void highlight(String name, InputStream in, ResponseWriter out,
- String encoding) throws IOException;
-
-
-
-}
\ No newline at end of file
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.ui.component;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.faces.context.ResponseWriter;
+
+public interface Highlight {
+
+ /**
+ * @param name
+ * @param in
+ * @param out
+ * @param encoding
+ * @throws IOException
+ * @see com.uwyn.jhighlight.renderer.Renderer#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
+ */
+ public void highlight(String name, InputStream in, ResponseWriter out,
+ String encoding) throws IOException;
+
+
+
+}
Modified: trunk/ui/insert/src/main/java/org/richfaces/ui/component/HighlightImpl.java
===================================================================
--- trunk/ui/insert/src/main/java/org/richfaces/ui/component/HighlightImpl.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/insert/src/main/java/org/richfaces/ui/component/HighlightImpl.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,74 +1,74 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.ui.component;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.faces.FacesException;
-import javax.faces.context.ResponseWriter;
-
-import com.uwyn.jhighlight.renderer.Renderer;
-import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
-
-/**
- * @author asmirnov
- *
- */
-public class HighlightImpl implements Highlight {
-
-
-
- private Renderer _renderer;
-
- public HighlightImpl(String type) {
- _renderer = XhtmlRendererFactory.getRenderer(type);
- if(null == _renderer){
- throw new FacesException("Unknown type ["+type+"] to highlight source");
- }
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
- */
- public void highlight(String name, InputStream in, ResponseWriter out,
- String encoding) throws IOException {
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- _renderer.highlight(name, in, outStream, encoding, true);
- if(null == encoding){
- out.write(outStream.toString());
- } else {
- out.write(outStream.toString(encoding));
- }
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.lang.String, java.lang.String, boolean)
- */
- public String highlight(String name, String in, String encoding) throws IOException {
- return _renderer.highlight(name, in, encoding, true);
- }
-
-
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.ui.component;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.faces.FacesException;
+import javax.faces.context.ResponseWriter;
+
+import com.uwyn.jhighlight.renderer.Renderer;
+import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class HighlightImpl implements Highlight {
+
+
+
+ private Renderer _renderer;
+
+ public HighlightImpl(String type) {
+ _renderer = XhtmlRendererFactory.getRenderer(type);
+ if(null == _renderer){
+ throw new FacesException("Unknown type ["+type+"] to highlight source");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.io.InputStream, java.io.OutputStream, java.lang.String, boolean)
+ */
+ public void highlight(String name, InputStream in, ResponseWriter out,
+ String encoding) throws IOException {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ _renderer.highlight(name, in, outStream, encoding, true);
+ if(null == encoding){
+ out.write(outStream.toString());
+ } else {
+ out.write(outStream.toString(encoding));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.ui.component.Highlight#highlight(java.lang.String, java.lang.String, java.lang.String, boolean)
+ */
+ public String highlight(String name, String in, String encoding) throws IOException {
+ return _renderer.highlight(name, in, encoding, true);
+ }
+
+
+
+}
Modified: trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx
===================================================================
--- trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/insert/src/main/templates/org/richfaces/ui/htmlInsert.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -9,11 +9,11 @@
baseclass="org.ajax4jsf.renderkit.AbstractInsertRenderer"
component="org.richfaces.ui.component.UIInsert"
>
- <h:styles>css/highlight.xcss</h:styles>
+ <h:styles>css/highlight.xcss</h:styles>
<f:clientid var="clientId"/>
<div id="#{clientId}"
x:passThruWithExclusions="value,name,type,id"
- >
- <f:call name="renderContent"/>
+ >
+ <f:call name="renderContent"/>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/jQuery/src/main/templates/jQuery.jspx
===================================================================
--- trunk/ui/jQuery/src/main/templates/jQuery.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/jQuery/src/main/templates/jQuery.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -75,4 +75,4 @@
<jsp:scriptlet><![CDATA[ } ]]></jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -29,10 +29,10 @@
</h:scripts>
<f:clientId var="clientId"/>
-
- <table id="#{clientId}" class="rich-list-shuttle #{component.attributes['styleClass']}"
+
+ <table id="#{clientId}" class="rich-list-shuttle #{component.attributes['styleClass']}"
cellspacing="0" cellpadding="0"
- x:passThruWithExclusions="id,class,styleClass">
+ x:passThruWithExclusions="id,class,styleClass">
<tbody>
<vcp:body>
<f:clientId var="clientId"/>
@@ -49,18 +49,18 @@
Boolean switchByClick = (Boolean) component.getAttributes().get("switchByClick");
variables.setVariable("switchByClick", switchByClick);
-
+
variables.setVariable("baseClientId", component.getBaseClientId(context));
]]>
</jsp:scriptlet>
- <tr style="#{this:getCaptionDisplay(context, component)}" >
- <td class="rich-list-shuttle-caption" colspan="2">
- <f:call name="encodeSLCaption"/>
- </td>
- <td class="rich-list-shuttle-caption" colspan="2">
- <f:call name="encodeTLCaption"/>
- </td>
+ <tr style="#{this:getCaptionDisplay(context, component)}" >
+ <td class="rich-list-shuttle-caption" colspan="2">
+ <f:call name="encodeSLCaption"/>
+ </td>
+ <td class="rich-list-shuttle-caption" colspan="2">
+ <f:call name="encodeTLCaption"/>
+ </td>
</tr>
<tr>
<td>
@@ -229,4 +229,4 @@
</vcp:body>
</tbody>
</table>
-</f:root>
+</f:root>
Modified: trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java
===================================================================
--- trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/listShuttle/src/test/java/org/richfaces/renderkit/ListShuttleRenderingTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,421 +1,421 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.component.html.HtmlOutputText;
-import javax.servlet.http.HttpServletResponse;
-
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.resource.image.ImageInfo;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-import org.richfaces.component.UIListShuttle;
-
-import com.gargoylesoftware.htmlunit.Page;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-public class ListShuttleRenderingTest extends AbstractAjax4JsfTestCase {
- private static final int IMAGE_COUNT = 16;
-
- private UIListShuttle listShuttle = null;
- private UIForm form = null;
- private List<SimpleItem> items = null;
- private HtmlOutputText output1 = null;
- private HtmlOutputText output2 = null;
- private UIColumn column1 = null;
- private UIColumn column2 = null;
-
- private static final Set<String> javaScripts = new HashSet<String>();
- private static final Set<String> imageClasses = new HashSet<String>();
- private static final Set<String> imagePNGClasses = new HashSet<String>();
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("scripts/utils.js");
- javaScripts.add("scripts/ShuttleUtils.js");
- javaScripts.add("scripts/SelectItem.js");
- javaScripts.add("scripts/LayoutManager.js");
- javaScripts.add("scripts/Control.js");
- javaScripts.add("scripts/OrderingList.js");
- javaScripts.add("scripts/ListShuttle.js");
- javaScripts.add("scripts/ListBase.js");
-
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUp");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
-
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopy");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAll");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAllDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemove");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAll");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAllDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDown");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
-
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
-
-
- }
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public ListShuttleRenderingTest(String testName) {
- super(testName);
- }
-
- public void setUp() throws Exception {
- super.setUp();
-
- application.addComponent(UIListShuttle.COMPONENT_TYPE, "org.richfaces.component.html.HtmlListShuttle");
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- listShuttle = (UIListShuttle)application.createComponent(UIListShuttle.COMPONENT_TYPE);
- listShuttle.setId("listShuttle");
- listShuttle.setVar("item");
-
- items = new ArrayList<SimpleItem>();
- items.add(new SimpleItem("Michael", 2000));
- items.add(new SimpleItem("John", 500));
- items.add(new SimpleItem("George", 4000));
-
- listShuttle.setSourceValue(items);
-
- output1 = new HtmlOutputText();
- output1.setValueBinding("value", application.createValueBinding("#{item.name}"));
- column1 = new UIColumn();
- column1.getChildren().add(output1);
- listShuttle.getChildren().add(column1);
-
- output2 = new HtmlOutputText();
- output2.setValueBinding("value", application.createValueBinding("#{item.salary}"));
- column2 = new UIColumn();
- column2.getChildren().add(output2);
- listShuttle.getChildren().add(column2);
-
- form.getChildren().add(listShuttle);
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- items = null;
- output1 = null;
- output2 = null;
- column1 = null;
- column2 = null;
- listShuttle = null;
- form = null;
- }
-
- /**
- * Test common rendering
- *
- * @throws Exception
- */
- public void testCommonRendering() throws Exception{
- HtmlPage view = renderView();
- assertNotNull(view);
-
- HtmlElement table = view.getHtmlElementById(listShuttle.getClientId(facesContext));
- assertNotNull(table);
- assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
-
- HtmlElement tbody = (HtmlElement) table.getFirstDomChild();
- assertNotNull(tbody);
- assertEquals(HTML.TBOBY_ELEMENT, tbody.getTagName());
-
- HtmlElement tr = (HtmlElement) tbody.getFirstDomChild();
- assertNotNull(tr);
- String style = tr.getAttributeValue(HTML.style_ATTRIBUTE);
- assertNotNull(style);
- assertTrue(style.contains("display: none;"));
- assertEquals(HTML.TR_ELEMENT, tr.getTagName());
-
- tr = (HtmlElement) tr.getNextDomSibling();
- assertNotNull(tr);
- assertNull(tr.getNextDomSibling());
-
- int childCount = 0;
- for (Iterator<HtmlElement> it = tr.getChildIterator(); it.hasNext();) {
- HtmlElement td = it.next();
- assertNotNull(td);
- assertEquals(HTML.td_ELEM, td.getTagName());
- childCount++;
- }
- assertEquals(4, childCount);
-
- HtmlElement hidden1 = view.getHtmlElementById(listShuttle.getClientId(facesContext) + "focusKeeper");
- assertNotNull(hidden1);
- assertEquals(HTML.INPUT_ELEM, hidden1.getNodeName());
- assertEquals(HTML.BUTTON, hidden1.getAttributeValue(HTML.TYPE_ATTR));
- hidden1.getAttributeValue(HTML.style_ATTRIBUTE).contains("left: -32767px");
-
- List<HtmlElement> inputs = view.getDocumentHtmlElement().
- getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.id_ATTRIBUTE, listShuttle.getClientId(facesContext) + "focusKeeper");
- assertNotNull(inputs);
- assertEquals(1, inputs.size());
- inputs = view.getDocumentHtmlElement().
- getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.id_ATTRIBUTE, listShuttle.getClientId(facesContext) + "tlFocusKeeper");
- assertNotNull(inputs);
- assertEquals(1, inputs.size());
-
- inputs = view.getDocumentHtmlElement().
- getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.NAME_ATTRIBUTE, listShuttle.getClientId(facesContext));
- assertNotNull(inputs);
- assertEquals(4, inputs.size());
- }
-
- /**
- * Test script rendering
- *
- * @throws Exception
- */
- public void testRenderScript() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
- List<HtmlScript> scripts = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.SCRIPT_ELEM);
- int foundCount = 0;
- for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = (String) srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- foundCount++;
-
- String uri = "http:" + srcAttr;
- Page page = webClient.getPage(uri);
- assertNotNull(page);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
-
- break;
- }
- }
-
- assertTrue(found);
- }
- }
- assertEquals(javaScripts.size(), foundCount);
- }
-
- /**
- * Test style rendering
- *
- * @throws Exception
- */
- public void testRenderStyle() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
- List<HtmlElement> links = view.getDocumentElement().getHtmlElementsByTagName(HTML.LINK_ELEMENT);
- assertNotNull(links);
- assertEquals(1, links.size());
- HtmlElement link = links.get(0);
- assertTrue(link.getAttributeValue(HTML.HREF_ATTR).contains("css/listShuttle.xcss"));
-
- String uri = "http:" + link.getAttributeValue(HTML.HREF_ATTR);
- Page page = webClient.getPage(uri);
- assertNotNull(page);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- }
-
- /**
- * Test controls rendering
- *
- * @throws Exception
- */
- public void testRenderControls() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- List<HtmlElement> images = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.IMG_ELEMENT);
- assertNotNull(images);
-
- int foundImages = 0;
- for (Iterator<HtmlElement> it = images.iterator(); it.hasNext(); ) {
- HtmlElement img = it.next();
- assertNotNull(img);
-
- String uri = "http:" + img.getAttributeValue(HTML.src_ATTRIBUTE);
- Page page = webClient.getPage(uri);
- assertNotNull(page);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
-
- if (uri.contains("spacer.gif")) {
- continue;
- }
- foundImages++;
-
- HtmlElement element = (HtmlElement) img.getParentDomNode();
- assertNotNull(element);
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
-
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
-
- if (HTML.a_ELEMENT.equalsIgnoreCase(element.getNodeName())) {
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
- }
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
-
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
- String clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-shuttle-control"));
- }
- assertEquals(IMAGE_COUNT, foundImages);
- }
-
- /**
- * Test default images rendering
- *
- * @throws Exception
- */
- public void testRenderImages() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- ImageInfo info = getImageResource(clazz);
- assertNotNull(info);
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
-
- for (Iterator<String> it = imagePNGClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- ImageInfo info = getImageResource(clazz);
- assertNotNull(info);
- assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
- }
-
- /**
- * Test items rendering
- *
- * @throws Exception
- */
- public void testRenderItems() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- HtmlElement div = view.getHtmlElementById(listShuttle.getClientId(facesContext) + "contentBox");
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getNodeName());
-
- HtmlElement table = (HtmlElement)div.getFirstDomChild();
- assertNotNull(table);
- assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
-
- HtmlElement tbody = (HtmlElement)table.getFirstDomChild();
- assertNotNull(tbody);
- assertEquals(HTML.TBOBY_ELEMENT, tbody.getNodeName());
-
- int rowsCount = 0;
- for (Iterator<HtmlElement> it = tbody.getChildIterator(); it.hasNext(); ) {
- HtmlElement tr = it.next();
- assertNotNull(tr);
- assertEquals(HTML.TR_ELEMENT, tr.getNodeName());
-
- String clazz = tr.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-shuttle-source-row"));
-
- int cellsCount = 0;
- for (Iterator<HtmlElement> it2 = tr.getChildIterator(); it2.hasNext(); ) {
- HtmlElement td = it2.next();
- assertNotNull(td);
- assertEquals(HTML.td_ELEM, td.getNodeName());
-
- String clazz2 = td.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz2);
- assertTrue(clazz2.contains("rich-shuttle-source-cell"));
-
- cellsCount++;
- }
- assertEquals(2, cellsCount);
-
- rowsCount++;
- }
- assertEquals(items.size(), rowsCount);
- }
-
- protected class SimpleItem {
- String name;
- int salary;
-
- public SimpleItem(String name, int salary) {
- this.name = name;
- this.salary = salary;
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getSalary() {
- return salary;
- }
- public void setSalary(int salary) {
- this.salary = salary;
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.image.ImageInfo;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIListShuttle;
+
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+public class ListShuttleRenderingTest extends AbstractAjax4JsfTestCase {
+ private static final int IMAGE_COUNT = 16;
+
+ private UIListShuttle listShuttle = null;
+ private UIForm form = null;
+ private List<SimpleItem> items = null;
+ private HtmlOutputText output1 = null;
+ private HtmlOutputText output2 = null;
+ private UIColumn column1 = null;
+ private UIColumn column2 = null;
+
+ private static final Set<String> javaScripts = new HashSet<String>();
+ private static final Set<String> imageClasses = new HashSet<String>();
+ private static final Set<String> imagePNGClasses = new HashSet<String>();
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("scripts/utils.js");
+ javaScripts.add("scripts/ShuttleUtils.js");
+ javaScripts.add("scripts/SelectItem.js");
+ javaScripts.add("scripts/LayoutManager.js");
+ javaScripts.add("scripts/Control.js");
+ javaScripts.add("scripts/OrderingList.js");
+ javaScripts.add("scripts/ListShuttle.js");
+ javaScripts.add("scripts/ListBase.js");
+
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUp");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
+
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopy");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAll");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconCopyAllDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemove");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAll");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.ListShuttleIconRemoveAllDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDown");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
+
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
+
+
+ }
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public ListShuttleRenderingTest(String testName) {
+ super(testName);
+ }
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent(UIListShuttle.COMPONENT_TYPE, "org.richfaces.component.html.HtmlListShuttle");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ listShuttle = (UIListShuttle)application.createComponent(UIListShuttle.COMPONENT_TYPE);
+ listShuttle.setId("listShuttle");
+ listShuttle.setVar("item");
+
+ items = new ArrayList<SimpleItem>();
+ items.add(new SimpleItem("Michael", 2000));
+ items.add(new SimpleItem("John", 500));
+ items.add(new SimpleItem("George", 4000));
+
+ listShuttle.setSourceValue(items);
+
+ output1 = new HtmlOutputText();
+ output1.setValueBinding("value", application.createValueBinding("#{item.name}"));
+ column1 = new UIColumn();
+ column1.getChildren().add(output1);
+ listShuttle.getChildren().add(column1);
+
+ output2 = new HtmlOutputText();
+ output2.setValueBinding("value", application.createValueBinding("#{item.salary}"));
+ column2 = new UIColumn();
+ column2.getChildren().add(output2);
+ listShuttle.getChildren().add(column2);
+
+ form.getChildren().add(listShuttle);
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ items = null;
+ output1 = null;
+ output2 = null;
+ column1 = null;
+ column2 = null;
+ listShuttle = null;
+ form = null;
+ }
+
+ /**
+ * Test common rendering
+ *
+ * @throws Exception
+ */
+ public void testCommonRendering() throws Exception{
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ HtmlElement table = view.getHtmlElementById(listShuttle.getClientId(facesContext));
+ assertNotNull(table);
+ assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
+
+ HtmlElement tbody = (HtmlElement) table.getFirstDomChild();
+ assertNotNull(tbody);
+ assertEquals(HTML.TBOBY_ELEMENT, tbody.getTagName());
+
+ HtmlElement tr = (HtmlElement) tbody.getFirstDomChild();
+ assertNotNull(tr);
+ String style = tr.getAttributeValue(HTML.style_ATTRIBUTE);
+ assertNotNull(style);
+ assertTrue(style.contains("display: none;"));
+ assertEquals(HTML.TR_ELEMENT, tr.getTagName());
+
+ tr = (HtmlElement) tr.getNextDomSibling();
+ assertNotNull(tr);
+ assertNull(tr.getNextDomSibling());
+
+ int childCount = 0;
+ for (Iterator<HtmlElement> it = tr.getChildIterator(); it.hasNext();) {
+ HtmlElement td = it.next();
+ assertNotNull(td);
+ assertEquals(HTML.td_ELEM, td.getTagName());
+ childCount++;
+ }
+ assertEquals(4, childCount);
+
+ HtmlElement hidden1 = view.getHtmlElementById(listShuttle.getClientId(facesContext) + "focusKeeper");
+ assertNotNull(hidden1);
+ assertEquals(HTML.INPUT_ELEM, hidden1.getNodeName());
+ assertEquals(HTML.BUTTON, hidden1.getAttributeValue(HTML.TYPE_ATTR));
+ hidden1.getAttributeValue(HTML.style_ATTRIBUTE).contains("left: -32767px");
+
+ List<HtmlElement> inputs = view.getDocumentHtmlElement().
+ getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.id_ATTRIBUTE, listShuttle.getClientId(facesContext) + "focusKeeper");
+ assertNotNull(inputs);
+ assertEquals(1, inputs.size());
+ inputs = view.getDocumentHtmlElement().
+ getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.id_ATTRIBUTE, listShuttle.getClientId(facesContext) + "tlFocusKeeper");
+ assertNotNull(inputs);
+ assertEquals(1, inputs.size());
+
+ inputs = view.getDocumentHtmlElement().
+ getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.NAME_ATTRIBUTE, listShuttle.getClientId(facesContext));
+ assertNotNull(inputs);
+ assertEquals(4, inputs.size());
+ }
+
+ /**
+ * Test script rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderScript() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+ List<HtmlScript> scripts = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.SCRIPT_ELEM);
+ int foundCount = 0;
+ for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ foundCount++;
+
+ String uri = "http:" + srcAttr;
+ Page page = webClient.getPage(uri);
+ assertNotNull(page);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+ assertEquals(javaScripts.size(), foundCount);
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+ List<HtmlElement> links = view.getDocumentElement().getHtmlElementsByTagName(HTML.LINK_ELEMENT);
+ assertNotNull(links);
+ assertEquals(1, links.size());
+ HtmlElement link = links.get(0);
+ assertTrue(link.getAttributeValue(HTML.HREF_ATTR).contains("css/listShuttle.xcss"));
+
+ String uri = "http:" + link.getAttributeValue(HTML.HREF_ATTR);
+ Page page = webClient.getPage(uri);
+ assertNotNull(page);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ }
+
+ /**
+ * Test controls rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderControls() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ List<HtmlElement> images = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.IMG_ELEMENT);
+ assertNotNull(images);
+
+ int foundImages = 0;
+ for (Iterator<HtmlElement> it = images.iterator(); it.hasNext(); ) {
+ HtmlElement img = it.next();
+ assertNotNull(img);
+
+ String uri = "http:" + img.getAttributeValue(HTML.src_ATTRIBUTE);
+ Page page = webClient.getPage(uri);
+ assertNotNull(page);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+
+ if (uri.contains("spacer.gif")) {
+ continue;
+ }
+ foundImages++;
+
+ HtmlElement element = (HtmlElement) img.getParentDomNode();
+ assertNotNull(element);
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+
+ if (HTML.a_ELEMENT.equalsIgnoreCase(element.getNodeName())) {
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+ }
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+ String clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-shuttle-control"));
+ }
+ assertEquals(IMAGE_COUNT, foundImages);
+ }
+
+ /**
+ * Test default images rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderImages() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
+ String clazz = it.next();
+ ImageInfo info = getImageResource(clazz);
+ assertNotNull(info);
+ assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ assertTrue(info.getHeight() > 0);
+ assertTrue(info.getWidth() > 0);
+ }
+
+ for (Iterator<String> it = imagePNGClasses.iterator(); it.hasNext(); ) {
+ String clazz = it.next();
+ ImageInfo info = getImageResource(clazz);
+ assertNotNull(info);
+ assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
+ assertTrue(info.getHeight() > 0);
+ assertTrue(info.getWidth() > 0);
+ }
+ }
+
+ /**
+ * Test items rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderItems() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ HtmlElement div = view.getHtmlElementById(listShuttle.getClientId(facesContext) + "contentBox");
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getNodeName());
+
+ HtmlElement table = (HtmlElement)div.getFirstDomChild();
+ assertNotNull(table);
+ assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
+
+ HtmlElement tbody = (HtmlElement)table.getFirstDomChild();
+ assertNotNull(tbody);
+ assertEquals(HTML.TBOBY_ELEMENT, tbody.getNodeName());
+
+ int rowsCount = 0;
+ for (Iterator<HtmlElement> it = tbody.getChildIterator(); it.hasNext(); ) {
+ HtmlElement tr = it.next();
+ assertNotNull(tr);
+ assertEquals(HTML.TR_ELEMENT, tr.getNodeName());
+
+ String clazz = tr.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-shuttle-source-row"));
+
+ int cellsCount = 0;
+ for (Iterator<HtmlElement> it2 = tr.getChildIterator(); it2.hasNext(); ) {
+ HtmlElement td = it2.next();
+ assertNotNull(td);
+ assertEquals(HTML.td_ELEM, td.getNodeName());
+
+ String clazz2 = td.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz2);
+ assertTrue(clazz2.contains("rich-shuttle-source-cell"));
+
+ cellsCount++;
+ }
+ assertEquals(2, cellsCount);
+
+ rowsCount++;
+ }
+ assertEquals(items.size(), rowsCount);
+ }
+
+ protected class SimpleItem {
+ String name;
+ int salary;
+
+ public SimpleItem(String name, int salary) {
+ this.name = name;
+ this.salary = salary;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public int getSalary() {
+ return salary;
+ }
+ public void setSalary(int salary) {
+ this.salary = salary;
+ }
+ }
+
+}
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/MenuItemRendererDelegate.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,190 +1,190 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.renderkit.ComponentVariables;
-import org.ajax4jsf.renderkit.RendererBase;
-
-public class MenuItemRendererDelegate extends RendererBase {
-
- protected void initializeStyles(FacesContext context, UIComponent menuItem,
- boolean disabled, ComponentVariables variables) {
- UIComponent parentMenu = getParentMenu(context, menuItem);
-
- Object itemClass = "";
- Object itemStyle = "";
- Object disabledItemClass = "";
- Object disabledItemStyle = "";
- Object selectItemClass = "";
-
- if (parentMenu != null) {
- itemClass = parentMenu.getAttributes().get("itemClass");
- itemStyle = parentMenu.getAttributes().get("itemStyle");
- disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
- disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
- selectItemClass = parentMenu.getAttributes().get("selectItemClass");
-
- }
- Object selectClass = menuItem.getAttributes().get("selectClass");
- Object styleClass = menuItem.getAttributes().get("styleClass");
- Object style = menuItem.getAttributes().get("style");
- Object labelClass = (String)menuItem.getAttributes().get("labelClass");
- Object disabledLabelClass = (String)menuItem.getAttributes().get("labelClass");
- Object selectedLabelClass = (String)menuItem.getAttributes().get("labelClass");
-
- if (null == labelClass) {
- labelClass = "";
- }
- if (null == disabledLabelClass) {
- disabledLabelClass = "";
- }
- if (null == selectedLabelClass) {
- selectedLabelClass = "";
- }
- if (null == itemClass) {
- itemClass = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
- if (null == disabledItemClass) {
- disabledItemClass = "";
- }
- if (null == disabledItemStyle) {
- disabledItemStyle = "";
- }
- if (null == selectItemClass) {
- selectItemClass = "";
- }
- if (null == styleClass) {
- styleClass = "";
- }
- if (null == selectClass) {
- selectClass = "";
- }
- if (null == style) {
- style = "";
- }
-
- if (disabled) {
- variables.setVariable("menuItemClass",
- "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled " +
- styleClass + " " +
- itemClass + " " + disabledItemClass);
- variables.setVariable("menuItemStyle",
- itemStyle + "; " + disabledItemStyle + "; " + style);
- variables.setVariable("menuItemLabelClass", "rich-menu-item-label rich-menu-item-label-disabled " +
- labelClass + " " + disabledLabelClass);
- variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
- itemClass + " " + disabledItemClass + " " + styleClass);
- variables.setVariable("menuItemMouseMove", "");
- variables.setVariable("menuItemItemIconClass", "rich-menu-item-icon-disabled");
- variables.setVariable("menuItemItemLabelClass", "rich-menu-item-label-disabled " + labelClass);
- variables.setVariable("menuItemItemFolderClass", "rich-menu-item-folder-disabled");
- } else {
- variables.setVariable("menuItemClass",
- "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " +
- styleClass + " " + itemClass);
- variables.setVariable("menuItemStyle", itemStyle + "; " + style);
- variables.setVariable("menuItemHoverClass",
- "this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover " +
- styleClass + " " + selectClass +
- selectItemClass + "';");
- variables.setVariable("menuItemLabelClass", "rich-menu-item-label " + labelClass);
- variables.setVariable("selectLabelClass", selectedLabelClass);
- variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
- itemClass + " " + styleClass);
- variables.setVariable("menuItemMouseMove", menuItem.getAttributes().get("onmousemove"));
- variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled rich-menu-group-icon ");
- variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label rich-menu-group-label " + labelClass);
- variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder rich-menu-group-folder ");
- variables.setVariable("onmouseoutInlineStyles", processInlineStyles(context, menuItem, false));
- variables.setVariable("onmouseoverInlineStyles", processInlineStyles(context, menuItem, true));
-
- variables.setVariable("menuGroupHoverClass", "this.className='dr-menu-item dr-menu-item-enabled rich-menu-group " +
- itemClass + " " + selectItemClass + " " + styleClass + "'");
- }
- }
-
- protected String processInlineStyles(FacesContext context, UIComponent menuItem, boolean isOnmouseover) {
-
- StringBuffer buffer = new StringBuffer();
- Object style = menuItem.getAttributes().get("style");
- Object selectStyle = menuItem.getAttributes().get("selectStyle");
-
- UIComponent parentMenu = getParentMenu(context, menuItem);
- Object selectItemStyle = null;
- Object itemStyle = null;
- if (parentMenu != null) {
- selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
- itemStyle = parentMenu.getAttributes().get("itemStyle");
-
- }
-
- if (null == selectStyle) {
- selectStyle = "";
- }
- if (null == selectItemStyle) {
- selectItemStyle = "";
- }
- if (null == itemStyle) {
- itemStyle = "";
- }
-
- selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
-
- buffer.append("$('" + menuItem.getClientId(context) + "').style.cssText='");
-
- if (null != style) {
- buffer.append(style.toString() + "; ");
- }
-
- if (isOnmouseover) {
- buffer.append(selectStyle.toString() + ";';");
- } else {
- buffer.append(itemStyle.toString() + ";';");
- }
-
- return buffer.toString();
- }
-
- protected UIComponent getParentMenu(FacesContext context, UIComponent menuItem) {
- UIComponent parent = menuItem.getParent();
- while (null != parent) {
- if (parent instanceof org.richfaces.component.MenuComponent) {
- return parent;
- }
- parent = parent.getParent();
- }
- return null;
-// throw new FacesException( "Parent menu for menu group (id="
-// + menuItem.getClientId(context) + ") has not been found.");
- }
-
- protected Class getComponentClass() {
- return null;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.renderkit.ComponentVariables;
+import org.ajax4jsf.renderkit.RendererBase;
+
+public class MenuItemRendererDelegate extends RendererBase {
+
+ protected void initializeStyles(FacesContext context, UIComponent menuItem,
+ boolean disabled, ComponentVariables variables) {
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+
+ Object itemClass = "";
+ Object itemStyle = "";
+ Object disabledItemClass = "";
+ Object disabledItemStyle = "";
+ Object selectItemClass = "";
+
+ if (parentMenu != null) {
+ itemClass = parentMenu.getAttributes().get("itemClass");
+ itemStyle = parentMenu.getAttributes().get("itemStyle");
+ disabledItemClass = parentMenu.getAttributes().get("disabledItemClass");
+ disabledItemStyle = parentMenu.getAttributes().get("disabledItemStyle");
+ selectItemClass = parentMenu.getAttributes().get("selectItemClass");
+
+ }
+ Object selectClass = menuItem.getAttributes().get("selectClass");
+ Object styleClass = menuItem.getAttributes().get("styleClass");
+ Object style = menuItem.getAttributes().get("style");
+ Object labelClass = (String)menuItem.getAttributes().get("labelClass");
+ Object disabledLabelClass = (String)menuItem.getAttributes().get("labelClass");
+ Object selectedLabelClass = (String)menuItem.getAttributes().get("labelClass");
+
+ if (null == labelClass) {
+ labelClass = "";
+ }
+ if (null == disabledLabelClass) {
+ disabledLabelClass = "";
+ }
+ if (null == selectedLabelClass) {
+ selectedLabelClass = "";
+ }
+ if (null == itemClass) {
+ itemClass = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+ if (null == disabledItemClass) {
+ disabledItemClass = "";
+ }
+ if (null == disabledItemStyle) {
+ disabledItemStyle = "";
+ }
+ if (null == selectItemClass) {
+ selectItemClass = "";
+ }
+ if (null == styleClass) {
+ styleClass = "";
+ }
+ if (null == selectClass) {
+ selectClass = "";
+ }
+ if (null == style) {
+ style = "";
+ }
+
+ if (disabled) {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-disabled rich-menu-item rich-menu-item-disabled " +
+ styleClass + " " +
+ itemClass + " " + disabledItemClass);
+ variables.setVariable("menuItemStyle",
+ itemStyle + "; " + disabledItemStyle + "; " + style);
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label rich-menu-item-label-disabled " +
+ labelClass + " " + disabledLabelClass);
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-disabled rich-menu-group rich-menu-group-disabled " +
+ itemClass + " " + disabledItemClass + " " + styleClass);
+ variables.setVariable("menuItemMouseMove", "");
+ variables.setVariable("menuItemItemIconClass", "rich-menu-item-icon-disabled");
+ variables.setVariable("menuItemItemLabelClass", "rich-menu-item-label-disabled " + labelClass);
+ variables.setVariable("menuItemItemFolderClass", "rich-menu-item-folder-disabled");
+ } else {
+ variables.setVariable("menuItemClass",
+ "dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " +
+ styleClass + " " + itemClass);
+ variables.setVariable("menuItemStyle", itemStyle + "; " + style);
+ variables.setVariable("menuItemHoverClass",
+ "this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover " +
+ styleClass + " " + selectClass +
+ selectItemClass + "';");
+ variables.setVariable("menuItemLabelClass", "rich-menu-item-label " + labelClass);
+ variables.setVariable("selectLabelClass", selectedLabelClass);
+ variables.setVariable("menuGroupClass", "dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + styleClass);
+ variables.setVariable("menuItemMouseMove", menuItem.getAttributes().get("onmousemove"));
+ variables.setVariable("menuGroupItemIconClass", "rich-menu-item-icon-enabled rich-menu-group-icon ");
+ variables.setVariable("menuGroupItemLabelClass", "rich-menu-item-label rich-menu-group-label " + labelClass);
+ variables.setVariable("menuGroupItemFolderClass", "rich-menu-item-folder rich-menu-group-folder ");
+ variables.setVariable("onmouseoutInlineStyles", processInlineStyles(context, menuItem, false));
+ variables.setVariable("onmouseoverInlineStyles", processInlineStyles(context, menuItem, true));
+
+ variables.setVariable("menuGroupHoverClass", "this.className='dr-menu-item dr-menu-item-enabled rich-menu-group " +
+ itemClass + " " + selectItemClass + " " + styleClass + "'");
+ }
+ }
+
+ protected String processInlineStyles(FacesContext context, UIComponent menuItem, boolean isOnmouseover) {
+
+ StringBuffer buffer = new StringBuffer();
+ Object style = menuItem.getAttributes().get("style");
+ Object selectStyle = menuItem.getAttributes().get("selectStyle");
+
+ UIComponent parentMenu = getParentMenu(context, menuItem);
+ Object selectItemStyle = null;
+ Object itemStyle = null;
+ if (parentMenu != null) {
+ selectItemStyle = parentMenu.getAttributes().get("selectItemStyle");
+ itemStyle = parentMenu.getAttributes().get("itemStyle");
+
+ }
+
+ if (null == selectStyle) {
+ selectStyle = "";
+ }
+ if (null == selectItemStyle) {
+ selectItemStyle = "";
+ }
+ if (null == itemStyle) {
+ itemStyle = "";
+ }
+
+ selectStyle = itemStyle + "; " + selectItemStyle + "; " + selectStyle;
+
+ buffer.append("$('" + menuItem.getClientId(context) + "').style.cssText='");
+
+ if (null != style) {
+ buffer.append(style.toString() + "; ");
+ }
+
+ if (isOnmouseover) {
+ buffer.append(selectStyle.toString() + ";';");
+ } else {
+ buffer.append(itemStyle.toString() + ";';");
+ }
+
+ return buffer.toString();
+ }
+
+ protected UIComponent getParentMenu(FacesContext context, UIComponent menuItem) {
+ UIComponent parent = menuItem.getParent();
+ while (null != parent) {
+ if (parent instanceof org.richfaces.component.MenuComponent) {
+ return parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+// throw new FacesException( "Parent menu for menu group (id="
+// + menuItem.getClientId(context) + ") has not been found.");
+ }
+
+ protected Class getComponentClass() {
+ return null;
+ }
+
+}
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuGroup.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -8,7 +8,7 @@
xmlns:vcp=" http://jsf.exadel.com/vcp"
baseclass="org.richfaces.renderkit.html.MenuGroupRendererBase"
class="org.richfaces.renderkit.html.MenuGroupRenderer"
- component="org.richfaces.component.UIMenuGroup" >
+ component="org.richfaces.component.UIMenuGroup" >
<h:styles>css/menucomponents.xcss</h:styles>
@@ -18,7 +18,7 @@
</h:scripts>
<f:clientid var="clientId"/>
- <f:call name="initializeResources" />
+ <f:call name="initializeResources" />
<f:call name="initializeStyleClasses" />
<f:resource name="/org/richfaces/renderkit/html/images/spacer.gif" var="spacer" />
@@ -26,42 +26,42 @@
<div id="#{clientId}"
class="#{menuGroupClass}"
style="#{menuItemStyle}"
- onmousemove="#{menuItemMouseMove}"
- onmouseout="if (RichFaces.Menu.isWithin(event, this)) return; this.className='#{menuGroupClass}'; #{onmouseoutInlineStyles}"
+ onmousemove="#{menuItemMouseMove}"
+ onmouseout="if (RichFaces.Menu.isWithin(event, this)) return; this.className='#{menuGroupClass}'; #{onmouseoutInlineStyles}"
onmouseover="if (RichFaces.Menu.isWithin(event, this)) return; #{menuGroupHoverClass}; #{onmouseoverInlineStyles}" >
-
+
<span id="#{clientId}:icon"
class="dr-menu-icon #{menuGroupItemIconClass} #{component.attributes['iconClass']}">
<jsp:scriptlet>
- <![CDATA[
- boolean disabled = ((Boolean) component.getAttributes().get("disabled")).booleanValue();
- String iconName = disabled ? "iconDisabled" : "icon";
+ <![CDATA[
+ boolean disabled = ((Boolean) component.getAttributes().get("disabled")).booleanValue();
+ String iconName = disabled ? "iconDisabled" : "icon";
UIComponent iconFacet = component.getFacet(iconName);
- if (iconFacet !=null && iconFacet.isRendered()) {
+ if (iconFacet !=null && iconFacet.isRendered()) {
renderChild(context, iconFacet);
} else if (component.getAttributes().get(iconName)!=null) {]]>
</jsp:scriptlet>
- <img width="16" height="16" alt=" "
+ <img width="16" height="16" alt=""
style="#{component.attributes['iconStyle']}"
src="#{actualIcon}"/>
<jsp:scriptlet>
<![CDATA[} else {]]>
</jsp:scriptlet>
- <img width="16" height="16" alt=" "
+ <img width="16" height="16" alt=""
style="#{component.attributes['iconStyle']}"
src="#{spacer}"/>
<jsp:scriptlet><![CDATA[}]]></jsp:scriptlet>
</span>
- <span id="#{clientId}:anchor" class="#{menuGroupItemLabelClass}">
- #{component.attributes['value']}
- </span>
+ <span id="#{clientId}:anchor" class="#{menuGroupItemLabelClass}">
+ #{component.attributes['value']}
+ </span>
<jsp:scriptlet>
- <![CDATA[
- String iconFolder = disabled ? "iconFolderDisabled" : "iconFolder";
+ <![CDATA[
+ String iconFolder = disabled ? "iconFolderDisabled" : "iconFolder";
UIComponent iconFolderFacet = component.getFacet(iconFolder);
- if (iconFolderFacet != null && iconFolderFacet.isRendered()) {
+ if (iconFolderFacet != null && iconFolderFacet.isRendered()) {
]]>
</jsp:scriptlet>
<div id="#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass}">
@@ -76,7 +76,7 @@
<![CDATA[} else if (component.getAttributes().get(iconFolder)!=null) {]]>
</jsp:scriptlet>
<div id="#{clientId}:folder" class="dr-menu-node #{menuGroupItemFolderClass} #{component.attributes['iconClass']}">
- <img width="16" height="16" alt=" "
+ <img width="16" height="16" alt=""
style="#{component.attributes['iconStyle']}"
src="#{actualIconFolder}"/>
</div>
@@ -93,4 +93,4 @@
</jsp:scriptlet>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -26,15 +26,15 @@
]]>
</jsp:scriptlet>
- <f:call name="initializeResources" />
-
+ <f:call name="initializeResources" />
+
<f:call name="initializeStyles" />
<f:clientid var="clientId"/>
<jsp:scriptlet><![CDATA[
- if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
+ if (((org.richfaces.component.UIMenuItem) component).isDisabled()) {
]]></jsp:scriptlet>
@@ -56,12 +56,12 @@
<div id="#{clientId}"
class="#{menuItemClass}"
- onmouseout="if (RichFaces.Menu.isWithin(event, this)) return;
+ onmouseout="if (RichFaces.Menu.isWithin(event, this)) return;
this.className='#{menuItemClass}';
#{onmouseoutInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon rich-menu-item-icon #{component.attributes['iconClass']}';
Element.removeClassName($('#{clientId}:anchor'), 'rich-menu-item-label-selected');"
- onmouseover="if (RichFaces.Menu.isWithin(event, this)) return;
+ onmouseover="if (RichFaces.Menu.isWithin(event, this)) return;
#{menuItemHoverClass};
#{onmouseoverInlineStyles}
$('#{clientId}:icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected #{component.attributes['iconClass']}';
@@ -90,7 +90,7 @@
} else {
]]></jsp:scriptlet>
- <img width="16" alt=" "
+ <img width="16" alt=""
height="16"
src="#{icon}" />
@@ -118,4 +118,4 @@
<jsp:scriptlet><![CDATA[
}
]]></jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuSeparator.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -16,4 +16,4 @@
<div id="#{clientId}" class="dr-menu-separator rich-menu-separator">
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuSeparatorComponentTest.java
===================================================================
--- trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuSeparatorComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/menu-components/src/test/java/org/richfaces/component/MenuSeparatorComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -106,4 +106,4 @@
assertEquals(menuSeparator.getClientId(facesContext), classAttr);
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
===================================================================
--- trunk/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -74,4 +74,4 @@
public abstract void setLevel(String level);
-}
\ No newline at end of file
+}
Modified: trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessageRenderer.java
===================================================================
--- trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessageRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/message/src/main/java/org/richfaces/renderkit/html/HtmlRichMessageRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -206,4 +206,4 @@
return UIMessage.class;
}
}
-
\ No newline at end of file
+
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -17,7 +17,7 @@
</h:styles>
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
- /org/richfaces/renderkit/html/scripts/utils.js,
+ /org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/browser_info.js,
/org/richfaces/renderkit/html/scripts/modalPanel.js,
/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
@@ -40,14 +40,14 @@
x:passThruWithExclusions="id,style,class,styleClass"
>
<div class="dr-mpnl-mask-div dr-mpnl-mask-div-opaque rich-mpnl-mask-div" id="#{clientId}Div"
- style="z-index: 1;"
- onclick="#{component.attributes['onmaskclick']}"
- ondblclick="#{component.attributes['onmaskdblclick']}"
- oncontextmenu="#{component.attributes['onmaskcontextmenu']}"
- onmouseup="#{component.attributes['onmaskmouseup']}"
- onmousedown="#{component.attributes['onmaskmousedown']}"
- onmousemove="#{component.attributes['onmaskmousemove']}"
- onmouseover="#{component.attributes['onmaskmouseover']}"
+ style="z-index: 1;"
+ onclick="#{component.attributes['onmaskclick']}"
+ ondblclick="#{component.attributes['onmaskdblclick']}"
+ oncontextmenu="#{component.attributes['onmaskcontextmenu']}"
+ onmouseup="#{component.attributes['onmaskmouseup']}"
+ onmousedown="#{component.attributes['onmaskmousedown']}"
+ onmousemove="#{component.attributes['onmaskmousemove']}"
+ onmouseover="#{component.attributes['onmaskmouseover']}"
onmouseout="#{component.attributes['onmaskmouseout']}">
<button class="dr-mpnl-pnl-button" id="#{clientId}FirstHref"></button>
@@ -59,38 +59,38 @@
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
-
+
<c:object var="divClass" type="java.lang.String" />
<c:object var="tableStyle" type="java.lang.String" />
-
+
<jsp:scriptlet>
<![CDATA[
if (component.isAutosized()) {
- int minWidth = component.getMinWidth();
+ int minWidth = component.getMinWidth();
int minHeight = component.getMinHeight();
-
+
int width = component.getWidth();
int height = component.getHeight();
-
- if (width < 0 || width < minWidth) {
- width = minWidth;
- }
-
+
+ if (width < 0 || width < minWidth) {
+ width = minWidth;
+ }
+
if (height < 0 || height < minHeight) {
height = minHeight;
}
-
- tableStyle += "width: " + (width > 0 ? width : 1) + "px;";
+
+ tableStyle += "width: " + (width > 0 ? width : 1) + "px;";
tableStyle += "height: " + (height > 0 ? height : 1) + "px;";
-
- divClass = "";
-
+
+ divClass = "";
+
} else {
- tableStyle = "height: 100%; width: 100%;";
+ tableStyle = "height: 100%; width: 100%;";
/*
overflow: hidden;
*/
- divClass = "dr-mpnl-ovf-hd";
+ divClass = "dr-mpnl-ovf-hd";
if (component.isTrimOverlayedElements()) {
/*
position: relative;
@@ -101,18 +101,18 @@
}
]]>
</jsp:scriptlet>
-
+
<div id="#{clientId}ContentDiv" style="#{component.attributes['style']}" class="#{divClass} dr-mpnl-pnl rich-mp-content">
- <jsp:scriptlet>
- <![CDATA[if(component.getFacet("controls")!=null && component.getFacet("controls").isRendered()) {]]>
- </jsp:scriptlet>
- <div class="dr-mpnl-pnl-text rich-mpnl-text rich-mpnl-controls #{component.attributes['controlsClass']}">
- <u:insertFacet name="controls" />
- </div>
- <jsp:scriptlet>
- <![CDATA[}]]>
- </jsp:scriptlet>
-
+ <jsp:scriptlet>
+ <![CDATA[if(component.getFacet("controls")!=null && component.getFacet("controls").isRendered()) {]]>
+ </jsp:scriptlet>
+ <div class="dr-mpnl-pnl-text rich-mpnl-text rich-mpnl-controls #{component.attributes['controlsClass']}">
+ <u:insertFacet name="controls" />
+ </div>
+ <jsp:scriptlet>
+ <![CDATA[}]]>
+ </jsp:scriptlet>
+
<table id="#{clientId}ContentTable" style="#{tableStyle}" border="0" cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null && component.getFacet("header").isRendered()) {]]>
@@ -194,11 +194,11 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="onbeforehide" /></f:call>,
keepVisualState: #{component.keepVisualState},
- showWhenRendered: #{component.showWhenRendered},
+ showWhenRendered: #{component.showWhenRendered},
selectBehavior: "#{component.tridentIVEngineSelectBehavior}",
- autosized: #{component.autosized}
-
+ autosized: #{component.autosized}
+
<f:call name="writeVisualOptions" />
});
</script>
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -565,4 +565,4 @@
return converter;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListButtonGradient.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListButtonGradient.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListButtonGradient.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,35 +1,35 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.gradientimages;
-
-import org.richfaces.renderkit.html.BaseGradient;
-import org.richfaces.skin.Skin;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListButtonGradient extends BaseGradient {
- public OrderingListButtonGradient() {
- super(8, 18, 9, Skin.generalBackgroundColor, "tabBackgroundColor");
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.renderkit.html.BaseGradient;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListButtonGradient extends BaseGradient {
+ public OrderingListButtonGradient() {
+ super(8, 18, 9, Skin.generalBackgroundColor, "tabBackgroundColor");
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,45 +1,45 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.gradientimages;
-
-import java.awt.Graphics2D;
-import java.awt.geom.AffineTransform;
-
-import org.ajax4jsf.resource.ResourceContext;
-import org.richfaces.renderkit.html.BaseGradient;
-import org.richfaces.skin.Skin;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListClickedGradient extends BaseGradient {
- protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
- g2d.transform(new AffineTransform(1., 0., 0., -1., 0., 15.));
- super.paint(resourceContext, g2d);
- }
-
- public OrderingListClickedGradient() {
- super(7, 15, 9, "tabBackgroundColor", Skin.generalBackgroundColor);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+
+import org.ajax4jsf.resource.ResourceContext;
+import org.richfaces.renderkit.html.BaseGradient;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListClickedGradient extends BaseGradient {
+ protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
+ g2d.transform(new AffineTransform(1., 0., 0., -1., 0., 15.));
+ super.paint(resourceContext, g2d);
+ }
+
+ public OrderingListClickedGradient() {
+ super(7, 15, 9, "tabBackgroundColor", Skin.generalBackgroundColor);
+ }
+
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,35 +1,35 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.gradientimages;
-
-import org.richfaces.renderkit.html.BaseGradient;
-import org.richfaces.skin.Skin;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListHeaderGradient extends BaseGradient {
- public OrderingListHeaderGradient() {
- super(8, 40, 14, Skin.generalBackgroundColor, "tabBackgroundColor");
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.renderkit.html.BaseGradient;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListHeaderGradient extends BaseGradient {
+ public OrderingListHeaderGradient() {
+ super(8, 40, 14, Skin.generalBackgroundColor, "tabBackgroundColor");
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottom.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottom.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottom.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,85 +1,85 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.ResourceContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconBottom extends TriangleIconBase {
-
- protected void paintImage(ResourceContext context, Graphics2D g2d,
- Color textColor, Color borderColor) {
-
- g2d.translate(0, -3);
-
- g2d.setColor(textColor);
- g2d.translate(7, 5);
- paintBaseTriangle(g2d);
- g2d.translate(-7, -5);
-
- g2d.setColor(borderColor);
- g2d.drawLine(4, 5, 10, 5);
- g2d.drawLine(11, 6, 8, 9);
- g2d.drawLine(6, 9, 3, 6);
-
- g2d.translate(0, 4);
- g2d.setColor(textColor);
- g2d.translate(7, 5);
- paintBaseTriangle(g2d);
- g2d.translate(-7, -5);
-
- g2d.setColor(borderColor);
- g2d.drawLine(4, 5, 6, 5);
- g2d.drawLine(8, 5, 10, 5);
- g2d.drawLine(11, 6, 8, 9);
- g2d.drawLine(6, 9, 3, 6);
-
- g2d.translate(0, 4);
-
- g2d.setColor(borderColor);
- g2d.drawLine(4, 5, 6, 5);
- g2d.drawLine(8, 5, 10, 5);
-
- g2d.drawLine(11, 6, 10, 7);
- g2d.drawLine(4, 7, 3, 6);
- g2d.drawLine(4, 7, 10, 7);
-
- g2d.setColor(textColor);
- g2d.drawLine(4, 6, 10, 6);
- }
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
- SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.ResourceContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconBottom extends TriangleIconBase {
+
+ protected void paintImage(ResourceContext context, Graphics2D g2d,
+ Color textColor, Color borderColor) {
+
+ g2d.translate(0, -3);
+
+ g2d.setColor(textColor);
+ g2d.translate(7, 5);
+ paintBaseTriangle(g2d);
+ g2d.translate(-7, -5);
+
+ g2d.setColor(borderColor);
+ g2d.drawLine(4, 5, 10, 5);
+ g2d.drawLine(11, 6, 8, 9);
+ g2d.drawLine(6, 9, 3, 6);
+
+ g2d.translate(0, 4);
+ g2d.setColor(textColor);
+ g2d.translate(7, 5);
+ paintBaseTriangle(g2d);
+ g2d.translate(-7, -5);
+
+ g2d.setColor(borderColor);
+ g2d.drawLine(4, 5, 6, 5);
+ g2d.drawLine(8, 5, 10, 5);
+ g2d.drawLine(11, 6, 8, 9);
+ g2d.drawLine(6, 9, 3, 6);
+
+ g2d.translate(0, 4);
+
+ g2d.setColor(borderColor);
+ g2d.drawLine(4, 5, 6, 5);
+ g2d.drawLine(8, 5, 10, 5);
+
+ g2d.drawLine(11, 6, 10, 7);
+ g2d.drawLine(4, 7, 3, 6);
+ g2d.drawLine(4, 7, 10, 7);
+
+ g2d.setColor(textColor);
+ g2d.drawLine(4, 6, 10, 6);
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
+ SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottomDisabled.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottomDisabled.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBottomDisabled.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,41 +1,41 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconBottomDisabled extends OrderingListIconBottom {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
- SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconBottomDisabled extends OrderingListIconBottom {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
+ SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
+ }
+
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDown.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDown.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDown.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconDown extends TriangleIconDown {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
- SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconDown extends TriangleIconDown {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
+ SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDownDisabled.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDownDisabled.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconDownDisabled.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconDownDisabled extends OrderingListIconDown {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
- SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconDownDisabled extends OrderingListIconDown {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
+ SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTop.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTop.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTop.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,44 +1,44 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-
-import org.ajax4jsf.resource.ResourceContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconTop extends OrderingListIconBottom {
-
- protected void paintImage(ResourceContext context, Graphics2D g2d,
- Color textColor, Color borderColor) {
-
- g2d.translate(0, 14);
- g2d.scale(1, -1);
-
- super.paintImage(context, g2d, textColor, borderColor);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+
+import org.ajax4jsf.resource.ResourceContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconTop extends OrderingListIconBottom {
+
+ protected void paintImage(ResourceContext context, Graphics2D g2d,
+ Color textColor, Color borderColor) {
+
+ g2d.translate(0, 14);
+ g2d.scale(1, -1);
+
+ super.paintImage(context, g2d, textColor, borderColor);
+ }
+
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTopDisabled.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTopDisabled.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconTopDisabled.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconTopDisabled extends OrderingListIconTop {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
- SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconTopDisabled extends OrderingListIconTop {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
+ SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUp.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUp.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUp.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconUp extends TriangleIconUp {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
- SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconUp extends TriangleIconUp {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_ICON_COLOR, ICON_COLOR,
+ SELECT_LIST_BORDER_COLOR, BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUpDisabled.java
===================================================================
--- trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUpDisabled.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconUpDisabled.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,39 +1,39 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.images;
-
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
-import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListIconUpDisabled extends OrderingListIconUp {
-
- protected Object getDataToStore(FacesContext context, Object data) {
- return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
- SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
- }
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.images;
+
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_BORDER_COLOR;
+import static org.richfaces.renderkit.html.images.OrderingListIconConstants.SELECT_LIST_DISABLED_ICON_COLOR;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListIconUpDisabled extends OrderingListIconUp {
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ return super.getDataToStore(context, SELECT_LIST_DISABLED_ICON_COLOR, DISABLED_ICON_COLOR,
+ SELECT_LIST_DISABLED_BORDER_COLOR, DISABLED_BORDER_COLOR);
+ }
+}
Modified: trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -52,18 +52,18 @@
}
]]></jsp:scriptlet>
</tr>
- <tr>
- <jsp:scriptlet><![CDATA[
- if ("left".equals(component.getAttributes().get("controlsHorizontalAlign"))) {
- ]]></jsp:scriptlet>
- <td class="rich-ordering-list-button-valign" style="vertical-align: #{component.attributes['controlsVerticalAlign']}" >
- <div class="rich-ordering-list-button-layout">
- <f:call name="encodeControlsFacets" />
- </div>
- </td>
- <jsp:scriptlet><![CDATA[
- }
+ <tr>
+ <jsp:scriptlet><![CDATA[
+ if ("left".equals(component.getAttributes().get("controlsHorizontalAlign"))) {
]]></jsp:scriptlet>
+ <td class="rich-ordering-list-button-valign" style="vertical-align: #{component.attributes['controlsVerticalAlign']}" >
+ <div class="rich-ordering-list-button-layout">
+ <f:call name="encodeControlsFacets" />
+ </div>
+ </td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
<td>
<div id="#{clientId}headerBox" class="rich-ordering-list-output">
<jsp:scriptlet><![CDATA[
@@ -100,17 +100,17 @@
</div>
</div>
</td>
- <jsp:scriptlet><![CDATA[
- if (!"left".equals(component.getAttributes().get("controlsHorizontalAlign"))) {
- ]]></jsp:scriptlet>
- <td class="rich-ordering-list-button-valign" style="vertical-align: #{component.attributes['controlsVerticalAlign']}" >
- <div class="rich-ordering-list-button-layout">
- <f:call name="encodeControlsFacets" />
- </div>
- </td>
- <jsp:scriptlet><![CDATA[
- }
+ <jsp:scriptlet><![CDATA[
+ if (!"left".equals(component.getAttributes().get("controlsHorizontalAlign"))) {
]]></jsp:scriptlet>
+ <td class="rich-ordering-list-button-valign" style="vertical-align: #{component.attributes['controlsVerticalAlign']}" >
+ <div class="rich-ordering-list-button-layout">
+ <f:call name="encodeControlsFacets" />
+ </div>
+ </td>
+ <jsp:scriptlet><![CDATA[
+ }
+ ]]></jsp:scriptlet>
</tr>
</tbody>
</table>
@@ -132,4 +132,4 @@
#{this:getRowClassesAsJSArray(context, component)});
</script>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
===================================================================
--- trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,397 +1,397 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIForm;
-import javax.faces.component.html.HtmlForm;
-import javax.faces.component.html.HtmlOutputText;
-import javax.servlet.http.HttpServletResponse;
-
-import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.ajax4jsf.resource.image.ImageInfo;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.apache.commons.lang.StringUtils;
-import org.richfaces.component.UIOrderingList;
-
-import com.gargoylesoftware.htmlunit.Page;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlScript;
-
-/**
- * @author Siarhej Chalipau
- *
- */
-public class OrderingListRenderingTest extends AbstractAjax4JsfTestCase {
- private static Set<String> javaScripts = new HashSet<String>();
- private static Set<String> imageClasses = new HashSet<String>();
- private static Set<String> imagePNGClasses = new HashSet<String>();
-
- static {
- javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
- javaScripts.add("scripts/utils.js");
- javaScripts.add("scripts/ShuttleUtils.js");
- javaScripts.add("scripts/SelectItem.js");
- javaScripts.add("scripts/LayoutManager.js");
- javaScripts.add("scripts/Control.js");
- javaScripts.add("scripts/OrderingList.js");
- javaScripts.add("scripts/ListBase.js");
-
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUp");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
- imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDown");
-
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
- imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
-
- }
-
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public OrderingListRenderingTest( String testName )
- {
- super( testName );
- }
-
- private final static int ROWS_COUNT = 3;
-
- private UIForm form = null;
- private UIOrderingList orderingList = null;
- private List<SimpleItem> items = null;
- private HtmlOutputText output1 = null;
- private HtmlOutputText output2 = null;
- private UIColumn column1 = null;
- private UIColumn column2 = null;
- private HtmlOutputText caption = null;
-
- public void setUp() throws Exception {
- super.setUp();
-
- application.addComponent("org.richfaces.OrderingList", "org.richfaces.component.html.HtmlOrderingList");
-
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- orderingList = (UIOrderingList)application.createComponent("org.richfaces.OrderingList");
- orderingList.setId("orderingList");
- orderingList.setControlsType("link");
- orderingList.setVar("item");
-
- caption = new HtmlOutputText();
- caption.setValue("caption");
- orderingList.getFacets().put("caption", caption);
-
- items = new ArrayList<SimpleItem>();
- items.add(new SimpleItem("Michael", 2000));
- items.add(new SimpleItem("John", 500));
- items.add(new SimpleItem("George", 4000));
-
- orderingList.setValue(items);
-
- output1 = new HtmlOutputText();
- output1.setValueBinding("value", application.createValueBinding("#{item.name}"));
- column1 = new UIColumn();
- column1.getChildren().add(output1);
- orderingList.getChildren().add(column1);
-
- output2 = new HtmlOutputText();
- output2.setValueBinding("value", application.createValueBinding("#{item.salary}"));
- column2 = new UIColumn();
- column2.getChildren().add(output2);
- orderingList.getChildren().add(column2);
-
- form.getChildren().add(orderingList);
- }
-
- public void tearDown() throws Exception {
- items = null;
- output1 = null;
- output2 = null;
- column1 = null;
- column2 = null;
- orderingList = null;
- form = null;
-
- super.tearDown();
- }
-
- /**
- * Test script rendering
- *
- * @throws Exception
- */
- public void testRenderScript() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
- List<HtmlScript> scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.SCRIPT_ELEM);
- int foundCount = 0;
- for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
- HtmlScript item = it.next();
- String srcAttr = item.getSrcAttribute();
-
- if (StringUtils.isNotBlank(srcAttr)) {
- boolean found = false;
- for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
- String src = srcIt.next();
-
- found = srcAttr.contains(src);
- if (found) {
- foundCount++;
- break;
- }
- }
-
- assertTrue(found);
- }
- }
- assertEquals(foundCount, javaScripts.size());
- }
-
- /**
- * Test default images rendering
- *
- * @throws Exception
- */
- public void testRenderImages() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- ImageInfo info = getImageResource(clazz);
- assertNotNull(info);
- assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
-
- for (Iterator<String> it = imagePNGClasses.iterator(); it.hasNext(); ) {
- String clazz = it.next();
- ImageInfo info = getImageResource(clazz);
- assertNotNull(info);
- assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
- assertTrue(info.getHeight() > 0);
- assertTrue(info.getWidth() > 0);
- }
- }
-
- /**
- * Test style rendering
- *
- * @throws Exception
- */
- public void testRenderStyle() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
- List<HtmlElement> links = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.LINK_ELEMENT);
- assertNotNull(links);
- assertEquals(1, links.size());
- HtmlElement link = links.get(0);
- assertTrue(link.getAttributeValue(HTML.HREF_ATTR).contains("css/orderingList.xcss"));
-
- String uri = "http:" + link.getAttributeValue(HTML.HREF_ATTR);
- Page page = webClient.getPage(uri);
- assertNotNull(page);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
- }
-
- /**
- * Test controls rendering
- *
- * @throws Exception
- */
- public void testRenderControls() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- List<HtmlElement> images = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.IMG_ELEMENT);
- assertNotNull(images);
-
- int generatedCount = 0;
- for (Iterator<HtmlElement> it = images.iterator(); it.hasNext(); ) {
- HtmlElement img = it.next();
- assertNotNull(img);
-
- String uri = "http:" + img.getAttributeValue(HTML.src_ATTRIBUTE);
- Page page = webClient.getPage(uri);
- assertNotNull(page);
- assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
-
- if (uri.contains("spacer.gif")) {
- continue;
- }
- generatedCount++;
-
- HtmlElement element = (HtmlElement) img.getParentDomNode();
- assertNotNull(element);
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
- String clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue("rich-ordering-list-button-content".equals(clazz));
-
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
- if (HTML.a_ELEMENT.equalsIgnoreCase(element.getNodeName())) {
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
- }
-
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
-
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
-
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
- clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-ordering-control-"));
-
- element = (HtmlElement) element.getParentDomNode();
- assertNotNull(element);
- assertEquals(HTML.DIV_ELEM, element.getNodeName());
- clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-ordering-list-button-layout"));
- }
- assertEquals(8, generatedCount);
- }
-
- /**
- * Test items rendering
- *
- * @throws Exception
- */
- public void testRenderItems() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- HtmlElement div = view.getHtmlElementById(orderingList.getClientId(facesContext) + "contentBox");
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getNodeName());
-
- HtmlElement table = (HtmlElement)div.getFirstDomChild();
- assertNotNull(table);
- assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
-
- HtmlElement tbody = (HtmlElement)table.getFirstDomChild();
- assertNotNull(tbody);
- assertEquals(HTML.TBOBY_ELEMENT, tbody.getNodeName());
-
- int rowsCount = 0;
- for (Iterator<HtmlElement> it = tbody.getChildIterator(); it.hasNext(); ) {
- HtmlElement tr = it.next();
- assertNotNull(tr);
- assertEquals(HTML.TR_ELEMENT, tr.getNodeName());
-
- String clazz = tr.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz);
- assertTrue(clazz.contains("rich-ordering-list-row"));
-
- int cellsCount = 0;
- for (Iterator<HtmlElement> it2 = tr.getChildIterator(); it2.hasNext(); ) {
- HtmlElement td = it2.next();
- assertNotNull(td);
- assertEquals(HTML.td_ELEM, td.getNodeName());
-
- String clazz2 = td.getAttributeValue(HTML.class_ATTRIBUTE);
- assertNotNull(clazz2);
- assertTrue(clazz2.contains("rich-ordering-list-cell"));
-
- cellsCount++;
- }
- assertEquals(2, cellsCount);
-
- rowsCount++;
- }
- assertEquals(items.size(), rowsCount);
- }
-
- /**
- * Test common rendering
- *
- * @throws Exception
- */
- public void testRender() throws Exception {
- HtmlPage view = renderView();
- assertNotNull(view);
-
- HtmlElement div = view.getHtmlElementById(orderingList.getClientId(facesContext));
- assertNotNull(div);
- assertEquals(HTML.DIV_ELEM, div.getNodeName());
-
- HtmlElement hidden1 = view.getHtmlElementById(orderingList.getClientId(facesContext) + "focusKeeper");
- assertNotNull(hidden1);
- assertEquals(HTML.INPUT_ELEM, hidden1.getNodeName());
- assertEquals(HTML.BUTTON, hidden1.getAttributeValue(HTML.TYPE_ATTR));
- hidden1.getAttributeValue(HTML.style_ATTRIBUTE).contains("left: -32767px");
-
- List<HtmlElement> hiddens = view.getDocumentHtmlElement()
- .getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.NAME_ATTRIBUTE, orderingList.getClientId(facesContext));
- assertNotNull(hiddens);
- assertEquals(ROWS_COUNT, hiddens.size());
- for (Iterator<HtmlElement> it = hiddens.iterator(); it.hasNext(); ) {
- HtmlElement hidden2 = it.next();
- assertEquals(HTML.INPUT_ELEM, hidden2.getNodeName());
- assertEquals(HTML.INPUT_TYPE_HIDDEN, hidden2.getAttributeValue(HTML.TYPE_ATTR));
- }
- }
-
- protected class SimpleItem {
- String name;
- int salary;
-
- public SimpleItem(String name, int salary) {
- this.name = name;
- this.salary = salary;
- }
-
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getSalary() {
- return salary;
- }
- public void setSalary(int salary) {
- this.salary = salary;
- }
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.image.ImageInfo;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIOrderingList;
+
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListRenderingTest extends AbstractAjax4JsfTestCase {
+ private static Set<String> javaScripts = new HashSet<String>();
+ private static Set<String> imageClasses = new HashSet<String>();
+ private static Set<String> imagePNGClasses = new HashSet<String>();
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("scripts/utils.js");
+ javaScripts.add("scripts/ShuttleUtils.js");
+ javaScripts.add("scripts/SelectItem.js");
+ javaScripts.add("scripts/LayoutManager.js");
+ javaScripts.add("scripts/Control.js");
+ javaScripts.add("scripts/OrderingList.js");
+ javaScripts.add("scripts/ListBase.js");
+
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUp");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTop");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottom");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconUpDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDownDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconTopDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled");
+ imageClasses.add("org.richfaces.renderkit.html.images.OrderingListIconDown");
+
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient");
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient");
+ imagePNGClasses.add("org.richfaces.renderkit.html.gradientimages.OrderingListButtonGradient");
+
+ }
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public OrderingListRenderingTest( String testName )
+ {
+ super( testName );
+ }
+
+ private final static int ROWS_COUNT = 3;
+
+ private UIForm form = null;
+ private UIOrderingList orderingList = null;
+ private List<SimpleItem> items = null;
+ private HtmlOutputText output1 = null;
+ private HtmlOutputText output2 = null;
+ private UIColumn column1 = null;
+ private UIColumn column2 = null;
+ private HtmlOutputText caption = null;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent("org.richfaces.OrderingList", "org.richfaces.component.html.HtmlOrderingList");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ orderingList = (UIOrderingList)application.createComponent("org.richfaces.OrderingList");
+ orderingList.setId("orderingList");
+ orderingList.setControlsType("link");
+ orderingList.setVar("item");
+
+ caption = new HtmlOutputText();
+ caption.setValue("caption");
+ orderingList.getFacets().put("caption", caption);
+
+ items = new ArrayList<SimpleItem>();
+ items.add(new SimpleItem("Michael", 2000));
+ items.add(new SimpleItem("John", 500));
+ items.add(new SimpleItem("George", 4000));
+
+ orderingList.setValue(items);
+
+ output1 = new HtmlOutputText();
+ output1.setValueBinding("value", application.createValueBinding("#{item.name}"));
+ column1 = new UIColumn();
+ column1.getChildren().add(output1);
+ orderingList.getChildren().add(column1);
+
+ output2 = new HtmlOutputText();
+ output2.setValueBinding("value", application.createValueBinding("#{item.salary}"));
+ column2 = new UIColumn();
+ column2.getChildren().add(output2);
+ orderingList.getChildren().add(column2);
+
+ form.getChildren().add(orderingList);
+ }
+
+ public void tearDown() throws Exception {
+ items = null;
+ output1 = null;
+ output2 = null;
+ column1 = null;
+ column2 = null;
+ orderingList = null;
+ form = null;
+
+ super.tearDown();
+ }
+
+ /**
+ * Test script rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List<HtmlScript> scripts = page.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.SCRIPT_ELEM);
+ int foundCount = 0;
+ for (Iterator<HtmlScript> it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator<String> srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ foundCount++;
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+ assertEquals(foundCount, javaScripts.size());
+ }
+
+ /**
+ * Test default images rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderImages() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ for (Iterator<String> it = imageClasses.iterator(); it.hasNext(); ) {
+ String clazz = it.next();
+ ImageInfo info = getImageResource(clazz);
+ assertNotNull(info);
+ assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ assertTrue(info.getHeight() > 0);
+ assertTrue(info.getWidth() > 0);
+ }
+
+ for (Iterator<String> it = imagePNGClasses.iterator(); it.hasNext(); ) {
+ String clazz = it.next();
+ ImageInfo info = getImageResource(clazz);
+ assertNotNull(info);
+ assertEquals(ImageInfo.FORMAT_PNG, info.getFormat());
+ assertTrue(info.getHeight() > 0);
+ assertTrue(info.getWidth() > 0);
+ }
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+ List<HtmlElement> links = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.LINK_ELEMENT);
+ assertNotNull(links);
+ assertEquals(1, links.size());
+ HtmlElement link = links.get(0);
+ assertTrue(link.getAttributeValue(HTML.HREF_ATTR).contains("css/orderingList.xcss"));
+
+ String uri = "http:" + link.getAttributeValue(HTML.HREF_ATTR);
+ Page page = webClient.getPage(uri);
+ assertNotNull(page);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ }
+
+ /**
+ * Test controls rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderControls() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ List<HtmlElement> images = view.getDocumentHtmlElement().getHtmlElementsByTagName(HTML.IMG_ELEMENT);
+ assertNotNull(images);
+
+ int generatedCount = 0;
+ for (Iterator<HtmlElement> it = images.iterator(); it.hasNext(); ) {
+ HtmlElement img = it.next();
+ assertNotNull(img);
+
+ String uri = "http:" + img.getAttributeValue(HTML.src_ATTRIBUTE);
+ Page page = webClient.getPage(uri);
+ assertNotNull(page);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+
+ if (uri.contains("spacer.gif")) {
+ continue;
+ }
+ generatedCount++;
+
+ HtmlElement element = (HtmlElement) img.getParentDomNode();
+ assertNotNull(element);
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+ String clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue("rich-ordering-list-button-content".equals(clazz));
+
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+ if (HTML.a_ELEMENT.equalsIgnoreCase(element.getNodeName())) {
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+ }
+
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+ clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-ordering-control-"));
+
+ element = (HtmlElement) element.getParentDomNode();
+ assertNotNull(element);
+ assertEquals(HTML.DIV_ELEM, element.getNodeName());
+ clazz = element.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-ordering-list-button-layout"));
+ }
+ assertEquals(8, generatedCount);
+ }
+
+ /**
+ * Test items rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderItems() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ HtmlElement div = view.getHtmlElementById(orderingList.getClientId(facesContext) + "contentBox");
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getNodeName());
+
+ HtmlElement table = (HtmlElement)div.getFirstDomChild();
+ assertNotNull(table);
+ assertEquals(HTML.TABLE_ELEMENT, table.getNodeName());
+
+ HtmlElement tbody = (HtmlElement)table.getFirstDomChild();
+ assertNotNull(tbody);
+ assertEquals(HTML.TBOBY_ELEMENT, tbody.getNodeName());
+
+ int rowsCount = 0;
+ for (Iterator<HtmlElement> it = tbody.getChildIterator(); it.hasNext(); ) {
+ HtmlElement tr = it.next();
+ assertNotNull(tr);
+ assertEquals(HTML.TR_ELEMENT, tr.getNodeName());
+
+ String clazz = tr.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz);
+ assertTrue(clazz.contains("rich-ordering-list-row"));
+
+ int cellsCount = 0;
+ for (Iterator<HtmlElement> it2 = tr.getChildIterator(); it2.hasNext(); ) {
+ HtmlElement td = it2.next();
+ assertNotNull(td);
+ assertEquals(HTML.td_ELEM, td.getNodeName());
+
+ String clazz2 = td.getAttributeValue(HTML.class_ATTRIBUTE);
+ assertNotNull(clazz2);
+ assertTrue(clazz2.contains("rich-ordering-list-cell"));
+
+ cellsCount++;
+ }
+ assertEquals(2, cellsCount);
+
+ rowsCount++;
+ }
+ assertEquals(items.size(), rowsCount);
+ }
+
+ /**
+ * Test common rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ HtmlElement div = view.getHtmlElementById(orderingList.getClientId(facesContext));
+ assertNotNull(div);
+ assertEquals(HTML.DIV_ELEM, div.getNodeName());
+
+ HtmlElement hidden1 = view.getHtmlElementById(orderingList.getClientId(facesContext) + "focusKeeper");
+ assertNotNull(hidden1);
+ assertEquals(HTML.INPUT_ELEM, hidden1.getNodeName());
+ assertEquals(HTML.BUTTON, hidden1.getAttributeValue(HTML.TYPE_ATTR));
+ hidden1.getAttributeValue(HTML.style_ATTRIBUTE).contains("left: -32767px");
+
+ List<HtmlElement> hiddens = view.getDocumentHtmlElement()
+ .getHtmlElementsByAttribute(HTML.INPUT_ELEM, HTML.NAME_ATTRIBUTE, orderingList.getClientId(facesContext));
+ assertNotNull(hiddens);
+ assertEquals(ROWS_COUNT, hiddens.size());
+ for (Iterator<HtmlElement> it = hiddens.iterator(); it.hasNext(); ) {
+ HtmlElement hidden2 = it.next();
+ assertEquals(HTML.INPUT_ELEM, hidden2.getNodeName());
+ assertEquals(HTML.INPUT_TYPE_HIDDEN, hidden2.getAttributeValue(HTML.TYPE_ATTR));
+ }
+ }
+
+ protected class SimpleItem {
+ String name;
+ int salary;
+
+ public SimpleItem(String name, int salary) {
+ this.name = name;
+ this.salary = salary;
+ }
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public int getSalary() {
+ return salary;
+ }
+ public void setSalary(int salary) {
+ this.salary = salary;
+ }
+ }
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuItem.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,62 +1,62 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import org.ajax4jsf.component.AjaxActionComponent;
-
-public abstract class UIPanelMenuItem extends AjaxActionComponent {
-
- public static final String COMPONENT_TYPE = "org.richfaces.panelMenuItem";
-
- public abstract String getMode();
- public abstract void setMode(String mode);
- public abstract String getIcon();
- public abstract void setIcon(String icon);
- public abstract String getIconDisabled();
- public abstract void setIconDisabled(String iconDisabled);
- public abstract boolean isDisabled();
- public abstract void setDisabled(boolean disabled);
- public abstract Object getLabel();
- public abstract void setLabel(Object label);
- public abstract String getHoverClass();
- public abstract void setHoverClass(String hoverClass);
- public abstract String getHoverStyle();
- public abstract void setHoverStyle(String hoverStyle);
- public abstract String getDisabledClass();
- public abstract void setDisabledClass(String disabledClass);
- public abstract String getDisabledStyle();
- public abstract void setDisabledStyle(String disabledStyle);
- public abstract String getStyleClass();
- public abstract void setStyleClass(String styleClass);
- public abstract String getStyle();
- public abstract void setStyle(String style);
- public abstract String getIconClass();
- public abstract void setIconClass(String iconClass);
- public abstract String getIconStyle();
- public abstract void setIconStyle(String iconStyle);
- public abstract String getTarget();
- public abstract void setTarget(String target);
-
- public abstract void setName(String string);
- public abstract String getName();
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import org.ajax4jsf.component.AjaxActionComponent;
+
+public abstract class UIPanelMenuItem extends AjaxActionComponent {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.panelMenuItem";
+
+ public abstract String getMode();
+ public abstract void setMode(String mode);
+ public abstract String getIcon();
+ public abstract void setIcon(String icon);
+ public abstract String getIconDisabled();
+ public abstract void setIconDisabled(String iconDisabled);
+ public abstract boolean isDisabled();
+ public abstract void setDisabled(boolean disabled);
+ public abstract Object getLabel();
+ public abstract void setLabel(Object label);
+ public abstract String getHoverClass();
+ public abstract void setHoverClass(String hoverClass);
+ public abstract String getHoverStyle();
+ public abstract void setHoverStyle(String hoverStyle);
+ public abstract String getDisabledClass();
+ public abstract void setDisabledClass(String disabledClass);
+ public abstract String getDisabledStyle();
+ public abstract void setDisabledStyle(String disabledStyle);
+ public abstract String getStyleClass();
+ public abstract void setStyleClass(String styleClass);
+ public abstract String getStyle();
+ public abstract void setStyle(String style);
+ public abstract String getIconClass();
+ public abstract void setIconClass(String iconClass);
+ public abstract String getIconStyle();
+ public abstract void setIconStyle(String iconStyle);
+ public abstract String getTarget();
+ public abstract void setTarget(String target);
+
+ public abstract void setName(String string);
+ public abstract String getName();
+
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevron.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -39,4 +39,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronDown.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -38,4 +38,4 @@
path.closePath();
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronLeft.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronLeft.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronLeft.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,38 +1,38 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.geom.GeneralPath;
-
-public class PanelMenuIconChevronLeft extends PanelMenuIconChevronBasic {
-
- void draw(GeneralPath path) {
- path.moveTo(61,1);
- path.lineTo(45,1);
- path.lineTo(15,31);
- path.lineTo(45,61);
- path.lineTo(61,61);
- path.lineTo(30,31);
- path.closePath();
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.geom.GeneralPath;
+
+public class PanelMenuIconChevronLeft extends PanelMenuIconChevronBasic {
+
+ void draw(GeneralPath path) {
+ path.moveTo(61,1);
+ path.lineTo(45,1);
+ path.lineTo(15,31);
+ path.lineTo(45,61);
+ path.lineTo(61,61);
+ path.lineTo(30,31);
+ path.closePath();
+ }
+
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconChevronUp.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -39,4 +39,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconDisc.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -48,4 +48,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconGrid.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -64,4 +64,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconSpacer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -32,4 +32,4 @@
protected void paintImage(ResourceContext context, Graphics2D g2d, Color color) {
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangle.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -38,4 +38,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleLeft.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleLeft.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/iconimages/PanelMenuIconTriangleLeft.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,38 +1,38 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Graphics2D;
-import java.awt.geom.GeneralPath;
-
-public class PanelMenuIconTriangleLeft extends PanelMenuIconTriangleBasic {
-
- void draw(GeneralPath path, Graphics2D g2d) {
- g2d.translate(47,30);
- path.moveTo(33,0);
- path.lineTo(0,33);
- path.lineTo(0,34);
- path.lineTo(33,67);
- path.closePath();
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Graphics2D;
+import java.awt.geom.GeneralPath;
+
+public class PanelMenuIconTriangleLeft extends PanelMenuIconTriangleBasic {
+
+ void draw(GeneralPath path, Graphics2D g2d) {
+ g2d.translate(47,30);
+ path.moveTo(33,0);
+ path.lineTo(0,33);
+ path.lineTo(0,34);
+ path.lineTo(33,67);
+ path.closePath();
+ }
+
+}
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http:/jsf.exadel.com/template"
- xmlns:h=" http://ajax4jsf.org/cdk/headers"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.HtmlPanelMenuRenderer"
- baseclass="org.richfaces.renderkit.html.PanelMenuRenderer"
- component="org.richfaces.component.UIPanelMenu" >
-
- <h:styles>
- /org/richfaces/renderkit/html/css/panelMenu.xcss
- </h:styles>
- <h:scripts>
- new org.ajax4jsf.javascript.PrototypeScript(),
- new org.ajax4jsf.javascript.AjaxScript(),
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlPanelMenuRenderer"
+ baseclass="org.richfaces.renderkit.html.PanelMenuRenderer"
+ component="org.richfaces.component.UIPanelMenu" >
+
+ <h:styles>
+ /org/richfaces/renderkit/html/css/panelMenu.xcss
+ </h:styles>
+ <h:scripts>
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.AjaxScript(),
/org/richfaces/renderkit/html/scripts/utils.js,
/org/ajax4jsf/javascript/scripts/form.js,
- /org/richfaces/renderkit/html/scripts/form.js
- /org/richfaces/renderkit/html/scripts/panelMenu.js,
- </h:scripts>
-
+ /org/richfaces/renderkit/html/scripts/form.js
+ /org/richfaces/renderkit/html/scripts/panelMenu.js,
+ </h:scripts>
+
<f:clientid var="clientId"/>
<jsp:scriptlet>
@@ -35,23 +35,23 @@
variables.setVariable("style", style);
]]>
</jsp:scriptlet>
-
-
- <f:call name="utils.encodeBeginFormIfNessesary"/>
- <div style="width:#{component.width}; #{style}" class="rich-pmenu #{component.styleClass}"
- id="#{clientId}"
- onclick="#{component.onclick}"
- ondblclick="#{component.ondblclick}"
- onmousemove="#{component.onmousemove}"
- onmouseout="#{component.onmouseout}"
- onmouseover="#{component.onmouseover}" >
- <input type="hidden" id="#{clientId}selectedItemName" name="#{clientId}selectedItemName" value="" />
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- <div style="display:none">
- <f:call name="insertScript"/>
- </div>
- </div>
- <f:call name="utils.encodeEndFormIfNessesary"/>
+
+
+ <f:call name="utils.encodeBeginFormIfNessesary"/>
+ <div style="width:#{component.width}; #{style}" class="rich-pmenu #{component.styleClass}"
+ id="#{clientId}"
+ onclick="#{component.onclick}"
+ ondblclick="#{component.ondblclick}"
+ onmousemove="#{component.onmousemove}"
+ onmouseout="#{component.onmouseout}"
+ onmouseover="#{component.onmouseover}" >
+ <input type="hidden" id="#{clientId}selectedItemName" name="#{clientId}selectedItemName" value="" />
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ <div style="display:none">
+ <f:call name="insertScript"/>
+ </div>
+ </div>
+ <f:call name="utils.encodeEndFormIfNessesary"/>
</f:root>
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.HtmlPanelMenuGroupRenderer"
- baseclass="org.richfaces.renderkit.html.PanelMenuGroupRenderer"
- component="org.richfaces.component.UIPanelMenuGroup"
- >
-
- <f:clientid var="clientId"/>
-
- <div id="#{clientId}" style="#{this:getHideStyle(context, component)}"
- class="#{this:getDivClass(context, component)}" >
- <jsp:scriptlet>
- <![CDATA[
- String isNodeOpened = isOpened(context, component) ? "opened" : "closed";
- ]]>
- </jsp:scriptlet>
- <table cellspacing="0" cellpadding="0" border="0"
- id="tablehide#{clientId}"
- class="#{this:getTableClass(context, component)} rich-pmenu-group #{this:getFullStyleClass( context, component )} "
- style="#{this:getFullStyle( context, component )}" >
-
- <f:call name="utils.encodePassThru" />
-
- <tbody>
- <tr id="row_#{clientId}"
- class="#{this:getSelectedClass( context, component )}" >
- <td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
- <f:call name="insertSpacerImages" />
- <f:call name="insertImage">
- <f:parameter value="left" />
- </f:call>
- </td>
- <td style="width:100%" id="icon#{clientId}" class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}" >
- <input type="hidden" name="panelMenuState#{clientId}"
- value="#{isNodeOpened}" />
-
- <input type="hidden" name="panelMenuAction#{clientId}"
- value="" />
- <f:call name="insertLabel"/>
- </td>
- <td class="#{this:getIconClass( context, component,'right')}">
- <f:call name="insertImage">
- <f:parameter value="right" />
- </f:call>
- </td>
- </tr>
- </tbody>
- </table>
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- </div>
-</f:root>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlPanelMenuGroupRenderer"
+ baseclass="org.richfaces.renderkit.html.PanelMenuGroupRenderer"
+ component="org.richfaces.component.UIPanelMenuGroup"
+ >
+
+ <f:clientid var="clientId"/>
+
+ <div id="#{clientId}" style="#{this:getHideStyle(context, component)}"
+ class="#{this:getDivClass(context, component)}" >
+ <jsp:scriptlet>
+ <![CDATA[
+ String isNodeOpened = isOpened(context, component) ? "opened" : "closed";
+ ]]>
+ </jsp:scriptlet>
+ <table cellspacing="0" cellpadding="0" border="0"
+ id="tablehide#{clientId}"
+ class="#{this:getTableClass(context, component)} rich-pmenu-group #{this:getFullStyleClass( context, component )} "
+ style="#{this:getFullStyle( context, component )}" >
+
+ <f:call name="utils.encodePassThru" />
+
+ <tbody>
+ <tr id="row_#{clientId}"
+ class="#{this:getSelectedClass( context, component )}" >
+ <td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
+ <f:call name="insertSpacerImages" />
+ <f:call name="insertImage">
+ <f:parameter value="left" />
+ </f:call>
+ </td>
+ <td style="width:100%" id="icon#{clientId}" class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}" >
+ <input type="hidden" name="panelMenuState#{clientId}"
+ value="#{isNodeOpened}" />
+
+ <input type="hidden" name="panelMenuAction#{clientId}"
+ value="" />
+ <f:call name="insertLabel"/>
+ </td>
+ <td class="#{this:getIconClass( context, component,'right')}">
+ <f:call name="insertImage">
+ <f:parameter value="right" />
+ </f:call>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </div>
+</f:root>
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.HtmlPanelMenuItemRenderer"
- baseclass="org.richfaces.renderkit.html.PanelMenuItemRenderer"
- component="org.richfaces.component.UIPanelMenuItem"
- >
-
- <f:clientid var="clientId"/>
-
- <div id="#{clientId}" style="#{this:getHideStyle(context, component)}" >
- <table cellspacing="0" cellpadding="0" border="0"
- id="tablehide#{clientId}"
- class="dr-pmenu-item rich-pmenu-item #{this:getFullStyleClass( context, component )} "
- style="#{this:getFullStyle( context, component )}" >
-
- <f:call name="utils.encodeAttributes">
- <f:parameter value="onclick,onmousedown,onmouseup,onmousemove" />
- </f:call>
-
- <tbody>
- <tr id="row_#{clientId}"
- class="#{this:getSelectedClass( context, component )}" >
- <td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
- <f:call name="insertSpacerImages" />
- <f:call name="insertImage">
- <f:parameter value="left" />
- </f:call>
- </td>
- <td style="width:100%" id="icon#{clientId}" class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}" >
- <input type="hidden" name="panelMenuAction#{clientId}" value=""/>
- <f:call name="insertLabel"/>
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- </td>
- <td class="#{this:getIconClass( context, component,'right')}">
- <f:call name="insertImage">
- <f:parameter value="right" />
- </f:call>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
-</f:root>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp=" http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlPanelMenuItemRenderer"
+ baseclass="org.richfaces.renderkit.html.PanelMenuItemRenderer"
+ component="org.richfaces.component.UIPanelMenuItem"
+ >
+
+ <f:clientid var="clientId"/>
+
+ <div id="#{clientId}" style="#{this:getHideStyle(context, component)}" >
+ <table cellspacing="0" cellpadding="0" border="0"
+ id="tablehide#{clientId}"
+ class="dr-pmenu-item rich-pmenu-item #{this:getFullStyleClass( context, component )} "
+ style="#{this:getFullStyle( context, component )}" >
+
+ <f:call name="utils.encodeAttributes">
+ <f:parameter value="onclick,onmousedown,onmouseup,onmousemove" />
+ </f:call>
+
+ <tbody>
+ <tr id="row_#{clientId}"
+ class="#{this:getSelectedClass( context, component )}" >
+ <td class="dr-pmenu-nowrap #{this:getIconClass( context, component,'left')}">
+ <f:call name="insertSpacerImages" />
+ <f:call name="insertImage">
+ <f:parameter value="left" />
+ </f:call>
+ </td>
+ <td style="width:100%" id="icon#{clientId}" class="dr-pmenu-group-self-label #{this:getLabelClass( context, component )}" >
+ <input type="hidden" name="panelMenuAction#{clientId}" value=""/>
+ <f:call name="insertLabel"/>
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </td>
+ <td class="#{this:getIconClass( context, component,'right')}">
+ <f:call name="insertImage">
+ <f:parameter value="right" />
+ </f:call>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</f:root>
Modified: trunk/ui/pickList/src/main/templates/htmlPickList.jspx
===================================================================
--- trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/pickList/src/main/templates/htmlPickList.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -29,10 +29,10 @@
</h:scripts>
<f:clientId var="clientId"/>
-
- <table id="#{clientId}" class="rich-list-picklist #{component.attributes['styleClass']}"
+
+ <table id="#{clientId}" class="rich-list-picklist #{component.attributes['styleClass']}"
cellspacing="0" cellpadding="0"
- x:passThruWithExclusions="id, class, styleClass">
+ x:passThruWithExclusions="id, class, styleClass">
<tbody>
<vcp:body>
<f:clientId var="clientId"/>
@@ -49,7 +49,7 @@
Boolean switchByClick = (Boolean) component.getAttributes().get("switchByClick");
variables.setVariable("switchByClick", switchByClick);
-
+
variables.setVariable("baseClientId", component.getBaseClientId(context));
]]>
</jsp:scriptlet>
@@ -171,4 +171,4 @@
"#{clientId}valueKeeper");
</script>
</span>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx
===================================================================
--- trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/progressBAR/src/main/templates/org/richfaces/progressBar.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -53,4 +53,4 @@
}
]]>
</jsp:scriptlet>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java
===================================================================
--- trunk/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/progressBAR/src/test/java/org/richfaces/sandbox/ProgressBarComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,144 +1,144 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.sandbox;
-
-import javax.faces.component.UIForm;
-import javax.faces.component.UIOutput;
-import javax.faces.component.html.HtmlForm;
-
-import org.ajax4jsf.event.AjaxEvent;
-import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
-import org.richfaces.component.UIProgressBar;
-
-import com.gargoylesoftware.htmlunit.html.DomText;
-import com.gargoylesoftware.htmlunit.html.HtmlElement;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.sun.org.apache.bcel.internal.generic.NEW;
-
-/**
- * Unit test for Progress bar component.
- */
-public class ProgressBarComponentTest extends AbstractAjax4JsfTestCase {
-
- /** Form component */
- private UIForm form = null;
-
- /** Progress bar component */
- private UIProgressBar progressBar = null;
-
- /** Child component for progres bar */
- private UIOutput output = null;
-
- /**
- * TODO Description goes here.
- *
- * @param name
- */
- public ProgressBarComponentTest(String name) {
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
- */
- @Override
- public void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- progressBar = (UIProgressBar) application
- .createComponent("org.richfaces.ProgressBar");
- progressBar.setId("prgs");
- progressBar.setValue(50);
- progressBar.setInterval(1000);
-
-// MockValueExpression expression = new MockValueExpression("50%");
-// ValueExpression exp = application.getExpressionFactory()
-// .createValueExpression(facesContext.getELContext(), "#{persent}", Object.class);
- output = (UIOutput)application.createComponent("javax.faces.Output");
- output.setValue("{value}%");
-// output.setValueExpression("value", expression);
-
- progressBar.getChildren().add(output);
-
- form.getChildren().add(progressBar);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
- */
- @Override
- public void tearDown() throws Exception {
- // TODO Auto-generated method stub
- super.tearDown();
- }
-
- /**
- * Method tests progress bar component
- * @throws Exception
- */
- public void testProgressBar() throws Exception {
- HtmlPage page = renderView();
- assertNotNull(page);
-
- String clientId = progressBar.getClientId(facesContext);
-
- HtmlElement progress = page.getHtmlElementById(clientId);
- assertNotNull(progress);
- assertEquals("div", progress.getNodeName());
-
- String classAttr = progress.getAttributeValue("class");
- assertTrue(classAttr.contains("rich-progress-bar"));
-
- HtmlElement node = (HtmlElement)progress.getHtmlElementById(clientId + ":remain");
- assertTrue(node.getAttributeValue("class").indexOf("rich-progress-bar-remained") != -1);
-
- node = (HtmlElement) progress.getLastChild();
- assertTrue("span".equalsIgnoreCase(node.getTagName()));
-
- node = (HtmlElement) node.getLastChild();
- assertTrue("script".equalsIgnoreCase(node.getTagName()));
-
- DomText text = (DomText) node.getFirstChild();
- assertTrue(text.getData().contains("$('" + clientId + "').component"));
- assertTrue(text.getData().contains("renderLabel"));
-
- assertEquals(1L, progressBar.getNumber(1));
- assertEquals(new Double(1), progressBar.getNumber("1"));
- assertEquals(0, progressBar.getNumber(null));
-
- facesContext.getExternalContext().getRequestParameterMap().put("percent", "100");
- facesContext.getExternalContext().getRequestParameterMap().put(progressBar.getClientId(facesContext), progressBar.getClientId(facesContext));
-
- progressBar.broadcast(new AjaxEvent(progressBar));
-
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.sandbox;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.html.HtmlForm;
+
+import org.ajax4jsf.event.AjaxEvent;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.richfaces.component.UIProgressBar;
+
+import com.gargoylesoftware.htmlunit.html.DomText;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.sun.org.apache.bcel.internal.generic.NEW;
+
+/**
+ * Unit test for Progress bar component.
+ */
+public class ProgressBarComponentTest extends AbstractAjax4JsfTestCase {
+
+ /** Form component */
+ private UIForm form = null;
+
+ /** Progress bar component */
+ private UIProgressBar progressBar = null;
+
+ /** Child component for progres bar */
+ private UIOutput output = null;
+
+ /**
+ * TODO Description goes here.
+ *
+ * @param name
+ */
+ public ProgressBarComponentTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
+ */
+ @Override
+ public void setUp() throws Exception {
+ // TODO Auto-generated method stub
+ super.setUp();
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ progressBar = (UIProgressBar) application
+ .createComponent("org.richfaces.ProgressBar");
+ progressBar.setId("prgs");
+ progressBar.setValue(50);
+ progressBar.setInterval(1000);
+
+// MockValueExpression expression = new MockValueExpression("50%");
+// ValueExpression exp = application.getExpressionFactory()
+// .createValueExpression(facesContext.getELContext(), "#{persent}", Object.class);
+ output = (UIOutput)application.createComponent("javax.faces.Output");
+ output.setValue("{value}%");
+// output.setValueExpression("value", expression);
+
+ progressBar.getChildren().add(output);
+
+ form.getChildren().add(progressBar);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#tearDown()
+ */
+ @Override
+ public void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ }
+
+ /**
+ * Method tests progress bar component
+ * @throws Exception
+ */
+ public void testProgressBar() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+
+ String clientId = progressBar.getClientId(facesContext);
+
+ HtmlElement progress = page.getHtmlElementById(clientId);
+ assertNotNull(progress);
+ assertEquals("div", progress.getNodeName());
+
+ String classAttr = progress.getAttributeValue("class");
+ assertTrue(classAttr.contains("rich-progress-bar"));
+
+ HtmlElement node = (HtmlElement)progress.getHtmlElementById(clientId + ":remain");
+ assertTrue(node.getAttributeValue("class").indexOf("rich-progress-bar-remained") != -1);
+
+ node = (HtmlElement) progress.getLastChild();
+ assertTrue("span".equalsIgnoreCase(node.getTagName()));
+
+ node = (HtmlElement) node.getLastChild();
+ assertTrue("script".equalsIgnoreCase(node.getTagName()));
+
+ DomText text = (DomText) node.getFirstChild();
+ assertTrue(text.getData().contains("$('" + clientId + "').component"));
+ assertTrue(text.getData().contains("renderLabel"));
+
+ assertEquals(1L, progressBar.getNumber(1));
+ assertEquals(new Double(1), progressBar.getNumber("1"));
+ assertEquals(0, progressBar.getNumber(null));
+
+ facesContext.getExternalContext().getRequestParameterMap().put("percent", "100");
+ facesContext.getExternalContext().getRequestParameterMap().put(progressBar.getClientId(facesContext), progressBar.getClientId(facesContext));
+
+ progressBar.broadcast(new AjaxEvent(progressBar));
+
+ }
+
+}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/AjaxFunctionBuilder.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -66,4 +66,4 @@
return functionDefinition;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -95,4 +95,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconSplit.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconSplit.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/iconimages/ScrollableDataTableIconSplit.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,121 +1,121 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.renderkit.html.iconimages;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.util.Date;
-
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.resource.GifRenderer;
-import org.ajax4jsf.resource.InternetResourceBuilder;
-import org.ajax4jsf.resource.Java2Dresource;
-import org.ajax4jsf.resource.ResourceContext;
-import org.ajax4jsf.util.HtmlColor;
-import org.ajax4jsf.util.Zipper;
-import org.richfaces.skin.Skin;
-import org.richfaces.skin.SkinFactory;
-
-public class ScrollableDataTableIconSplit extends Java2Dresource {
-
- public ScrollableDataTableIconSplit() {
- setRenderer(new GifRenderer());
- setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
- }
-
- public Dimension calculateDimensions() {
- return new Dimension(2, 13);
- }
-
- protected void paint(ResourceContext context, Graphics2D g2d) {
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
- g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
-
- Object [] data = (Object[]) restoreData(context);
- Color col1 = (Color)data[0];
- Color col2 = (Color)data[1];
-
- g2d.setColor(col2);
- g2d.drawLine(0, 0, 0, 12);
- g2d.setColor(col1);
- g2d.drawLine(1, 0, 1, 12);
- }
-
- public Dimension getDimensions(FacesContext facesContext, Object data) {
- return calculateDimensions();
- }
- protected Dimension getDimensions(ResourceContext resourceContext) {
- return calculateDimensions();
- }
-
- protected Object deserializeData(byte[] objectArray) {
- if (objectArray == null) {
- return null;
- }
-
- Object [] stored = new Object[2];
- stored[0] = new Color(Zipper.unzip(objectArray, 0));
- stored[1] = new Color(Zipper.unzip(objectArray, 3));
-
- return stored;
- }
-
- protected Object getDataToStore(FacesContext context, Object data) {
- Skin skin = SkinFactory.getInstance().getSkin(context);
- Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
-
- Color col = null;
-
- String skinParameter = "headerTextColor";
- String headerTextColor = (String) skin.getParameter(context, skinParameter);
- if (null == headerTextColor || "".equals(headerTextColor))
- headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
-
- if (headerTextColor == null) {
- return null;
- }
-
- col = HtmlColor.decode(headerTextColor);
-
- byte[] ret = new byte[6];
- Zipper.zip(ret, col.getRGB(), 0);
-
- skinParameter = "headerBackgroundColor";
- String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
- if (null == headerBackgroundColor || "".equals(headerBackgroundColor))
- headerBackgroundColor = (String) defaultSkin.getParameter(context, skinParameter);
-
- if (headerBackgroundColor == null) {
- return null;
- }
-
- col = HtmlColor.decode(headerBackgroundColor);
-
- Zipper.zip(ret, col.getRGB(), 3);
-
- return ret;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.renderkit.html.iconimages;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.util.Date;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.resource.GifRenderer;
+import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.Java2Dresource;
+import org.ajax4jsf.resource.ResourceContext;
+import org.ajax4jsf.util.HtmlColor;
+import org.ajax4jsf.util.Zipper;
+import org.richfaces.skin.Skin;
+import org.richfaces.skin.SkinFactory;
+
+public class ScrollableDataTableIconSplit extends Java2Dresource {
+
+ public ScrollableDataTableIconSplit() {
+ setRenderer(new GifRenderer());
+ setLastModified(new Date(InternetResourceBuilder.getInstance().getStartTime()));
+ }
+
+ public Dimension calculateDimensions() {
+ return new Dimension(2, 13);
+ }
+
+ protected void paint(ResourceContext context, Graphics2D g2d) {
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+ g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
+ g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
+
+ Object [] data = (Object[]) restoreData(context);
+ Color col1 = (Color)data[0];
+ Color col2 = (Color)data[1];
+
+ g2d.setColor(col2);
+ g2d.drawLine(0, 0, 0, 12);
+ g2d.setColor(col1);
+ g2d.drawLine(1, 0, 1, 12);
+ }
+
+ public Dimension getDimensions(FacesContext facesContext, Object data) {
+ return calculateDimensions();
+ }
+ protected Dimension getDimensions(ResourceContext resourceContext) {
+ return calculateDimensions();
+ }
+
+ protected Object deserializeData(byte[] objectArray) {
+ if (objectArray == null) {
+ return null;
+ }
+
+ Object [] stored = new Object[2];
+ stored[0] = new Color(Zipper.unzip(objectArray, 0));
+ stored[1] = new Color(Zipper.unzip(objectArray, 3));
+
+ return stored;
+ }
+
+ protected Object getDataToStore(FacesContext context, Object data) {
+ Skin skin = SkinFactory.getInstance().getSkin(context);
+ Skin defaultSkin = SkinFactory.getInstance().getDefaultSkin(context);
+
+ Color col = null;
+
+ String skinParameter = "headerTextColor";
+ String headerTextColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerTextColor || "".equals(headerTextColor))
+ headerTextColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if (headerTextColor == null) {
+ return null;
+ }
+
+ col = HtmlColor.decode(headerTextColor);
+
+ byte[] ret = new byte[6];
+ Zipper.zip(ret, col.getRGB(), 0);
+
+ skinParameter = "headerBackgroundColor";
+ String headerBackgroundColor = (String) skin.getParameter(context, skinParameter);
+ if (null == headerBackgroundColor || "".equals(headerBackgroundColor))
+ headerBackgroundColor = (String) defaultSkin.getParameter(context, skinParameter);
+
+ if (headerBackgroundColor == null) {
+ return null;
+ }
+
+ col = HtmlColor.decode(headerBackgroundColor);
+
+ Zipper.zip(ret, col.getRGB(), 3);
+
+ return ret;
+ }
+
+}
Modified: trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-cell.jspx
===================================================================
--- trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-cell.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-cell.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -17,4 +17,4 @@
</div>
</td>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx
===================================================================
--- trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-footer-cell.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -17,4 +17,4 @@
</div>
</th>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx
===================================================================
--- trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-cell.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -35,4 +35,4 @@
<span column="#{cell_index}" id="#{client_id}:hsep_#{cell_index}" style="left: #{offset}px;" class="dr-sdt-hsep rich-sdt-hsep" />
</th>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-itself.jspx
===================================================================
--- trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-itself.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table-header-itself.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -27,4 +27,4 @@
</div>
<ajax:update>#{client_id}:hcb_#{cell_index}</ajax:update>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
===================================================================
--- trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -240,4 +240,4 @@
</f:root>
-
\ No newline at end of file
+
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/model/internal/TestObj.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -43,4 +43,4 @@
public String getName() {
return name;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,48 +1,48 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.renderkit.html;
-
-import junit.framework.TestCase;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.renderkit.html;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
Modified: trunk/ui/separator/src/main/templates/separator.jspx
===================================================================
--- trunk/ui/separator/src/main/templates/separator.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/separator/src/main/templates/separator.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -9,7 +9,7 @@
baseclass="org.richfaces.renderkit.html.SeparatorRendererBase"
component="org.richfaces.component.UISeparator"
>
- <f:clientid var="clientId"/>
+ <f:clientid var="clientId"/>
<h:styles>css/separator.xcss</h:styles>
<div id="#{clientId}" style="font-size: 0px;"
x:passThruWithExclusions="id,width,height,style,class,align,styleClass">
Modified: trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java
===================================================================
--- trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/component/UISimpleTogglePanel.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,218 +1,218 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import javax.faces.component.ActionSource;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesEvent;
-
-import org.ajax4jsf.component.AjaxActionComponent;
-import org.ajax4jsf.component.AjaxComponent;
-import org.ajax4jsf.event.AjaxSource;
-import org.richfaces.event.SimpleToggleEvent;
-
-
-/**
- * JSF component class
- */
-public abstract class UISimpleTogglePanel extends AjaxActionComponent implements AjaxComponent, AjaxSource, ActionSource
-//public abstract class UISimpleTogglePanel extends UIInput implements AjaxComponent, AjaxSource, ActionSource
-{
-
- public static final String COMPONENT_FAMILY = "javax.faces.Command";
- public static final String SERVER_SWITCH_TYPE = "server";
- public static final String CLIENT_SWITCH_TYPE = "client";
- public static final String AJAX_SWITCH_TYPE = "ajax";
- public static final boolean COLLAPSED = false;
- public static final boolean EXPANDED = true;
-
-// private transient Boolean openedSet = null;
-
- private transient Boolean wasOpened = null;
-
- protected boolean isWasOpened() {
- if (wasOpened == null) {
- if (CLIENT_SWITCH_TYPE.equals(getSwitchType())) {
- wasOpened = Boolean.TRUE;
- } else {
- wasOpened = isOpened();
- }
- }
-
- return wasOpened;
- }
-
- public abstract void setSwitchType(String switchType);
-
- public abstract String getSwitchType();
-
- public void setOpened(boolean opened) {
- setValue(new Boolean(opened).toString());
- }
-
- public boolean isOpened() {
- Object value = getValue();
- if (value instanceof Boolean) {
- return ((Boolean)value).booleanValue();
- } else if (value instanceof String) {
- String s = (String) value;
- return Boolean.parseBoolean(s);
- }
- return true;
- }
-
- public boolean getRendersChildren() {
- return true;
- }
-
- /**
- * @throws NullPointerException {@inheritDoc}
- */
- public void processDecodes(FacesContext context) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- // Skip processing if our rendered flag is false
- if (!isRendered()) {
- return;
- }
-
- if (isWasOpened()) {
- // Process all facets and children of this component
- Iterator<UIComponent> kids = getFacetsAndChildren();
- while (kids.hasNext()) {
- UIComponent kid = kids.next();
- kid.processDecodes(context);
- }
- }
-
- // Process this component itself
- try {
- decode(context);
- } catch (RuntimeException e) {
- context.renderResponse();
- throw e;
- }
-
- }
- @Override
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- if(event instanceof SimpleToggleEvent) {
- SimpleToggleEvent simpleToggleEvent = (SimpleToggleEvent) event;
- setOpened(simpleToggleEvent.isIsOpen());
- }
- super.broadcast(event);
- }
-
-
- /**
- * @throws NullPointerException {@inheritDoc}
- */
- public void processValidators(FacesContext context) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- // Skip processing if our rendered flag is false
- if (!isRendered()) {
- return;
- }
-
- if (isWasOpened()) {
- // Process all the facets and children of this component
- Iterator<UIComponent> kids = getFacetsAndChildren();
- while (kids.hasNext()) {
- UIComponent kid = kids.next();
- kid.processValidators(context);
- }
- }
- }
-
-
- /**
- * @throws NullPointerException {@inheritDoc}
- */
- public void processUpdates(FacesContext context) {
-
- if (context == null) {
- throw new NullPointerException();
- }
-
- // Skip processing if our rendered flag is false
- if (!isRendered()) {
- return;
- }
-
-// updateModel();
-
- if (isWasOpened()) {
- // Process all facets and children of this component
- Iterator<UIComponent> kids = getFacetsAndChildren();
- while (kids.hasNext()) {
- UIComponent kid = kids.next();
- kid.processUpdates(context);
- }
- }
- }
-
-// private void updateModel () {
-// if (openedSet != null) {
-// setOpened(openedSet);
-// }
-// }
-
-// public boolean isOpenedSet() {
-// return openedSet;
-// }
-
-// /**
-// * @param openedSet the openedSet to set
-// */
-// public void setOpenedSet(boolean openedSet) {
-// this.openedSet = openedSet;
-// }
-
-/*
- * public void setValueBinding(String arg0, ValueBinding arg1) { if
- * ("opened".equals(arg0)) super.setValueBinding("value", arg1);
- * super.setValueBinding(arg0, arg1); }
- *
- * public ValueBinding getValueBinding(String arg0) { if ("opened".equals(arg0))
- * return super.getValueBinding("value"); return super.getValueBinding(arg0); }
- */
- //public void broadcast(FacesEvent facesEvent) throws AbortProcessingException {
- // super.broadcast(facesEvent);
- // FacesContext facesContext = FacesContext.getCurrentInstance();
- // if (AjaxRendererUtils.isAjaxRequest(facesContext) && this.getSwitchType().equals(AJAX_SWITCH_TYPE)) {
- // AjaxRendererUtils.addRegionByName(facesContext,
- // this,
- // this.getId());
- // }
- //}
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+import org.ajax4jsf.component.AjaxActionComponent;
+import org.ajax4jsf.component.AjaxComponent;
+import org.ajax4jsf.event.AjaxSource;
+import org.richfaces.event.SimpleToggleEvent;
+
+
+/**
+ * JSF component class
+ */
+public abstract class UISimpleTogglePanel extends AjaxActionComponent implements AjaxComponent, AjaxSource, ActionSource
+//public abstract class UISimpleTogglePanel extends UIInput implements AjaxComponent, AjaxSource, ActionSource
+{
+
+ public static final String COMPONENT_FAMILY = "javax.faces.Command";
+ public static final String SERVER_SWITCH_TYPE = "server";
+ public static final String CLIENT_SWITCH_TYPE = "client";
+ public static final String AJAX_SWITCH_TYPE = "ajax";
+ public static final boolean COLLAPSED = false;
+ public static final boolean EXPANDED = true;
+
+// private transient Boolean openedSet = null;
+
+ private transient Boolean wasOpened = null;
+
+ protected boolean isWasOpened() {
+ if (wasOpened == null) {
+ if (CLIENT_SWITCH_TYPE.equals(getSwitchType())) {
+ wasOpened = Boolean.TRUE;
+ } else {
+ wasOpened = isOpened();
+ }
+ }
+
+ return wasOpened;
+ }
+
+ public abstract void setSwitchType(String switchType);
+
+ public abstract String getSwitchType();
+
+ public void setOpened(boolean opened) {
+ setValue(new Boolean(opened).toString());
+ }
+
+ public boolean isOpened() {
+ Object value = getValue();
+ if (value instanceof Boolean) {
+ return ((Boolean)value).booleanValue();
+ } else if (value instanceof String) {
+ String s = (String) value;
+ return Boolean.parseBoolean(s);
+ }
+ return true;
+ }
+
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void processDecodes(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+ if (isWasOpened()) {
+ // Process all facets and children of this component
+ Iterator<UIComponent> kids = getFacetsAndChildren();
+ while (kids.hasNext()) {
+ UIComponent kid = kids.next();
+ kid.processDecodes(context);
+ }
+ }
+
+ // Process this component itself
+ try {
+ decode(context);
+ } catch (RuntimeException e) {
+ context.renderResponse();
+ throw e;
+ }
+
+ }
+ @Override
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ if(event instanceof SimpleToggleEvent) {
+ SimpleToggleEvent simpleToggleEvent = (SimpleToggleEvent) event;
+ setOpened(simpleToggleEvent.isIsOpen());
+ }
+ super.broadcast(event);
+ }
+
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void processValidators(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+ if (isWasOpened()) {
+ // Process all the facets and children of this component
+ Iterator<UIComponent> kids = getFacetsAndChildren();
+ while (kids.hasNext()) {
+ UIComponent kid = kids.next();
+ kid.processValidators(context);
+ }
+ }
+ }
+
+
+ /**
+ * @throws NullPointerException {@inheritDoc}
+ */
+ public void processUpdates(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ // Skip processing if our rendered flag is false
+ if (!isRendered()) {
+ return;
+ }
+
+// updateModel();
+
+ if (isWasOpened()) {
+ // Process all facets and children of this component
+ Iterator<UIComponent> kids = getFacetsAndChildren();
+ while (kids.hasNext()) {
+ UIComponent kid = kids.next();
+ kid.processUpdates(context);
+ }
+ }
+ }
+
+// private void updateModel () {
+// if (openedSet != null) {
+// setOpened(openedSet);
+// }
+// }
+
+// public boolean isOpenedSet() {
+// return openedSet;
+// }
+
+// /**
+// * @param openedSet the openedSet to set
+// */
+// public void setOpenedSet(boolean openedSet) {
+// this.openedSet = openedSet;
+// }
+
+/*
+ * public void setValueBinding(String arg0, ValueBinding arg1) { if
+ * ("opened".equals(arg0)) super.setValueBinding("value", arg1);
+ * super.setValueBinding(arg0, arg1); }
+ *
+ * public ValueBinding getValueBinding(String arg0) { if ("opened".equals(arg0))
+ * return super.getValueBinding("value"); return super.getValueBinding(arg0); }
+ */
+ //public void broadcast(FacesEvent facesEvent) throws AbortProcessingException {
+ // super.broadcast(facesEvent);
+ // FacesContext facesContext = FacesContext.getCurrentInstance();
+ // if (AjaxRendererUtils.isAjaxRequest(facesContext) && this.getSwitchType().equals(AJAX_SWITCH_TYPE)) {
+ // AjaxRendererUtils.addRegionByName(facesContext,
+ // this,
+ // this.getId());
+ // }
+ //}
+}
Modified: trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java
===================================================================
--- trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/simpleTogglePanel/src/main/java/org/richfaces/renderkit/html/SimpleTogglePanelRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -222,4 +222,4 @@
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/spacer/src/main/templates/spacer.jspx
===================================================================
--- trunk/ui/spacer/src/main/templates/spacer.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/spacer/src/main/templates/spacer.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -21,4 +21,4 @@
x:passThruWithExclusions="id,width,height,title,styleClass,class"
>
</img>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/state/src/main/java/org/richfaces/el/StateELResolver.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/el/StateELResolver.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/el/StateELResolver.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,239 +1,239 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.el;
-
-import java.beans.FeatureDescriptor;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.FunctionMapper;
-import javax.el.PropertyNotFoundException;
-import javax.el.PropertyNotWritableException;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.ui.model.State;
-
-/**
- * @author asmirnov
- *
- */
-public class StateELResolver extends ELResolver {
-
- private static final class ELContextWrapper extends ELContext {
- private final ELContext context;
-
- private boolean resolved = false;
-
- private ELContextWrapper(ELContext context) {
- this.context = context;
- }
-
- @Override
- public ELResolver getELResolver() {
- return context.getELResolver();
- }
-
- @Override
- public FunctionMapper getFunctionMapper() {
- return context.getFunctionMapper();
- }
-
- @Override
- public VariableMapper getVariableMapper() {
- return context.getVariableMapper();
- }
-
- /**
- * @param key
- * @return
- * @see javax.el.ELContext#getContext(java.lang.Class)
- */
- public Object getContext(Class key) {
- return context.getContext(key);
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getLocale()
- */
- public Locale getLocale() {
- return context.getLocale();
- }
-
- /**
- * @return
- * @see javax.el.ELContext#isPropertyResolved()
- */
- public boolean isPropertyResolved() {
- return resolved;
- }
-
- /**
- * @param key
- * @param contextObject
- * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
- */
- public void putContext(Class key, Object contextObject) {
- context.putContext(key, contextObject);
- }
-
- /**
- * @param locale
- * @see javax.el.ELContext#setLocale(java.util.Locale)
- */
- public void setLocale(Locale locale) {
- context.setLocale(locale);
- }
-
- /**
- * @param resolved
- * @see javax.el.ELContext#setPropertyResolved(boolean)
- */
- public void setPropertyResolved(boolean resolved) {
- this.resolved = resolved;
- }
- }
-
- private static List<FeatureDescriptor> stateFeatureDescriptors;
- static {
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setDisplayName("Page state");
- descriptor.setExpert(false);
- descriptor.setName("state");
- descriptor.setHidden(false);
- stateFeatureDescriptors = Collections.singletonList(descriptor);
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (null != base && base instanceof State) {
- return String.class;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
- Object base) {
- if (null != base && base instanceof State) {
- return stateFeatureDescriptors.iterator();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Class<?> getType(ELContext context, Object base, Object property) {
- if (null != base && base instanceof State) {
- if (property == null) {
- throw new PropertyNotFoundException("Null property");
- }
- State state = (State)base;
- Object stateProperty = state.get(property.toString());
- if (stateProperty == null) {
- throw new PropertyNotFoundException("State Property ["+property+"] not found ");
- }
- context.setPropertyResolved(true);
- if (stateProperty instanceof ValueExpression) {
- ValueExpression propertyExpression = (ValueExpression) stateProperty;
- FacesContext facesContext = FacesContext.getCurrentInstance();
- return propertyExpression.getType(facesContext.getELContext());
- }
- return stateProperty.getClass();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Object getValue(final ELContext context, Object base, Object property) {
- if (null != base && base instanceof State) {
- if (property == null) {
- throw new PropertyNotFoundException("Null property");
- }
- State state = (State)base;
- Object stateProperty = state.get(property.toString());
- if (stateProperty == null) {
- throw new PropertyNotFoundException("State Property ["+property+"] not found ");
- }
- context.setPropertyResolved(true);
- if (stateProperty instanceof ValueExpression) {
- ValueExpression propertyExpression = (ValueExpression) stateProperty;
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext tempContext = new ELContextWrapper(context);
- return propertyExpression.getValue(tempContext);
- }
- return stateProperty;
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- if (null != base && base instanceof State){
- if (property == null) {
- throw new PropertyNotFoundException("Null property");
- }
- State state = (State)base;
- Object stateProperty = state.get(property.toString());
- if (stateProperty == null) {
- throw new PropertyNotFoundException("State Property ["+property+"] not found ");
- }
- context.setPropertyResolved(true);
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property,
- Object value) {
- if (null != base && base instanceof State){
- if (property == null) {
- throw new PropertyNotFoundException("Null property");
- }
- throw new PropertyNotWritableException((String) property);
- }
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.State;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateELResolver extends ELResolver {
+
+ private static final class ELContextWrapper extends ELContext {
+ private final ELContext context;
+
+ private boolean resolved = false;
+
+ private ELContextWrapper(ELContext context) {
+ this.context = context;
+ }
+
+ @Override
+ public ELResolver getELResolver() {
+ return context.getELResolver();
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper() {
+ return context.getFunctionMapper();
+ }
+
+ @Override
+ public VariableMapper getVariableMapper() {
+ return context.getVariableMapper();
+ }
+
+ /**
+ * @param key
+ * @return
+ * @see javax.el.ELContext#getContext(java.lang.Class)
+ */
+ public Object getContext(Class key) {
+ return context.getContext(key);
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getLocale()
+ */
+ public Locale getLocale() {
+ return context.getLocale();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#isPropertyResolved()
+ */
+ public boolean isPropertyResolved() {
+ return resolved;
+ }
+
+ /**
+ * @param key
+ * @param contextObject
+ * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
+ */
+ public void putContext(Class key, Object contextObject) {
+ context.putContext(key, contextObject);
+ }
+
+ /**
+ * @param locale
+ * @see javax.el.ELContext#setLocale(java.util.Locale)
+ */
+ public void setLocale(Locale locale) {
+ context.setLocale(locale);
+ }
+
+ /**
+ * @param resolved
+ * @see javax.el.ELContext#setPropertyResolved(boolean)
+ */
+ public void setPropertyResolved(boolean resolved) {
+ this.resolved = resolved;
+ }
+ }
+
+ private static List<FeatureDescriptor> stateFeatureDescriptors;
+ static {
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setDisplayName("Page state");
+ descriptor.setExpert(false);
+ descriptor.setName("state");
+ descriptor.setHidden(false);
+ stateFeatureDescriptors = Collections.singletonList(descriptor);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (null != base && base instanceof State) {
+ return String.class;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
+ Object base) {
+ if (null != base && base instanceof State) {
+ return stateFeatureDescriptors.iterator();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State) {
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ if (stateProperty instanceof ValueExpression) {
+ ValueExpression propertyExpression = (ValueExpression) stateProperty;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ return propertyExpression.getType(facesContext.getELContext());
+ }
+ return stateProperty.getClass();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Object getValue(final ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State) {
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ if (stateProperty instanceof ValueExpression) {
+ ValueExpression propertyExpression = (ValueExpression) stateProperty;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ELContext tempContext = new ELContextWrapper(context);
+ return propertyExpression.getValue(tempContext);
+ }
+ return stateProperty;
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ if (null != base && base instanceof State){
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ State state = (State)base;
+ Object stateProperty = state.get(property.toString());
+ if (stateProperty == null) {
+ throw new PropertyNotFoundException("State Property ["+property+"] not found ");
+ }
+ context.setPropertyResolved(true);
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void setValue(ELContext context, Object base, Object property,
+ Object value) {
+ if (null != base && base instanceof State){
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+ throw new PropertyNotWritableException((String) property);
+ }
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplication.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,467 +1,467 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import javax.el.ELContextListener;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.application.NavigationHandler;
-import javax.faces.application.StateManager;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.el.MethodBinding;
-import javax.faces.el.PropertyResolver;
-import javax.faces.el.ReferenceSyntaxException;
-import javax.faces.el.ValueBinding;
-import javax.faces.el.VariableResolver;
-import javax.faces.event.ActionListener;
-import javax.faces.validator.Validator;
-
-/**
- * @author asmirnov
- *
- */
-public class StateApplication extends Application {
-
- private final Application parent;
- private final ExpressionFactory exprFactory;
-
- /**
- * @param parent
- */
- public StateApplication(Application parentApp) {
- super();
- this.parent = parentApp;
- this.exprFactory = new StateExpressionFactory(){
- @Override
- public ExpressionFactory getDefaultFactory() {
- return parent.getExpressionFactory();
- }
- };
- }
-
- /**
- * @param componentType
- * @param componentClass
- * @see javax.faces.application.Application#addComponent(java.lang.String, java.lang.String)
- */
- public void addComponent(String componentType, String componentClass) {
- parent.addComponent(componentType, componentClass);
- }
-
- /**
- * @param targetClass
- * @param converterClass
- * @see javax.faces.application.Application#addConverter(java.lang.Class, java.lang.String)
- */
- public void addConverter(Class targetClass, String converterClass) {
- parent.addConverter(targetClass, converterClass);
- }
-
- /**
- * @param converterId
- * @param converterClass
- * @see javax.faces.application.Application#addConverter(java.lang.String, java.lang.String)
- */
- public void addConverter(String converterId, String converterClass) {
- parent.addConverter(converterId, converterClass);
- }
-
- /**
- * @param listener
- * @see javax.faces.application.Application#addELContextListener(javax.el.ELContextListener)
- */
- public void addELContextListener(ELContextListener listener) {
- parent.addELContextListener(listener);
- }
-
- /**
- * @param resolver
- * @see javax.faces.application.Application#addELResolver(javax.el.ELResolver)
- */
- public void addELResolver(ELResolver resolver) {
- parent.addELResolver(resolver);
- }
-
- /**
- * @param validatorId
- * @param validatorClass
- * @see javax.faces.application.Application#addValidator(java.lang.String, java.lang.String)
- */
- public void addValidator(String validatorId, String validatorClass) {
- parent.addValidator(validatorId, validatorClass);
- }
-
- /**
- * @param componentType
- * @return
- * @throws FacesException
- * @see javax.faces.application.Application#createComponent(java.lang.String)
- */
- public UIComponent createComponent(String componentType)
- throws FacesException {
- return parent.createComponent(componentType);
- }
-
- /**
- * @param componentBinding
- * @param context
- * @param componentType
- * @return
- * @throws FacesException
- * @deprecated
- * @see javax.faces.application.Application#createComponent(javax.faces.el.ValueBinding, javax.faces.context.FacesContext, java.lang.String)
- */
- public UIComponent createComponent(ValueBinding componentBinding,
- FacesContext context, String componentType) throws FacesException {
- return parent.createComponent(componentBinding, context, componentType);
- }
-
- /**
- * @param componentExpression
- * @param context
- * @param componentType
- * @return
- * @throws FacesException
- * @see javax.faces.application.Application#createComponent(javax.el.ValueExpression, javax.faces.context.FacesContext, java.lang.String)
- */
- public UIComponent createComponent(ValueExpression componentExpression,
- FacesContext context, String componentType) throws FacesException {
- return parent.createComponent(componentExpression, context,
- componentType);
- }
-
- /**
- * @param targetClass
- * @return
- * @see javax.faces.application.Application#createConverter(java.lang.Class)
- */
- public Converter createConverter(Class targetClass) {
- return parent.createConverter(targetClass);
- }
-
- /**
- * @param converterId
- * @return
- * @see javax.faces.application.Application#createConverter(java.lang.String)
- */
- public Converter createConverter(String converterId) {
- return parent.createConverter(converterId);
- }
-
- /**
- * @param ref
- * @param params
- * @return
- * @throws ReferenceSyntaxException
- * @deprecated
- * @see javax.faces.application.Application#createMethodBinding(java.lang.String, java.lang.Class[])
- */
- public MethodBinding createMethodBinding(String ref, Class[] params)
- throws ReferenceSyntaxException {
- return parent.createMethodBinding(ref, params);
- }
-
- /**
- * @param validatorId
- * @return
- * @throws FacesException
- * @see javax.faces.application.Application#createValidator(java.lang.String)
- */
- public Validator createValidator(String validatorId) throws FacesException {
- return parent.createValidator(validatorId);
- }
-
- /**
- * @param ref
- * @return
- * @throws ReferenceSyntaxException
- * @deprecated
- * @see javax.faces.application.Application#createValueBinding(java.lang.String)
- */
- public ValueBinding createValueBinding(String ref)
- throws ReferenceSyntaxException {
- return parent.createValueBinding(ref);
- }
-
- /**
- * @param context
- * @param expression
- * @param expectedType
- * @return
- * @throws ELException
- * @see javax.faces.application.Application#evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)
- */
- public Object evaluateExpressionGet(FacesContext context,
- String expression, Class expectedType) throws ELException {
- return parent.evaluateExpressionGet(context, expression, expectedType);
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getActionListener()
- */
- public ActionListener getActionListener() {
- return parent.getActionListener();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getComponentTypes()
- */
- public Iterator<String> getComponentTypes() {
- return parent.getComponentTypes();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getConverterIds()
- */
- public Iterator<String> getConverterIds() {
- return parent.getConverterIds();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getConverterTypes()
- */
- public Iterator<Class> getConverterTypes() {
- return parent.getConverterTypes();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getDefaultLocale()
- */
- public Locale getDefaultLocale() {
- return parent.getDefaultLocale();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getDefaultRenderKitId()
- */
- public String getDefaultRenderKitId() {
- return parent.getDefaultRenderKitId();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getELContextListeners()
- */
- public ELContextListener[] getELContextListeners() {
- return parent.getELContextListeners();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getELResolver()
- */
- public ELResolver getELResolver() {
- return parent.getELResolver();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getExpressionFactory()
- */
- public ExpressionFactory getExpressionFactory() {
- return this.exprFactory;
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getMessageBundle()
- */
- public String getMessageBundle() {
- return parent.getMessageBundle();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getNavigationHandler()
- */
- public NavigationHandler getNavigationHandler() {
- return parent.getNavigationHandler();
- }
-
- /**
- * @return
- * @deprecated
- * @see javax.faces.application.Application#getPropertyResolver()
- */
- public PropertyResolver getPropertyResolver() {
- return parent.getPropertyResolver();
- }
-
- /**
- * @param ctx
- * @param name
- * @return
- * @see javax.faces.application.Application#getResourceBundle(javax.faces.context.FacesContext, java.lang.String)
- */
- public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
- return parent.getResourceBundle(ctx, name);
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getStateManager()
- */
- public StateManager getStateManager() {
- return parent.getStateManager();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getSupportedLocales()
- */
- public Iterator<Locale> getSupportedLocales() {
- return parent.getSupportedLocales();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getValidatorIds()
- */
- public Iterator<String> getValidatorIds() {
- return parent.getValidatorIds();
- }
-
- /**
- * @return
- * @deprecated
- * @see javax.faces.application.Application#getVariableResolver()
- */
- public VariableResolver getVariableResolver() {
- return parent.getVariableResolver();
- }
-
- /**
- * @return
- * @see javax.faces.application.Application#getViewHandler()
- */
- public ViewHandler getViewHandler() {
- return parent.getViewHandler();
- }
-
- /**
- * @param listener
- * @see javax.faces.application.Application#removeELContextListener(javax.el.ELContextListener)
- */
- public void removeELContextListener(ELContextListener listener) {
- parent.removeELContextListener(listener);
- }
-
- /**
- * @param listener
- * @see javax.faces.application.Application#setActionListener(javax.faces.event.ActionListener)
- */
- public void setActionListener(ActionListener listener) {
- parent.setActionListener(listener);
- }
-
- /**
- * @param locale
- * @see javax.faces.application.Application#setDefaultLocale(java.util.Locale)
- */
- public void setDefaultLocale(Locale locale) {
- parent.setDefaultLocale(locale);
- }
-
- /**
- * @param renderKitId
- * @see javax.faces.application.Application#setDefaultRenderKitId(java.lang.String)
- */
- public void setDefaultRenderKitId(String renderKitId) {
- parent.setDefaultRenderKitId(renderKitId);
- }
-
- /**
- * @param bundle
- * @see javax.faces.application.Application#setMessageBundle(java.lang.String)
- */
- public void setMessageBundle(String bundle) {
- parent.setMessageBundle(bundle);
- }
-
- /**
- * @param handler
- * @see javax.faces.application.Application#setNavigationHandler(javax.faces.application.NavigationHandler)
- */
- public void setNavigationHandler(NavigationHandler handler) {
- parent.setNavigationHandler(handler);
- }
-
- /**
- * @param resolver
- * @deprecated
- * @see javax.faces.application.Application#setPropertyResolver(javax.faces.el.PropertyResolver)
- */
- public void setPropertyResolver(PropertyResolver resolver) {
- parent.setPropertyResolver(resolver);
- }
-
- /**
- * @param manager
- * @see javax.faces.application.Application#setStateManager(javax.faces.application.StateManager)
- */
- public void setStateManager(StateManager manager) {
- parent.setStateManager(manager);
- }
-
- /**
- * @param locales
- * @see javax.faces.application.Application#setSupportedLocales(java.util.Collection)
- */
- public void setSupportedLocales(Collection<Locale> locales) {
- parent.setSupportedLocales(locales);
- }
-
- /**
- * @param resolver
- * @deprecated
- * @see javax.faces.application.Application#setVariableResolver(javax.faces.el.VariableResolver)
- */
- public void setVariableResolver(VariableResolver resolver) {
- parent.setVariableResolver(resolver);
- }
-
- /**
- * @param handler
- * @see javax.faces.application.Application#setViewHandler(javax.faces.application.ViewHandler)
- */
- public void setViewHandler(ViewHandler handler) {
- parent.setViewHandler(handler);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.el.ELContextListener;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.NavigationHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.PropertyResolver;
+import javax.faces.el.ReferenceSyntaxException;
+import javax.faces.el.ValueBinding;
+import javax.faces.el.VariableResolver;
+import javax.faces.event.ActionListener;
+import javax.faces.validator.Validator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateApplication extends Application {
+
+ private final Application parent;
+ private final ExpressionFactory exprFactory;
+
+ /**
+ * @param parent
+ */
+ public StateApplication(Application parentApp) {
+ super();
+ this.parent = parentApp;
+ this.exprFactory = new StateExpressionFactory(){
+ @Override
+ public ExpressionFactory getDefaultFactory() {
+ return parent.getExpressionFactory();
+ }
+ };
+ }
+
+ /**
+ * @param componentType
+ * @param componentClass
+ * @see javax.faces.application.Application#addComponent(java.lang.String, java.lang.String)
+ */
+ public void addComponent(String componentType, String componentClass) {
+ parent.addComponent(componentType, componentClass);
+ }
+
+ /**
+ * @param targetClass
+ * @param converterClass
+ * @see javax.faces.application.Application#addConverter(java.lang.Class, java.lang.String)
+ */
+ public void addConverter(Class targetClass, String converterClass) {
+ parent.addConverter(targetClass, converterClass);
+ }
+
+ /**
+ * @param converterId
+ * @param converterClass
+ * @see javax.faces.application.Application#addConverter(java.lang.String, java.lang.String)
+ */
+ public void addConverter(String converterId, String converterClass) {
+ parent.addConverter(converterId, converterClass);
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#addELContextListener(javax.el.ELContextListener)
+ */
+ public void addELContextListener(ELContextListener listener) {
+ parent.addELContextListener(listener);
+ }
+
+ /**
+ * @param resolver
+ * @see javax.faces.application.Application#addELResolver(javax.el.ELResolver)
+ */
+ public void addELResolver(ELResolver resolver) {
+ parent.addELResolver(resolver);
+ }
+
+ /**
+ * @param validatorId
+ * @param validatorClass
+ * @see javax.faces.application.Application#addValidator(java.lang.String, java.lang.String)
+ */
+ public void addValidator(String validatorId, String validatorClass) {
+ parent.addValidator(validatorId, validatorClass);
+ }
+
+ /**
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createComponent(java.lang.String)
+ */
+ public UIComponent createComponent(String componentType)
+ throws FacesException {
+ return parent.createComponent(componentType);
+ }
+
+ /**
+ * @param componentBinding
+ * @param context
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @deprecated
+ * @see javax.faces.application.Application#createComponent(javax.faces.el.ValueBinding, javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIComponent createComponent(ValueBinding componentBinding,
+ FacesContext context, String componentType) throws FacesException {
+ return parent.createComponent(componentBinding, context, componentType);
+ }
+
+ /**
+ * @param componentExpression
+ * @param context
+ * @param componentType
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createComponent(javax.el.ValueExpression, javax.faces.context.FacesContext, java.lang.String)
+ */
+ public UIComponent createComponent(ValueExpression componentExpression,
+ FacesContext context, String componentType) throws FacesException {
+ return parent.createComponent(componentExpression, context,
+ componentType);
+ }
+
+ /**
+ * @param targetClass
+ * @return
+ * @see javax.faces.application.Application#createConverter(java.lang.Class)
+ */
+ public Converter createConverter(Class targetClass) {
+ return parent.createConverter(targetClass);
+ }
+
+ /**
+ * @param converterId
+ * @return
+ * @see javax.faces.application.Application#createConverter(java.lang.String)
+ */
+ public Converter createConverter(String converterId) {
+ return parent.createConverter(converterId);
+ }
+
+ /**
+ * @param ref
+ * @param params
+ * @return
+ * @throws ReferenceSyntaxException
+ * @deprecated
+ * @see javax.faces.application.Application#createMethodBinding(java.lang.String, java.lang.Class[])
+ */
+ public MethodBinding createMethodBinding(String ref, Class[] params)
+ throws ReferenceSyntaxException {
+ return parent.createMethodBinding(ref, params);
+ }
+
+ /**
+ * @param validatorId
+ * @return
+ * @throws FacesException
+ * @see javax.faces.application.Application#createValidator(java.lang.String)
+ */
+ public Validator createValidator(String validatorId) throws FacesException {
+ return parent.createValidator(validatorId);
+ }
+
+ /**
+ * @param ref
+ * @return
+ * @throws ReferenceSyntaxException
+ * @deprecated
+ * @see javax.faces.application.Application#createValueBinding(java.lang.String)
+ */
+ public ValueBinding createValueBinding(String ref)
+ throws ReferenceSyntaxException {
+ return parent.createValueBinding(ref);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedType
+ * @return
+ * @throws ELException
+ * @see javax.faces.application.Application#evaluateExpressionGet(javax.faces.context.FacesContext, java.lang.String, java.lang.Class)
+ */
+ public Object evaluateExpressionGet(FacesContext context,
+ String expression, Class expectedType) throws ELException {
+ return parent.evaluateExpressionGet(context, expression, expectedType);
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getActionListener()
+ */
+ public ActionListener getActionListener() {
+ return parent.getActionListener();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getComponentTypes()
+ */
+ public Iterator<String> getComponentTypes() {
+ return parent.getComponentTypes();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getConverterIds()
+ */
+ public Iterator<String> getConverterIds() {
+ return parent.getConverterIds();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getConverterTypes()
+ */
+ public Iterator<Class> getConverterTypes() {
+ return parent.getConverterTypes();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getDefaultLocale()
+ */
+ public Locale getDefaultLocale() {
+ return parent.getDefaultLocale();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getDefaultRenderKitId()
+ */
+ public String getDefaultRenderKitId() {
+ return parent.getDefaultRenderKitId();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getELContextListeners()
+ */
+ public ELContextListener[] getELContextListeners() {
+ return parent.getELContextListeners();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getELResolver()
+ */
+ public ELResolver getELResolver() {
+ return parent.getELResolver();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getExpressionFactory()
+ */
+ public ExpressionFactory getExpressionFactory() {
+ return this.exprFactory;
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getMessageBundle()
+ */
+ public String getMessageBundle() {
+ return parent.getMessageBundle();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getNavigationHandler()
+ */
+ public NavigationHandler getNavigationHandler() {
+ return parent.getNavigationHandler();
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see javax.faces.application.Application#getPropertyResolver()
+ */
+ public PropertyResolver getPropertyResolver() {
+ return parent.getPropertyResolver();
+ }
+
+ /**
+ * @param ctx
+ * @param name
+ * @return
+ * @see javax.faces.application.Application#getResourceBundle(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public ResourceBundle getResourceBundle(FacesContext ctx, String name) {
+ return parent.getResourceBundle(ctx, name);
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getStateManager()
+ */
+ public StateManager getStateManager() {
+ return parent.getStateManager();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getSupportedLocales()
+ */
+ public Iterator<Locale> getSupportedLocales() {
+ return parent.getSupportedLocales();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getValidatorIds()
+ */
+ public Iterator<String> getValidatorIds() {
+ return parent.getValidatorIds();
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see javax.faces.application.Application#getVariableResolver()
+ */
+ public VariableResolver getVariableResolver() {
+ return parent.getVariableResolver();
+ }
+
+ /**
+ * @return
+ * @see javax.faces.application.Application#getViewHandler()
+ */
+ public ViewHandler getViewHandler() {
+ return parent.getViewHandler();
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#removeELContextListener(javax.el.ELContextListener)
+ */
+ public void removeELContextListener(ELContextListener listener) {
+ parent.removeELContextListener(listener);
+ }
+
+ /**
+ * @param listener
+ * @see javax.faces.application.Application#setActionListener(javax.faces.event.ActionListener)
+ */
+ public void setActionListener(ActionListener listener) {
+ parent.setActionListener(listener);
+ }
+
+ /**
+ * @param locale
+ * @see javax.faces.application.Application#setDefaultLocale(java.util.Locale)
+ */
+ public void setDefaultLocale(Locale locale) {
+ parent.setDefaultLocale(locale);
+ }
+
+ /**
+ * @param renderKitId
+ * @see javax.faces.application.Application#setDefaultRenderKitId(java.lang.String)
+ */
+ public void setDefaultRenderKitId(String renderKitId) {
+ parent.setDefaultRenderKitId(renderKitId);
+ }
+
+ /**
+ * @param bundle
+ * @see javax.faces.application.Application#setMessageBundle(java.lang.String)
+ */
+ public void setMessageBundle(String bundle) {
+ parent.setMessageBundle(bundle);
+ }
+
+ /**
+ * @param handler
+ * @see javax.faces.application.Application#setNavigationHandler(javax.faces.application.NavigationHandler)
+ */
+ public void setNavigationHandler(NavigationHandler handler) {
+ parent.setNavigationHandler(handler);
+ }
+
+ /**
+ * @param resolver
+ * @deprecated
+ * @see javax.faces.application.Application#setPropertyResolver(javax.faces.el.PropertyResolver)
+ */
+ public void setPropertyResolver(PropertyResolver resolver) {
+ parent.setPropertyResolver(resolver);
+ }
+
+ /**
+ * @param manager
+ * @see javax.faces.application.Application#setStateManager(javax.faces.application.StateManager)
+ */
+ public void setStateManager(StateManager manager) {
+ parent.setStateManager(manager);
+ }
+
+ /**
+ * @param locales
+ * @see javax.faces.application.Application#setSupportedLocales(java.util.Collection)
+ */
+ public void setSupportedLocales(Collection<Locale> locales) {
+ parent.setSupportedLocales(locales);
+ }
+
+ /**
+ * @param resolver
+ * @deprecated
+ * @see javax.faces.application.Application#setVariableResolver(javax.faces.el.VariableResolver)
+ */
+ public void setVariableResolver(VariableResolver resolver) {
+ parent.setVariableResolver(resolver);
+ }
+
+ /**
+ * @param handler
+ * @see javax.faces.application.Application#setViewHandler(javax.faces.application.ViewHandler)
+ */
+ public void setViewHandler(ViewHandler handler) {
+ parent.setViewHandler(handler);
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplicationFactory.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplicationFactory.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateApplicationFactory.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,67 +1,67 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import javax.faces.application.Application;
-import javax.faces.application.ApplicationFactory;
-
-/**
- * @author asmirnov
- *
- */
-public class StateApplicationFactory extends ApplicationFactory {
-
- private ApplicationFactory parent;
-
- private Application application;
-
- /**
- * @param parent
- */
- public StateApplicationFactory(ApplicationFactory parent) {
- super();
- this.parent = parent;
- }
-
-
- /* (non-Javadoc)
- * @see javax.faces.application.ApplicationFactory#getApplication()
- */
- @Override
- public Application getApplication() {
- if (application == null) {
- application = new StateApplication(parent.getApplication());
-
- }
-
- return application;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ApplicationFactory#setApplication(javax.faces.application.Application)
- */
- @Override
- public void setApplication(Application application) {
- parent.setApplication(application);
- this.application = new StateApplication(application);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateApplicationFactory extends ApplicationFactory {
+
+ private ApplicationFactory parent;
+
+ private Application application;
+
+ /**
+ * @param parent
+ */
+ public StateApplicationFactory(ApplicationFactory parent) {
+ super();
+ this.parent = parent;
+ }
+
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ApplicationFactory#getApplication()
+ */
+ @Override
+ public Application getApplication() {
+ if (application == null) {
+ application = new StateApplication(parent.getApplication());
+
+ }
+
+ return application;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.application.ApplicationFactory#setApplication(javax.faces.application.Application)
+ */
+ @Override
+ public void setApplication(Application application) {
+ parent.setApplication(application);
+ this.application = new StateApplication(application);
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateExpressionFactory.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,91 +1,91 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import javax.el.ELContext;
-import javax.el.ExpressionFactory;
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-
-/**
- * @author asmirnov
- *
- */
-public abstract class StateExpressionFactory extends ExpressionFactory {
-
-
- /**
- * @param obj
- * @param targetType
- * @return
- * @see javax.el.ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class)
- */
- public Object coerceToType(Object obj, Class<?> targetType) {
- return getDefaultFactory().coerceToType(obj, targetType);
- }
-
- /**
- * @param context
- * @param expression
- * @param expectedReturnType
- * @param expectedParamTypes
- * @return
- * @see javax.el.ExpressionFactory#createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class<?>[])
- */
- public MethodExpression createMethodExpression(ELContext context,
- String expression, Class<?> expectedReturnType,
- Class<?>[] expectedParamTypes) {
- MethodExpression methodExpression = getDefaultFactory().createMethodExpression(context, expression,
- expectedReturnType, expectedParamTypes);
- ValueExpression valueExpression = getDefaultFactory().createValueExpression(context, expression, MethodExpression.class);
- return new StateMethodExpressionWrapper(methodExpression,valueExpression);
- }
-
- /**
- * @param context
- * @param expression
- * @param expectedType
- * @return
- * @see javax.el.ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
- */
- public ValueExpression createValueExpression(ELContext context,
- String expression, Class<?> expectedType) {
- return getDefaultFactory().createValueExpression(context, expression,
- expectedType);
- }
-
- /**
- * @param instance
- * @param expectedType
- * @return
- * @see javax.el.ExpressionFactory#createValueExpression(java.lang.Object, java.lang.Class)
- */
- public ValueExpression createValueExpression(Object instance,
- Class<?> expectedType) {
- return getDefaultFactory().createValueExpression(instance, expectedType);
- }
-
- /**
- * @return the defaultFactory
- */
- public abstract ExpressionFactory getDefaultFactory() ;
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.MethodExpression;
+import javax.el.ValueExpression;
+
+/**
+ * @author asmirnov
+ *
+ */
+public abstract class StateExpressionFactory extends ExpressionFactory {
+
+
+ /**
+ * @param obj
+ * @param targetType
+ * @return
+ * @see javax.el.ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class)
+ */
+ public Object coerceToType(Object obj, Class<?> targetType) {
+ return getDefaultFactory().coerceToType(obj, targetType);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedReturnType
+ * @param expectedParamTypes
+ * @return
+ * @see javax.el.ExpressionFactory#createMethodExpression(javax.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class<?>[])
+ */
+ public MethodExpression createMethodExpression(ELContext context,
+ String expression, Class<?> expectedReturnType,
+ Class<?>[] expectedParamTypes) {
+ MethodExpression methodExpression = getDefaultFactory().createMethodExpression(context, expression,
+ expectedReturnType, expectedParamTypes);
+ ValueExpression valueExpression = getDefaultFactory().createValueExpression(context, expression, MethodExpression.class);
+ return new StateMethodExpressionWrapper(methodExpression,valueExpression);
+ }
+
+ /**
+ * @param context
+ * @param expression
+ * @param expectedType
+ * @return
+ * @see javax.el.ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
+ */
+ public ValueExpression createValueExpression(ELContext context,
+ String expression, Class<?> expectedType) {
+ return getDefaultFactory().createValueExpression(context, expression,
+ expectedType);
+ }
+
+ /**
+ * @param instance
+ * @param expectedType
+ * @return
+ * @see javax.el.ExpressionFactory#createValueExpression(java.lang.Object, java.lang.Class)
+ */
+ public ValueExpression createValueExpression(Object instance,
+ Class<?> expectedType) {
+ return getDefaultFactory().createValueExpression(instance, expectedType);
+ }
+
+ /**
+ * @return the defaultFactory
+ */
+ public abstract ExpressionFactory getDefaultFactory() ;
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateMethodExpressionWrapper.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateMethodExpressionWrapper.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateMethodExpressionWrapper.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,122 +1,122 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.MethodInfo;
-import javax.el.MethodNotFoundException;
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-
-/**
- * @author asmirnov
- *
- */
-public class StateMethodExpressionWrapper extends MethodExpression {
-
- private MethodExpression parent;
-
- private ValueExpression baseObjectExpression = null;
-
- /**
- * @param parent
- */
- public StateMethodExpressionWrapper(MethodExpression parent,ValueExpression baseObject) {
- this.parent = parent;
- this.baseObjectExpression = baseObject;
- }
-
- /**
- * @return
- * @see javax.el.Expression#getExpressionString()
- */
- public String getExpressionString() {
- return parent.getExpressionString();
- }
-
- /**
- * @param context
- * @return
- * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
- */
- public MethodInfo getMethodInfo(ELContext context) {
- MethodInfo methodInfo = parent.getMethodInfo(context);
- return methodInfo;
- }
-
- /**
- * @param context
- * @param params
- * @return
- * @see javax.el.MethodExpression#invoke(javax.el.ELContext,
- * java.lang.Object[])
- */
- public Object invoke(ELContext context, Object[] params) {
- Object result;
- try {
- result = parent.invoke(context, params);
- } catch (MethodNotFoundException e) {
- Object base = baseObjectExpression.getValue(context);
- if (base instanceof MethodExpression) {
- MethodExpression referencedMethod = (MethodExpression) base;
- result = referencedMethod.invoke(context, params);
- } else {
- throw e;
- }
- }
- return result;
- }
-
- /**
- * @return
- * @see javax.el.Expression#isLiteralText()
- */
- public boolean isLiteralText() {
- return parent.isLiteralText();
- }
-
- /**
- * @param obj
- * @return
- * @see javax.el.Expression#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return parent.equals(obj);
- }
-
- /**
- * @return
- * @see javax.el.Expression#hashCode()
- */
- public int hashCode() {
- return parent.hashCode();
- }
-
- /**
- * @return
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return parent.toString();
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+import javax.el.MethodInfo;
+import javax.el.MethodNotFoundException;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateMethodExpressionWrapper extends MethodExpression {
+
+ private MethodExpression parent;
+
+ private ValueExpression baseObjectExpression = null;
+
+ /**
+ * @param parent
+ */
+ public StateMethodExpressionWrapper(MethodExpression parent,ValueExpression baseObject) {
+ this.parent = parent;
+ this.baseObjectExpression = baseObject;
+ }
+
+ /**
+ * @return
+ * @see javax.el.Expression#getExpressionString()
+ */
+ public String getExpressionString() {
+ return parent.getExpressionString();
+ }
+
+ /**
+ * @param context
+ * @return
+ * @see javax.el.MethodExpression#getMethodInfo(javax.el.ELContext)
+ */
+ public MethodInfo getMethodInfo(ELContext context) {
+ MethodInfo methodInfo = parent.getMethodInfo(context);
+ return methodInfo;
+ }
+
+ /**
+ * @param context
+ * @param params
+ * @return
+ * @see javax.el.MethodExpression#invoke(javax.el.ELContext,
+ * java.lang.Object[])
+ */
+ public Object invoke(ELContext context, Object[] params) {
+ Object result;
+ try {
+ result = parent.invoke(context, params);
+ } catch (MethodNotFoundException e) {
+ Object base = baseObjectExpression.getValue(context);
+ if (base instanceof MethodExpression) {
+ MethodExpression referencedMethod = (MethodExpression) base;
+ result = referencedMethod.invoke(context, params);
+ } else {
+ throw e;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @return
+ * @see javax.el.Expression#isLiteralText()
+ */
+ public boolean isLiteralText() {
+ return parent.isLiteralText();
+ }
+
+ /**
+ * @param obj
+ * @return
+ * @see javax.el.Expression#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ return parent.equals(obj);
+ }
+
+ /**
+ * @return
+ * @see javax.el.Expression#hashCode()
+ */
+ public int hashCode() {
+ return parent.hashCode();
+ }
+
+ /**
+ * @return
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return parent.toString();
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateNavigationHandler.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,69 +1,69 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import java.util.Map;
-
-import javax.faces.application.NavigationHandler;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.ui.model.States;
-
-/**
- * @author asmirnov
- *
- */
-public class StateNavigationHandler extends NavigationHandler {
-
- private NavigationHandler parent;
-
- /**
- * @param parent
- */
- public StateNavigationHandler(NavigationHandler parent) {
- super();
- this.parent = parent;
- }
-
- /**
- * @param context
- * @param fromAction
- * @param outcome
- * @see javax.faces.application.NavigationHandler#handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
- */
- public void handleNavigation(FacesContext context, String fromAction,
- String outcome) {
- if(null != outcome){
- Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
- for (Object bean : requestMap.values()) {
- if (bean instanceof States) {
- States state = (States) bean;
- String navigation = state.getNavigation(outcome);
- if(null != navigation){
- state.setCurrentState(navigation);
- }
- }
- }
- }
- parent.handleNavigation(context, fromAction, outcome);
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import java.util.Map;
+
+import javax.faces.application.NavigationHandler;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.ui.model.States;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateNavigationHandler extends NavigationHandler {
+
+ private NavigationHandler parent;
+
+ /**
+ * @param parent
+ */
+ public StateNavigationHandler(NavigationHandler parent) {
+ super();
+ this.parent = parent;
+ }
+
+ /**
+ * @param context
+ * @param fromAction
+ * @param outcome
+ * @see javax.faces.application.NavigationHandler#handleNavigation(javax.faces.context.FacesContext, java.lang.String, java.lang.String)
+ */
+ public void handleNavigation(FacesContext context, String fromAction,
+ String outcome) {
+ if(null != outcome){
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ for (Object bean : requestMap.values()) {
+ if (bean instanceof States) {
+ States state = (States) bean;
+ String navigation = state.getNavigation(outcome);
+ if(null != navigation){
+ state.setCurrentState(navigation);
+ }
+ }
+ }
+ }
+ parent.handleNavigation(context, fromAction, outcome);
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StatePropertyResolver.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StatePropertyResolver.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StatePropertyResolver.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,113 +1,113 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import javax.faces.el.EvaluationException;
-import javax.faces.el.PropertyNotFoundException;
-import javax.faces.el.PropertyResolver;
-
-/**
- * @author asmirnov
- *
- */
-public class StatePropertyResolver extends PropertyResolver {
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, java.lang.Object)
- */
-
- public Class getType(Object arg0, Object arg1) throws EvaluationException,
- PropertyNotFoundException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, int)
- */
-
- public Class getType(Object arg0, int arg1) throws EvaluationException,
- PropertyNotFoundException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, java.lang.Object)
- */
-
- public Object getValue(Object arg0, Object arg1)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, int)
- */
-
- public Object getValue(Object arg0, int arg1) throws EvaluationException,
- PropertyNotFoundException {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, java.lang.Object)
- */
-
- public boolean isReadOnly(Object arg0, Object arg1)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, int)
- */
-
- public boolean isReadOnly(Object arg0, int arg1)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, java.lang.Object, java.lang.Object)
- */
-
- public void setValue(Object arg0, Object arg1, Object arg2)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, int, java.lang.Object)
- */
-
- public void setValue(Object arg0, int arg1, Object arg2)
- throws EvaluationException, PropertyNotFoundException {
- // TODO Auto-generated method stub
-
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import javax.faces.el.EvaluationException;
+import javax.faces.el.PropertyNotFoundException;
+import javax.faces.el.PropertyResolver;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StatePropertyResolver extends PropertyResolver {
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, java.lang.Object)
+ */
+
+ public Class getType(Object arg0, Object arg1) throws EvaluationException,
+ PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#getType(java.lang.Object, int)
+ */
+
+ public Class getType(Object arg0, int arg1) throws EvaluationException,
+ PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, java.lang.Object)
+ */
+
+ public Object getValue(Object arg0, Object arg1)
+ throws EvaluationException, PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#getValue(java.lang.Object, int)
+ */
+
+ public Object getValue(Object arg0, int arg1) throws EvaluationException,
+ PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, java.lang.Object)
+ */
+
+ public boolean isReadOnly(Object arg0, Object arg1)
+ throws EvaluationException, PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#isReadOnly(java.lang.Object, int)
+ */
+
+ public boolean isReadOnly(Object arg0, int arg1)
+ throws EvaluationException, PropertyNotFoundException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+
+ public void setValue(Object arg0, Object arg1, Object arg2)
+ throws EvaluationException, PropertyNotFoundException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.PropertyResolver#setValue(java.lang.Object, int, java.lang.Object)
+ */
+
+ public void setValue(Object arg0, int arg1, Object arg2)
+ throws EvaluationException, PropertyNotFoundException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/application/StateResolver.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/application/StateResolver.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/application/StateResolver.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,42 +1,42 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.application;
-
-import javax.faces.context.FacesContext;
-import javax.faces.el.EvaluationException;
-import javax.faces.el.VariableResolver;
-
-/**
- * @author asmirnov
- *
- */
-public class StateResolver extends VariableResolver {
-
- /* (non-Javadoc)
- * @see javax.faces.el.VariableResolver#resolveVariable(javax.faces.context.FacesContext, java.lang.String)
- */
- public Object resolveVariable(FacesContext arg0, String arg1)
- throws EvaluationException {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.application;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.VariableResolver;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateResolver extends VariableResolver {
+
+ /* (non-Javadoc)
+ * @see javax.faces.el.VariableResolver#resolveVariable(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public Object resolveVariable(FacesContext arg0, String arg1)
+ throws EvaluationException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/model/State.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/model/State.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/model/State.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,35 +1,35 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.model;
-
-import java.util.Map;
-
-/**
- * @author asmirnov
- *
- */
-public interface State extends Map<String, Object>{
-
- public String getNavigation(String outcome);
-
- public void setNavigation(String outcome, String navigation);
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.model;
+
+import java.util.Map;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface State extends Map<String, Object>{
+
+ public String getNavigation(String outcome);
+
+ public void setNavigation(String outcome, String navigation);
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/model/StateImpl.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,56 +1,56 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author asmirnov
- *
- */
-public class StateImpl extends HashMap<String, Object> implements State {
-
- /**
- *
- */
- private static final long serialVersionUID = 5521648998682443502L;
-
- private Map<String,String>navigations = new HashMap<String, String>();
-
-
-
- /* (non-Javadoc)
- * @see org.richfaces.ui.model.State#getNavigation(java.lang.String)
- */
- public String getNavigation(String outcome) {
- // TODO Auto-generated method stub
- return navigations.get(outcome);
- }
-
-
- public void setNavigation(String outcome, String navigation) {
- navigations.put(outcome, navigation);
-
- }
-
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class StateImpl extends HashMap<String, Object> implements State {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5521648998682443502L;
+
+ private Map<String,String>navigations = new HashMap<String, String>();
+
+
+
+ /* (non-Javadoc)
+ * @see org.richfaces.ui.model.State#getNavigation(java.lang.String)
+ */
+ public String getNavigation(String outcome) {
+ // TODO Auto-generated method stub
+ return navigations.get(outcome);
+ }
+
+
+ public void setNavigation(String outcome, String navigation) {
+ navigations.put(outcome, navigation);
+
+ }
+
+
+}
Modified: trunk/ui/state/src/main/java/org/richfaces/ui/model/States.java
===================================================================
--- trunk/ui/state/src/main/java/org/richfaces/ui/model/States.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/java/org/richfaces/ui/model/States.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,155 +1,155 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.ui.model;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.ajax4jsf.model.KeepAlive;
-
-/**
- * @author asmirnov
- *
- */
-@KeepAlive
-public class States implements State, Serializable {
-
- /**
- *
- */
- private static final long serialVersionUID = 8593398262385876975L;
-
- private static final String DEFAULT_STATE = "DEFAULT";
-
- private final Map<String, State> states;
-
- private State currentState;
-
- private String currentStateName;
-
- public States() {
- states = new HashMap<String, State>();
- }
-
- /**
- * HACK - bean property setter for a initialisation from faces-config.xml.
- * @param stateConfig
- */
- public void setConfig(String stateConfig){
- // TODO - parse configuration.
- }
-
- /**
- * Copy all states from an initial state configuration. Use to init state bean from faces-config.xml
- * @param initial
- */
- public void setStates(States initial){
- this.states.clear();
- this.states.putAll(initial.states);
- this.currentState = initial.currentState;
- this.currentStateName = initial.currentStateName;
- }
-
- public void setCurrentState(String name) {
- State state = states.get(name);
- if (null == state) {
- state = new StateImpl();
- states.put(name, state);
- }
- currentStateName = name;
- currentState = state;
- }
-
- public String getCurrentState(){
- return currentStateName;
- }
-
- public void setState(String name, State state) {
- states.put(name, state);
- currentStateName = name;
- currentState = state;
- }
-
- public void clear() {
- currentState.clear();
- }
-
- public boolean containsKey(Object key) {
- return currentState.containsKey(key);
- }
-
- public boolean containsValue(Object value) {
- return currentState.containsValue(value);
- }
-
- public Set<Entry<String, Object>> entrySet() {
- return currentState.entrySet();
- }
-
- public Object get(Object key) {
- return currentState.get(key);
- }
-
- public String getNavigation(String outcome) {
- return currentState.getNavigation(outcome);
- }
-
- /**
- * @param outcome
- * @param navigation
- * @see org.richfaces.ui.model.State#setNavigation(java.lang.String, java.lang.String)
- */
- public void setNavigation(String outcome, String navigation) {
- currentState.setNavigation(outcome, navigation);
- }
-
- public boolean isEmpty() {
- return currentState.isEmpty();
- }
-
- public Set<String> keySet() {
- return currentState.keySet();
- }
-
- public Object put(String key, Object value) {
- return currentState.put(key, value);
- }
-
- public void putAll(Map<? extends String, ? extends Object> t) {
- currentState.putAll(t);
- }
-
- public Object remove(Object key) {
- return currentState.remove(key);
- }
-
- public int size() {
- return currentState.size();
- }
-
- public Collection<Object> values() {
- return currentState.values();
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.ui.model;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.ajax4jsf.model.KeepAlive;
+
+/**
+ * @author asmirnov
+ *
+ */
+@KeepAlive
+public class States implements State, Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8593398262385876975L;
+
+ private static final String DEFAULT_STATE = "DEFAULT";
+
+ private final Map<String, State> states;
+
+ private State currentState;
+
+ private String currentStateName;
+
+ public States() {
+ states = new HashMap<String, State>();
+ }
+
+ /**
+ * HACK - bean property setter for a initialisation from faces-config.xml.
+ * @param stateConfig
+ */
+ public void setConfig(String stateConfig){
+ // TODO - parse configuration.
+ }
+
+ /**
+ * Copy all states from an initial state configuration. Use to init state bean from faces-config.xml
+ * @param initial
+ */
+ public void setStates(States initial){
+ this.states.clear();
+ this.states.putAll(initial.states);
+ this.currentState = initial.currentState;
+ this.currentStateName = initial.currentStateName;
+ }
+
+ public void setCurrentState(String name) {
+ State state = states.get(name);
+ if (null == state) {
+ state = new StateImpl();
+ states.put(name, state);
+ }
+ currentStateName = name;
+ currentState = state;
+ }
+
+ public String getCurrentState(){
+ return currentStateName;
+ }
+
+ public void setState(String name, State state) {
+ states.put(name, state);
+ currentStateName = name;
+ currentState = state;
+ }
+
+ public void clear() {
+ currentState.clear();
+ }
+
+ public boolean containsKey(Object key) {
+ return currentState.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ return currentState.containsValue(value);
+ }
+
+ public Set<Entry<String, Object>> entrySet() {
+ return currentState.entrySet();
+ }
+
+ public Object get(Object key) {
+ return currentState.get(key);
+ }
+
+ public String getNavigation(String outcome) {
+ return currentState.getNavigation(outcome);
+ }
+
+ /**
+ * @param outcome
+ * @param navigation
+ * @see org.richfaces.ui.model.State#setNavigation(java.lang.String, java.lang.String)
+ */
+ public void setNavigation(String outcome, String navigation) {
+ currentState.setNavigation(outcome, navigation);
+ }
+
+ public boolean isEmpty() {
+ return currentState.isEmpty();
+ }
+
+ public Set<String> keySet() {
+ return currentState.keySet();
+ }
+
+ public Object put(String key, Object value) {
+ return currentState.put(key, value);
+ }
+
+ public void putAll(Map<? extends String, ? extends Object> t) {
+ currentState.putAll(t);
+ }
+
+ public Object remove(Object key) {
+ return currentState.remove(key);
+ }
+
+ public int size() {
+ return currentState.size();
+ }
+
+ public Collection<Object> values() {
+ return currentState.values();
+ }
+
+}
Modified: trunk/ui/state/src/main/templates/org/richfaces/ui/htmlState.jspx
===================================================================
--- trunk/ui/state/src/main/templates/org/richfaces/ui/htmlState.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/templates/org/richfaces/ui/htmlState.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -14,4 +14,4 @@
x:passThruWithExclusions="value,name,type,id"
>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/state/src/main/templates/org/richfaces/ui/htmlStates.jspx
===================================================================
--- trunk/ui/state/src/main/templates/org/richfaces/ui/htmlStates.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/state/src/main/templates/org/richfaces/ui/htmlStates.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -14,4 +14,4 @@
x:passThruWithExclusions="value,name,type,id"
>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/taglib/SuggestionBoxTagHandler.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,143 +1,143 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.taglib;
-
-import org.richfaces.component.UISuggestionBox;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-
-/**
- * Component tag handler for Facelets.
- *
- * @author shura (latest modification by $Author: ishabalov $)
- * @version $Revision: 1.1.2.4 $ $Date: 2007/02/20 20:58:03 $
- */
-public class SuggestionBoxTagHandler
- extends com.sun.facelets.tag.jsf.ComponentHandler {
-
- /**
- * Meta rule for tag handler.
- */
- private static final SuggestionBoxTagHandlerMetaRule metaRule =
- new SuggestionBoxTagHandlerMetaRule();
-
- /**
- * Constructor.
- *
- * @param config {@link com.sun.facelets.tag.jsf.ComponentConfig}
- */
- public SuggestionBoxTagHandler(final ComponentConfig config) {
- super(config);
- }
-
- /**
- * Creates metarules.
- *
- * @param type Class
- * @return {@link com.sun.facelets.tag.MetaRuleset}
- */
- protected final MetaRuleset createMetaRuleset(final Class type) {
- MetaRuleset m = super.createMetaRuleset(type);
- m.addRule(metaRule);
- return m;
- }
-
- /**
- * Meta rule implementation.
- *
- * @author shura (latest modification by $Author: ishabalov $)
- * @version $Revision: 1.1.2.4 $ $Date: 2007/02/20 20:58:03 $
- */
- static class SuggestionBoxTagHandlerMetaRule extends MetaRule {
-
- /**
- * Apply rule.
- *
- * @param name rule name
- * @param attribute {@link com.sun.facelets.tag.TagAttribute}
- * @param meta {@link com.sun.facelets.tag.TagAttribute}
- * @return metadata {@link com.sun.facelets.tag.Metadata}
- *
- * @see {@link com.sun.facelets.tag.MetaRule#applyRule(String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)}
- */
- public Metadata applyRule(final String name,
- final TagAttribute attribute,
- final MetadataTarget meta) {
- if (meta.isTargetInstanceOf(UISuggestionBox.class)) {
- if ("suggestionAction".equals(name)) {
- return new SuggestionActionMapper(attribute);
- }
-
- }
- return null;
- }
- }
-
- /**
- * Meta data implementation.
- */
- static class SuggestionActionMapper extends Metadata {
- /**
- * Signature.
- */
- private static final Class[] SIGNATURE =
- new Class[]{java.lang.Object.class};
-
- /**
- * Action attribute.
- */
- private final TagAttribute action;
-
- /**
- * Sets attribute.
- *
- * @param attribute {@link com.sun.facelets.tag.TagAttribute}
- */
- public SuggestionActionMapper(final TagAttribute attribute) {
- action = attribute;
- }
-
- /**
- * Apply metadata.
-
- * @param context {@link javax.faces.context.FacesContext}
- * @param instance {@link java.lang.Object}
- *
- * @see {@link com.sun.facelets.tag.Metadata#applyMetadata(
- * com.sun.facelets.FaceletContext, Object)}
- */
- public void applyMetadata(final FaceletContext context,
- final Object instance) {
- ((UISuggestionBox) instance)
- .setSuggestionAction(this.action
- .getMethodExpression(context, null, SIGNATURE));
- }
- }
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.taglib;
+
+import org.richfaces.component.UISuggestionBox;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+
+/**
+ * Component tag handler for Facelets.
+ *
+ * @author shura (latest modification by $Author: ishabalov $)
+ * @version $Revision: 1.1.2.4 $ $Date: 2007/02/20 20:58:03 $
+ */
+public class SuggestionBoxTagHandler
+ extends com.sun.facelets.tag.jsf.ComponentHandler {
+
+ /**
+ * Meta rule for tag handler.
+ */
+ private static final SuggestionBoxTagHandlerMetaRule metaRule =
+ new SuggestionBoxTagHandlerMetaRule();
+
+ /**
+ * Constructor.
+ *
+ * @param config {@link com.sun.facelets.tag.jsf.ComponentConfig}
+ */
+ public SuggestionBoxTagHandler(final ComponentConfig config) {
+ super(config);
+ }
+
+ /**
+ * Creates metarules.
+ *
+ * @param type Class
+ * @return {@link com.sun.facelets.tag.MetaRuleset}
+ */
+ protected final MetaRuleset createMetaRuleset(final Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(metaRule);
+ return m;
+ }
+
+ /**
+ * Meta rule implementation.
+ *
+ * @author shura (latest modification by $Author: ishabalov $)
+ * @version $Revision: 1.1.2.4 $ $Date: 2007/02/20 20:58:03 $
+ */
+ static class SuggestionBoxTagHandlerMetaRule extends MetaRule {
+
+ /**
+ * Apply rule.
+ *
+ * @param name rule name
+ * @param attribute {@link com.sun.facelets.tag.TagAttribute}
+ * @param meta {@link com.sun.facelets.tag.TagAttribute}
+ * @return metadata {@link com.sun.facelets.tag.Metadata}
+ *
+ * @see {@link com.sun.facelets.tag.MetaRule#applyRule(String,
+ * com.sun.facelets.tag.TagAttribute,
+ * com.sun.facelets.tag.MetadataTarget)}
+ */
+ public Metadata applyRule(final String name,
+ final TagAttribute attribute,
+ final MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(UISuggestionBox.class)) {
+ if ("suggestionAction".equals(name)) {
+ return new SuggestionActionMapper(attribute);
+ }
+
+ }
+ return null;
+ }
+ }
+
+ /**
+ * Meta data implementation.
+ */
+ static class SuggestionActionMapper extends Metadata {
+ /**
+ * Signature.
+ */
+ private static final Class[] SIGNATURE =
+ new Class[]{java.lang.Object.class};
+
+ /**
+ * Action attribute.
+ */
+ private final TagAttribute action;
+
+ /**
+ * Sets attribute.
+ *
+ * @param attribute {@link com.sun.facelets.tag.TagAttribute}
+ */
+ public SuggestionActionMapper(final TagAttribute attribute) {
+ action = attribute;
+ }
+
+ /**
+ * Apply metadata.
+
+ * @param context {@link javax.faces.context.FacesContext}
+ * @param instance {@link java.lang.Object}
+ *
+ * @see {@link com.sun.facelets.tag.Metadata#applyMetadata(
+ * com.sun.facelets.FaceletContext, Object)}
+ */
+ public void applyMetadata(final FaceletContext context,
+ final Object instance) {
+ ((UISuggestionBox) instance)
+ .setSuggestionAction(this.action
+ .getMethodExpression(context, null, SIGNATURE));
+ }
+ }
+}
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -49,9 +49,9 @@
</f:if>
<tbody>
<u:insertChildren context="rows">
- <tr>
- <f:attribute name="class">
- <f:call name="getEntryClass"/>
+ <tr>
+ <f:attribute name="class">
+ <f:call name="getEntryClass"/>
</f:attribute>
<f:if property="fetchValue">
<td style="display: none;"><f:attribute name="class"
@@ -65,10 +65,10 @@
<u:insertChild/></td>
</u:insertChildren>
</tr>
- </u:insertChildren>
-
- <f:call name="insertNothingLabel" />
+ </u:insertChildren>
+ <f:call name="insertNothingLabel" />
+
</tbody>
</table>
</f:template>
Modified: trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabClassBuilder.java
===================================================================
--- trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabClassBuilder.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabClassBuilder.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -177,4 +177,4 @@
protected String getSpecificTabClassFromPane(UITab tab, UITabPanel pane) {
return "";
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/tabPanel/src/main/templates/tab.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tab.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tabPanel/src/main/templates/tab.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -27,4 +27,4 @@
</tr>
</table>
</td>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/tabPanel/src/main/templates/tabHeader.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tabHeader.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tabPanel/src/main/templates/tabHeader.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -20,7 +20,7 @@
<f:call name="encodeTabLabel" />
<tr>
- <td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img src="#{spacer}" width="1" height="1" alt=" " style="border:0" /></td>
+ <td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img src="#{spacer}" width="1" height="1" alt="" style="border:0" /></td>
<td class="dr-tbpnl-tbtopbrdr rich-tabhdr-side-cell" style="#{this:encodeTabLabelWidth(context, component)}">
<table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0" >
<tr>
@@ -40,12 +40,12 @@
</tr>
</table>
</td>
- <td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img src="#{spacer}" width="1" height="1" alt=" " style="border:0" /></td>
+ <td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img src="#{spacer}" width="1" height="1" alt="" style="border:0" /></td>
</tr>
</table>
</td>
- <td><img src="#{spacer}" height="1" alt=" " style="#{this:encodeHeaderSpacing(context, component)};border:0"/></td>
+ <td><img src="#{spacer}" height="1" alt="" style="#{this:encodeHeaderSpacing(context, component)};border:0"/></td>
</f:root>
Modified: trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:h="http://jsf.exadel.com/header"
- xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- baseclass="org.richfaces.renderkit.TabPanelRendererBase"
- class="org.richfaces.renderkit.html.TabPanelRenderer"
- component="org.richfaces.component.UITabPanel">
-
- <h:styles>css/tabPanel.xcss</h:styles>
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h="http://jsf.exadel.com/header"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ baseclass="org.richfaces.renderkit.TabPanelRendererBase"
+ class="org.richfaces.renderkit.html.TabPanelRenderer"
+ component="org.richfaces.component.UITabPanel">
+
+ <h:styles>css/tabPanel.xcss</h:styles>
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
new org.ajax4jsf.javascript.AjaxScript(),
@@ -18,32 +18,32 @@
/org/richfaces/renderkit/html/scripts/browser_info.js,
/org/ajax4jsf/javascript/scripts/form.js,
scripts/tabPanel.js
- </h:scripts>
-
- <f:clientid var="clientId" />
-
- <f:resource name="images/spacer.gif" var="spacer" />
+ </h:scripts>
+
+ <f:clientid var="clientId" />
+
+ <f:resource name="images/spacer.gif" var="spacer" />
<f:call name="encodeTabPanelScript"/>
- <table border="0" cellpadding="0" cellspacing="0" id="#{clientId}"
- class="rich-tabpanel #{component.attributes['styleClass']}"
- style="#{this:encodeStyles(context, component)}">
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="width,height,styleClass,class,style,id" />
- </f:call>
-
- <tbody>
- <tr>
+ <table border="0" cellpadding="0" cellspacing="0" id="#{clientId}"
+ class="rich-tabpanel #{component.attributes['styleClass']}"
+ style="#{this:encodeStyles(context, component)}">
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="width,height,styleClass,class,style,id" />
+ </f:call>
+
+ <tbody>
+ <tr>
<td align="#{component.attributes['headerAlignment']}" class="dr-bottom-line rich-tab-bottom-line #{component.attributes['headerClass']}">
- <f:call name="utils.encodeBeginFormIfNessesary" />
+ <f:call name="utils.encodeBeginFormIfNessesary" />
<!--table border="0" cellpadding="0" cellspacing="0" style="position:relative;top:1px"-->
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
- <img src="#{spacer}" height="1" alt=" "
+ <img src="#{spacer}" height="1" alt=""
style="#{this:encodeHeaderSpacing(context, component)};border:0" />
</td>
@@ -53,26 +53,26 @@
</table>
-
+
<div style="display: none;">
<c:if test="#{clientSide}">
- <input type="hidden"
+ <input type="hidden"
id="#{clientId}_input"
- name="#{clientId}"
+ name="#{clientId}"
value="#{this:getValueAsString(context, component)}" />
</c:if>
<f:call name="encodeTabsScript" />
- </div>
+ </div>
<f:call name="utils.encodeEndFormIfNessesary" />
- </td>
+ </td>
</tr>
- <tr>
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- </tr>
- </tbody>
- </table>
-</f:root>
-
-
+ <tr>
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </tr>
+ </tbody>
+ </table>
+</f:root>
+
+
Modified: trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java
===================================================================
--- trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -264,4 +264,4 @@
}
*/
}
-
\ No newline at end of file
+
Modified: trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
--- trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -163,4 +163,4 @@
return component != null ? component.getClientId(context) : null;
}
*/
-}
\ No newline at end of file
+}
Modified: trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java
===================================================================
--- trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/TogglePanelRenderer.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -173,4 +173,4 @@
// panel.setValue(value);
// }
// }
-}
\ No newline at end of file
+}
Modified: trunk/ui/togglePanel/src/main/templates/toggleControl.jspx
===================================================================
--- trunk/ui/togglePanel/src/main/templates/toggleControl.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/togglePanel/src/main/templates/toggleControl.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -26,4 +26,4 @@
<f:call name="renderChildren" />
</vcp:body>
</a>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/togglePanel/src/main/templates/togglePanel.jspx
===================================================================
--- trunk/ui/togglePanel/src/main/templates/togglePanel.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/togglePanel/src/main/templates/togglePanel.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -22,4 +22,4 @@
<vcp:body/>
<f:call name="handleFacets"/>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/images/SquareSeparatorImage.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -74,4 +74,4 @@
area.subtract(new Area(inSquare));
g2d.fill(area);
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/taglib/ToolTipTagHandlerBase.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/taglib/ToolTipTagHandlerBase.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/taglib/ToolTipTagHandlerBase.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -53,4 +53,4 @@
}
return ruleset;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -12,10 +12,10 @@
component="org.richfaces.component.UIToolTip" >
<f:clientid var="clientId"/>
- <span id="#{clientId}" style="z-index:#{component.attributes['zorder']}; #{component.attributes['style']}"
+ <span id="#{clientId}" style="z-index:#{component.attributes['zorder']}; #{component.attributes['style']}"
class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,style,class,disabled" />
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="id,style,class,disabled" />
</f:call>
<jsp:scriptlet>
<![CDATA[if("ajax".equals(component.getMode()) && component.getFacet("defaultContent")!=null) {]]>
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1352,4 +1352,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -24,7 +24,7 @@
/org/richfaces/renderkit/html/scripts/tree-selection.js,
/org/richfaces/renderkit/html/scripts/tree-item.js,
/org/richfaces/renderkit/html/scripts/tree-item-dnd.js,
- /org/richfaces/renderkit/html/scripts/drag-indicator.js,
+ /org/richfaces/renderkit/html/scripts/drag-indicator.js,
/org/richfaces/renderkit/html/scripts/browser_info.js
</h:scripts>
Modified: trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -35,10 +35,10 @@
<tbody>
<tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{this:getToggleScript(context, component, 'mainRow')}" >
- <f:call name="encodeAttributeParameters" />
-
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,onclick"/>
+ <f:call name="encodeAttributeParameters" />
+
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="id,onclick"/>
</f:call>
<td class="dr-tree-h-ic rich-tree-node-handleicon #{line}" id="#{clientId}:handles">
<jsp:scriptlet>
@@ -55,12 +55,12 @@
<div>
<jsp:scriptlet>
- <![CDATA[
+ <![CDATA[
boolean leaf = component.getUITree().isLeaf();
if (leaf) {
]]>
</jsp:scriptlet>
- <img id="#{clientId}:handle:img" src="#{spacer}" alt=" " class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img id="#{clientId}:handle:img" src="#{spacer}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
} else {
@@ -93,7 +93,7 @@
<img id="#{clientId}:handle:img:collapsed"
src="#{collapsed}" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-collapsed"
- style="#{this:getHandleCollapsedDisplayStyle(context, component)};border:0" alt=" " />
+ style="#{this:getHandleCollapsedDisplayStyle(context, component)};border:0" alt="" />
<jsp:scriptlet>
<![CDATA[
@@ -125,7 +125,7 @@
</jsp:scriptlet>
<img id="#{clientId}:handle:img:expanded" src="#{expanded}"
style="#{this:getHandleExpandedDisplayStyle(context, component)};border:0"
- class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" alt=" " />
+ class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" alt="" />
<jsp:scriptlet>
<![CDATA[
}
@@ -196,7 +196,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{leaf}" alt=" " class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{leaf}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
@@ -221,7 +221,7 @@
} else {
]]>
</jsp:scriptlet>
- <img src="#{folder}" alt=" " class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
+ <img src="#{folder}" alt="" class="dr-tree-h-ic-img-md dr-tree-h-ic-img" />
<jsp:scriptlet>
<![CDATA[
}
@@ -238,4 +238,4 @@
</tbody>
</table>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeNodeTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -1,107 +1,107 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import java.util.Iterator;
-
-import org.richfaces.model.TreeNode;
-import org.richfaces.model.TreeNodeImpl;
-
-import junit.framework.TestCase;
-
-/**
- * @author hans
- *
- */
-public class TreeNodeTest extends TestCase {
-
- private final static Object NODE_ID = new Integer(0);
-
- protected TreeNode node = null;
- protected static final int TEST_CHILDREN_COUNT = 7;
-
- /**
- * @param arg0
- */
- public TreeNodeTest(String arg0) {
- super(arg0);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- node = new TreeNodeImpl();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- node = null;
- }
-
- public void testChildrenNew() {
- assertFalse(node.getChildren().hasNext());
- }
-
- public void testChildrenCount() {
- for (int i = 0; i < TEST_CHILDREN_COUNT; i++)
- node.addChild(new Integer(i), new TreeNodeImpl());
- Iterator it = node.getChildren();
- int count = 0;
- for (; it.hasNext(); it.next())
- count++;
- assertEquals(count, TEST_CHILDREN_COUNT);
- }
-
- public void testIsLeafNew() {
- assertTrue(node.isLeaf());
- }
-
- public void testIsLeaf() {
- node.addChild(NODE_ID, new TreeNodeImpl());
- assertFalse(node.isLeaf());
- }
-
- public void testParent() {
- TreeNode child = new TreeNodeImpl();
- node.addChild(NODE_ID, child);
- assertEquals(child.getParent(), node);
- }
-
- public void testGetChild() {
- TreeNode firstNode = new TreeNodeImpl();
- firstNode.setData("First Node");
- TreeNode secondNode = new TreeNodeImpl();
- secondNode.setData("Second Node");
- node.addChild(NODE_ID, firstNode);
- node.addChild("second", secondNode);
- node.addChild("third", new TreeNodeImpl());
- assertTrue(node.getChild("second").getData().equals("Second Node"));
- }
-
- public void testRemove() {
- assertTrue(node.isLeaf());
- node.addChild(NODE_ID, new TreeNodeImpl());
- assertFalse(node.isLeaf());
- node.removeChild(NODE_ID);
- assertTrue(node.isLeaf());
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+
+import junit.framework.TestCase;
+
+/**
+ * @author hans
+ *
+ */
+public class TreeNodeTest extends TestCase {
+
+ private final static Object NODE_ID = new Integer(0);
+
+ protected TreeNode node = null;
+ protected static final int TEST_CHILDREN_COUNT = 7;
+
+ /**
+ * @param arg0
+ */
+ public TreeNodeTest(String arg0) {
+ super(arg0);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ node = new TreeNodeImpl();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ node = null;
+ }
+
+ public void testChildrenNew() {
+ assertFalse(node.getChildren().hasNext());
+ }
+
+ public void testChildrenCount() {
+ for (int i = 0; i < TEST_CHILDREN_COUNT; i++)
+ node.addChild(new Integer(i), new TreeNodeImpl());
+ Iterator it = node.getChildren();
+ int count = 0;
+ for (; it.hasNext(); it.next())
+ count++;
+ assertEquals(count, TEST_CHILDREN_COUNT);
+ }
+
+ public void testIsLeafNew() {
+ assertTrue(node.isLeaf());
+ }
+
+ public void testIsLeaf() {
+ node.addChild(NODE_ID, new TreeNodeImpl());
+ assertFalse(node.isLeaf());
+ }
+
+ public void testParent() {
+ TreeNode child = new TreeNodeImpl();
+ node.addChild(NODE_ID, child);
+ assertEquals(child.getParent(), node);
+ }
+
+ public void testGetChild() {
+ TreeNode firstNode = new TreeNodeImpl();
+ firstNode.setData("First Node");
+ TreeNode secondNode = new TreeNodeImpl();
+ secondNode.setData("Second Node");
+ node.addChild(NODE_ID, firstNode);
+ node.addChild("second", secondNode);
+ node.addChild("third", new TreeNodeImpl());
+ assertTrue(node.getChild("second").getData().equals("Second Node"));
+ }
+
+ public void testRemove() {
+ assertTrue(node.isLeaf());
+ node.addChild(NODE_ID, new TreeNodeImpl());
+ assertFalse(node.isLeaf());
+ node.removeChild(NODE_ID);
+ assertTrue(node.isLeaf());
+ }
+
+}
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsListenersTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsListenersTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/events/TreeEventsListenersTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -116,4 +116,4 @@
public FacesEvent getEvent() {
return event;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/treeModel/src/test/java/org/richfaces/component/TreeModelComponentTest.java
===================================================================
--- trunk/ui/treeModel/src/test/java/org/richfaces/component/TreeModelComponentTest.java 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/treeModel/src/test/java/org/richfaces/component/TreeModelComponentTest.java 2008-12-23 18:34:51 UTC (rev 12000)
@@ -258,4 +258,4 @@
return null;
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx
===================================================================
--- trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-12-23 18:14:24 UTC (rev 11999)
+++ trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-12-23 18:34:51 UTC (rev 12000)
@@ -37,4 +37,4 @@
//]]>
</script>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
16 years, 9 months
JBoss Rich Faces SVN: r11999 - trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-23 13:14:24 -0500 (Tue, 23 Dec 2008)
New Revision: 11999
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
Log:
https://jira.jboss.org/jira/browse/RF-5104
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-12-23 17:22:53 UTC (rev 11998)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-12-23 18:14:24 UTC (rev 11999)
@@ -492,7 +492,7 @@
public boolean shouldRenderAttribute(String attributeName, Object attributeVal) {
if (!requiredAttributes.contains(attributeName)) {
- shouldRenderAttribute(attributeVal);
+ return shouldRenderAttribute(attributeVal);
} else {
if (null == attributeVal) {
return false;
16 years, 9 months
JBoss Rich Faces SVN: r11998 - trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-12-23 12:22:53 -0500 (Tue, 23 Dec 2008)
New Revision: 11998
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
Log:
https://jira.jboss.org/jira/browse/RF-5104
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-12-23 16:54:44 UTC (rev 11997)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-12-23 17:22:53 UTC (rev 11998)
@@ -25,8 +25,10 @@
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Set;
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
@@ -66,9 +68,12 @@
* Substitutions for components properies names and HTML attributes names.
*/
private static Map<String, String> substitutions = new HashMap<String, String>();
+
+ private static Set<String> requiredAttributes = new HashSet<String>();
static {
substitutions.put(HTML.class_ATTRIBUTE, "styleClass");
+ requiredAttributes.add(HTML.alt_ATTRIBUTE);
Arrays.sort(HTML.PASS_THRU);
Arrays.sort(HTML.PASS_THRU_BOOLEAN);
Arrays.sort(HTML.PASS_THRU_URI);
@@ -387,7 +392,7 @@
ResponseWriter writer, String attribute) throws IOException {
Object value = attributeValue(attribute, attributes
.get(getComponentAttributeName(attribute)));
- if (null != value && shouldRenderAttribute(value)) {
+ if (null != value && shouldRenderAttribute(attribute, value)) {
if (Arrays.binarySearch(HTML.PASS_THRU_URI, attribute) >= 0) {
String url = context.getApplication().getViewHandler()
.getResourceURL(context, value.toString());
@@ -439,7 +444,7 @@
Object property, String attributeName) throws IOException {
ResponseWriter writer = context.getResponseWriter();
Object value = component.getAttributes().get(property);
- if (shouldRenderAttribute(value)) {
+ if (shouldRenderAttribute(attributeName, value)) {
writer.writeAttribute(attributeName, value, property.toString());
}
@@ -461,7 +466,7 @@
*/
public void writeAttribute(ResponseWriter writer, String attribute,
Object value) throws IOException {
- if (shouldRenderAttribute(value)) {
+ if (shouldRenderAttribute(attribute, value)) {
writer.writeAttribute(attribute, value.toString(), attribute);
}
}
@@ -484,6 +489,17 @@
} else
return isValidProperty(attributeVal);
}
+
+ public boolean shouldRenderAttribute(String attributeName, Object attributeVal) {
+ if (!requiredAttributes.contains(attributeName)) {
+ shouldRenderAttribute(attributeVal);
+ } else {
+ if (null == attributeVal) {
+ return false;
+ }
+ }
+ return true;
+ }
/**
* Test for valid value of property. by default, for non-setted properties
16 years, 9 months
JBoss Rich Faces SVN: r11997 - in trunk/docs: migrationguide/en/src/main/docbook and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-12-23 11:54:44 -0500 (Tue, 23 Dec 2008)
New Revision: 11997
Added:
trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
Modified:
trunk/docs/common-resources/en/src/main/css/html-common.css
trunk/docs/migrationguide/en/src/main/docbook/master.xml
Log:
RF-3048 - Migration issues were added
Modified: trunk/docs/common-resources/en/src/main/css/html-common.css
===================================================================
--- trunk/docs/common-resources/en/src/main/css/html-common.css 2008-12-23 16:08:35 UTC (rev 11996)
+++ trunk/docs/common-resources/en/src/main/css/html-common.css 2008-12-23 16:54:44 UTC (rev 11997)
@@ -22,11 +22,6 @@
color: #334D69;
}
-
-div.chapter, div.section {
- padding-top:3em;
-}
-
div.book, div.chapter, div.section{
width:1000px;
margin:0 auto;
@@ -38,6 +33,10 @@
font-size:10px;
}
+.docnav{
+ padding:1em 0 3em;
+}
+
.docnav li.previous strong, .docnav li.next strong {
width: 200px;
height:22px;
Added: trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml (rev 0)
+++ trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml 2008-12-23 16:54:44 UTC (rev 11997)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section id="dataTableAjax" role="new">
+ <?dbhtml filename="dataTableAjax.html"?>
+ <sectioninfo>
+ <keywordset>
+ <keyword>dataTable</keyword>
+ <keyword>ajax</keyword>
+ </keywordset>
+ </sectioninfo>
+ <title>Ajax request calls encode() method of <rich:dataTable> even if it is not necessary</title>
+ <section>
+ <title>Description</title>
+ <para>
+ Any Ajax request reloads the list that is related to the <emphasis role="bold"><property><rich:dataTable></property></emphasis> component even if the Ajax request is related to another bean.
+It happens because the Ajax request checks whether the <emphasis role="bold"><property><rich:dataTable></property></emphasis> has nested <emphasis role="bold"><property><h:outputPanel></property></emphasis> or <emphasis role="bold"><property><h:messages></property></emphasis> components that should be updated.
+If there are no <emphasis role="bold"><property><h:outputPanel></property></emphasis>, <emphasis role="bold"><property><h:messages></property></emphasis> components inside the <emphasis role="bold"><property><rich:dataTable></property></emphasis> is not updated, but anyway the <code>encode()</code> method is called by the Ajax request.
+ </para>
+ </section>
+ <section>
+ <title>Links</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <ulink url="https://jira.jboss.org/jira/browse/RF-3341">Jira</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4197996#...">RichFaces Forum</ulink>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>How to reproduce</title>
+ <para>
+ Place the following code on a page and click the button. The list in <code>myBean1.myList</code> will be reloaded.
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:form id="form1">
+ <rich:dataTable id="myTable" value="#{myBean1.myList}" var="comp">
+ ...
+ </rich:dataTable>
+</h:form>
+<h:form id="form2">
+ <h:outputText value="#{myBean2.test}"/>
+ <a4j:commandButton event="onclick" reRender="form2" />
+</h:form>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Causes</title>
+ <para>
+ Bug is caused by <emphasis role="bold"><property><rich:dataTable></property></emphasis> implementation peculiarity.
+ </para>
+ </section>
+
+ <section>
+ <title>Workarounds</title>
+ <para>
+ Wrap the zone of a page that should be processed and updated in the <emphasis role="bold"><property><a4j:region></property></emphasis> component with <code>renderRegionOnly="true"</code>. The <emphasis role="bold"><property><rich:dataTable></property></emphasis> should be outside of the <emphasis role="bold"><property><a4j:region></property></emphasis>.
+ </para>
+ </section>
+</section>
Property changes on: trunk/docs/migrationguide/en/src/main/docbook/included/dataTableAjax.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/docs/migrationguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/migrationguide/en/src/main/docbook/master.xml 2008-12-23 16:08:35 UTC (rev 11996)
+++ trunk/docs/migrationguide/en/src/main/docbook/master.xml 2008-12-23 16:54:44 UTC (rev 11997)
@@ -23,6 +23,7 @@
<!ENTITY asClientId SYSTEM "included/asClientId.xml">
<!ENTITY panelGridClass SYSTEM "included/panelGridClass.xml">
+ <!ENTITY dataTableAjax SYSTEM "included/dataTableAjax.xml">
]>
<book>
@@ -155,7 +156,8 @@
However, most of the problems can be positively solved.
This section covers the most significant issues you can potentially encounter, providing ways to handle the cases.
</para>
-&panelGridClass;
+&panelGridClass;
+&dataTableAjax;
</section>
<section id="ThirdPartyFrameworks32to33">
<?dbhtml filename="ThirdPartyFrameworks32to33.html"?>
16 years, 9 months
JBoss Rich Faces SVN: r11996 - in trunk/ui/editor/src/main/java/org/richfaces: convert/seamtext and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-12-23 11:08:35 -0500 (Tue, 23 Dec 2008)
New Revision: 11996
Modified:
trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/SeamTextConverterFactory.java
trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
trunk/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
Log:
Editor code review results committed
Modified: trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-23 16:06:54 UTC (rev 11995)
+++ trunk/ui/editor/src/main/java/org/richfaces/component/UIEditor.java 2008-12-23 16:08:35 UTC (rev 11996)
@@ -48,6 +48,7 @@
/** Id suffix of textarea which used as target element for tinyMCE scripts*/
public static final String EDITOR_TEXT_AREA_ID_SUFFIX = "TextArea";
+ //TODO nick - it's a bad idea to create converterFactory instance for each component
private SeamTextConverterFactory converterFactory = new SeamTextConverterFactory();
public abstract void setType(String type);
@@ -142,6 +143,8 @@
if(isUseSeamText() && converter == null) {
return converterFactory.getConverter();
}
+
+ //TODO nick - check that converter is instance of SeamTextConverter if we use SeamText
return converter;
}
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java 2008-12-23 16:06:54 UTC (rev 11995)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java 2008-12-23 16:08:35 UTC (rev 11996)
@@ -51,10 +51,11 @@
/** The converter id for this converter. */
public static final String CONVERTER_ID = DefaultSeamTextConverter.class.getName();
-
+ //TODO nick - let everybody create instance of this class
private DefaultSeamTextConverter() {
}
+ //TODO nick - this class is not necessary
private static class DefaultConverterHolder {
private static final SeamTextConverter INSTANCE = new DefaultSeamTextConverter();
}
@@ -66,7 +67,7 @@
public Object getAsObject(FacesContext context, UIComponent component,
String value) {
try {
-
+ //TODO nick - value can be null here - see JavaDoc
Reader r = new StringReader(value);
HtmlSeamTextLexer lexer = new HtmlSeamTextLexer(r);
HtmlSeamTextParser parser = new HtmlSeamTextParser(lexer);
Modified: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/SeamTextConverterFactory.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/SeamTextConverterFactory.java 2008-12-23 16:06:54 UTC (rev 11995)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/SeamTextConverterFactory.java 2008-12-23 16:08:35 UTC (rev 11996)
@@ -44,9 +44,11 @@
public SeamTextConverter createSeamTextConverter() {
try {
-
+ //TODO nick - use ThreadCCL
Class clazz = Class.forName("org.richfaces.convert.seamtext.DefaultSeamTextConverter");
Method method = clazz.getMethod("getInstance");
+
+ //TODO nick - static method doesn't need any argument, better pass null
return (SeamTextConverter) method.invoke(clazz);
} catch(Exception e) {
Modified: trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-23 16:06:54 UTC (rev 11995)
+++ trunk/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-12-23 16:08:35 UTC (rev 11996)
@@ -82,6 +82,7 @@
* @param value - component value
* @return converted to String model value
*/
+ //TODO nick - do we really need this method?
protected String getConvertedStringValue(FacesContext context,
UIEditor component, Object value) {
return InputUtils.getConvertedStringValue(context, component, value);
@@ -151,6 +152,8 @@
InternetResource resource = getResource(resourceName);
String resourceUri = resource.getUri(context, null);
String suffix = resourceUri.substring(resourceUri.indexOf(resourceName) + resourceName.length());
+
+ //TODO nick - I doubt suffix can be null
if(suffix == null){
suffix = "";
}
@@ -176,6 +179,8 @@
try {
ClassLoader loader = Thread.currentThread()
.getContextClassLoader();
+
+ //TODO nick - use org.ajax4jsf.resource.util.URLToStreamHelper.urlToStream(URL)
InputStream is = loader.getResourceAsStream(configName
+ ".properties");
if (is == null) {
@@ -184,6 +189,8 @@
+ configName
+ "' was not found in class path");
}
+
+ //TODO nick - streams should be closed, in finally block
parameters.load(is);
writer.writeText(this.convertProperties(parameters), null);
writer.writeText(";\n", null);
@@ -204,6 +211,7 @@
* @param component - Editor component instance
* @throws IOException
*/
+ //TODO nick - merge with writeEditorConfigurationParameters() method
public void writeEditorCustomPluginsParameters(FacesContext context,
UIEditor component) throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -325,6 +333,8 @@
+ ScriptUtils.toScript(component.getHeight())
+ ";\n", null);
}
+
+ //TODO nick - use local variables
if (component.getOninit() != null && component.getOninit().length() > 0) {
writer.writeText("tinyMceParams.oninit = function (event) {\n"
+ component.getOninit() + "\n" + "};\n", null);
@@ -405,6 +415,7 @@
* @return true if needed or false if only target textarea should be rendered
*/
public boolean shouldRenderTinyMCE(UIEditor component) {
+ //TODO nick - use TINY_MCE_DISABLED_MODE.equalsIgnoreCase(component.getViewMode())
if (component.getViewMode() != null
&& component.getViewMode().equalsIgnoreCase(
TINY_MCE_DISABLED_MODE)) {
Modified: trunk/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-12-23 16:06:54 UTC (rev 11995)
+++ trunk/ui/editor/src/main/java/org/richfaces/renderkit/resources/EditorHTMLRenderer.java 2008-12-23 16:08:35 UTC (rev 11996)
@@ -117,7 +117,11 @@
int total = 0;
BufferedReader br = new BufferedReader(new InputStreamReader(in));
+
+ //TODO nick - why we need BufferedWriter?
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out));
+
+ //TODO nick - cannot be changed in runtime, cache in private field
String scriptSuffix = getSriptMappingSuffix();
String cssSuffix = getCssMappingSuffix();
@@ -156,6 +160,7 @@
total += line.getBytes().length;
}
} finally {
+ //TODO nick - close always flushes, no need to do that explicitly
bw.flush();
br.close();
bw.close();
16 years, 9 months
JBoss Rich Faces SVN: r11995 - trunk/ui/menu-components/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-23 11:06:54 -0500 (Tue, 23 Dec 2008)
New Revision: 11995
Modified:
trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
Log:
https://jira.jboss.org/jira/browse/RF-2516
Modified: trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx
===================================================================
--- trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-12-23 15:52:11 UTC (rev 11994)
+++ trunk/ui/menu-components/src/main/templates/org/richfaces/htmlMenuItem.jspx 2008-12-23 16:06:54 UTC (rev 11995)
@@ -68,9 +68,10 @@
Element.addClassName($('#{clientId}:anchor'), 'rich-menu-item-label-selected');"
style="#{menuItemStyle}"
onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled #{component.attributes['styleClass']}'; #{onselect} #{onclick};"
- onmouseup="Event.stop(event); #{component.attributes['onmouseup']}">
+ onmouseup="Event.stop(event); #{component.attributes['onmouseup']}"
+ onmousedown="Event.stop(event); #{component.attributes['onmousedown']}">
<f:call name="utils.encodeAttributes">
- <f:parameter value="onmousedown,onmousemove" />
+ <f:parameter value="onmousemove" />
</f:call>
<jsp:scriptlet><![CDATA[
16 years, 9 months
JBoss Rich Faces SVN: r11994 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/modalPanel and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-12-23 10:52:11 -0500 (Tue, 23 Dec 2008)
New Revision: 11994
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/testTrimOverlayedElements.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/Configurator.java
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
Log:
trimOverlayed test; template parameters
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/Configurator.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/Configurator.java 2008-12-23 14:26:04 UTC (rev 11993)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/Configurator.java 2008-12-23 15:52:11 UTC (rev 11994)
@@ -20,6 +20,11 @@
*/
package org.ajax4jsf.bean;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.ajax4jsf.template.Template;
+
public class Configurator {
private static final String[] LOAD_STRATEGIES = new String[] {"DEFAULT", "ALL"};
@@ -30,6 +35,8 @@
private static int currentStrategyIndex = 0;
+ private static Object[][] templates = null;
+
public Configurator() {}
public String getLoadScriptStrategy() {
@@ -47,5 +54,35 @@
public static void setLoadStyleStrategy(String strategy) {
loadStyleStrategy = strategy;
}
+
+ /**
+ * @return the templates
+ */
+ public static Object[][] getTemplates() {
+ return templates;
+ }
+
+ /**
+ * @param templates the templates to set
+ */
+ public static void setTemplates(String templateExpr) {
+ if (templateExpr != null) {
+ String[] array = new String[]{};
+ if(null != templateExpr) {
+ array = templateExpr.split(",");
+ }
+
+ List<Object[]> list = new ArrayList<Object[]>();
+ for (String string : array) {
+ Object[] elem = new Object[] {Template.valueOf(string.toUpperCase())};
+ list.add(elem);
+ }
+
+ templates = (Object[][]) list.toArray(new Object[0][0]);
+ }else {
+ templates = new Object[][] { { Template.SIMPLE }, { Template.DATA_TABLE }, { Template.DATA_TABLE2 }, { Template.MODAL_PANEL } };
+ }
+
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-12-23 14:26:04 UTC (rev 11993)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/ModalPanelTestBean.java 2008-12-23 15:52:11 UTC (rev 11994)
@@ -33,6 +33,7 @@
private Boolean resizeable = true;
private Boolean autosized = false;
private Boolean keepVisualState = false;
+ private Boolean trimOverlayedElements = true;
private String input;
/**
* @return the rendered
@@ -108,6 +109,11 @@
return null;
}
+ public String changeTrimOverlayed() {
+ trimOverlayedElements = false;
+ return null;
+ }
+
public String reset(){
rendered = true;
showWhenRendered = false;
@@ -116,6 +122,7 @@
input = null;
autosized = false;
keepVisualState = false;
+ trimOverlayedElements = true;
return null;
}
@@ -155,5 +162,17 @@
public void setKeepVisualState(Boolean keepVisualState) {
this.keepVisualState = keepVisualState;
}
+ /**
+ * @return the trimOverlayedElements
+ */
+ public Boolean getTrimOverlayedElements() {
+ return trimOverlayedElements;
+ }
+ /**
+ * @param trimOverlayedElements the trimOverlayedElements to set
+ */
+ public void setTrimOverlayedElements(Boolean trimOverlayedElements) {
+ this.trimOverlayedElements = trimOverlayedElements;
+ }
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/testTrimOverlayedElements.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/testTrimOverlayedElements.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/modalPanel/testTrimOverlayedElements.xhtml 2008-12-23 15:52:11 UTC (rev 11994)
@@ -0,0 +1,46 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ 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 template="#{templateBean.template}">
+ <ui:define name="style">
+ </ui:define>
+ <ui:define name="component">
+ <rich:modalPanel id="test_panel"
+ top="101"
+ left="102"
+ width="103"
+ height="104"
+ zindex="12"
+ showWhenRendered="false"
+ minWidth="70"
+ minHeight="70"
+ trimOverlayedElements="#{modalPanelBean.trimOverlayedElements}"
+ styleClass="noclass">
+ <f:facet name="header">
+ <h:outputText id="header" value="header" />
+ </f:facet>
+ <div style="position: absolute; width: 50px; left: -20px; top: 18px; color: red">
+ Richfaces
+ </div>
+ <h:form id="_f">
+ <h:outputText value="Richfaces modal panel" /><br/><br/>
+ <h:inputText id="input" value="#{modalPanelBean.input}" style="width: 20px"></h:inputText><br/>
+ <h:commandLink id="hide" onclick="Richfaces.hideModalPanel('test_panel'); return false;" value="Hide panel" /><br/>
+ <h:commandLink id="submit" value="Submit"></h:commandLink>
+ </h:form>
+ </rich:modalPanel>
+ <h:form id="form">
+ <a href="#" id="show" onclick="Richfaces.showModalPanel('test_panel'); return false;">Open</a>
+ <h:selectBooleanCheckbox id="trimOverlayed" value="#{modalPanelBean.trimOverlayedElements}"></h:selectBooleanCheckbox>
+ <h:commandButton id="submit" value="Submit"></h:commandButton>
+ </h:form>
+
+
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-23 14:26:04 UTC (rev 11993)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-12-23 15:52:11 UTC (rev 11994)
@@ -40,6 +40,7 @@
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
+import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import com.thoughtworks.selenium.DefaultSelenium;
@@ -130,7 +131,8 @@
@DataProvider(name = "templates")
protected Object[][] templates() {
- return new Object[][] { { Template.SIMPLE }, { Template.DATA_TABLE }, { Template.DATA_TABLE2 }, { Template.MODAL_PANEL } };
+ //return new Object[][] { { Template.SIMPLE }, { Template.DATA_TABLE }, { Template.DATA_TABLE2 }, { Template.MODAL_PANEL } };
+ return Configurator.getTemplates();
//return this.data;
}
@@ -212,10 +214,11 @@
}
@BeforeTest
- @Parameters({"loadStyleStrategy", "loadScriptStrategy"})
- protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy) throws Exception {
- Configurator.setLoadScriptStrategy(loadScriptStrategy);
+ @Parameters({"loadStyleStrategy", "loadScriptStrategy", "templates"})
+ protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy, @Optional String templates) throws Exception {
+ Configurator.setLoadScriptStrategy(loadScriptStrategy);
Configurator.setLoadStyleStrategy(loadStyleStrategy);
+ Configurator.setTemplates(templates);
}
/**
@@ -1369,7 +1372,7 @@
public void assertStyleAttributes(String id, Map<String, String> styleAttrs) {
for (String a : styleAttrs.keySet()) {
String actualStyle = getStyleAttributeString(id, a);
- Assert.assertEquals(actualStyle, styleAttrs.get(a), "Style attribute invalid. Expected ["+styleAttrs.get(a)+"]. But was ["+actualStyle+"]");
+ Assert.assertEquals(actualStyle, styleAttrs.get(a), "Style attribute invalid. Expected ["+ a + "="+ styleAttrs.get(a)+"]. But was ["+a + "=" + actualStyle+"]");
}
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-12-23 14:26:04 UTC (rev 11993)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ModalPanelTest.java 2008-12-23 15:52:11 UTC (rev 11994)
@@ -20,6 +20,9 @@
*/
package org.richfaces.testng;
+import java.util.HashMap;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -32,6 +35,7 @@
*/
public class ModalPanelTest extends SeleniumTestBase {
+ static final String TRIM_OVERLAYED_TEST = "pages/modalPanel/testTrimOverlayedElements.xhtml";
private final static String PANEL_ID="test_panel";
private final static String FORM_ID="form:";
private final static String FORM2_ID="_f:";
@@ -57,8 +61,35 @@
public String getTestUrl() {
return "pages/modalPanel/modalPanelTest.xhtml";
}
+
+ @Test
+ public void testTrimOverlayedElementsAttribute(Template template) {
+ renderPage(TRIM_OVERLAYED_TEST, template, RESET_METHOD_NAME);
+
+ String booleanId = getParentId() + FORM_ID + "trimOverlayed";
+ String submitId = getParentId() +FORM_ID + "submit";
+ String showButtonId = "show";
+
+ clickById(showButtonId);
+
+ Map<String, String> styles = new HashMap<String, String>();
+ styles.put("position", "relative");
+ styles.put("z-index", "0");
+
+ assertStyleAttributes(getParentId() + PANEL_CONTENT_DIV_ID, styles);
+
+ selenium.click(booleanId);
+ //selenium.check(booleanId);
+ clickCommandAndWait(submitId);
+ clickById(showButtonId);
+
+ styles.clear();
+ styles.put("position", "static");
+
+ assertStyleAttributes(getParentId() + PANEL_CONTENT_DIV_ID, styles);
+ }
- @Test
+ //@Test
public void testModalPanel(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing modal panel");
@@ -80,7 +111,7 @@
}
- @Test
+ //@Test
public void testRenderedAttribute(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing rendered attribute");
@@ -95,7 +126,7 @@
}
- @Test
+ //@Test
public void testShowWhenRenderedAttribute(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing showWhenRendered attribute");
@@ -111,7 +142,7 @@
AssertVisible(panelId);
}
- @Test
+ //@Test
public void testNotResizeableAndNotMoveable(Template template) {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing not resizeable panel");
@@ -144,7 +175,7 @@
}
- @Test
+ //@Test
public void testJSApi(Template template) {
renderPage(template, RESET_METHOD_NAME);
String panelId = getParentId() + PANEL_CONTAINER_DIV_ID;
@@ -159,7 +190,7 @@
AssertNotVisible(panelId, "Modal panel has not closed by JS API");
}
- @Test
+ //@Test
public void testLayoutAttributes(Template template) throws Exception {
renderPage(template, RESET_METHOD_NAME);
writeStatus("Testing layout attribute");
@@ -195,7 +226,7 @@
assertClassNames(panelContainerId, new String [] {"rich-modalpanel"}, "", true);
}
- @Test
+ //@Test
public void testDragByHeader(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -219,7 +250,7 @@
}
- @Test
+ // @Test
public void testMinWidthAndMinHeight(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -238,7 +269,7 @@
}
- @Test
+ //@Test
public void testNestedInputAndCommand(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -263,7 +294,7 @@
}
- @Test
+ //@Test
public void testAutosized(Template template) {
renderPage(template, RESET_METHOD_NAME);
@@ -304,7 +335,7 @@
}
- @Test
+ // @Test
public void testKeepVisualState(Template template) {
renderPage(template, RESET_METHOD_NAME);
String message = "KeepVisualState attribute does not work";
16 years, 9 months
JBoss Rich Faces SVN: r11993 - in trunk/ui/columns/src/main: java/org/richfaces/taglib and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-12-23 09:26:04 -0500 (Tue, 23 Dec 2008)
New Revision: 11993
Modified:
trunk/ui/columns/src/main/config/component/columns.xml
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
Log:
https://jira.jboss.org/jira/browse/RF-4292
Modified: trunk/ui/columns/src/main/config/component/columns.xml
===================================================================
--- trunk/ui/columns/src/main/config/component/columns.xml 2008-12-23 13:21:19 UTC (rev 11992)
+++ trunk/ui/columns/src/main/config/component/columns.xml 2008-12-23 14:26:04 UTC (rev 11993)
@@ -81,5 +81,13 @@
Binding attribute
</description>
</property>
+ <property>
+ <name>rendered</name>
+ <classname>boolean</classname>
+ <description>
+ Attribute defines if component should be rendered. Default value is "true".
+ </description>
+ <defaultvalue>true</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-12-23 13:21:19 UTC (rev 11992)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsHandler.java 2008-12-23 14:26:04 UTC (rev 11993)
@@ -95,6 +95,9 @@
/** end attribute */
private TagAttribute end;
+
+ /** rendered attribute */
+ private boolean rendered = true;
class IterationContext {
@@ -400,12 +403,32 @@
}
}
- /* (non-Javadoc)
- * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext, javax.faces.component.UIComponent)
- */
+ private void initRendered(FaceletContext ctx) {
+ TagAttribute renderedAttribute = getAttribute("rendered");
+ if (renderedAttribute != null) {
+ try {
+ this.rendered = (Boolean) renderedAttribute.getObject(ctx);
+ } catch (ClassCastException e) {
+ this.rendered = true;
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.taglib.ComponentHandler#apply(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent)
+ */
//@Override
public void apply(FaceletContext ctx, UIComponent parent)
throws IOException, FacesException, ELException {
+
+ initRendered(ctx);
+ if(!rendered){
+ return;
+ }
+
IterationContext iterationContext = new IterationContext();
iterationContextLocal.set(iterationContext);
Modified: trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java
===================================================================
--- trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2008-12-23 13:21:19 UTC (rev 11992)
+++ trunk/ui/columns/src/main/java/org/richfaces/taglib/ColumnsTag.java 2008-12-23 14:26:04 UTC (rev 11993)
@@ -241,6 +241,14 @@
* width Attribute defines width of column. Default value is "100px".
*/
private ValueExpression _width;
+
+ /**
+ * Attribute defines if component should be rendered.
+ */
+ private ValueExpression _rendered;
+
+ /** boolean value of rendered attr */
+ private boolean rendered = true;
/**
* SortOrder is an enumeration of the possible sort orderings. Setter for
@@ -282,7 +290,10 @@
*/
@Override
public int doStartTag() throws JspException {
-
+ initRendered();
+ if(!rendered){
+ return SKIP_BODY;
+ }
prepare();
if (hasNext()) {
@@ -329,6 +340,9 @@
*/
@Override
public int doEndTag() throws JspException {
+ if(!rendered){
+ return EVAL_PAGE;
+ }
if (!atFirst()) {
return super.doEndTag();
}
@@ -672,7 +686,21 @@
// TODO: handle exception
}
}
+
+ /**
+ * Extracts boolean value from index rendered
+ */
+ private void initRendered() {
+ if (_rendered != null) {
+ try {
+ rendered = (Boolean) _rendered.getValue(getELContext());
+ } catch (ClassCastException e) {
+ rendered = true;
+ }
+ }
+ }
+
/**
* Return true if we didn't complete column's count
*
@@ -1109,4 +1137,14 @@
public void setSortExpression(ValueExpression __sortExpression) {
this._sortExpression = __sortExpression;
}
+
+ /**
+ * Attribute defines whether to render component or not
+ * Setter for rendered
+ *
+ * @param __rendered - new value
+ */
+ public void setRendered(ValueExpression __rendered) {
+ this._rendered = __rendered;
+ }
}
16 years, 9 months
JBoss Rich Faces SVN: r11992 - trunk/framework/impl/src/main/resources/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-12-23 08:21:19 -0500 (Tue, 23 Dec 2008)
New Revision: 11992
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/component/messages_de.properties
Log:
use proper German messages
Modified: trunk/framework/impl/src/main/resources/org/richfaces/component/messages_de.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/component/messages_de.properties 2008-12-23 13:18:35 UTC (rev 11991)
+++ trunk/framework/impl/src/main/resources/org/richfaces/component/messages_de.properties 2008-12-23 13:21:19 UTC (rev 11992)
@@ -1,9 +1,9 @@
# components
org.richfaces.component.UIExtendedDataTable.Menu.Columns=Spalten
-org.richfaces.component.UIExtendedDataTable.Menu.SortAscending=Sortieren aufsteigend
-org.richfaces.component.UIExtendedDataTable.Menu.SortDescending=Sortieren absteigend
-org.richfaces.component.UIExtendedDataTable.Menu.GroupByColumn=Gruppe nach Spalte
-org.richfaces.component.UIExtendedDataTable.Menu.DisableGrouping=Deaktivieren Sie Gruppierung
+org.richfaces.component.UIExtendedDataTable.Menu.SortAscending=Absteigend sortieren
+org.richfaces.component.UIExtendedDataTable.Menu.SortDescending=Aufsteigend sortieren
+org.richfaces.component.UIExtendedDataTable.Menu.GroupByColumn=Gruppierung anhand der Spalte
+org.richfaces.component.UIExtendedDataTable.Menu.DisableGrouping=Gruppierung aufheben
# converters
16 years, 9 months
JBoss Rich Faces SVN: r11991 - trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-23 08:18:35 -0500 (Tue, 23 Dec 2008)
New Revision: 11991
Modified:
trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
Log:
https://jira.jboss.org/jira/browse/RF-2648
Modified: trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js
===================================================================
--- trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-12-23 12:13:56 UTC (rev 11990)
+++ trunk/ui/menu-components/src/main/resources/org/richfaces/renderkit/html/scripts/menu.js 2008-12-23 13:18:35 UTC (rev 11991)
@@ -399,6 +399,10 @@
var scrollOffsets = Position.realOffset(this.layer);
toolTipX = toolTipX + scrollOffsets[0];
toolTipY = toolTipY + scrollOffsets[1];
+ var dx = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
+ var dy = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
+ toolTipX -= dx;
+ toolTipY -= dy;
var layerdim = Element.getDimensions(this.layer);
var layerLeft = toolTipX;
16 years, 9 months
JBoss Rich Faces SVN: r11990 - trunk/ui/inplaceSelect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-23 07:13:56 -0500 (Tue, 23 Dec 2008)
New Revision: 11990
Modified:
trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
Log:
remove default value
Modified: trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml
===================================================================
--- trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-12-23 12:10:58 UTC (rev 11989)
+++ trunk/ui/inplaceSelect/src/main/config/component/inplaceselect.xml 2008-12-23 12:13:56 UTC (rev 11990)
@@ -71,7 +71,7 @@
<classname>java.lang.String</classname>
<description>The attribute is used to display text while
value is undefined</description>
- <defaultvalue>"\u00a0\u00a0\u00a0"</defaultvalue>
+ <defaultvalue>""</defaultvalue>
</property>
<property>
<name>showControls</name>
16 years, 9 months
JBoss Rich Faces SVN: r11989 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-23 07:10:58 -0500 (Tue, 23 Dec 2008)
New Revision: 11989
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml 2008-12-23 11:06:46 UTC (rev 11988)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml 2008-12-23 12:10:58 UTC (rev 11989)
@@ -45,7 +45,7 @@
</f:facet>
<h:form>
<h:panelGrid columns="2" id="editContent">
- <h:outputText value="Short Descrition:"/>
+ <h:outputText value="Short Description:"/>
<h:inputText value="#{calendarDataModel.currentShortDescription}"/>
<h:outputText value="Day Notes:"/>
<h:inputTextarea value="#{calendarDataModel.currentDescription}"/>
16 years, 9 months
JBoss Rich Faces SVN: r11988 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-12-23 06:06:46 -0500 (Tue, 23 Dec 2008)
New Revision: 11988
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
RF-5176 - the new section has been added
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-12-23 11:05:40 UTC (rev 11987)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-12-23 11:06:46 UTC (rev 11988)
@@ -2741,4 +2741,16 @@
</itemizedlist>
</para>
</section>
+ <section id="OnJBossServer">
+ <title>How to launch the RichFaces sample on the JBoss server </title>
+ <para>
+ In order to launch the RichFaces sample application on the JBoss server you necessary to add the following code to your web.xml:
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
+ <param-value>true</param-value>
+</context-param>
+...]]></programlisting>
+ </section>
</chapter>
16 years, 9 months
JBoss Rich Faces SVN: r11987 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-23 06:05:40 -0500 (Tue, 23 Dec 2008)
New Revision: 11987
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/facetsTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/layoutTests.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5343
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/facetsTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/facetsTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/facetsTest.xhtml 2008-12-23 11:05:40 UTC (rev 11987)
@@ -0,0 +1,48 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ 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 template="#{templateBean.template}">
+ <ui:define name="component">
+ <h:form id="_form">
+ <rich:calendar
+ id="calendar"
+ popup="false"
+ cellWidth="70px"
+ cellHeight="70px">
+ <f:facet name="header">
+ <h:panelGrid columns="2">
+ <h:outputText value="Header"/>
+ <h:outputText value="{todayControl}"/>
+ </h:panelGrid>
+ </f:facet>
+ <f:facet name="optionalHeader">
+ <h:outputText value="optionalHeader"/>
+ </f:facet>
+ <f:facet name="weekDay">
+ <h:outputText value="WD: {weekDayLabelShort}"/>
+ </f:facet>
+ <f:facet name="weekNumber">
+ <h:outputText value="WN: {weekNumber}" style="color:red"/>
+ </f:facet>
+ <f:facet name="footer">
+ <h:panelGrid columns="4">
+ <h:outputText value="Footer"/>
+ <h:outputText value="{previousMonthControl}"/>
+ <h:outputText value="{currentMonthControl}"/>
+ <h:outputText value="{nextMonthControl}"/>
+ </h:panelGrid>
+ </f:facet>
+ <f:facet name="optionalFooter">
+ <h:outputText value="optionalFooter"/>
+ </f:facet>
+ <h:outputText value="{day}"></h:outputText>
+ </rich:calendar>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/layoutTests.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-23 10:54:38 UTC (rev 11986)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-23 11:05:40 UTC (rev 11987)
@@ -75,6 +75,8 @@
static final String RESET_TIME_ON_DATE_SELECTION_TEST_URL = "pages/calendar/resetTimeOnDateSelectTest.xhtml";
+ static final String FACETS_TEST_URL = "pages/calendar/facetsTest.xhtml";
+
static final String CONTROLS_FORM_ID = "_controls:";
static final String availableDayCellClass = "rich-calendar-cell-size rich-calendar-cell rich-calendar-btn";
@@ -191,7 +193,15 @@
String enableManualInputId;
String boundaryDatesModeId;
+
+ String optionalHeaderFacetId;
+ String optionalFooterFacetId;
+
+ String headerFacetId;
+
+ String footerFacetId;
+
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
@@ -241,6 +251,10 @@
directionId = parentId + FORM_ID + "direction";
enableManualInputId = parentId + FORM_ID + "enableManualInput";
boundaryDatesModeId = parentId + FORM_ID + "boundaryDatesMode";
+ optionalHeaderFacetId = calendarId + "HeaderOptional";
+ optionalFooterFacetId = calendarId + "FooterOptional";
+ headerFacetId = calendarId + "Header";
+ footerFacetId = calendarId + "Footer";
}
String getStatus() {
@@ -1636,10 +1650,43 @@
@Test
public void testFacets(Template template) {
- renderPage(LAYOUT_TESTS_URL, template, null);
+ renderPage(FACETS_TEST_URL, template, null);
initIds(getParentId());
+ writeStatus("Check facets of the component: 'header', 'footer', 'optionalHeader', 'optionalFooter', 'weekNumber' and 'weekDay'");
- writeStatus("Check facets of the component: 'header', 'footer', 'optionalHeader', 'optionalFooter', 'weekNumber' and 'weekDay'");
+ AssertTextEquals(optionalHeaderFacetId, "optionalHeader", "Optional header facet is not rendered to client");
+ AssertTextEquals(optionalFooterFacetId, "optionalFooter", "Optional footer facet is not rendered to client");
+
+ writeStatus("Check header facet");
+ String headerFacetText = selenium.getText(headerFacetId);
+ Assert.assertTrue(headerFacetText.matches(".*Header.*"), "Header facet is not rendered to client");
+ Assert.assertTrue(headerFacetText.matches(".*Today.*"), "Header facet is not rendered to client");
+
+ writeStatus("Check footer facet");
+ AssertPresent(footerFacetId, "Footer facet is not rendered");
+ AssertTextEquals("//*[@id='" + footerFacetId + "']/table/tbody/tr/td[1]", "Footer");
+
+ writeStatus("Check '{previousMonthControl}' element works");
+ AssertTextEquals("//*[@id='" + footerFacetId + "']/table/tbody/tr/td[2]", "<");
+ String beforeHTML = getHTMLById(calendarId);
+ selenium.click("//*[@id='" + footerFacetId + "']/table/tbody/tr/td[2]/div");
+ String afterHTML = getHTMLById(calendarId);
+ Assert.assertFalse(afterHTML.equals(beforeHTML), "It looks as if previous month control does not work");
+
+ writeStatus("Check '{nextMonthControl}' element works");
+ AssertTextEquals("//*[@id='" + footerFacetId + "']/table/tbody/tr/td[4]", ">");
+ beforeHTML = getHTMLById(calendarId);
+ selenium.click("//*[@id='" + footerFacetId + "']/table/tbody/tr/td[4]/div");
+ afterHTML = getHTMLById(calendarId);
+ Assert.assertFalse(afterHTML.equals(beforeHTML), "It looks as if next month control does not work");
+
+ writeStatus("Check 'weekNumber' facet");
+ String weekNumberCellText = selenium.getText(calendarId + "WeekNumCell1");
+ Assert.assertTrue(weekNumberCellText.matches(".*WN:.*"), "Week number facet is not rendered to client");
+
+ writeStatus("Check 'weekDay' facet");
+ String weekDayCellText = selenium.getText(calendarId + "WeekDayCell1");
+ Assert.assertTrue(weekDayCellText.matches(".*WD:.*"), "Week day facet is not rendered to client");
}
@Test
16 years, 9 months
JBoss Rich Faces SVN: r11986 - in trunk/ui/fileUpload/src/main: flash/src and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-23 05:54:38 -0500 (Tue, 23 Dec 2008)
New Revision: 11986
Added:
trunk/ui/fileUpload/src/main/flash/bin/FileUploadComponent.swf
Modified:
trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/FileUploadComponent.swf
Log:
https://jira.jboss.org/jira/browse/RF-5175
https://jira.jboss.org/jira/browse/RF-5462
Added: trunk/ui/fileUpload/src/main/flash/bin/FileUploadComponent.swf
===================================================================
(Binary files differ)
Property changes on: trunk/ui/fileUpload/src/main/flash/bin/FileUploadComponent.swf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as
===================================================================
--- trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as 2008-12-23 10:46:57 UTC (rev 11985)
+++ trunk/ui/fileUpload/src/main/flash/src/FileUploadComponent.as 2008-12-23 10:54:38 UTC (rev 11986)
@@ -21,6 +21,7 @@
private var fileTypes: Array;
private var uploadIndex: Number;
private var parent:MovieClip;
+ private var disabled:Boolean;
public function FileUploadComponent(parent:MovieClip) {
this.parent = parent;
@@ -31,12 +32,14 @@
this.maxFiles = 5;
this.fileTypes = null;
this.uploadIndex = -1;
+ this.disabled = true;
//ExternalInterface.addCallback("browse", this, browse);
ExternalInterface.addCallback("setProperties", this, setProperties);
ExternalInterface.addCallback("removeFile", this, removeFile);
ExternalInterface.addCallback("uploadFile", this, uploadFile);
ExternalInterface.addCallback("cancelUploadFile", this, cancelUploadFile);
+ ExternalInterface.addCallback("disableAdd", this, disableAdd);
}
public function setProperties(properties:Object)
@@ -55,6 +58,16 @@
}
}
+ public function disableAdd(isDisabled:Boolean)
+ {
+ this.disabled = isDisabled;
+ }
+
+ public function isDisabled()
+ {
+ return this.disabled;
+ }
+
public function removeFile(index:Number)
{
if (index<this.uploadIndex) this.uploadIndex--;
@@ -188,6 +201,7 @@
swfRoot.onMouseUp = function ()
{
+ if (swfRoot.app.isDisabled()) return;
swfRoot.app.browse();
ExternalInterface.call(swfRoot.app.getComponentString() + "._flashClearFocus()");
}
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-23 10:46:57 UTC (rev 11985)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-12-23 10:54:38 UTC (rev 11986)
@@ -833,6 +833,7 @@
}
this._updateClassNames(d1, d2, this.classes.ADD, this.classes.ADD_CONTENT);
this.disabled = _disabled;
+ this._flashDisableAdd(disabled || this.disabled);
},
disableUploadButton: function () {
@@ -1122,6 +1123,7 @@
initFlashModule: function ()
{
var allowFlash = this.options.allowFlash;
+ this.oldDisabled = this.disabled;
if (allowFlash=="auto" || allowFlash=="true")
{
var httpsSuffix = window.location.href.substr(0,5).toLowerCase()=="https" ? "s" : "";
@@ -1170,9 +1172,15 @@
this.flashComponent.style.width = this.currentInput.parentNode.style.width;
this.flashComponent.style.height = this.currentInput.parentNode.style.height;
}
- this.enable();
+ if (!this.oldDisabled) this.enable();
},
+ _flashDisableAdd: function (isDisabled)
+ {
+ if (this.flashComponent)
+ this.flashComponent.disableAdd(isDisabled);
+ },
+
_flashAdd: function(files) {
if (this.disabled) return;
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/swf/FileUploadComponent.swf
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Rich Faces SVN: r11985 - trunk/test-applications/jsp/src/main/webapp/tTree.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-23 05:46:57 -0500 (Tue, 23 Dec 2008)
New Revision: 11985
Modified:
trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-23 10:46:28 UTC (rev 11984)
+++ trunk/test-applications/jsp/src/main/webapp/tTree/tTree.jsp 2008-12-23 10:46:57 UTC (rev 11985)
@@ -35,8 +35,8 @@
value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
ajaxSubmitSelection="#{tTree.ajaxSubmitSelection}"
immediate="#{tTree.immediate}" rendered="#{tTree.rendered}"
- reRender="reRenderID"
- nodeFace="#{defTree.name == 'param-value' ? 'input' : 'text'}"
+ reRender="reRenderID" ignoreDupResponses="true"
+ nodeFace="#{defTree.name != 'param-value' ? 'text' : 'input'}"
showConnectingLines="#{tTree.showConnectingLines}" focus="focusID"
nodeSelectListener="#{tTree.nodeSelectListener}"
toggleOnClick="#{tTree.toggleOnClick}"
16 years, 9 months
JBoss Rich Faces SVN: r11984 - trunk/test-applications/facelets/src/main/webapp/tTree.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-12-23 05:46:28 -0500 (Tue, 23 Dec 2008)
New Revision: 11984
Modified:
trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml 2008-12-23 10:42:07 UTC (rev 11983)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTree.xhtml 2008-12-23 10:46:28 UTC (rev 11984)
@@ -35,7 +35,8 @@
value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
ajaxSubmitSelection="#{tTree.ajaxSubmitSelection}"
immediate="#{tTree.immediate}" rendered="#{tTree.rendered}"
- reRender="reRenderID"
+ reRender="reRenderID" ignoreDupResponses="true"
+ nodeFace="#{defTree.name != 'param-value' ? 'text' : 'input'}"
showConnectingLines="#{tTree.showConnectingLines}" focus="focusID"
nodeSelectListener="#{tTree.nodeSelectListener}"
toggleOnClick="#{tTree.toggleOnClick}"
@@ -56,12 +57,12 @@
onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
onselected="#{event.onselected}">
- <rich:treeNode>
+ <rich:treeNode type="input">
<h:outputText value="#{defTree} : " />
<h:inputText value="#{defTree.name}" />
</rich:treeNode>
- <rich:treeNode>
+ <rich:treeNode type="text">
<h:outputText value="#{defTree}" />
</rich:treeNode>
</rich:tree>
Modified: trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml 2008-12-23 10:42:07 UTC (rev 11983)
+++ trunk/test-applications/facelets/src/main/webapp/tTree/tTreeStraightforward.xhtml 2008-12-23 10:46:28 UTC (rev 11984)
@@ -71,7 +71,7 @@
<rich:tree id="leftTree" style="width:300px"
nodeSelectListener="#{tTreeDND.processLSelection}"
- reRender="selectedNodeL, leftContainer" ajaxSubmitSelection="true"
+ reRender="selectedNodeL" ajaxSubmitSelection="true"
switchType="client" value="#{tTreeDND.treeNodeLeft}"
changeExpandListener="#{tTreeDND.onExpand}"
binding="#{tTreeDND.leftTree}"
@@ -96,7 +96,7 @@
<rich:tree id="rightTree" style="width:300px"
nodeSelectListener="#{tTreeDND.processRSelection}"
- reRender="selectedNodeR,rightContainer" ajaxSubmitSelection="true"
+ reRender="selectedNodeR" ajaxSubmitSelection="true"
switchType="client" value="#{tTreeDND.treeNodeRight}"
changeExpandListener="#{tTreeDND.onExpand}"
binding="#{tTreeDND.rightTree}"
16 years, 9 months