JBoss Rich Faces SVN: r6888 - Reports/3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-03-18 05:26:47 -0400 (Tue, 18 Mar 2008)
New Revision: 6888
Added:
trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008ayanul.xls
trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008vvolkov.xls
Modified:
trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR213032008ayanul.xls
Log:
Modified: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR213032008ayanul.xls
===================================================================
(Binary files differ)
Added: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008ayanul.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008ayanul.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008vvolkov.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008vvolkov.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Rich Faces SVN: r6887 - trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 23:29:37 -0400 (Mon, 17 Mar 2008)
New Revision: 6887
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2344
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-18 03:27:37 UTC (rev 6886)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-18 03:29:37 UTC (rev 6887)
@@ -344,7 +344,7 @@
return parent;
} else {
throw new FacesException("SuggestionBox cannot be attached to component having id: " +
- component.getId() + " because its client identifier is likely to not be written into browser! " +
+ parent.getId() + " because its client identifier is likely to not be written into browser! " +
"Please try to set id manually!");
}
} else {
16 years, 10 months
JBoss Rich Faces SVN: r6886 - trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 23:27:37 -0400 (Mon, 17 Mar 2008)
New Revision: 6886
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2344
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-18 03:27:32 UTC (rev 6885)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-18 03:27:37 UTC (rev 6886)
@@ -52,6 +52,7 @@
import org.ajax4jsf.resource.TemplateCSSResource;
import org.richfaces.component.AjaxSuggestionEvent;
import org.richfaces.component.UISuggestionBox;
+import org.richfaces.component.util.HtmlUtil;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
import org.richfaces.util.ReferenceMap;
@@ -87,6 +88,7 @@
*/
private final InternetResource[] additionalScripts = {
new org.ajax4jsf.javascript.PrototypeScript(),
+ getResource("/org/richfaces/renderkit/html/scripts/available.js"),
new org.ajax4jsf.javascript.SmartPositionScript(),
getResource("/org/richfaces/renderkit/html/scripts/browser_info.js"),
getResource("scripts/scriptaculo.js"),
@@ -336,8 +338,19 @@
+ " not found in SuggestionBox " + component.getId());
}
} else {
- throw new FacesException("Component SuggestionBox "
- + component.getId() + " don't have property 'for' ");
+ UIComponent parent = component.getParent();
+ if (parent != null) {
+ if (HtmlUtil.shouldWriteId(parent)) {
+ return parent;
+ } else {
+ throw new FacesException("SuggestionBox cannot be attached to component having id: " +
+ component.getId() + " because its client identifier is likely to not be written into browser! " +
+ "Please try to set id manually!");
+ }
+ } else {
+ throw new FacesException("Parent component is null for SuggestionBox " +
+ component.getId());
+ }
}
}
@@ -350,13 +363,15 @@
*/
private String getScript(final FacesContext context,
final UIComponent component) {
+ UIComponent targetComponent = getTarget(component);
+ String targetId = targetComponent.getClientId(context);
+
Map attributes = component.getAttributes();
StringBuffer script = new StringBuffer(" new ");
// Build ajax function call
JSFunction submitSuggest = AjaxRendererUtils.buildAjaxFunction(
component, context, "RichFaces.Suggestion");
- UIComponent targetComponent = getTarget(component);
- submitSuggest.addParameter(targetComponent.getClientId(context));
+ submitSuggest.addParameter(targetId);
submitSuggest.addParameter(component.getClientId(context));
submitSuggest.addParameter(component.getAttributes().get("onsubmit"));
Map options = AjaxRendererUtils.buildEventOptions(context, component);
@@ -399,7 +414,7 @@
submitSuggest.addParameter(options);
script.append(submitSuggest.toScript()).append(";\n");
- return script.toString();
+ return "Richfaces.onAvailable('" + targetId + "', function() {" + script.toString() + "});";
}
/**
16 years, 10 months
JBoss Rich Faces SVN: r6885 - in trunk/framework/impl/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 23:27:32 -0400 (Mon, 17 Mar 2008)
New Revision: 6885
Added:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js
Modified:
trunk/framework/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
Log:
http://jira.jboss.com/jira/browse/RF-2344
Modified: trunk/framework/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2008-03-18 03:27:25 UTC (rev 6884)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/util/HtmlUtil.java 2008-03-18 03:27:32 UTC (rev 6885)
@@ -25,6 +25,7 @@
import java.util.regex.Pattern;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import org.ajax4jsf.renderkit.RendererUtils;
@@ -35,7 +36,12 @@
*
*/
public class HtmlUtil {
- public static String qualifySize(String sizeDeclaration) {
+
+ private static final String ORG_RICHFACES = "org.richfaces.";
+
+ private static final String ORG_AJAX4JSF = "org.ajax4jsf.";
+
+ public static String qualifySize(String sizeDeclaration) {
String trimmedValue = sizeDeclaration.trim();
if (trimmedValue.length() != 0) {
char lastChar = trimmedValue.charAt(trimmedValue.length() - 1);
@@ -96,6 +102,22 @@
return buffer.toString();
}
+ public static boolean shouldWriteId(UIComponent component) {
+ String rendererType = component.getRendererType();
+
+ String id = component.getId();
+ if (id != null && !id.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
+
+ return true;
+ }
+
+ if (rendererType != null &&
+ (rendererType.startsWith(ORG_AJAX4JSF) || rendererType.startsWith(ORG_RICHFACES))) {
+
+ return true;
+ }
+
+ return false;
+ }
-
}
Added: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js (rev 0)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/available.js 2008-03-18 03:27:32 UTC (rev 6885)
@@ -0,0 +1,145 @@
+//Requires prototype.js & AJAX script
+if (!document.observe) {
+ throw "prototype.js is required!";
+}
+
+if (!A4J || !A4J.AJAX || !A4J.AJAX.AddListener) {
+ throw "AJAX script is required!";
+}
+
+if (!window.Richfaces) {
+ window.Richfaces = {};
+}
+
+Object.extend(Richfaces, function() {
+ var _queueLength = 0;
+ var _available = {};
+ var _pollingActivated = false;
+
+ var _lastEltId = null;
+
+ var executeCallback = function(elt, callbacks) {
+ if (callbacks instanceof Array) {
+ for (var i = 0; i < callbacks.length; i++) {
+ callbacks[i](elt);
+ }
+ } else {
+ callbacks(elt);
+ }
+ };
+
+ var stopPolling = function() {
+ if (_pollingActivated) {
+ Event.stopObserving(document, "mouseover", onEvent, true);
+ Event.stopObserving(document, "focus", onEvent, true);
+ Event.stopObserving(document, "focusin", onEvent, true);
+
+ _pollingActivated = false;
+ _lastEltId = null;
+ }
+ }
+
+ var onEvent = function(event) {
+ var elt = Event.element(event);
+ while (elt) {
+ var id = elt.id;
+ if (id) {
+ if (!_lastEltId) {
+ _lastEltId = id;
+ } else if (_lastEltId == id) {
+ //we can stop now because elements queue hasn't changed since we've checked this element
+ break;
+ }
+
+ var callbacks = _available[id];
+ if (callbacks) {
+ try {
+ executeCallback(elt, callbacks);
+ } catch (e) {
+ cleanup();
+ throw e;
+ }
+
+ delete _available[id];
+ if (--_queueLength == 0) {
+ stopPolling();
+ //done all elements for now
+ break;
+ }
+ }
+ }
+
+ elt = elt.parentNode;
+ }
+ };
+
+ var activatePolling = function() {
+ if (!_pollingActivated) {
+ Event.observe(document, "mousemove", onEvent, true);
+ Event.observe(document, "focus", onEvent, true);
+ Event.observe(document, "focusin", onEvent, true);
+
+ _pollingActivated = true;
+ }
+ };
+
+ var cleanup = function() {
+ try {
+ stopPolling();
+ _queueLength = 0;
+ _available = {};
+ } catch (e) {
+ LOG.error("Error occured during cleanup: " + e);
+ }
+ };
+
+
+ var onReady = function() {
+ try {
+ for (var id in _available) {
+ var elt = $(id);
+ if (elt) {
+ executeCallback(elt, _available[id]);
+ } else {
+ LOG.error("Element with id = " + id + " hasn't been found!");
+ }
+ }
+ } finally {
+ cleanup();
+ }
+ };
+
+ var onAvailable = function(eltId, callback) {
+ var elt = $(eltId);
+ if (elt) {
+ callback(elt);
+ } else {
+ var a = _available[eltId];
+ if (!a) {
+ _available[eltId] = callback;
+
+ //reset cached element because we've just changed the queue
+ _lastEltId = null;
+
+ _queueLength++;
+ activatePolling();
+ } else {
+ if (a instanceof Array) {
+ a.push(callback)
+ } else {
+ var ar = new Array();
+ ar.push(a);
+ ar.push(callback);
+ _available[eltId] = ar;
+ }
+ }
+ }
+ };
+
+ A4J.AJAX.AddListener(onReady);
+ document.observe("dom:loaded", onReady);
+
+ return {
+ onAvailable: onAvailable
+ };
+}());
16 years, 10 months
JBoss Rich Faces SVN: r6884 - in trunk/samples/suggestionbox-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 23:27:25 -0400 (Mon, 17 Mar 2008)
New Revision: 6884
Modified:
trunk/samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-2344
Modified: trunk/samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
===================================================================
--- trunk/samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2008-03-17 20:11:25 UTC (rev 6883)
+++ trunk/samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2008-03-18 03:27:25 UTC (rev 6884)
@@ -21,13 +21,16 @@
package org.richfaces;
-import org.richfaces.renderkit.html.SuggestionBoxRenderer;
-
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.io.Serializable;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.renderkit.html.SuggestionBoxRenderer;
+
public class SuggestionBox implements Serializable {
private String property;
@@ -67,7 +70,11 @@
}
public List autocomplete(Object suggest) {
- String pref = (String)suggest;
+ FacesContext context = FacesContext.getCurrentInstance();
+ FacesMessage message = new FacesMessage("SuggestionBox.autocomplete(" + suggest + ")");
+ context.addMessage(null, message);
+
+ String pref = (String)suggest;
ArrayList result = new ArrayList();
Iterator iterator = getAllData().iterator();
Modified: trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-17 20:11:25 UTC (rev 6883)
+++ trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-18 03:27:25 UTC (rev 6884)
@@ -11,6 +11,11 @@
<body>
<f:view>
+
+<a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+</a4j:outputPanel>
+
<h:form id="suggestionbox_form">
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
@@ -24,7 +29,7 @@
<br/>
<br/>
-<h:panelGrid columns="3" border="0" style="border: 1px solid black;">
+<h:panelGrid columns="4" border="0" style="border: 1px solid black;">
<f:verbatim>Suggestion Box will suggest you Town's names if it's started with the "a" or
"A" letter</f:verbatim>
@@ -35,30 +40,58 @@
<f:verbatim> </f:verbatim>
- <h:inputText value="#{suggestionBox.property}" id="text"/>
- <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
- rules="#{suggestionBox.rules}"
- suggestionAction="#{suggestionBox.autocomplete}" var="result"
- fetchValue="#{result.text}"
- first="#{suggestionBox.intFirst}"
- minChars="#{suggestionBox.minchars}"
- shadowOpacity="#{suggestionBox.shadowOpacity}"
- border="#{suggestionBox.border}"
- width="#{suggestionBox.width}"
- height="#{suggestionBox.height}"
- shadowDepth="#{suggestionBox.shadowDepth}"
- cellpadding="#{suggestionBox.cellpadding}">
+ <h:panelGroup>
+ <h:inputText value="#{suggestionBox.property}" id="text"/>
+ <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
+ rules="#{suggestionBox.rules}"
+ suggestionAction="#{suggestionBox.autocomplete}" var="result"
+ fetchValue="#{result.text}"
+ first="#{suggestionBox.intFirst}"
+ minChars="#{suggestionBox.minchars}"
+ shadowOpacity="#{suggestionBox.shadowOpacity}"
+ border="#{suggestionBox.border}"
+ width="#{suggestionBox.width}"
+ height="#{suggestionBox.height}"
+ shadowDepth="#{suggestionBox.shadowDepth}"
+ cellpadding="#{suggestionBox.cellpadding}">
+
+ <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
+ <h:column>
+ <h:outputText value="#{result.text}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{result.price}">
+ <f:convertNumber pattern="#,##.00" type="currency"/>
+ </h:outputText>
+ </h:column>
+ </rich:suggestionbox>
+ </h:panelGroup>
- <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
- <h:column>
- <h:outputText value="#{result.text}"/>
- </h:column>
- <h:column>
- <h:outputText value="#{result.price}">
- <f:convertNumber pattern="#,##.00" type="currency"/>
- </h:outputText>
- </h:column>
- </rich:suggestionbox>
+ <h:inputText value="#{suggestionBox.property}" id="text1">
+ <rich:suggestionbox id="suggestionBoxId1" tokens=",["
+ rules="#{suggestionBox.rules}"
+ suggestionAction="#{suggestionBox.autocomplete}" var="result"
+ fetchValue="#{result.text}"
+ first="#{suggestionBox.intFirst}"
+ minChars="#{suggestionBox.minchars}"
+ shadowOpacity="#{suggestionBox.shadowOpacity}"
+ border="#{suggestionBox.border}"
+ width="#{suggestionBox.width}"
+ height="#{suggestionBox.height}"
+ shadowDepth="#{suggestionBox.shadowDepth}"
+ cellpadding="#{suggestionBox.cellpadding}">
+
+ <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
+ <h:column>
+ <h:outputText value="#{result.text}"/>
+ </h:column>
+ <h:column>
+ <h:outputText value="#{result.price}">
+ <f:convertNumber pattern="#,##.00" type="currency"/>
+ </h:outputText>
+ </h:column>
+ </rich:suggestionbox>
+ </h:inputText>
</h:panelGrid>
<br/>
16 years, 10 months
JBoss Rich Faces SVN: r6883 - Reports/3.2.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-03-17 16:11:25 -0400 (Mon, 17 Mar 2008)
New Revision: 6883
Added:
trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008mvitenkov.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008mvitenkov.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.2.0/DailyReport320CR317032008mvitenkov.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 10 months
JBoss Rich Faces SVN: r6882 - trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 15:50:27 -0400 (Mon, 17 Mar 2008)
New Revision: 6882
Modified:
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
Log:
SuggestionBox: optimization - tokens cache added
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-17 19:50:23 UTC (rev 6881)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-17 19:50:27 UTC (rev 6882)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -53,11 +54,16 @@
import org.richfaces.component.UISuggestionBox;
import org.richfaces.skin.Skin;
import org.richfaces.skin.SkinFactory;
+import org.richfaces.util.ReferenceMap;
/**
* Renderer for SuggestionBox component.
*/
public class SuggestionBoxRenderer extends AjaxComponentRendererBase {
+
+ private static final Map<String, Pattern> tokensCache =
+ Collections.synchronizedMap(new ReferenceMap<String, Pattern>());
+
/**
* Component options.
*/
@@ -120,17 +126,26 @@
//TODO nick - cache ?
String tokens = (String) component.getAttributes().get("tokens");
if (tokens != null && tokens.length() != 0) {
- StringBuilder patternSource = new StringBuilder();
- char[] array = tokens.toCharArray();
- int l = array.length;
- for (int i = 0; i < l; i++) {
- if (i != 0) {
- patternSource.append('|');
- }
- patternSource.append(Pattern.quote(String.valueOf(array[i])));
- }
-
- return Pattern.compile(patternSource.toString());
+ Pattern pattern;
+ synchronized (tokensCache) {
+ pattern = tokensCache.get(tokens);
+ if (pattern == null) {
+ StringBuilder patternSource = new StringBuilder();
+ char[] array = tokens.toCharArray();
+ int l = array.length;
+ for (int i = 0; i < l; i++) {
+ if (i != 0) {
+ patternSource.append('|');
+ }
+ patternSource.append(Pattern.quote(String.valueOf(array[i])));
+ }
+
+ pattern = Pattern.compile(patternSource.toString());
+ tokensCache.put(tokens, pattern);
+ }
+ }
+
+ return pattern;
} else {
return null;
}
16 years, 10 months
JBoss Rich Faces SVN: r6881 - in trunk/framework/impl/src/main/java/org/richfaces: util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-17 15:50:23 -0400 (Mon, 17 Mar 2008)
New Revision: 6881
Added:
trunk/framework/impl/src/main/java/org/richfaces/util/
trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java
Log:
SuggestionBox: optimization - tokens cache added
Added: trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2008-03-17 19:50:23 UTC (rev 6881)
@@ -0,0 +1,159 @@
+/**
+ * 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.util;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Created 17.03.2008
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public class ReferenceMap<K, V> implements Map<K, V> {
+
+ private Map<K, ReferenceMapSoftReference<K, V>> map = new HashMap<K, ReferenceMapSoftReference<K, V>>();
+
+ private ReferenceQueue<V> queue = new ReferenceQueue<V>();
+
+ private void purge() {
+ Reference<? extends V> reference = null;
+ while ((reference = queue.poll()) != null) {
+ ReferenceMapSoftReference<?, ?> entry = (ReferenceMapSoftReference<?, ?>) reference;
+ entry.clear();
+ map.remove(entry.getKey());
+ }
+ }
+
+ public void clear() {
+ map.clear();
+ while (queue.poll() != null) {
+ //release queue entries
+ }
+ }
+
+ public boolean containsKey(Object key) {
+ purge();
+
+ return map.containsKey(key);
+ }
+
+ public boolean containsValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set<java.util.Map.Entry<K, V>> entrySet() {
+ throw new UnsupportedOperationException();
+ }
+
+ public V get(Object key) {
+ purge();
+
+ ReferenceMapSoftReference<K,V> reference = map.get(key);
+ if (reference != null) {
+ return reference.get();
+ }
+
+ return null;
+ }
+
+ public boolean isEmpty() {
+ purge();
+
+ return map.isEmpty();
+ }
+
+ public Set<K> keySet() {
+ purge();
+
+ return map.keySet();
+ }
+
+ private V doPut(K key, V value) {
+ ReferenceMapSoftReference<K,V> reference = map.put(key,
+ new ReferenceMapSoftReference<K, V>(key, value, queue));
+
+ if (reference != null) {
+ return reference.get();
+ }
+
+ return null;
+ }
+
+ public V put(K key, V value) {
+ purge();
+
+ return doPut(key, value);
+ }
+
+ public void putAll(Map<? extends K, ? extends V> t) {
+ purge();
+
+ for (Map.Entry<? extends K, ? extends V> entry: t.entrySet()) {
+ doPut(entry.getKey(), entry.getValue());
+ }
+ }
+
+ public V remove(Object key) {
+ purge();
+
+ ReferenceMapSoftReference<K,V> reference = map.remove(key);
+ if (reference != null) {
+ return reference.get();
+ }
+
+ return null;
+ }
+
+ public int size() {
+ purge();
+
+ return map.size();
+ }
+
+ public Collection<V> values() {
+ throw new UnsupportedOperationException();
+ }
+}
+
+class ReferenceMapSoftReference<K, V> extends SoftReference<V> {
+ private K key;
+
+ public K getKey() {
+ return key;
+ }
+
+ public ReferenceMapSoftReference(K key, V value) {
+ this(key, value, null);
+ }
+
+ public ReferenceMapSoftReference(K key, V value, ReferenceQueue<? super V> queue) {
+ super(value, queue);
+ this.key = key;
+ }
+}
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r6880 - in trunk/ui: fileUpload/src/main/config/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-17 15:45:20 -0400 (Mon, 17 Mar 2008)
New Revision: 6880
Modified:
trunk/ui/dataTable/src/main/config/component/dataTable.xml
trunk/ui/dataTable/src/main/config/component/subTable.xml
trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
Log:
http://jira.jboss.com/jira/browse/RF-2310
Modified: trunk/ui/dataTable/src/main/config/component/dataTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-03-17 17:37:16 UTC (rev 6879)
+++ trunk/ui/dataTable/src/main/config/component/dataTable.xml 2008-03-17 19:45:20 UTC (rev 6880)
@@ -185,10 +185,10 @@
<classname>java.util.Collection</classname>
<description></description>
</property>
- <property hidden="true">
+ <property hidden="true" existintag="false" exist="false" >
<name>sortFields</name>
</property>
- <property hidden="true">
+ <property hidden="true" existintag="false" exist="false" >
<name>filterFields</name>
</property>
<property>
Modified: trunk/ui/dataTable/src/main/config/component/subTable.xml
===================================================================
--- trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-03-17 17:37:16 UTC (rev 6879)
+++ trunk/ui/dataTable/src/main/config/component/subTable.xml 2008-03-17 19:45:20 UTC (rev 6880)
@@ -137,6 +137,12 @@
<classname>java.lang.String</classname>
<description>HTML: a script expression; a pointer is moved within of row
</description>
+ </property>
+ <property hidden="true" existintag="false" exist="false" >
+ <name>sortFields</name>
+ </property>
+ <property hidden="true" existintag="false" exist="false" >
+ <name>filterFields</name>
</property>
</component>
</components>
Modified: trunk/ui/fileUpload/src/main/config/component/fileUpload.xml
===================================================================
--- trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-17 17:37:16 UTC (rev 6879)
+++ trunk/ui/fileUpload/src/main/config/component/fileUpload.xml 2008-03-17 19:45:20 UTC (rev 6880)
@@ -66,25 +66,21 @@
<classname>java.lang.Object</classname>
<description>Collection of files uploaded</description>
</property>
- <property elonly="true">
- <name>contentType</name>
- <classname>java.lang.String</classname>
- <description>the property to receive the contentType</description>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>contentType</name>
+ <classname>java.lang.Object</classname>
</property>
- <property elonly="true">
- <name>fileName</name>
- <classname>java.lang.String</classname>
- <description>this value binding receives the filename (optional).</description>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>fileName</name>
+ <classname>java.lang.Object</classname>
</property>
- <property elonly="true">
- <name>fileSize</name>
- <classname>java.lang.Integer</classname>
- <description>this value binding receives the file size (optional).</description>
- </property>
- <property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>fileSize</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property hidden="true" existintag="false" exist="false" >
<name>progressInfo</name>
- <classname>java.lang.String</classname>
- <description>Defines bean name where progress info should be stored (optional).</description>
+ <classname>java.lang.Object</classname>
</property>
<property>
<name>maxFilesQuantity</name>
@@ -252,6 +248,34 @@
<property>
<name>stopEntryControlLabel</name>
<classname>java.lang.String</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>size</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>localContentType</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>localFileName</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>localFileSize</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>localInputStream</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>localValueSet</name>
+ <classname>java.lang.Object</classname>
+ </property>
+ <property elonly="true" hidden="true" existintag="false" exist="false" >
+ <name>maxLength</name>
+ <classname>java.lang.Object</classname>
</property>
</component>
&listeners;
Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-17 17:37:16 UTC (rev 6879)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-17 19:45:20 UTC (rev 6880)
@@ -183,7 +183,7 @@
</description>
</property>
- <property>
+ <property hidden="true" existintag="false" exist="false" >
<name>rowKey</name>
<classname>java.lang.Object</classname>
<description>The attribute is a representation of an identifier for a specific data row</description>
16 years, 10 months
JBoss Rich Faces SVN: r6879 - trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-17 13:37:16 -0400 (Mon, 17 Mar 2008)
New Revision: 6879
Modified:
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2173
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-03-17 17:18:06 UTC (rev 6878)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/table.jspx 2008-03-17 17:37:16 UTC (rev 6879)
@@ -3,14 +3,17 @@
xmlns:u='http:/jsf.exadel.com/template/util'
xmlns="http://www.w3.org/1999/xhtml">
- <table border="0" cellpadding="0" cellspacing="0" class="dr-sb-int-decor-table rich-sb-int-decor-table" width="100%" >
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" >
<f:attribute name="id">
<f:call name="getContentId"/>
</f:attribute>
<f:call name="utils.encodePassThruWithExclusions">
<f:parameter value="styleClass,class,onclick,onselect,width,height,rows,frame,bgcolor,border,rules,cellpadding"/>
</f:call>
- <f:attribute name="class" property="styleClass"/>
+ <f:attribute name="class">
+ <f:verbatim value="dr-sb-int-decor-table rich-sb-int-decor-table "/>
+ <f:verbatim property="styleClass"/>
+ </f:attribute>
<colgroup>
<f:attribute name="span" context="columnsCount" mantadory="false"/>
</colgroup>
16 years, 10 months