Friday, 19 March
2010
Fri, 19 Mar
'10
4:03 p.m.
Author: amarkhel
Date: 2010-03-19 17:03:10 -0400 (Fri, 19 Mar 2010)
New Revision: 16643
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
Log:
RF-8425
Modified:
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
---
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2010-03-19
21:01:42 UTC (rev 16642)
+++
branches/community/3.3.X/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2010-03-19
21:03:10 UTC (rev 16643)
@@ -43,7 +43,6 @@
import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
-import org.ajax4jsf.renderkit.RendererUtils.ScriptHashVariableWrapper;
import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIToolTip;
import org.richfaces.skin.Skin;
@@ -52,6 +51,8 @@
private static final String DIRECTION_AUTO = "auto";
private static final String DIRECTION_BOTTOM_RIGHT = "bottom-right";
+ private ToolTipRenderer blockRenderer;
+ private ToolTipRenderer nonblockRenderer;
private static final String AJAX_MODE = "ajax";
@@ -391,15 +392,21 @@
}
private ToolTipRenderer getRenderer(UIToolTip toolTip) throws ClassNotFoundException,
InstantiationException, IllegalAccessException{
- Class<?> rendererClass;
- if ("block".equals(toolTip.getLayout())) {
- rendererClass =
Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
- } else {
- rendererClass =
Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ synchronized (this) {
+ if ("block".equals(toolTip.getLayout())) {
+ if (blockRenderer==null){
+ blockRenderer =
(ToolTipRenderer)Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock").newInstance();
+ }
+ return blockRenderer;
+
+ } else {
+ if (nonblockRenderer==null){
+ nonblockRenderer =
(ToolTipRenderer)Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer").newInstance();
+ }
+ return nonblockRenderer;
+
+ }
}
-
- return (ToolTipRenderer) rendererClass.newInstance();
-
}
}
Show replies by date