You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/11/10 00:40:13 UTC
svn commit: r1200042 [1/3] - in
/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared:
component/ config/ renderkit/html/ renderkit/html/util/ resource/ taglib/
util/ util/el/
Author: lu4242
Date: Wed Nov 9 23:40:12 2011
New Revision: 1200042
URL: http://svn.apache.org/viewvc?rev=1200042&view=rev
Log:
apply some checkstyle rules
Modified:
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/component/EscapeCapable.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlListboxRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMenuRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/UnicodeEncoder.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ClassLoaderResourceLoader.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ExternalContextResourceLoader.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagBase.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/BiLevelCacheMap.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ClassLoaderExtension.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/ExceptionUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/HashMapUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/NullEnumeration.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/StringUtils.java
myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/util/el/GenericMap.java
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/component/EscapeCapable.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/component/EscapeCapable.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/component/EscapeCapable.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/component/EscapeCapable.java Wed Nov 9 23:40:12 2011
@@ -26,7 +26,8 @@ package org.apache.myfaces.shared.compon
* @author Grant Smith (latest modification by $Author$)
*/
-public interface EscapeCapable {
+public interface EscapeCapable
+{
boolean isEscape();
void setEscape(boolean escape);
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java Wed Nov 9 23:40:12 2011
@@ -18,7 +18,6 @@
*/
package org.apache.myfaces.shared.config;
-import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.context.ExternalContext;
@@ -113,9 +112,11 @@ public class MyfacesConfig
* gain performance.
*/
@JSFWebConfigParam(defaultValue="org.apache.myfaces. renderkit.html.util. DefaultAddResource",since="1.1",
- desc="Tomahawk specific: Indicate the class responsible to place scripts and css using tomahawk AddResource API", tags="tomahawk")
+ desc="Tomahawk specific: Indicate the class responsible to place scripts and css using " +
+ "tomahawk AddResource API", tags="tomahawk")
private static final String INIT_PARAM_ADD_RESOURCE_CLASS = "org.apache.myfaces.ADD_RESOURCE_CLASS";
- private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT = "org.apache.myfaces.renderkit.html.util.DefaultAddResource";
+ private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT =
+ "org.apache.myfaces.renderkit.html.util.DefaultAddResource";
/**
* Tomahawk specific: A very common problem in configuring MyFaces-web-applications
@@ -129,20 +130,25 @@ public class MyfacesConfig
*
* In tomahawk for JSF 2.0 since version 1.1.11, this param is set by default to false, otherwise is true.
*/
- @JSFWebConfigParam(defaultValue="for JSF 2.0 since 1.1.11 false, otherwise true", expectedValues="true, false, on, off, yes, no",since="1.1", ignoreUpperLowerCase=true,
- desc="Tomahawk specific: This parameter will check for a properly configured Extensions-Filter if it is needed by the web-app.", tags="tomahawk")
+ @JSFWebConfigParam(defaultValue="for JSF 2.0 since 1.1.11 false, otherwise true",
+ expectedValues="true, false, on, off, yes, no",since="1.1", ignoreUpperLowerCase=true,
+ desc="Tomahawk specific: This parameter will check for a properly configured Extensions-Filter if " +
+ "it is needed by the web-app.", tags="tomahawk")
private static final String INIT_CHECK_EXTENSIONS_FILTER = "org.apache.myfaces.CHECK_EXTENSIONS_FILTER";
private static final boolean INIT_CHECK_EXTENSIONS_FILTER_DEFAULT = false;
/**
* Tomahawk specific: Interpret "readonly" property as "disable" for select components like t:selectOneRow.
*/
- @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1", ignoreUpperLowerCase=true, tags="tomahawk", group="render")
- private static final String INIT_READONLY_AS_DISABLED_FOR_SELECT = "org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS";
+ @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1",
+ ignoreUpperLowerCase=true, tags="tomahawk", group="render")
+ private static final String INIT_READONLY_AS_DISABLED_FOR_SELECT =
+ "org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS";
private static final boolean INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT = true;
/**
- * Set the time in seconds that check for updates of web.xml and faces-config descriptors and refresh the configuration.
+ * Set the time in seconds that check for updates of web.xml and faces-config descriptors and
+ * refresh the configuration.
* This param is valid only if project stage is not production. Set this param to 0 disable this feature.
*/
@JSFWebConfigParam(defaultValue="2",since="1.1", classType="java.lang.Long")
@@ -158,16 +164,18 @@ public class MyfacesConfig
private static final boolean INIT_PARAM_VIEWSTATE_JAVASCRIPT_DEFAULT = false;
/**
- * Define if the input field that should store the state (javax.faces.ViewState) should render id="javax.faces.ViewState".
+ * Define if the input field that should store the state (javax.faces.ViewState) should render
+ * id="javax.faces.ViewState".
*
* JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
* and the "id" attribute of the hidden input that is rendered for the purpose of state saving
- * (see <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM">API</a>).
+ * (see ResponseStateManager.VIEW_STATE_PARAM).
* Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on
* one page. With the org.apache.myfaces.RENDER_VIEWSTATE_ID context parameter you can tune this behaviour.
* <br/>Set it to
* <ul><li>true - to render JSF 1.2 compliant id attributes (that might cause invalid XHTML), or</li>
- * <li>false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript components)</li></ul>
+ * <li>false - to omit rendering of the id attribute (which is only needed for very special
+ * AJAX/Javascript components)</li></ul>
* Default value is: true (for backwards compatibility and JSF 1.2 compliancy)
*/
@JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1",
@@ -203,18 +211,21 @@ public class MyfacesConfig
*/
@JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.2.3",
ignoreUpperLowerCase=true, group="render")
- private static final String INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON = "org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON";
+ private static final String INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON =
+ "org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON";
private static final boolean INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT= false;
/**
- * This param renders hidden fields at the end of h:form for link params when h:commandLink + f:param is used, instead
- * use javascript to create them. Set this param to true also enables org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON
- * automatically to ensure consistency. This feature is required to support Windows Mobile 6, because in this environment,
- * document.createElement() and form.appendChild() javascript methods are not supported.
+ * This param renders hidden fields at the end of h:form for link params when h:commandLink + f:param is used,
+ * instead use javascript to create them. Set this param to true also enables
+ * org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON
+ * automatically to ensure consistency. This feature is required to support Windows Mobile 6, because in
+ * this environment, document.createElement() and form.appendChild() javascript methods are not supported.
*/
@JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.2.9",
ignoreUpperLowerCase=true, group="render")
- private static final String INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS = "org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS";
+ private static final String INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS =
+ "org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS";
private static final boolean INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT= false;
/**
@@ -227,28 +238,31 @@ public class MyfacesConfig
private static final boolean INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT = false;
/**
- * Define an alternate class name that will be used to initialize MyFaces, instead the default javax.faces.webapp.FacesServlet.
+ * Define an alternate class name that will be used to initialize MyFaces, instead the default
+ * javax.faces.webapp.FacesServlet.
*
- * <p>This helps MyFaces to detect the mappings and other additional configuration used to setup the environment, and prevent
- * abort initialization if no FacesServlet config is detected.
+ * <p>This helps MyFaces to detect the mappings and other additional configuration used to setup the
+ * environment, and prevent abort initialization if no FacesServlet config is detected.
* </p>
*/
@JSFWebConfigParam(since="1.2.7")
private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET";
/**
- * Indicate if the facelet associated to the view should be reapplied when the view is refreshed. Default mode is "auto".
+ * Indicate if the facelet associated to the view should be reapplied when the view is refreshed.
+ * Default mode is "auto".
*
* <p>This param is only valid when partial state saving is on.
- * If this is set as true, the tag-handlers are always reapplied before render view, like in facelets 1.1.x, allowing
- * c:if work correctly to "toggle" components based on a value changed on invoke application phase.
+ * If this is set as true, the tag-handlers are always reapplied before render view, like in facelets 1.1.x,
+ * allowing c:if work correctly to "toggle" components based on a value changed on invoke application phase.
* If the param is set as "auto", the implementation check if c:if, c:forEach,
* c:choose and ui:include with src=ELExpression is used on the page and if that so, mark the view
* to be refreshed.</p>
*/
@JSFWebConfigParam(since="2.0", defaultValue="auto", expectedValues="true,false,auto", tags="performance",
ignoreUpperLowerCase=true, group="state")
- public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS = "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS";
+ public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS =
+ "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS";
public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT = "auto";
/**
@@ -260,9 +274,10 @@ public class MyfacesConfig
* c:choose and ui:include with src=ELExpression are marked to be restored fully, so state
* is preserved between request.</p>
*/
- @JSFWebConfigParam(since="2.0", defaultValue="false", expectedValues="true, false, on, off, yes, no", tags="performance",
- ignoreUpperLowerCase=true, group="state")
- public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE = "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE";
+ @JSFWebConfigParam(since="2.0", defaultValue="false", expectedValues="true, false, on, off, yes, no",
+ tags="performance", ignoreUpperLowerCase=true, group="state")
+ public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE =
+ "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE";
public final static boolean INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT = false;
/**
@@ -278,7 +293,8 @@ public class MyfacesConfig
*/
@JSFWebConfigParam(since="2.0.1", expectedValues="true, false, on, off, yes, no", defaultValue="true",
ignoreUpperLowerCase=true, group="render")
- public final static String INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG = "org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG";
+ public final static String INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG =
+ "org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG";
public final static boolean INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT = true;
/**
@@ -286,12 +302,15 @@ public class MyfacesConfig
*/
@JSFWebConfigParam(since="2.0.2", expectedValues="true, false, on, off, yes, no", defaultValue="false",
ignoreUpperLowerCase=true, group="render")
- public final static String INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE = "org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE";
+ public final static String INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE =
+ "org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE";
public final static boolean INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT = false;
/**
- * Enable/disable DebugPhaseListener feature, with provide useful information about ValueHolder variables (submittedValue, localValue, value).
- * Note evaluate those getters for each component could cause some unwanted side effects when using "access" type scopes like on MyFaces CODI.
+ * Enable/disable DebugPhaseListener feature, with provide useful information about ValueHolder
+ * variables (submittedValue, localValue, value).
+ * Note evaluate those getters for each component could cause some unwanted side effects when
+ * using "access" type scopes like on MyFaces CODI.
* This param only has effect when project stage is Development.
*/
@JSFWebConfigParam(since="2.0.8")
@@ -299,12 +318,14 @@ public class MyfacesConfig
public final static boolean INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT = false;
/**
- * Detect if a target (usually head) should be update for the current view in an ajax render operation. This is activated if a css or js resource
- * is added dynamically by effect of a refresh (c:if, ui:include src="#{...}" or a manipulation of the tree). This ensures ajax updates of content
+ * Detect if a target (usually head) should be update for the current view in an ajax render
+ * operation. This is activated if a css or js resource is added dynamically by effect of a refresh
+ * (c:if, ui:include src="#{...}" or a manipulation of the tree). This ensures ajax updates of content
* using ui:include will be consistent.
*/
@JSFWebConfigParam(since="2.0.10", expectedValues="true, false", defaultValue="false")
- public final static String INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX = "org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX";
+ public final static String INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX =
+ "org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX";
public final static boolean INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX_DEFAULT = false;
private boolean _prettyHtml;
@@ -426,7 +447,8 @@ public class MyfacesConfig
setStrictJsf2RefreshTargetAjax(INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX_DEFAULT);
}
- private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx) {
+ private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx)
+ {
MyfacesConfig myfacesConfig = new MyfacesConfig();
@@ -435,22 +457,26 @@ public class MyfacesConfig
myfacesConfig.setAllowJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_ALLOW_JAVASCRIPT,
INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT));
- myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON,
+ myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx,
+ INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON,
INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT));
- myfacesConfig.setRenderHiddenFieldsForLinkParams(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS,
+ myfacesConfig.setRenderHiddenFieldsForLinkParams(getBooleanInitParameter(extCtx,
+ INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS,
INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT));
myfacesConfig.setSaveFormSubmitLinkIE(getBooleanInitParameter(extCtx, INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE,
INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT));
- myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx, INIT_READONLY_AS_DISABLED_FOR_SELECT,
+ myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx,
+ INIT_READONLY_AS_DISABLED_FOR_SELECT,
INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT));
myfacesConfig.setRenderViewStateId(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_VIEWSTATE_ID,
INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT));
myfacesConfig.setStrictXhtmlLinks(getBooleanInitParameter(extCtx, INIT_PARAM_STRICT_XHTML_LINKS,
INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT));
- myfacesConfig.setRenderFormSubmitScriptInline(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE,
+ myfacesConfig.setRenderFormSubmitScriptInline(getBooleanInitParameter(extCtx,
+ INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE,
INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT));
myfacesConfig.setConfigRefreshPeriod(getLongInitParameter(extCtx, INIT_PARAM_CONFIG_REFRESH_PERIOD,
@@ -461,7 +487,8 @@ public class MyfacesConfig
myfacesConfig.setDelegateFacesServlet(extCtx.getInitParameter(INIT_PARAM_DELEGATE_FACES_SERVLET));
- String refreshTransientBuildOnPSS = getStringInitParameter(extCtx, INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS,
+ String refreshTransientBuildOnPSS = getStringInitParameter(extCtx,
+ INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS,
INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT);
if (refreshTransientBuildOnPSS == null)
@@ -491,10 +518,12 @@ public class MyfacesConfig
INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE,
INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT));
- myfacesConfig.setValidateXML(getBooleanInitParameter(extCtx, INIT_PARAM_VALIDATE_XML, INIT_PARAM_VALIDATE_XML_DEFAULT));
+ myfacesConfig.setValidateXML(getBooleanInitParameter(extCtx, INIT_PARAM_VALIDATE_XML,
+ INIT_PARAM_VALIDATE_XML_DEFAULT));
myfacesConfig.setWrapScriptContentWithXmlCommentTag(getBooleanInitParameter(extCtx,
- INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG, INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT));
+ INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG,
+ INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT));
myfacesConfig.setDebugPhaseListenerEnabled(getBooleanInitParameter(extCtx, INIT_PARAM_DEBUG_PHASE_LISTENER,
INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT));
@@ -538,14 +567,16 @@ public class MyfacesConfig
{
if (log.isLoggable(Level.INFO))
{
- log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.");
+ log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, "+
+ "AddResourceClass and CheckExtensionsFilter are disabled now.");
}
}*/
/*
if(RI_IMPL_AVAILABLE && MYFACES_IMPL_AVAILABLE)
{
- log.severe("Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.");
+ log.severe("Both MyFaces and the RI are on your classpath. Please make sure to"+
+ " use only one of the two JSF-implementations.");
}*/
return myfacesConfig;
}
@@ -557,20 +588,24 @@ public class MyfacesConfig
String strValue = externalContext.getInitParameter(paramName);
if (strValue == null)
{
- //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + paramName + "' found, using default value " + defaultValue);
+ //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" +
+ // paramName + "' found, using default value " + defaultValue);
return defaultValue;
}
- else if (strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("on") || strValue.equalsIgnoreCase("yes"))
+ else if (strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("on") ||
+ strValue.equalsIgnoreCase("yes"))
{
return true;
}
- else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("off") || strValue.equalsIgnoreCase("no"))
+ else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("off") ||
+ strValue.equalsIgnoreCase("no"))
{
return false;
}
else
{
- //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" + paramName + "' (='" + strValue + "'), using default value " + defaultValue);
+ //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" +
+ //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
return defaultValue;
}
}
@@ -582,7 +617,9 @@ public class MyfacesConfig
String strValue = externalContext.getInitParameter(paramName);
if (strValue == null)
{
- //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + paramName + "' found, using default value " + defaultValue); //defaultValue==null should not be a problem here
+ //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + paramName +
+ //"' found, using default value " + defaultValue); //defaultValue==null should not be
+ //a problem here
return defaultValue;
}
@@ -591,19 +628,25 @@ public class MyfacesConfig
private static long getLongInitParameter(ExternalContext externalContext,
String paramName,
- long defaultValue) {
+ long defaultValue)
+ {
String strValue = externalContext.getInitParameter(paramName);
if (strValue == null)
{
- //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" +paramName +"' found, using default value " +defaultValue);
+ //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" +paramName +
+ //"' found, using default value " +defaultValue);
return defaultValue;
}
else
{
- try {
+ try
+ {
return Long.parseLong(strValue);
- } catch (NumberFormatException e) {
- //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" + paramName + "' (='" + strValue + "'), using default value " + defaultValue);
+ }
+ catch (NumberFormatException e)
+ {
+ //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" +
+ //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
}
return defaultValue;
}
@@ -663,20 +706,23 @@ public class MyfacesConfig
/**
* JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
* and the "id" attribute of the hidden input that is rendered for the purpose of state saving
- * (see <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/render/ResponseStateManager.html#VIEW_STATE_PARAM">API</a>).
+ * (see ResponseStateManager.VIEW_STATE_PARAM).
* Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on
* one page. With the {@link #INIT_PARAM_RENDER_VIEWSTATE_ID} context parameter you can tune this behaviour.
* <br/>Set it to
* <ul><li>true - to render JSF 1.2 compliant id attributes (that might cause invalid XHTML), or</li>
- * <li>false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript components)</li></ul>
+ * <li>false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript
+ * components)</li></ul>
* Default value is: true (for backwards compatibility and JSF 1.2 compliancy)
* @return true, if the client state hidden input "javax.faces.ViewState" id attribute should be rendered
*/
- public boolean isRenderViewStateId() {
+ public boolean isRenderViewStateId()
+ {
return _renderViewStateId;
}
- public void setRenderViewStateId(boolean renderViewStateId) {
+ public void setRenderViewStateId(boolean renderViewStateId)
+ {
_renderViewStateId = renderViewStateId;
}
@@ -691,14 +737,16 @@ public class MyfacesConfig
* "bug compatible" to the Sun RI which renders plain "&" chars in links as well.</p>
* @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3.2">HTML 4.01 Specification</a>
* @see <a href="http://issues.apache.org/jira/browse/MYFACES-1774">Jira: MYFACES-1774</a>
- * @return true if ampersand characters ("&") should be correctly rendered as "&amp;" entities within link urls (=default),
- * false for old (XHTML incompatible) behaviour
+ * @return true if ampersand characters ("&") should be correctly rendered as "&amp;" entities
+ * within link urls (=default), false for old (XHTML incompatible) behaviour
*/
- public boolean isStrictXhtmlLinks() {
+ public boolean isStrictXhtmlLinks()
+ {
return _strictXhtmlLinks;
}
- public void setStrictXhtmlLinks(boolean strictXhtmlLinks) {
+ public void setStrictXhtmlLinks(boolean strictXhtmlLinks)
+ {
_strictXhtmlLinks = strictXhtmlLinks;
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyConstants.java Wed Nov 9 23:40:12 2011
@@ -104,7 +104,7 @@ public class CommonPropertyConstants
public static final long MAXLENGTH_PROP = 0x2000000000L;
public static final long SIZE_PROP = 0x4000000000L;
- public static Map<String, Long> COMMON_PROPERTIES_KEY_BY_NAME = new HashMap<String, Long>(64,1);
+ public static final Map<String, Long> COMMON_PROPERTIES_KEY_BY_NAME = new HashMap<String, Long>(64,1);
static
{
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java Wed Nov 9 23:40:12 2011
@@ -61,7 +61,8 @@ public class HtmlBodyRendererBase extend
ResponseWriter writer = facesContext.getResponseWriter();
Map<String, List<ClientBehavior>> behaviors = null;
- if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder &&
+ JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
if (!behaviors.isEmpty())
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java Wed Nov 9 23:40:12 2011
@@ -19,7 +19,6 @@
package org.apache.myfaces.shared.renderkit.html;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -64,14 +63,16 @@ public class HtmlButtonRendererBase
public void decode(FacesContext facesContext, UIComponent uiComponent)
{
- org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UICommand.class);
+ org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(
+ facesContext, uiComponent, UICommand.class);
//super.decode must not be called, because value is handled here
if (!isReset(uiComponent) && isSubmitted(facesContext, uiComponent))
{
uiComponent.queueEvent(new ActionEvent(uiComponent));
- org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(uiComponent, facesContext);
+ org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(
+ uiComponent, facesContext);
}
if (uiComponent instanceof ClientBehaviorHolder &&
@@ -112,7 +113,8 @@ public class HtmlButtonRendererBase
public void encodeEnd(FacesContext facesContext, UIComponent uiComponent)
throws IOException
{
- org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, UICommand.class);
+ org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(
+ facesContext, uiComponent, UICommand.class);
String clientId = uiComponent.getClientId(facesContext);
@@ -167,7 +169,8 @@ public class HtmlButtonRendererBase
String image = RendererUtils.getIconSrc(facesContext, uiComponent, JSFAttr.IMAGE_ATTR);
if (image != null)
{
- writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_IMAGE, org.apache.myfaces.shared.renderkit.JSFAttr.TYPE_ATTR);
+ writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_IMAGE,
+ org.apache.myfaces.shared.renderkit.JSFAttr.TYPE_ATTR);
writer.writeURIAttribute(HTML.SRC_ATTR, image, org.apache.myfaces.shared.renderkit.JSFAttr.IMAGE_ATTR);
}
else
@@ -182,7 +185,8 @@ public class HtmlButtonRendererBase
Object value = getValue(uiComponent);
if (value != null)
{
- writer.writeAttribute(org.apache.myfaces.shared.renderkit.html.HTML.VALUE_ATTR, value, org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR);
+ writer.writeAttribute(org.apache.myfaces.shared.renderkit.html.HTML.VALUE_ATTR, value,
+ org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR);
}
}
@@ -192,7 +196,8 @@ public class HtmlButtonRendererBase
{
if (!reset && !button)
{
- String onClick = buildBehaviorizedOnClick(uiComponent, behaviors, facesContext, writer, formInfo, validParams);
+ String onClick = buildBehaviorizedOnClick(
+ uiComponent, behaviors, facesContext, writer, formInfo, validParams);
if (onClick.length() != 0)
{
writer.writeAttribute(HTML.ONCLICK_ATTR, onClick.toString(), null);
@@ -200,7 +205,8 @@ public class HtmlButtonRendererBase
}
else
{
- Collection<ClientBehaviorContext.Parameter> paramList = HtmlRendererUtils.getClientBehaviorContextParameters(
+ Collection<ClientBehaviorContext.Parameter> paramList =
+ HtmlRendererUtils.getClientBehaviorContextParameters(
HtmlRendererUtils.mapAttachedParamsToStringValues(facesContext, uiComponent));
String onClick = HtmlRendererUtils.buildBehaviorChain(facesContext, uiComponent,
@@ -252,7 +258,8 @@ public class HtmlButtonRendererBase
if (behaviors != null && !behaviors.isEmpty())
{
- HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(facesContext, writer, uiComponent, behaviors);
+ HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+ facesContext, writer, uiComponent, behaviors);
HtmlRendererUtils.renderBehaviorizedFieldEventHandlers(facesContext, writer, uiComponent, behaviors);
}
else
@@ -274,19 +281,22 @@ public class HtmlButtonRendererBase
if (isDisabled(facesContext, uiComponent))
{
- writer.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE, org.apache.myfaces.shared.renderkit.JSFAttr.DISABLED_ATTR);
+ writer.writeAttribute(HTML.DISABLED_ATTR, Boolean.TRUE,
+ org.apache.myfaces.shared.renderkit.JSFAttr.DISABLED_ATTR);
}
if (isReadonly(facesContext, uiComponent))
{
- writer.writeAttribute(HTML.READONLY_ATTR, Boolean.TRUE, org.apache.myfaces.shared.renderkit.JSFAttr.READONLY_ATTR);
+ writer.writeAttribute(HTML.READONLY_ATTR, Boolean.TRUE,
+ org.apache.myfaces.shared.renderkit.JSFAttr.READONLY_ATTR);
}
writer.endElement(HTML.INPUT_ELEM);
if (formInfo != null)
{
- HtmlFormRendererBase.renderScrollHiddenInputIfNecessary(formInfo.getForm(), facesContext, writer);
+ HtmlFormRendererBase.renderScrollHiddenInputIfNecessary(
+ formInfo.getForm(), facesContext, writer);
}
// render the UIParameter children of the commandButton (since 2.0)
@@ -305,9 +315,12 @@ public class HtmlButtonRendererBase
private boolean hasSubmittingBehavior(Map<String, List<ClientBehavior>> clientBehaviors, String eventName)
{
List<ClientBehavior> eventBehaviors = clientBehaviors.get(eventName);
- if (eventBehaviors != null && !eventBehaviors.isEmpty()) {
- for (ClientBehavior behavior : eventBehaviors) {
- if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
+ if (eventBehaviors != null && !eventBehaviors.isEmpty())
+ {
+ for (ClientBehavior behavior : eventBehaviors)
+ {
+ if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING))
+ {
return true;
}
}
@@ -316,15 +329,18 @@ public class HtmlButtonRendererBase
}
protected String buildBehaviorizedOnClick(UIComponent uiComponent, Map<String, List<ClientBehavior>> behaviors,
- FacesContext facesContext, ResponseWriter writer, FormInfo nestedFormInfo, List<UIParameter> validParams)
+ FacesContext facesContext, ResponseWriter writer,
+ FormInfo nestedFormInfo, List<UIParameter> validParams)
throws IOException
{
- //we can omit autoscroll here for now maybe we should check if it is an ajax behavior and omit it only in this case
+ //we can omit autoscroll here for now maybe we should check if it is an ajax
+ //behavior and omit it only in this case
StringBuilder userOnClick = new StringBuilder();
//user onclick part
String commandOnClick = (String) uiComponent.getAttributes().get(HTML.ONCLICK_ATTR);
- if (commandOnClick != null) {
+ if (commandOnClick != null)
+ {
userOnClick.append(commandOnClick);
userOnClick.append(';');
}
@@ -341,17 +357,20 @@ public class HtmlButtonRendererBase
// hidden fields, because this code is called for a submit button.
//if (behaviors.isEmpty() && validParams != null && !validParams.isEmpty() )
//{
- // rendererOnClick.append(buildServerOnclick(facesContext, uiComponent, uiComponent.getClientId(facesContext), nestedFormInfo, validParams));
+ // rendererOnClick.append(buildServerOnclick(facesContext, uiComponent,
+ // uiComponent.getClientId(facesContext), nestedFormInfo, validParams));
//}
//else
//{
String formName = nestedFormInfo.getFormName();
- if (JavascriptUtils.isRenderClearJavascriptOnButton(facesContext.getExternalContext())) {
+ if (JavascriptUtils.isRenderClearJavascriptOnButton(facesContext.getExternalContext()))
+ {
//call the script to clear the form (clearFormHiddenParams_<formName>) method
HtmlRendererUtils.appendClearHiddenCommandFormParamsFunctionCall(rendererOnClick, formName);
}
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll()) {
+ if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
+ {
HtmlRendererUtils.appendAutoScrollAssignment(rendererOnClick, formName);
}
//}
@@ -375,14 +394,16 @@ public class HtmlButtonRendererBase
StringBuffer onClick = new StringBuffer();
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm())) {
+ if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
+ {
onClick.append("submitForm('");
onClick.append(formInfo.getForm().getClientId(facesContext));
onClick.append("',1,{source:'");
onClick.append(component.getClientId(facesContext));
onClick.append("'});return false;");
}
- else {
+ else
+ {
StringBuffer params = addChildParameters(facesContext, component, nestingForm, validParams);
String target = getTarget(component);
@@ -402,7 +423,8 @@ public class HtmlButtonRendererBase
append(component.getClientId(facesContext)).append("'");
}
- if (params.length() > 2 || target != null) {
+ if (params.length() > 2 || target != null)
+ {
onClick.append(",").
append(target == null ? "null" : ("'" + target + "'")).append(",").
append(params);
@@ -418,7 +440,9 @@ public class HtmlButtonRendererBase
return onClick.toString();
}
- private StringBuffer addChildParameters(FacesContext context, UIComponent component, UIComponent nestingForm, List<UIParameter> validParams) {
+ private StringBuffer addChildParameters(FacesContext context, UIComponent component,
+ UIComponent nestingForm, List<UIParameter> validParams)
+ {
//add child parameters
StringBuffer params = new StringBuffer();
params.append("[");
@@ -489,13 +513,16 @@ public class HtmlButtonRendererBase
return params;
}
- private String getTarget(UIComponent component) {
+ private String getTarget(UIComponent component)
+ {
// for performance reason: double check for the target attribute
String target;
- if (component instanceof HtmlCommandLink) {
+ if (component instanceof HtmlCommandLink)
+ {
target = ((HtmlCommandLink) component).getTarget();
}
- else {
+ else
+ {
target = (String) component.getAttributes().get(HTML.TARGET_ATTR);
}
return target;
@@ -552,11 +579,13 @@ public class HtmlButtonRendererBase
if (validParams != null && !validParams.isEmpty() )
{
- StringBuffer params = addChildParameters(facesContext, uiComponent, nestedFormInfo.getForm(), validParams);
+ StringBuffer params = addChildParameters(
+ facesContext, uiComponent, nestedFormInfo.getForm(), validParams);
String target = getTarget(uiComponent);
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
+ if (MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
{
onClick.append("return ").
append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
@@ -571,7 +600,8 @@ public class HtmlButtonRendererBase
append(uiComponent.getClientId(facesContext)).append("'");
}
- if (params.length() > 2 || target != null) {
+ if (params.length() > 2 || target != null)
+ {
onClick.append(",").
append(target == null ? "null" : ("'" + target + "'")).append(",").
append(params);
@@ -580,7 +610,8 @@ public class HtmlButtonRendererBase
//Not necessary since we are using oamSetHiddenInput to create input hidden fields
//render hidden field - todo: in here for backwards compatibility
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
+ if (MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
{
String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(nestedFormInfo);
addHiddenCommandParameter(facesContext, nestedFormInfo.getForm(), hiddenFieldName);
@@ -590,13 +621,15 @@ public class HtmlButtonRendererBase
{
if (JavascriptUtils.isRenderClearJavascriptOnButton(facesContext.getExternalContext()) ||
- MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams() )
+ MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams() )
{
//call the script to clear the form (clearFormHiddenParams_<formName>) method
HtmlRendererUtils.appendClearHiddenCommandFormParamsFunctionCall(onClick, formName);
}
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll()) {
+ if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
+ {
HtmlRendererUtils.appendAutoScrollAssignment(onClick, formName);
}
}
@@ -621,7 +654,8 @@ public class HtmlButtonRendererBase
return onClick;
}
- protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
+ protected void addHiddenCommandParameter(FacesContext facesContext,
+ UIComponent nestingForm, String hiddenFieldName)
{
if (nestingForm != null)
{
@@ -646,7 +680,8 @@ public class HtmlButtonRendererBase
return ((HtmlCommandButton)uiComponent).isDisabled();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, HTML.DISABLED_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(
+ uiComponent, HTML.DISABLED_ATTR, false);
}
@@ -656,7 +691,8 @@ public class HtmlButtonRendererBase
{
return ((HtmlCommandButton)uiComponent).isReadonly();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, HTML.READONLY_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(
+ uiComponent, HTML.READONLY_ATTR, false);
}
private String getImage(UIComponent uiComponent)
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java Wed Nov 9 23:40:12 2011
@@ -64,7 +64,8 @@ public abstract class HtmlLinkRendererBa
//private static final Log log = LogFactory.getLog(HtmlLinkRenderer.class);
- public static final String END_LINK_OUTCOME_AS_SPAN = "org.apache.myfaces.shared.HtmlLinkRendererBase.END_LINK_OUTCOME_AS_SPAN";
+ public static final String END_LINK_OUTCOME_AS_SPAN =
+ "org.apache.myfaces.shared.HtmlLinkRendererBase.END_LINK_OUTCOME_AS_SPAN";
public boolean getRendersChildren()
{
@@ -86,7 +87,8 @@ public abstract class HtmlLinkRendererBa
String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));
if (reqValue != null && reqValue.equals(clientId)
- || HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId)) {
+ || HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId))
+ {
component.queueEvent(new ActionEvent(component));
RendererUtils.initPartialValidationAndModelUpdate(component, facesContext);
@@ -230,7 +232,8 @@ public abstract class HtmlLinkRendererBa
if (HtmlRendererUtils.isDisabled(component) || formInfo == null)
{
writer.startElement(HTML.SPAN_ELEM, component);
- if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -242,7 +245,8 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, component, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, component, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, component, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
@@ -250,7 +254,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -275,7 +280,8 @@ public abstract class HtmlLinkRendererBa
if (component instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
- renderBehaviorizedJavaScriptAnchorStart(facesContext, writer, component, clientId, behaviors, formInfo);
+ renderBehaviorizedJavaScriptAnchorStart(
+ facesContext, writer, component, clientId, behaviors, formInfo);
if (!behaviors.isEmpty())
{
HtmlRendererUtils.writeIdAndName(writer, component, facesContext);
@@ -284,8 +290,10 @@ public abstract class HtmlLinkRendererBa
{
HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
}
- HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(facesContext, writer, component, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, component, behaviors);
+ HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+ facesContext, writer, component, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, component, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyleAndEvents(writer,
@@ -293,7 +301,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS);
}
}
else
@@ -307,7 +316,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE);
}
}
}
@@ -322,7 +332,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE);
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE);
}
}
@@ -377,14 +388,16 @@ public abstract class HtmlLinkRendererBa
onClick.append("var oamSF = function(){");
}
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm())) {
+ if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
+ {
onClick.append("submitForm('");
onClick.append(formInfo.getForm().getClientId(facesContext));
onClick.append("',1,{source:'");
onClick.append(component.getClientId(facesContext));
onClick.append("'});return false;");
}
- else {
+ else
+ {
HtmlRendererUtils.renderFormSubmitScript(facesContext);
StringBuffer params = addChildParameters(facesContext, component, nestingForm);
@@ -406,7 +419,8 @@ public abstract class HtmlLinkRendererBa
append(clientId).append("'");
}
- if (params.length() > 2 || target != null) {
+ if (params.length() > 2 || target != null)
+ {
onClick.append(",").
append(target == null ? "null" : ("'" + target + "'")).append(",").
append(params);
@@ -415,7 +429,8 @@ public abstract class HtmlLinkRendererBa
//Not necessary since we are using oamSetHiddenInput to create input hidden fields
//render hidden field - todo: in here for backwards compatibility
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
+ if (MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
{
String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo);
addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
@@ -477,7 +492,8 @@ public abstract class HtmlLinkRendererBa
}
//render a javascript that chain the related code
- Collection<ClientBehaviorContext.Parameter> paramList = HtmlRendererUtils.getClientBehaviorContextParameters(
+ Collection<ClientBehaviorContext.Parameter> paramList =
+ HtmlRendererUtils.getClientBehaviorContextParameters(
HtmlRendererUtils.mapAttachedParamsToStringValues(facesContext, component));
onclick = HtmlRendererUtils.buildBehaviorChain(facesContext, component,
@@ -493,9 +509,12 @@ public abstract class HtmlLinkRendererBa
private boolean hasSubmittingBehavior(Map<String, List<ClientBehavior>> clientBehaviors, String eventName)
{
List<ClientBehavior> eventBehaviors = clientBehaviors.get(eventName);
- if (eventBehaviors != null && !eventBehaviors.isEmpty()) {
- for (ClientBehavior behavior : eventBehaviors) {
- if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING)) {
+ if (eventBehaviors != null && !eventBehaviors.isEmpty())
+ {
+ for (ClientBehavior behavior : eventBehaviors)
+ {
+ if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING))
+ {
return true;
}
}
@@ -511,21 +530,24 @@ public abstract class HtmlLinkRendererBa
StringBuffer onClick = new StringBuffer();
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm())) {
+ if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
+ {
onClick.append("submitForm('");
onClick.append(formInfo.getForm().getClientId(facesContext));
onClick.append("',1,{source:'");
onClick.append(component.getClientId(facesContext));
onClick.append("'});return false;");
}
- else {
+ else
+ {
HtmlRendererUtils.renderFormSubmitScript(facesContext);
StringBuffer params = addChildParameters(facesContext, component, nestingForm);
String target = getTarget(component);
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
+ if (MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
{
onClick.append("return ").
append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
@@ -540,7 +562,8 @@ public abstract class HtmlLinkRendererBa
append(clientId).append("'");
}
- if (params.length() > 2 || target != null) {
+ if (params.length() > 2 || target != null)
+ {
onClick.append(",").
append(target == null ? "null" : ("'" + target + "'")).append(",").
append(params);
@@ -556,19 +579,23 @@ public abstract class HtmlLinkRendererBa
return onClick.toString();
}
- private String getTarget(UIComponent component) {
+ private String getTarget(UIComponent component)
+ {
// for performance reason: double check for the target attribute
String target;
- if (component instanceof HtmlCommandLink) {
+ if (component instanceof HtmlCommandLink)
+ {
target = ((HtmlCommandLink) component).getTarget();
}
- else {
+ else
+ {
target = (String) component.getAttributes().get(HTML.TARGET_ATTR);
}
return target;
}
- private StringBuffer addChildParameters(FacesContext context, UIComponent component, UIComponent nestingForm) {
+ private StringBuffer addChildParameters(FacesContext context, UIComponent component, UIComponent nestingForm)
+ {
//add child parameters
StringBuffer params = new StringBuffer();
params.append("[");
@@ -650,7 +677,8 @@ public abstract class HtmlLinkRendererBa
return _ComponentUtils.findNestingForm(uiComponent, facesContext);
}
- protected void addHiddenCommandParameter(FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
+ protected void addHiddenCommandParameter(
+ FacesContext facesContext, UIComponent nestingForm, String hiddenFieldName)
{
if (nestingForm != null)
{
@@ -683,9 +711,12 @@ public abstract class HtmlLinkRendererBa
}
else
{
- if (strictXhtmlLinks) {
+ if (strictXhtmlLinks)
+ {
hrefBuf.append("&");
- } else {
+ }
+ else
+ {
hrefBuf.append('&');
}
}
@@ -738,7 +769,8 @@ public abstract class HtmlLinkRendererBa
if (HtmlRendererUtils.isDisabled(output))
{
writer.startElement(HTML.SPAN_ELEM, output);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -750,7 +782,8 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, output, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
@@ -758,7 +791,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -821,7 +855,8 @@ public abstract class HtmlLinkRendererBa
//write anchor
writer.startElement(HTML.ANCHOR_ELEM, output);
writer.writeURIAttribute(HTML.HREF_ATTR, href, null);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -833,7 +868,8 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdAndNameIfNecessary(writer, output, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, output, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
@@ -841,7 +877,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -874,7 +911,8 @@ public abstract class HtmlLinkRendererBa
{
output.getAttributes().put(END_LINK_OUTCOME_AS_SPAN, Boolean.TRUE);
writer.startElement(HTML.SPAN_ELEM, output);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -886,7 +924,8 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdIfNecessary(writer, output, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, output, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
@@ -894,7 +933,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -923,7 +963,8 @@ public abstract class HtmlLinkRendererBa
//write anchor
writer.startElement(HTML.ANCHOR_ELEM, output);
writer.writeURIAttribute(HTML.HREF_ATTR, targetHref, null);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -935,7 +976,8 @@ public abstract class HtmlLinkRendererBa
HtmlRendererUtils.writeIdAndNameIfNecessary(writer, output, facesContext);
}
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, output, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(facesContext, writer, output, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, output, behaviors);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutEvents(writer,
@@ -943,7 +985,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS);
}
}
else
@@ -956,7 +999,8 @@ public abstract class HtmlLinkRendererBa
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, output, HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
+ HtmlRendererUtils.renderHTMLAttributes(writer, output,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES);
}
}
@@ -978,7 +1022,8 @@ public abstract class HtmlLinkRendererBa
onClick.append(jsForm);
onClick.append(".elements['").append(name).append("']");
//UIParameter is no ValueHolder, so no conversion possible
- String strParamValue = value != null ? org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder.encode(value.toString(), false, false) : "";
+ String strParamValue = value != null ? org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder.encode(
+ value.toString(), false, false) : "";
onClick.append(".value='").append(strParamValue).append("';");
addHiddenCommandParameter(FacesContext.getCurrentInstance(), nestingForm, name);
@@ -989,17 +1034,25 @@ public abstract class HtmlLinkRendererBa
StringBuffer hrefBuf,
boolean firstParameter,
String charEncoding,
- boolean strictXhtmlLinks) throws UnsupportedEncodingException {
- if (name == null) {
+ boolean strictXhtmlLinks) throws UnsupportedEncodingException
+ {
+ if (name == null)
+ {
throw new IllegalArgumentException("Unnamed parameter value not allowed within command link.");
}
- if (firstParameter) {
+ if (firstParameter)
+ {
hrefBuf.append('?');
- } else {
- if (strictXhtmlLinks) {
+ }
+ else
+ {
+ if (strictXhtmlLinks)
+ {
hrefBuf.append("&");
- } else {
+ }
+ else
+ {
hrefBuf.append('&');
}
}
@@ -1018,7 +1071,8 @@ public abstract class HtmlLinkRendererBa
{
ResponseWriter writer = facesContext.getResponseWriter();
- if (HtmlRendererUtils.isDisabled(component) || component.getAttributes().remove(END_LINK_OUTCOME_AS_SPAN) != null)
+ if (HtmlRendererUtils.isDisabled(component) || component.getAttributes().remove(
+ END_LINK_OUTCOME_AS_SPAN) != null)
{
writer.endElement(HTML.SPAN_ELEM);
}
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlListboxRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlListboxRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlListboxRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlListboxRendererBase.java Wed Nov 9 23:40:12 2011
@@ -100,7 +100,8 @@ public class HtmlListboxRendererBase
}
else
{
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, org.apache.myfaces.shared.renderkit.html.HTML.DISABLED_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent,
+ org.apache.myfaces.shared.renderkit.html.HTML.DISABLED_ATTR, false);
}
}
@@ -128,7 +129,8 @@ public class HtmlListboxRendererBase
}
}
- public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
+ public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue)
+ throws ConverterException
{
org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, null);
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMenuRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMenuRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMenuRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMenuRendererBase.java Wed Nov 9 23:40:12 2011
@@ -18,9 +18,9 @@
*/
package org.apache.myfaces.shared.renderkit.html;
-import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
-import org.apache.myfaces.shared.renderkit.html.HtmlRendererUtils;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.component.UISelectMany;
@@ -32,9 +32,9 @@ import javax.faces.component.html.HtmlSe
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
+
+import org.apache.myfaces.shared.renderkit.RendererUtils;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
/**
* X-CHECKED: tlddoc of h:selectManyListbox
@@ -97,7 +97,8 @@ public class HtmlMenuRendererBase
}
else
{
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent, org.apache.myfaces.shared.renderkit.html.HTML.DISABLED_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(uiComponent,
+ org.apache.myfaces.shared.renderkit.html.HTML.DISABLED_ATTR, false);
}
}
@@ -124,7 +125,8 @@ public class HtmlMenuRendererBase
}
}
- public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue) throws ConverterException
+ public Object getConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object submittedValue)
+ throws ConverterException
{
org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext, uiComponent, null);
Modified: myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java?rev=1200042&r1=1200041&r2=1200042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java (original)
+++ myfaces/core/branches/2.0.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java Wed Nov 9 23:40:12 2011
@@ -66,7 +66,8 @@ public abstract class HtmlMessageRendere
renderMessage(facesContext, message, false);
}
- protected void renderMessage(FacesContext facesContext, UIComponent message, boolean alwaysRenderSpan) throws IOException
+ protected void renderMessage(FacesContext facesContext, UIComponent message,
+ boolean alwaysRenderSpan) throws IOException
{
renderMessage(facesContext, message, alwaysRenderSpan, false);
}
@@ -76,7 +77,8 @@ public abstract class HtmlMessageRendere
* @param message
* @param alwaysRenderSpan if true will render a span even if there is no message
*/
- protected void renderMessage(FacesContext facesContext, UIComponent message, boolean alwaysRenderSpan, boolean renderDivWhenNoMessagesAndIdSet) throws IOException
+ protected void renderMessage(FacesContext facesContext, UIComponent message,
+ boolean alwaysRenderSpan, boolean renderDivWhenNoMessagesAndIdSet) throws IOException
{
String forAttr = getFor(message);
if (forAttr == null)
@@ -88,7 +90,11 @@ public abstract class HtmlMessageRendere
UIComponent forComponent = message.findComponent(forAttr);
if (forComponent == null)
{
- log.severe("Could not render Message. Unable to find component '" + forAttr + "' (calling findComponent on component '" + message.getClientId(facesContext) + "'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.");
+ log.severe("Could not render Message. Unable to find component '"
+ + forAttr + "' (calling findComponent on component '"
+ + message.getClientId(facesContext)
+ + "'). If the provided id was correct, wrap the message and its "
+ + "component into an h:panelGroup or h:panelGrid.");
return;
}
@@ -107,7 +113,8 @@ public abstract class HtmlMessageRendere
HtmlRendererUtils.renderHTMLAttribute(writer, message, JSFAttr.STYLE_CLASS_ATTR, HTML.CLASS_ATTR);
writer.endElement(HTML.SPAN_ELEM);
}
- else if (renderDivWhenNoMessagesAndIdSet && message.getId() != null && !message.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
+ else if (renderDivWhenNoMessagesAndIdSet && message.getId() != null &&
+ !message.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
{
// show span anyways in case there's a client side update, ie: ajax
ResponseWriter writer = facesContext.getResponseWriter();
@@ -172,14 +179,16 @@ public abstract class HtmlMessageRendere
throws IOException
{
Map<String, List<ClientBehavior>> behaviors = null;
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
}
boolean wrapSpan = (message.getId() != null && !message.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
|| (behaviors != null && !behaviors.isEmpty());
- renderSingleFacesMessage(facesContext, message, facesMessage, messageClientId, renderId, renderStyleAndStyleClass, wrapSpan);
+ renderSingleFacesMessage(facesContext, message, facesMessage, messageClientId,
+ renderId, renderStyleAndStyleClass, wrapSpan);
}
protected void renderSingleFacesMessage(FacesContext facesContext,
@@ -192,7 +201,8 @@ public abstract class HtmlMessageRendere
throws IOException
{
// determine style and style class
- String[] styleAndClass = HtmlMessageRendererBase.getStyleAndStyleClass(message, facesMessage.getSeverity());
+ String[] styleAndClass = HtmlMessageRendererBase.getStyleAndStyleClass(
+ message, facesMessage.getSeverity());
String style = styleAndClass[0];
String styleClass = styleAndClass[1];
@@ -212,7 +222,8 @@ public abstract class HtmlMessageRendere
boolean span = false;
Map<String, List<ClientBehavior>> behaviors = null;
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed
+ (facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
}
@@ -232,28 +243,35 @@ public abstract class HtmlMessageRendere
{
HtmlRendererUtils.writeIdIfNecessary(writer, message, facesContext);
}
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
+ facesContext.getExternalContext()))
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
HtmlRendererUtils.renderBehaviorizedEventHandlers(facesContext, writer, message, behaviors);
- HtmlRendererUtils.renderHTMLAttributes(writer, message, HTML.UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE_AND_TITLE);
+ HtmlRendererUtils.renderHTMLAttributes(writer, message,
+ HTML.UNIVERSAL_ATTRIBUTES_WITHOUT_STYLE_AND_TITLE);
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, message, HTML.MESSAGE_PASSTHROUGH_ATTRIBUTES_WITHOUT_TITLE_STYLE_AND_STYLE_CLASS);
+ HtmlRendererUtils.renderHTMLAttributes(writer, message,
+ HTML.MESSAGE_PASSTHROUGH_ATTRIBUTES_WITHOUT_TITLE_STYLE_AND_STYLE_CLASS);
}
}
else
{
span = HtmlRendererUtils.renderHTMLAttributesWithOptionalStartElement(
- writer, message, HTML.SPAN_ELEM, HTML.MESSAGE_PASSTHROUGH_ATTRIBUTES_WITHOUT_TITLE_STYLE_AND_STYLE_CLASS);
+ writer, message, HTML.SPAN_ELEM,
+ HTML.MESSAGE_PASSTHROUGH_ATTRIBUTES_WITHOUT_TITLE_STYLE_AND_STYLE_CLASS);
}
- span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(writer, message, HTML.SPAN_ELEM, HTML.TITLE_ATTR, title, span);
+ span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(
+ writer, message, HTML.SPAN_ELEM, HTML.TITLE_ATTR, title, span);
if (renderStyleAndStyleClass)
{
- span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(writer, message, HTML.SPAN_ELEM, HTML.STYLE_ATTR, style, span);
- span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(writer, message, HTML.SPAN_ELEM, HTML.STYLE_CLASS_ATTR, styleClass, span);
+ span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(
+ writer, message, HTML.SPAN_ELEM, HTML.STYLE_ATTR, style, span);
+ span |= HtmlRendererUtils.renderHTMLAttributeWithOptionalStartElement(
+ writer, message, HTML.SPAN_ELEM, HTML.STYLE_CLASS_ATTR, styleClass, span);
}
@@ -389,7 +407,8 @@ public abstract class HtmlMessageRendere
return ((HtmlMessage) component).isTooltip();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component, org.apache.myfaces.shared.renderkit.JSFAttr.TOOLTIP_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.TOOLTIP_ATTR, false);
}
@@ -400,7 +419,8 @@ public abstract class HtmlMessageRendere
return ((UIMessage) component).isShowSummary();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component, org.apache.myfaces.shared.renderkit.JSFAttr.SHOW_SUMMARY_ATTR, false);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.SHOW_SUMMARY_ATTR, false);
}
@@ -411,7 +431,8 @@ public abstract class HtmlMessageRendere
return ((UIMessage) component).isShowDetail();
}
- return RendererUtils.getBooleanAttribute(component, org.apache.myfaces.shared.renderkit.JSFAttr.SHOW_DETAIL_ATTR, false);
+ return RendererUtils.getBooleanAttribute(component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.SHOW_DETAIL_ATTR, false);
}
@@ -422,7 +443,8 @@ public abstract class HtmlMessageRendere
return ((UIMessage) component).isRedisplay();
}
- return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component, org.apache.myfaces.shared.renderkit.JSFAttr.REDISPLAY_ATTR, true);
+ return org.apache.myfaces.shared.renderkit.RendererUtils.getBooleanAttribute(component,
+ org.apache.myfaces.shared.renderkit.JSFAttr.REDISPLAY_ATTR, true);
}