Author: nbelaevski
Date: 2008-04-24 20:52:13 -0400 (Thu, 24 Apr 2008)
New Revision: 8147
Modified:
trunk/framework/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java
trunk/framework/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
Log:
Skins code refactored
Modified:
trunk/framework/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java
===================================================================
---
trunk/framework/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java 2008-04-25
00:25:03 UTC (rev 8146)
+++
trunk/framework/impl/src/main/java/org/richfaces/skin/AbstractChainableSkinImpl.java 2008-04-25
00:52:13 UTC (rev 8147)
@@ -43,7 +43,7 @@
}
protected Skin getBaseSkin(FacesContext context) {
- Object object = getSkinParams().get(Skin.baseSkin);
+ Object object = getLocalParameter(context, Skin.baseSkin);
boolean base = isBase();
Skin skin = null;
@@ -82,7 +82,7 @@
}
}
- return getValueReference(context, object);
+ return object;
}
protected boolean containsProperty(FacesContext context, String name, int[]
singleInt) {
@@ -110,13 +110,13 @@
protected Object resolveSkinParameter(FacesContext context, String name) {
int[] singleInt = new int[] {0};
- Object resolvedParameter = resolveSkinParameter(context, name, singleInt);
+ Object resolvedParameter = getValueReference(context, resolveSkinParameter(context,
name, singleInt));
while (resolvedParameter instanceof String) {
String string = (String) resolvedParameter;
if (string.length() > 0 && string.charAt(0) == '&') {
singleInt[0]++;
- resolvedParameter = resolveSkinParameter(context, string.substring(1), singleInt);
+ resolvedParameter = getValueReference(context, resolveSkinParameter(context,
string.substring(1), singleInt));
if (resolvedParameter == null) {
throw new FacesException(Messages.getMessage(
Messages.SKIN_ILLEGAL_REFERENCE, name));
Modified: trunk/framework/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2008-04-25
00:25:03 UTC (rev 8146)
+++ trunk/framework/impl/src/main/java/org/richfaces/skin/BasicSkinImpl.java 2008-04-25
00:52:13 UTC (rev 8147)
@@ -56,10 +56,6 @@
this.skinParams = properties;
}
- protected Map<String, Object> getSkinParams() {
- return skinParams;
- }
-
/* (non-Javadoc)
* @see org.richfaces.skin.Skin#getRenderKitId(javax.faces.context.FacesContext)
*/
@@ -85,6 +81,10 @@
return value;
}
+ protected Object getLocalParameter(FacesContext context, String name) {
+ return getValueReference(context, skinParams.get(name));
+ }
+
protected Object resolveSkinParameter(FacesContext context, String name) {
return skinParams.get(name);
}
Show replies by date