You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/11/04 12:33:52 UTC
svn commit: r832709 - in /myfaces/tobago/trunk:
core/src/main/java/org/apache/myfaces/tobago/layout/
theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/
theme/scarborough/src/main/java/org/apache/myfaces/toba...
Author: lofwyr
Date: Wed Nov 4 11:31:47 2009
New Revision: 832709
URL: http://svn.apache.org/viewvc?rev=832709&view=rev
Log:
TOBAGO-812: Refactor Style Handling of components: Don't put style in the component attributes
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutComponent.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/BoxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java
myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java
myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutComponent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutComponent.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutComponent.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutComponent.java Wed Nov 4 11:31:47 2009
@@ -39,4 +39,11 @@
Display getDisplay();
void setDisplay(Display display);
+
+ /**
+ * The renderer is an id that is used by Tobago to gather information about the components which are
+ * configured in the theme configuration files. E. g. the preferredWidth of a component.
+ * @return The renderer type.
+ */
+ String getRendererType();
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/BoxRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/tag/BoxRenderer.java Wed Nov 4 11:31:47 2009
@@ -24,9 +24,11 @@
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
+import org.apache.myfaces.tobago.component.UIBox;
import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.UserAgent;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -37,21 +39,22 @@
public class BoxRenderer extends org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.BoxRenderer {
- public void encodeBegin(FacesContext facesContext,
- UIComponent component) throws IOException {
+ public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
- UIComponent label = component.getFacet(Facets.LABEL);
- String labelString
- = (String) component.getAttributes().get(Attributes.LABEL);
+ UIBox box = (UIBox) component;
+
+ UIComponent label = box.getFacet(Facets.LABEL);
+ String labelString = (String) box.getAttributes().get(Attributes.LABEL);
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- writer.startElement(HtmlConstants.FIELDSET, component);
+ writer.startElement(HtmlConstants.FIELDSET, box);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, box);
+ writer.writeStyleAttribute(style);
if (label != null || labelString != null) {
- writer.startElement(HtmlConstants.LEGEND, component);
+ writer.startElement(HtmlConstants.LEGEND, box);
writer.writeClassAttribute();
writer.startElement(HtmlConstants.B, null);
@@ -69,7 +72,7 @@
writer.endElement(HtmlConstants.BR);
}
}
- writer.startElement(HtmlConstants.DIV, component);
+ writer.startElement(HtmlConstants.DIV, box);
writer.writeClassAttribute();
}
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java Wed Nov 4 11:31:47 2009
@@ -17,16 +17,13 @@
* limitations under the License.
*/
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
-
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Facets;
+import org.apache.myfaces.tobago.component.UIBox;
import org.apache.myfaces.tobago.config.ThemeConfig;
import org.apache.myfaces.tobago.context.ClientProperties;
+import org.apache.myfaces.tobago.layout.LayoutComponent;
+import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.layout.PixelMeasure;
import org.apache.myfaces.tobago.renderkit.BoxRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -44,30 +41,27 @@
public class BoxRenderer extends BoxRendererBase {
- public void encodeBegin(
- FacesContext facesContext, UIComponent component) throws IOException {
+ public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
+
+ UIBox box = (UIBox) component;
+ TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- UIComponent label = component.getFacet(Facets.LABEL);
- String labelString
- = (String) component.getAttributes().get(Attributes.LABEL);
- UIPanel toolbar = (UIPanel) component.getFacet(Facets.TOOL_BAR);
+ UIComponent label = box.getFacet(Facets.LABEL);
+ String labelString = box.getLabel();
+ UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, box);
if (toolbar != null) {
- final int padding = ThemeConfig.getValue(facesContext, component, "paddingTopWhenToolbar");
-// fixme
-// HtmlRendererUtils.replaceStyleAttribute(component, getAttrStyleKey(), "padding-top", padding);
-// fixme
-// HtmlRendererUtils.replaceStyleAttribute(component, getAttrStyleKey(), "padding-bottom", 0);
+ Measure padding = ThemeConfig.getMeasure(facesContext, box, "paddingTopWhenToolbar");
+ style.setPaddingTop(padding);
+ style.setPaddingBottom(PixelMeasure.ZERO);
}
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-
- writer.startElement(HtmlConstants.FIELDSET, component);
+ writer.startElement(HtmlConstants.FIELDSET, box);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
- writer.writeAttributeFromComponent(HtmlAttributes.STYLE, getAttrStyleKey());
+ writer.writeStyleAttribute(style);
if (label != null || labelString != null) {
- writer.startElement(HtmlConstants.LEGEND, component);
+ writer.startElement(HtmlConstants.LEGEND, box);
writer.writeClassAttribute();
if (label != null) {
@@ -92,13 +86,13 @@
innerStyle.setTop(new PixelMeasure(-10));
}
}
- writer.startElement(HtmlConstants.DIV, component);
+ writer.startElement(HtmlConstants.DIV, box);
writer.writeClassAttribute();
writer.writeStyleAttribute(innerStyle);
}
public void encodeEnd(FacesContext facesContext,
- UIComponent component) throws IOException {
+ UIComponent component) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
writer.endElement(HtmlConstants.DIV);
@@ -108,9 +102,4 @@
public boolean getRendersChildren() {
return true;
}
-
- protected String getAttrStyleKey() {
- return Attributes.STYLE;
- }
-
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java Wed Nov 4 11:31:47 2009
@@ -33,6 +33,7 @@
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.CommandRendererHelper;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
@@ -50,34 +51,35 @@
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UICommand command = (UICommand) component;
- String clientId = command.getClientId(facesContext);
+ UIButton button = (UIButton) component;
+ String clientId = button.getClientId(facesContext);
- CommandRendererHelper helper = new CommandRendererHelper(facesContext, command, CommandRendererHelper.Tag.BUTTON);
+ CommandRendererHelper helper = new CommandRendererHelper(facesContext, button, CommandRendererHelper.Tag.BUTTON);
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- LabelWithAccessKey label = new LabelWithAccessKey(command);
+ LabelWithAccessKey label = new LabelWithAccessKey(button);
- writer.startElement(HtmlConstants.BUTTON, command);
- writer.writeAttribute(HtmlAttributes.TYPE, createButtonType(command), false);
+ writer.startElement(HtmlConstants.BUTTON, button);
+ writer.writeAttribute(HtmlAttributes.TYPE, createButtonType(button), false);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
- HtmlRendererUtils.renderTip(command, writer);
+ HtmlRendererUtils.renderTip(button, writer);
writer.writeAttribute(HtmlAttributes.DISABLED, helper.isDisabled());
- Integer tabIndex = ((UIButton)command).getTabIndex();
+ Integer tabIndex = button.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
if (helper.getOnclick() != null) {
writer.writeAttribute(HtmlAttributes.ONCLICK, helper.getOnclick(), true);
}
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, button);
+ writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
writer.writeClassAttribute();
writer.flush(); // force closing the start tag
- String imageName = (String) command.getAttributes().get(Attributes.IMAGE);
+ String imageName = (String) button.getAttributes().get(Attributes.IMAGE);
if (imageName != null) {
String image;
if (imageName.startsWith("HTTP:") || imageName.startsWith("FTP:")
@@ -107,15 +109,15 @@
LOG.info("duplicated accessKey : " + label.getAccessKey());
}
HtmlRendererUtils.addClickAcceleratorKey(
- facesContext, command.getClientId(facesContext), label.getAccessKey());
+ facesContext, button.getClientId(facesContext), label.getAccessKey());
}
if (ComponentUtils.getBooleanAttribute(component, Attributes.DEFAULT_COMMAND)) {
- boolean transition = ComponentUtils.getBooleanAttribute(command, Attributes.TRANSITION);
+ boolean transition = ComponentUtils.getBooleanAttribute(button, Attributes.TRANSITION);
HtmlRendererUtils.setDefaultTransition(facesContext, transition);
HtmlRendererUtils.writeScriptLoader(facesContext, null, new String[]{
- "Tobago.setDefaultAction('" + command.getClientId(facesContext) + "')"});
+ "Tobago.setDefaultAction('" + button.getClientId(facesContext) + "')"});
}
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java Wed Nov 4 11:31:47 2009
@@ -31,6 +31,7 @@
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataRequest;
@@ -114,9 +115,8 @@
writer.startElement(HtmlConstants.INPUT, input);
writer.writeAttribute(HtmlAttributes.TYPE, "file", false);
writer.writeClassAttribute();
-// if (!ClientProperties.getInstance(facesContext).getUserAgent().isMozilla()) {
- writer.writeStyleAttribute();
-// }
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, input);
+ writer.writeStyleAttribute(style);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
writer.writeAttribute(HtmlAttributes.READONLY, ComponentUtils.getBooleanAttribute(input, Attributes.DISABLED));
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java Wed Nov 4 11:31:47 2009
@@ -25,17 +25,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.Attributes;
+import org.apache.myfaces.tobago.component.UICommand;
+import org.apache.myfaces.tobago.component.UIImage;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
-import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIGraphic;
import javax.faces.context.FacesContext;
import java.io.IOException;
import java.util.Locale;
@@ -49,13 +50,12 @@
HtmlRendererUtils.renderDojoDndSource(facesContext, component);
}
- public void encodeEnd(FacesContext facesContext,
- UIComponent component) throws IOException {
+ public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- UIGraphic graphic = (UIGraphic) component;
- final String value = graphic.getUrl();
+ UIImage image = (UIImage) component;
+ final String value = image.getUrl();
String src = value;
if (src != null) {
final String ucSrc = src.toUpperCase(Locale.ENGLISH);
@@ -64,31 +64,31 @@
// absolute Path to image : nothing to do
} else {
src = null;
- if (isDisabled(graphic)) {
+ if (isDisabled(image)) {
src = ResourceManagerUtil.getImageWithPath(
facesContext, HtmlRendererUtils.createSrc(value, "Disabled"), true);
}
if (src == null) {
src = ResourceManagerUtil.getImageWithPath(facesContext, value);
}
- HtmlRendererUtils.addImageSources(facesContext, writer, graphic.getUrl(),
- graphic.getClientId(facesContext));
+ HtmlRendererUtils.addImageSources(facesContext, writer, image.getUrl(),
+ image.getClientId(facesContext));
}
}
- String border = (String) graphic.getAttributes().get(Attributes.BORDER);
+ String border = (String) image.getAttributes().get(Attributes.BORDER);
if (border == null) {
border = "0";
}
- String alt = (String) graphic.getAttributes().get(Attributes.ALT);
+ String alt = (String) image.getAttributes().get(Attributes.ALT);
if (alt == null) {
alt = "";
}
- writer.startElement(HtmlConstants.IMG, graphic);
- final String clientId = graphic.getClientId(facesContext);
+ writer.startElement(HtmlConstants.IMG, image);
+ final String clientId = image.getClientId(facesContext);
writer.writeIdAttribute(clientId);
- if (ComponentUtils.isHoverEnabled(graphic) && !isDisabled(graphic)) {
+ if (ComponentUtils.isHoverEnabled(image) && !isDisabled(image)) {
writer.writeAttribute(HtmlAttributes.ONMOUSEOVER,
"Tobago.imageMouseover('" + clientId + "')", false);
writer.writeAttribute(HtmlAttributes.ONMOUSEOUT,
@@ -98,11 +98,11 @@
writer.writeAttribute(HtmlAttributes.SRC, src, true);
}
writer.writeAttribute(HtmlAttributes.ALT, alt, true);
- HtmlRendererUtils.renderTip(graphic, writer);
+ HtmlRendererUtils.renderTip(image, writer);
writer.writeAttribute(HtmlAttributes.BORDER, border, false);
-// writer.writeAttributeFromComponent(HtmlAttributes.HEIGHT, Attributes.HEIGHT);
- writer.writeStyleAttribute();
- HtmlRendererUtils.renderDojoDndItem(component, writer, true);
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, image);
+ writer.writeStyleAttribute(style);
+ HtmlRendererUtils.renderDojoDndItem(image, writer, true);
writer.writeClassAttribute();
writer.endElement(HtmlConstants.IMG);
@@ -119,14 +119,8 @@
}
}
- private boolean isDisabled(UIGraphic graphic) {
- boolean disabled = ComponentUtils.getBooleanAttribute(graphic,
- Attributes.DISABLED);
- if (!disabled && graphic.getParent() instanceof UICommand) {
- disabled =
- ComponentUtils.getBooleanAttribute(graphic.getParent(), Attributes.DISABLED);
- }
- return disabled;
+ private boolean isDisabled(UIImage graphic) {
+ return graphic.isDisabled()
+ || (graphic.getParent() instanceof UICommand && ((UICommand)graphic.getParent()).isDisabled());
}
}
-
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java Wed Nov 4 11:31:47 2009
@@ -34,6 +34,7 @@
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -126,7 +127,8 @@
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, input);
+ writer.writeStyleAttribute(style);
applyExtraStyle(facesContext, input, currentValue);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java Wed Nov 4 11:31:47 2009
@@ -20,14 +20,17 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.Facets;
+import org.apache.myfaces.tobago.component.UILabel;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.AccessKeyMap;
import org.apache.myfaces.tobago.util.ComponentUtils;
+import org.apache.myfaces.tobago.util.Deprecation;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -42,30 +45,41 @@
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UIOutput output = (UIOutput) component;
+ UILabel output = null;
+ // todo: remove after 1.5.0
+ if (component instanceof UILabel) {
+ output = (UILabel) component;
+ } else {
+ Deprecation.LOG.warn("LabelRenderer should only render UILabel but got " + component.getClass().getName()
+ + " id=" + component.getClientId(facesContext));
+ }
+ TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
LabelWithAccessKey label = new LabelWithAccessKey(component);
- String forValue = ComponentUtils.findClientIdFor(output, facesContext);
+ String forValue = ComponentUtils.findClientIdFor(component, facesContext);
createClassAttribute(component);
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- String clientId = output.getClientId(facesContext);
- writer.startElement(HtmlConstants.DIV, output);
+ String clientId = component.getClientId(facesContext);
+ writer.startElement(HtmlConstants.DIV, component);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
- writer.startElement(HtmlConstants.A, output);
+ // todo: remove after 1.5.0 (see start of method)
+ if (output != null) {
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, output);
+ writer.writeStyleAttribute(style);
+ }
+ writer.startElement(HtmlConstants.A, component);
writer.writeClassAttribute();
- writer.startElement(HtmlConstants.LABEL, output);
+ writer.startElement(HtmlConstants.LABEL, component);
writer.writeIdAttribute(clientId);
if (forValue != null) {
writer.writeAttribute(HtmlAttributes.FOR, forValue, false);
}
writer.writeClassAttribute();
- HtmlRendererUtils.renderTip(output, writer);
+ HtmlRendererUtils.renderTip(component, writer);
if (label.getText() != null) {
HtmlRendererUtils.writeLabelWithAccessKey(writer, label);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java Wed Nov 4 11:31:47 2009
@@ -24,6 +24,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.component.AbstractUICommand;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UICommand;
import org.apache.myfaces.tobago.component.UILink;
@@ -31,10 +32,12 @@
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.CommandRendererHelper;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.AccessKeyMap;
import org.apache.myfaces.tobago.util.ComponentUtils;
+import org.apache.myfaces.tobago.util.Deprecation;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
@@ -48,18 +51,18 @@
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
- UICommand command = (UICommand) component;
- String clientId = command.getClientId(facesContext);
- CommandRendererHelper helper = new CommandRendererHelper(facesContext, command, CommandRendererHelper.Tag.ANCHOR);
+ AbstractUICommand link = (AbstractUICommand) component;
+ String clientId = link.getClientId(facesContext);
+ CommandRendererHelper helper = new CommandRendererHelper(facesContext, link, CommandRendererHelper.Tag.ANCHOR);
String href = helper.getHref();
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- LabelWithAccessKey label = new LabelWithAccessKey(command);
+ LabelWithAccessKey label = new LabelWithAccessKey(link);
if (helper.isDisabled()) {
- writer.startElement(HtmlConstants.SPAN, command);
+ writer.startElement(HtmlConstants.SPAN, link);
} else {
- writer.startElement(HtmlConstants.A, command);
+ writer.startElement(HtmlConstants.A, link);
writer.writeAttribute(HtmlAttributes.HREF, href, true);
if (helper.getOnclick() != null) {
writer.writeAttribute(HtmlAttributes.ONCLICK, helper.getOnclick(), true);
@@ -68,34 +71,38 @@
writer.writeAttribute(HtmlAttributes.TARGET, helper.getTarget(), true);
}
Integer tabIndex = null;
- if (command instanceof UILink) {
- tabIndex = ((UILink) command).getTabIndex();
+ if (link instanceof UILink) {
+ tabIndex = ((UILink) link).getTabIndex();
+ } else {
+ Deprecation.LOG.warn("LinkRenderer should only render UILink but got " + link.getClass().getName()
+ + " id=" + link.getClientId(facesContext));
}
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
}
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, link);
+ writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
writer.writeClassAttribute();
writer.writeIdAttribute(clientId);
writer.writeNameAttribute(clientId);
- HtmlRendererUtils.renderTip(command, writer);
+ HtmlRendererUtils.renderTip(link, writer);
writer.flush();
// image
- String image = (String) command.getAttributes().get(Attributes.IMAGE);
+ String image = (String) link.getAttributes().get(Attributes.IMAGE);
if (image != null) {
if (image.startsWith("HTTP:") || image.startsWith("FTP:") || image.startsWith("/")) {
// absolute Path to image : nothing to do
} else {
image = getImageWithPath(facesContext, image, helper.isDisabled());
}
- writer.startElement(HtmlConstants.IMG, command);
+ writer.startElement(HtmlConstants.IMG, link);
writer.writeAttribute(HtmlAttributes.SRC, image, true);
writer.writeAttribute(HtmlAttributes.BORDER, 0); // TODO: is border=0 setting via style possible?
- HtmlRendererUtils.renderImageTip(command, writer);
- HtmlRendererUtils.renderTip(command, writer);
+ HtmlRendererUtils.renderImageTip(link, writer);
+ HtmlRendererUtils.renderTip(link, writer);
writer.endElement(HtmlConstants.IMG);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java Wed Nov 4 11:31:47 2009
@@ -43,6 +43,7 @@
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -80,7 +81,8 @@
if (facesContext.getMessages().hasNext()) { // in ie empty span gets a height
writer.startElement(HtmlConstants.SPAN, messages);
writer.writeClassAttribute("tobago-validation-message");
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, messages);
+ writer.writeStyleAttribute(style);
// with id
String focusId = null;
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ObjectRenderer.java Wed Nov 4 11:31:47 2009
@@ -18,10 +18,12 @@
*/
import org.apache.myfaces.tobago.component.Attributes;
+import org.apache.myfaces.tobago.component.UIObject;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -30,32 +32,33 @@
import java.io.IOException;
public class ObjectRenderer extends LayoutableRendererBase {
- public void encodeEnd(FacesContext facesContext, UIComponent component)
- throws IOException {
+ public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
+ UIObject object = (UIObject) component;
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- writer.startElement(HtmlConstants.IFRAME, component);
- writer.writeIdAttribute(component.getClientId(facesContext));
- writer.writeNameAttribute(component.getClientId(facesContext));
- Object src = component.getAttributes().get(Attributes.SRC);
+
+ writer.startElement(HtmlConstants.IFRAME, object);
+ writer.writeIdAttribute(object.getClientId(facesContext));
+ writer.writeNameAttribute(object.getClientId(facesContext));
+ Object src = object.getSrc();
if (src != null) {
writer.writeAttribute(HtmlAttributes.SRC, String.valueOf(src), true);
} else {
writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtil.getBlankPage(facesContext), false);
}
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, object);
+ writer.writeStyleAttribute(style);
String noframes = ResourceManagerUtil.getPropertyNotNull(
facesContext, "tobago", "browser.noframe.message.prefix");
writer.writeText(noframes + " ");
- writer.startElement(HtmlConstants.A, component);
- if (component.getAttributes().get(Attributes.SRC) != null) {
+ writer.startElement(HtmlConstants.A, object);
+ if (src != null) {
writer.writeAttributeFromComponent(HtmlAttributes.HREF, Attributes.SRC);
writer.writeTextFromComponent(Attributes.SRC);
}
writer.endElement(HtmlConstants.A);
- noframes = ResourceManagerUtil.getPropertyNotNull(
- facesContext, "tobago", "browser.noframe.message.postfix");
+ noframes = ResourceManagerUtil.getPropertyNotNull(facesContext, "tobago", "browser.noframe.message.postfix");
writer.writeText(" " + noframes);
writer.endElement(HtmlConstants.IFRAME);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/OutRenderer.java Wed Nov 4 11:31:47 2009
@@ -20,6 +20,7 @@
import org.apache.myfaces.tobago.component.UIOut;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -49,7 +50,8 @@
String id = out.getClientId(facesContext);
writer.startElement(HtmlConstants.DIV, out);
writer.writeIdAttribute(id);
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, out);
+ writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(out, writer, true);
writer.writeClassAttribute();
HtmlRendererUtils.renderTip(out, writer);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Wed Nov 4 11:31:47 2009
@@ -33,6 +33,7 @@
import org.apache.myfaces.tobago.renderkit.PageRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.util.AccessKeyMap;
@@ -341,9 +342,10 @@
writer.startElement(HtmlConstants.BODY, page);
writer.writeAttribute(HtmlAttributes.ONLOAD, "Tobago.init('" + clientId + "');", false);
// writer.writeAttribute("onunload", "Tobago.onexit();", null);
- writer.writeClassAttribute();
- writer.writeStyleAttribute();
writer.writeIdAttribute(clientId);
+ writer.writeClassAttribute();
+// HtmlStyleMap style = new HtmlStyleMap(facesContext, page);
+// writer.writeStyleAttribute(style);
writer.startJavascript();
writer.write("Tobago.pngFixBlankImage = '");
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PanelRenderer.java Wed Nov 4 11:31:47 2009
@@ -26,12 +26,14 @@
import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.ajax.api.AjaxRenderer;
import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
+import org.apache.myfaces.tobago.component.AbstractUIPanel;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.component.UIReload;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -67,17 +69,22 @@
@Override
public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {
- String clientId = component.getClientId(facesContext);
+
+ // UIPanel and UICell
+ AbstractUIPanel panel = (AbstractUIPanel) component;
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- writer.startElement(HtmlConstants.DIV, component);
- HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeClassAttribute();
+
+ String clientId = panel.getClientId(facesContext);
+ writer.startElement(HtmlConstants.DIV, panel);
+ HtmlRendererUtils.renderDojoDndItem(panel, writer, true);
writer.writeIdAttribute(clientId);
- writer.writeStyleAttribute();
+ writer.writeClassAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, panel);
+ writer.writeStyleAttribute(style);
if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
// writer.writeJavascript("Tobago.addAjaxComponent(\"" + clientId + "\")");
Integer frequency = null;
- UIComponent facetReload = component.getFacet(Facets.RELOAD);
+ UIComponent facetReload = panel.getFacet(Facets.RELOAD);
if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
UIReload update = (UIReload) facetReload;
frequency = update.getFrequency();
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java Wed Nov 4 11:31:47 2009
@@ -29,6 +29,7 @@
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.RendererTypes;
import org.apache.myfaces.tobago.component.UICommand;
+import org.apache.myfaces.tobago.component.UIInput;
import org.apache.myfaces.tobago.component.UISelectBooleanCommand;
import org.apache.myfaces.tobago.component.UIToolBar;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
@@ -36,6 +37,7 @@
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
@@ -44,7 +46,6 @@
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
import javax.faces.component.UIPanel;
import javax.faces.context.FacesContext;
import java.io.IOException;
@@ -86,66 +87,65 @@
return content;
}
- public void encodeEnd(FacesContext facesContext,
- UIComponent uiComponent) throws IOException {
+ public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UIInput component = (UIInput) uiComponent;
+ UIInput input = (UIInput) component;
boolean previewState
- = ComponentUtils.getBooleanAttribute(component, Attributes.STATE_PREVIEW);
+ = ComponentUtils.getBooleanAttribute(input, Attributes.STATE_PREVIEW);
// FIXME: remove this when i18n is ok
- String clientId = component.getClientId(facesContext);
+ String clientId = input.getClientId(facesContext);
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- StyleClasses containerClasses = StyleClasses.ensureStyleClassesCopy(component);
+ StyleClasses containerClasses = StyleClasses.ensureStyleClassesCopy(input);
containerClasses.addClass("richTextEditor", "container");
- writer.startElement(HtmlConstants.DIV, component);
+ writer.startElement(HtmlConstants.DIV, input);
writer.writeClassAttribute(containerClasses);
- writer.writeStyleAttribute();
- // class, stly.width, style.height
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, input);
+ writer.writeStyleAttribute(style);
- UIComponent toolbar = component.getFacet(Facets.TOOL_BAR);
+ UIComponent toolbar = input.getFacet(Facets.TOOL_BAR);
if (toolbar == null) {
- toolbar = createToolbar(facesContext, component);
+ toolbar = createToolbar(facesContext, input);
}
facesContext.getExternalContext().getRequestMap().put(
"tobagoRichtextPreviewState", previewState ? Boolean.TRUE : Boolean.FALSE);
RenderUtil.encode(facesContext, toolbar);
-// renderToolBar(facesContext, writer, component);
+// renderToolBar(facesContext, writer, input);
- String content = getCurrentValue(facesContext, component);
+ String content = getCurrentValue(facesContext, input);
- StyleClasses bodyClasses = StyleClasses.ensureStyleClassesCopy(component);
+ StyleClasses bodyClasses = StyleClasses.ensureStyleClassesCopy(input);
bodyClasses.addClass("richTextEditor", "body");
if (previewState) {
- writer.startElement(HtmlConstants.INPUT, component);
+ writer.startElement(HtmlConstants.INPUT, input);
writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
writer.writeNameAttribute(clientId);
writer.writeAttribute(HtmlAttributes.VALUE, content, true);
writer.endElement(HtmlConstants.INPUT);
- writer.startElement(HtmlConstants.DIV, component);
+ writer.startElement(HtmlConstants.DIV, input);
writer.writeClassAttribute(bodyClasses);
writer.writeIdAttribute(clientId);
- writer.writeStyleAttribute();
+ writer.writeStyleAttribute(style);
writer.writeText("");
writer.write(RichTextEditorRenderer.contentToHtml(content));
writer.endElement(HtmlConstants.DIV);
} else {
- writer.startElement(HtmlConstants.TEXTAREA, component);
+ writer.startElement(HtmlConstants.TEXTAREA, input);
writer.writeClassAttribute(bodyClasses);
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
- writer.writeStyleAttribute();
- String onchange = HtmlUtils.generateOnchange(component, facesContext);
+ writer.writeStyleAttribute(style);
+ String onchange = HtmlUtils.generateOnchange(input, facesContext);
if (null != onchange) {
writer.writeAttribute(HtmlAttributes.ONCHANGE, onchange, null);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java Wed Nov 4 11:31:47 2009
@@ -29,6 +29,7 @@
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
@@ -56,10 +57,10 @@
}
UISelectManyCheckbox selectMany = (UISelectManyCheckbox) component;
+ TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
List<SelectItem> items = RenderUtil.getItemsToRender(selectMany);
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
Object[] values = selectMany.getSelectedValues();
if (LOG.isDebugEnabled()) {
@@ -76,7 +77,8 @@
writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, selectMany);
+ writer.writeStyleAttribute(style);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java Wed Nov 4 11:31:47 2009
@@ -29,6 +29,7 @@
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -57,6 +58,7 @@
}
UISelectManyListbox selectMany = (UISelectManyListbox) component;
+ TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
List<SelectItem> items = RenderUtil.getSelectItems(selectMany);
@@ -64,7 +66,6 @@
LOG.debug("items.size() = '" + items.size() + "'");
}
- TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, selectMany);
writer.startElement(HtmlConstants.SELECT, selectMany);
String clientId = selectMany.getClientId(facesContext);
@@ -77,7 +78,8 @@
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, selectMany);
+ writer.writeStyleAttribute(style);
writer.writeClassAttribute();
writer.writeAttribute(HtmlAttributes.MULTIPLE, HtmlAttributes.MULTIPLE, false);
if (title != null) {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java Wed Nov 4 11:31:47 2009
@@ -26,6 +26,7 @@
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -70,14 +71,13 @@
writer.writeNameAttribute(selectOne.getClientId(facesContext));
writer.writeIdAttribute(selectOne.getClientId(facesContext));
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, selectOne);
+ writer.writeStyleAttribute(style);
writer.writeAttribute(HtmlAttributes.DISABLED, disabled);
Integer tabIndex = selectOne.getTabIndex();
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
- writer.writeStyleAttribute();
- writer.writeClassAttribute();
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java Wed Nov 4 11:31:47 2009
@@ -29,6 +29,7 @@
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -56,7 +57,6 @@
}
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-
UISelectOneListbox selectOne = (UISelectOneListbox) component;
List<SelectItem> items = RenderUtil.getSelectItems(selectOne);
@@ -69,7 +69,8 @@
if (tabIndex != null) {
writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
}
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, selectOne);
+ writer.writeStyleAttribute(style);
writer.writeClassAttribute();
HtmlRendererUtils.renderTip(selectOne, writer);
writer.writeAttribute(HtmlAttributes.SIZE, 2); // should be greater 1
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Wed Nov 4 11:31:47 2009
@@ -30,6 +30,7 @@
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
@@ -94,7 +95,8 @@
writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, selectOne);
+ writer.writeStyleAttribute(style);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Wed Nov 4 11:31:47 2009
@@ -263,7 +263,8 @@
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
final String clientId = tabGroup.getClientId(facesContext);
writer.writeIdAttribute(clientId + "__" + virtualTab);
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, tabGroup);
+ writer.writeStyleAttribute(style);
writer.startElement(HtmlConstants.TR, tabGroup);
writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java Wed Nov 4 11:31:47 2009
@@ -30,6 +30,7 @@
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
@@ -77,8 +78,9 @@
}
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeStyleAttribute();
writer.writeClassAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, input);
+ writer.writeStyleAttribute(style);
if (onchange != null) {
writer.writeAttribute(HtmlAttributes.ONCHANGE, onchange, null);
}
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java Wed Nov 4 11:31:47 2009
@@ -32,6 +32,7 @@
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -111,7 +112,8 @@
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
writer.startElement(HtmlConstants.DIV, input);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, input);
+ writer.writeStyleAttribute(style);
writer.startElement(HtmlConstants.DIV, input);
writer.writeAttribute(HtmlAttributes.ID, idPrefix + "borderDiv", false);
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ToolBarRenderer.java Wed Nov 4 11:31:47 2009
@@ -26,11 +26,11 @@
import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.tobago.component.UIToolBar;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIPanel;
import javax.faces.context.FacesContext;
import java.io.IOException;
@@ -39,7 +39,8 @@
private static final Log LOG = LogFactory.getLog(ToolBarRenderer.class);
public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
- UIPanel toolbar = (UIPanel) uiComponent;
+
+ UIToolBar toolbar = (UIToolBar) uiComponent;
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
@@ -47,7 +48,8 @@
writer.writeIdAttribute(toolbar.getClientId(facesContext));
HtmlRendererUtils.renderDojoDndItem(toolbar, writer, true);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, toolbar);
+ writer.writeStyleAttribute(style);
writer.startElement(HtmlConstants.DIV, toolbar);
boolean right = false;
if (toolbar instanceof UIToolBar) {
Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeRenderer.java Wed Nov 4 11:31:47 2009
@@ -27,6 +27,7 @@
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
import org.apache.myfaces.tobago.util.ComponentUtils;
@@ -89,7 +90,8 @@
writer.startElement(HtmlConstants.DIV, tree);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, tree);
+ writer.writeStyleAttribute(style);
writer.startElement(HtmlConstants.INPUT, tree);
writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
Modified: myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java?rev=832709&r1=832708&r2=832709&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SeparatorRenderer.java Wed Nov 4 11:31:47 2009
@@ -25,6 +25,7 @@
import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.Deprecation;
@@ -55,7 +56,8 @@
writer.startElement(HtmlConstants.TABLE, component);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, separator);
+ writer.writeStyleAttribute(style);
writer.writeAttribute(HtmlAttributes.CELLPADDING, "0", false);
writer.writeAttribute(HtmlAttributes.CELLSPACING, "0", false);
@@ -93,7 +95,8 @@
} else {
writer.startElement(HtmlConstants.HR , component);
writer.writeClassAttribute();
- writer.writeStyleAttribute();
+ HtmlStyleMap style = new HtmlStyleMap(facesContext, separator);
+ writer.writeStyleAttribute(style);
writer.endElement(HtmlConstants.HR);
}
}