Author: maksimkaszynski
Date: 2008-03-25 12:17:48 -0400 (Tue, 25 Mar 2008)
New Revision: 7186
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
Log:
http://jira.jboss.com/jira/browse/RF-2726
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-03-25
16:17:42 UTC (rev 7185)
+++
trunk/framework/impl/src/main/java/org/richfaces/renderkit/CompositeRenderer.java 2008-03-25
16:17:48 UTC (rev 7186)
@@ -43,20 +43,20 @@
*
*/
public abstract class CompositeRenderer extends AjaxChildrenRenderer {
- private List renderers = new ArrayList();
+ private List<RendererContributor> renderers = new
ArrayList<RendererContributor>();
- private List parameterEncoders = new ArrayList();
+ private List<AttributeParametersEncoder> parameterEncoders = new
ArrayList<AttributeParametersEncoder>();
private abstract static class Command {
- protected final void execute(Iterator renderers,
+ protected final void execute(Iterator<?> renderers,
FacesContext facesContext,
UIComponent component,
Object argument,
- Class clazz) {
+ Class<?> clazz) {
while (renderers.hasNext()) {
RendererContributor contributor = (RendererContributor) renderers.next();
- Class acceptableClass = contributor.getAcceptableClass();
+ Class<?> acceptableClass = contributor.getAcceptableClass();
if (clazz == null || acceptableClass == null ||
acceptableClass.isAssignableFrom(clazz)) {
execute(contributor, facesContext, component, argument);
}
@@ -101,7 +101,7 @@
String[] styleDependencies = renderer.getStyleDependencies();
if (styleDependencies != null) {
- Set styles = (Set) argument;
+ Set<String> styles = (Set<String>) argument;
for (int i = 0; i < styleDependencies.length; i++) {
styles.add(styleDependencies[i]);
@@ -119,7 +119,7 @@
String[] scriptDependencies = renderer.getScriptDependencies();
if (scriptDependencies != null) {
- Set scripts = (Set) argument;
+ Set<String> scripts = (Set<String>) argument;
for (int i = 0; i < scriptDependencies.length; i++) {
scripts.add(scriptDependencies[i]);
@@ -137,7 +137,7 @@
String contribution = renderer.getScriptContribution(context, component);
if (contribution != null) {
- ((List) argument).add(contribution);
+ ((List<String>) argument).add(contribution);
}
}
@@ -153,7 +153,7 @@
mergeScriptOptions(scriptOptions, context, component, null);
}
- protected void mergeScriptOptions(ScriptOptions scriptOptions, FacesContext context,
UIComponent component, Class acceptableClass) {
+ protected void mergeScriptOptions(ScriptOptions scriptOptions, FacesContext context,
UIComponent component, Class<?> acceptableClass) {
MERGE_OPTIONS_COMMAND.execute(renderers.iterator(), context, component, scriptOptions,
acceptableClass);
}
@@ -165,26 +165,26 @@
return getResources(null, MERGE_STYLE_DEPENDENCIES);
}
- protected InternetResource[] getScripts(Class clazz) {
+ protected InternetResource[] getScripts(Class<?> clazz) {
return getResources(clazz, MERGE_SCRIPT_DEPENDENCIES);
}
- protected InternetResource[] getStyles(Class clazz) {
+ protected InternetResource[] getStyles(Class<?> clazz) {
return getResources(clazz, MERGE_STYLE_DEPENDENCIES);
}
- private InternetResource[] getResources(Class acceptableClass, Command command) {
- Set scriptsSet = new LinkedHashSet();
+ private InternetResource[] getResources(Class<?> acceptableClass, Command command)
{
+ Set<String> scriptsSet = new LinkedHashSet<String>();
command.execute(renderers.iterator(), null, null, scriptsSet, acceptableClass);
if (!scriptsSet.isEmpty()) {
- Iterator iterator = scriptsSet.iterator();
+ Iterator<String> iterator = scriptsSet.iterator();
InternetResource[] result = new InternetResource[scriptsSet.size()];
for (int i = 0; i < result.length; i++) {
- result[i] = getResource((String) iterator.next());
+ result[i] = getResource(iterator.next());
}
return result;
@@ -197,13 +197,13 @@
return getScriptContributions(varString, context, component, component.getClass());
}
- protected String getScriptContributions(String varString, FacesContext context,
UIComponent component, Class acceptableClass) {
- List scriptContributions = new ArrayList();
+ protected String getScriptContributions(String varString, FacesContext context,
UIComponent component, Class<?> acceptableClass) {
+ List<String> scriptContributions = new ArrayList<String>();
GET_SCRIPT_CONTRIBUTIONS.execute(renderers.iterator(), context, component,
scriptContributions, acceptableClass);
StringBuffer result = new StringBuffer();
- for (Iterator itr = scriptContributions.iterator(); itr.hasNext(); ) {
+ for (Iterator<String> itr = scriptContributions.iterator(); itr.hasNext(); ) {
result.append(varString);
result.append(itr.next());
}
@@ -233,8 +233,8 @@
}
public void encodeAttributeParameters(FacesContext context, UIComponent component)
throws IOException {
- for (Iterator iterator = parameterEncoders.iterator(); iterator.hasNext();) {
- AttributeParametersEncoder encoder = (AttributeParametersEncoder) iterator.next();
+ for (Iterator<AttributeParametersEncoder> iterator =
parameterEncoders.iterator(); iterator.hasNext();) {
+ AttributeParametersEncoder encoder = iterator.next();
encoder.doEncode(context, component);
}
Modified:
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2008-03-25
16:17:42 UTC (rev 7185)
+++
trunk/framework/impl/src/main/java/org/richfaces/webapp/taglib/UIComponentELTagBase.java 2008-03-25
16:17:48 UTC (rev 7186)
@@ -78,7 +78,7 @@
data.setRowKeyConverter(conv);
}
} else {
- throw new
IllegalArgumentException(Messages.getMessage(Messages.NO_VALUE_HOLDER_ERROR,
component.getClass().getName()));
+ throw new IllegalArgumentException(Messages.getMessage(Messages.NO_DATA_ADAPTOR,
component.getClass().getName()));
}
}
}