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 2010/07/20 12:06:00 UTC
svn commit: r965782 [2/4] - in /myfaces/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/config/
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/sr...
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-richmond/src/main/resources/org/apache/myfaces/tobago/renderkit/html/richmond/standard/style/style.css Tue Jul 20 10:05:56 2010
@@ -42,36 +42,36 @@
color: #3366CC;
}
-.tobago-button-disabled {
+.tobago-button-markup-disabled {
color: gray;
}
/* - calendar --------------------------------------------------------------- */
-td.tobago-calendar-day-selected {
+td.tobago-calendar-day-markup-selected {
background-color: #99CCFF;
}
/* date ---------------------------------------------------------------------- */
-.tobago-date {
+.tobago-date {
border: 1px #3366CC solid;
height: 20px;
font: 12px arial, helvetica, sans-serif;
color: #3366CC;
}
-.tobago-date-readonly {
+.tobago-date-markup-readonly {
background-color: #e6e6e6;
color: #3366cc;
}
-.tobago-date-disabled {
+.tobago-date-markup-disabled {
color: #3366cc;
background-color: #e6e6e6;
}
-.tobago-date-error {
+.tobago-date-markup-error, .tobago-date-markup-error {
border: 1px solid #ff0000;
}
@@ -81,7 +81,6 @@ td.tobago-calendar-day-selected {
height: 20px;
}
-
/* label ------------------------------------------------------------ */
div.tobago-label {
@@ -103,27 +102,27 @@ label.tobago-label {
/* in ---------------------------------------------------------------------- */
-.tobago-in {
+.tobago-in {
border: 1px #3366CC solid;
font: 12px arial, helvetica, sans-serif;
color: #3366CC;
}
-.tobago-in-readonly {
+.tobago-in-markup-readonly {
background-color: #e6e6e6;
color: #3366cc;
}
-.tobago-in-disabled {
+.tobago-in-markup-disabled {
color: #3366cc;
background-color: #e6e6e6;
}
-.tobago-in-error {
+.tobago-in-markup-error, .tobago-in-markup-fatal {
border: 1px solid #ff0000;
}
-/* menuBar ----------------------------------------------------------------- */
+/* link ----------------------------------------------------------------- */
.tobago-link {
font: bold 12px arial, helvetica, sans-serif;
@@ -131,7 +130,7 @@ label.tobago-label {
text-decoration: none;
}
-.tobago-link-disabled {
+.tobago-link-markup-disabled {
color:#888888
}
@@ -160,9 +159,7 @@ li.tobago-menu-selected {
/* messages ----------------------------------------------------------------- */
-/* todo rename to tobago-messages */
-.tobago-validation-message {
- color: #ff0000;
+.tobago-messages {
font: 14px arial, helvetica, sans-serif;
}
@@ -195,13 +192,13 @@ img.tobago-progress-color2 {
/* separator ------------------------------------------------------------------- */
-hr.tobago-separator {
+.tobago-separator hr {
border-bottom-color: #3366cc;
}
/* sheet ----------------------------------------------------------------- */
-.tobago-sheet-header-div {
+.tobago-sheet-headerDiv {
border-bottom: 1px solid #d6ebff;
}
@@ -212,19 +209,19 @@ hr.tobago-separator {
font: bold 13px arial, helvetica, sans-serif;
}
-.tobago-sheet-body-div {
+.tobago-sheet-body {
background: #EBEFEB;
}
-.tobago-sheet-row-odd {
+.tobago-sheet-row-markup-odd {
background: #EBEFEB;
}
-.tobago-sheet-row-even {
+.tobago-sheet-row-markup-even {
background: #EBEFEB;
}
-.tobago-sheet-row-selected {
+.tobago-sheet-row-markup-selected {
background: highlight;
color: highlighttext;
}
@@ -237,7 +234,7 @@ hr.tobago-separator {
text-decoration: none;
}
-.tobago-sheet-paging-input {
+.tobago-sheet-pagingInput {
border: 1px #3366CC solid;
}
@@ -248,32 +245,22 @@ hr.tobago-separator {
color: #D6EBFF;
}
-div.tobago-tab-selected-outer {
+div.tobago-tab-outer {
border-color: #3366CC;
- padding: 0.2ex 0.2em;
background: #6699FF repeat-x top;
- -moz-box-sizing: border-box;
box-sizing: border-box;
}
-div.tobago-tab-selected-inner {
- font: bold 12px arial, helvetica, sans-serif;
- color: #3366CC;
-}
-
-div.tobago-tab-unselected-outer {
- border-color: #3366CC;
- background: #6699FF repeat-x top;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+div.tobago-tab-outer-markup-selected {
+ padding: 0.2ex 0.2em;
}
-div.tobago-tab-unselected-inner {
+div.tobago-tab-inner {
font: bold 12px arial, helvetica, sans-serif;
color: #3366CC;
}
-div.tobago-tab-fulfill {
+div.tobago-tabGroup-fulfill {
border-color: #3366CC;
margin: 1px;
margin-bottom:0px;
@@ -286,7 +273,6 @@ div.tobago-tab-fulfill {
border-top: 0px solid transparent;
padding: 14px 10px 12px 13px;
background: #FFFFFF;
- -moz-box-sizing: border-box;
box-sizing: border-box;
}
@@ -295,15 +281,9 @@ div.tobago-tab-fulfill {
border: 0px solid #FFFFFF;
border-top: 0px solid transparent;
border-left: 0px solid transparent;
- -moz-box-sizing: border-box;
box-sizing: border-box;
}
-a:link.tab, a:visited.tab, a:active.tab {
- font-family: bold 12px arial, helvetica, sans-serif;
- color: #3366CC;
-}
-
/* time -------------------------------------------------------------------- */
.tobago-time-borderDiv {
@@ -314,28 +294,28 @@ a:link.tab, a:visited.tab, a:active.tab
color: #3366CC;
}
-.tobago-time-input-selected {
+.tobago-time-input-markup-selected {
background: #D6EBFF;
}
/* textArea -------------------------------------------------------------- */
-.tobago-textArea {
+.tobago-textArea {
font: 12px arial, helvetica, sans-serif;
color: #3366CC;
border: 1px solid #3366CC;
}
-.tobago-textArea-readonly {
+.tobago-textArea-markup-readonly {
background-color: #e6e6e6;
}
-.tobago-textArea-disabled {
+.tobago-textArea-markup-disabled {
color: #808080;
background-color: #e6e6e6;
}
-.tobago-textArea-error {
+.tobago-textArea-markup-error, .tobago-textArea-markup-fatal {
border: 1px solid #ff0000;
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/BoxRenderer.java Tue Jul 20 10:05:56 2010
@@ -22,6 +22,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIBox;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.BoxRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
@@ -72,9 +73,9 @@ public class BoxRenderer extends BoxRend
Style contentStyle = new Style(facesContext, box);
if (toolbar != null) {
writer.startElement(HtmlConstants.DIV, null);
- writer.writeClassAttribute("tobago-box-toolbar-div");
+ writer.writeClassAttribute(Classes.create(box, "toolbarOuter"));
writer.startElement(HtmlConstants.DIV, null);
- writer.writeClassAttribute("tobago-box-toolbar-span");
+ writer.writeClassAttribute(Classes.create(box, "toolbarInner"));
toolbar.setRendererType(RendererTypes.BOX_TOOL_BAR);
RenderUtils.encode(facesContext, toolbar);
writer.endElement(HtmlConstants.DIV);
@@ -85,7 +86,7 @@ public class BoxRenderer extends BoxRend
}
}
writer.startElement(HtmlConstants.DIV, box);
- writer.writeClassAttribute("tobago-box-content"); // needed to be scrollable inside of the box
+ writer.writeClassAttribute(Classes.create(box, "content")); // needed to be scrollable inside of the box
writer.writeStyleAttribute(contentStyle);
final Measure offsetLeft = getOffsetLeft(facesContext, box);
final Measure offsetRight = getOffsetRight(facesContext, box);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ButtonRenderer.java Tue Jul 20 10:05:56 2010
@@ -29,6 +29,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -75,7 +76,7 @@ public class ButtonRenderer extends Comm
Style style = new Style(facesContext, button);
writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(button));
writer.flush(); // force closing the start tag
String imageName = (String) button.getAttributes().get(Attributes.IMAGE);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/CalendarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/CalendarRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/CalendarRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/CalendarRenderer.java Tue Jul 20 10:05:56 2010
@@ -18,20 +18,22 @@ package org.apache.myfaces.tobago.render
*/
import org.apache.commons.lang.StringUtils;
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UICalendar;
+import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.model.CalendarModel;
import org.apache.myfaces.tobago.model.DateModel;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -100,19 +102,19 @@ public class CalendarRenderer extends La
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
writer.startElement(HtmlConstants.TR, null);
- writer.writeClassAttribute("tobago-calendar-header-tr");
+ writer.writeClassAttribute(Classes.create(output, "headerRow"));
writer.startElement(HtmlConstants.TH, null);
writer.writeAttribute(HtmlAttributes.COLSPAN, 7);
writer.startElement(HtmlConstants.TABLE, null);
writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
- writer.writeClassAttribute("tobago-calendar-header");
+ writer.writeClassAttribute(Classes.create(output, "header"));
writer.startElement(HtmlConstants.TR, null);
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.ALIGN, "left", false);
writer.startElement(HtmlConstants.IMG, null);
- writer.writeClassAttribute("tobago-calendar-header");
+ writer.writeClassAttribute(Classes.create(output, "header"));
writer.writeAttribute(HtmlAttributes.ALT, "", false);
writer.writeAttribute(HtmlAttributes.SRC,
ResourceManagerUtils.getImageWithPath(facesContext, "image/calendarFastPrev.gif"), false);
@@ -123,7 +125,7 @@ public class CalendarRenderer extends La
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.ALIGN, "left", false);
writer.startElement(HtmlConstants.IMG, null);
- writer.writeClassAttribute("tobago-calendar-header");
+ writer.writeClassAttribute(Classes.create(output, "header"));
writer.writeAttribute(HtmlAttributes.ALT, "", false);
writer.writeAttribute(HtmlAttributes.SRC,
ResourceManagerUtils.getImageWithPath(facesContext, "image/calendarPrev.gif"), false);
@@ -132,7 +134,7 @@ public class CalendarRenderer extends La
writer.endElement(HtmlConstants.TD);
writer.startElement(HtmlConstants.TH, null);
- writer.writeClassAttribute("tobago-calendar-header-center");
+ writer.writeClassAttribute(Classes.create(output, "headerCenter"));
writer.writeAttribute(HtmlAttributes.ALIGN, "center", false);
writer.writeIdAttribute(id + ":title");
writer.writeText(dateFormat.format(calendar.getTime()));
@@ -141,7 +143,7 @@ public class CalendarRenderer extends La
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.ALIGN, "right", false);
writer.startElement(HtmlConstants.IMG, null);
- writer.writeClassAttribute("tobago-calendar-header");
+ writer.writeClassAttribute(Classes.create(output, "header"));
writer.writeAttribute(HtmlAttributes.ALT, "", false);
writer.writeAttribute(HtmlAttributes.SRC,
ResourceManagerUtils.getImageWithPath(facesContext, "image/calendarNext.gif"), false);
@@ -152,7 +154,7 @@ public class CalendarRenderer extends La
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.ALIGN, "right", false);
writer.startElement(HtmlConstants.IMG, null);
- writer.writeClassAttribute("tobago-calendar-header");
+ writer.writeClassAttribute(Classes.create(output, "header"));
writer.writeAttribute(HtmlAttributes.ALT, "", false);
writer.writeAttribute(HtmlAttributes.SRC,
ResourceManagerUtils.getImageWithPath(facesContext, "image/calendarFastNext.gif"), false);
@@ -175,7 +177,7 @@ public class CalendarRenderer extends La
dayName = StringUtils.substring(dayName, 0, 2);
writer.startElement(HtmlConstants.TH, null);
- writer.writeClassAttribute("tobago-calendar-inner-header");
+ writer.writeClassAttribute(Classes.create(output, "headerInner"));
writer.writeText(dayName);
writer.endElement(HtmlConstants.TH);
}
@@ -198,7 +200,8 @@ public class CalendarRenderer extends La
writer.startElement(HtmlConstants.TD, null);
writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);
writer.writeIdAttribute(id + ":" + week + ":" + dayIt);
- writer.writeClassAttribute(getClass(date, model));
+ writer.writeClassAttribute(
+ Classes.create(output, "day", date.getMonth() == model.getMonth() ? null : Markup.DISABLED));
writer.writeText(dayDescription);
@@ -250,12 +253,6 @@ public class CalendarRenderer extends La
writer.endElement(HtmlConstants.INPUT);
}
- private String getClass(DateModel date, CalendarModel model) {
- return (date.getMonth() == model.getMonth())
- ? "tobago-calendar-day"
- : "tobago-calendar-day-disabled";
- }
-
private String getMonthNames(Locale locale) {
SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM", locale);
StringBuilder buffer = new StringBuilder(64);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java Tue Jul 20 10:05:56 2010
@@ -23,13 +23,12 @@ package org.apache.myfaces.tobago.render
*/
import org.apache.commons.fileupload.FileItem;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UIFileInput;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.internal.webapp.TobagoMultipartFormdataRequest;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -37,6 +36,8 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -115,7 +116,7 @@ public class FileRenderer extends InputR
writer.startElement(HtmlConstants.INPUT, input);
writer.writeAttribute(HtmlAttributes.TYPE, HtmlInputTypes.FILE, false);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(input));
Style style = new Style(facesContext, input);
writer.writeStyleAttribute(style);
writer.writeNameAttribute(clientId);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ImageRenderer.java Tue Jul 20 10:05:56 2010
@@ -27,6 +27,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIImage;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -49,7 +50,7 @@ public class ImageRenderer extends Layou
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);
@@ -94,7 +95,7 @@ public class ImageRenderer extends Layou
Style style = new Style(facesContext, image);
writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(image, writer, true);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(image));
writer.endElement(HtmlConstants.IMG);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java Tue Jul 20 10:05:56 2010
@@ -28,11 +28,11 @@ import org.apache.myfaces.tobago.model.A
import org.apache.myfaces.tobago.model.AutoSuggestItem;
import org.apache.myfaces.tobago.model.AutoSuggestItems;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -137,9 +137,8 @@ public class InRenderer extends InputRen
Style style = new Style(facesContext, input);
writer.writeStyleAttribute(style);
- applyExtraStyle(facesContext, input, currentValue);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(input));
/*if (component instanceof UIInputBase) {
String onchange = HtmlUtils.generateOnchange((UIInputBase) component, facesContext);
if (onchange != null) {
@@ -152,10 +151,10 @@ public class InRenderer extends InputRen
HtmlRendererUtils.checkForCommandFacet(input, facesContext, writer);
boolean required = ComponentUtils.getBooleanAttribute(input, Attributes.REQUIRED);
- String rendererName = HtmlRendererUtils.getRendererName(facesContext, input);
+ final String requiredClass = Classes.required(input);
if (required && !renderAjaxSuggest) {
final String[] cmds = {
- "new Tobago.In(\"" + id + "\", true ,\"" + StyleClasses.PREFIX + rendererName + "\" );"
+ "new Tobago.In(\"" + id + "\", true ,\"" + requiredClass + "\" );"
};
HtmlRendererUtils.writeScriptLoader(facesContext, null, cmds);
@@ -171,7 +170,7 @@ public class InRenderer extends InputRen
"new Tobago.AutocompleterAjax(",
" '" + id + "',",
" " + required + ",",
- " '" + StyleClasses.PREFIX + rendererName + "',",
+ " '" + requiredClass + "',",
" { });"
};
@@ -181,15 +180,6 @@ public class InRenderer extends InputRen
}
}
- protected void applyExtraStyle(FacesContext facesContext, UIInputBase input, String currentValue) {
- if (currentValue != null && currentValue.length() > 0
- && ComponentUtils.getBooleanAttribute(input, Attributes.REQUIRED)) {
- StyleClasses styleClasses = StyleClasses.ensureStyleClasses(input);
- String rendererName = HtmlRendererUtils.getRendererName(facesContext, input);
- styleClasses.removeAspectClass(rendererName, StyleClasses.Aspect.REQUIRED);
- }
- }
-
private void encodeAjax(FacesContext context, UIComponent component) throws IOException {
if (!(component instanceof UIInputBase)) {
LOG.error("Wrong type: Need " + UIInputBase.class.getName() + ", but was " + component.getClass().getName());
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LabelRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,38 +17,55 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.UILabel;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.internal.util.AccessKeyMap;
import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import java.io.IOException;
-import java.util.Locale;
public class LabelRenderer extends LayoutComponentRendererBase {
private static final Logger LOG = LoggerFactory.getLogger(LabelRenderer.class);
+ @Override
+ public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+ super.prepareRender(facesContext, component);
+
+ ComponentUtils.evaluateAutoFor(component);
+
+ // adding the markups from the corresponding input component
+ final UILabel label = (UILabel) component;
+ final UIComponent corresponding = ComponentUtils.findFor(label);
+ if (corresponding != null) {
+ Markup markup = label.getCurrentMarkup();
+ markup = ComponentUtils.updateMarkup(corresponding, markup);
+ label.setCurrentMarkup(markup);
+ }
+ }
+
+
public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UILabel output = null;
+ final UILabel output;
// todo: remove test after 1.5.0, then UILabel is required
if (component instanceof UILabel) {
output = (UILabel) component;
} else {
+ output = null;
Deprecation.LOG.warn("LabelRenderer should only render UILabel but got " + component.getClass().getName()
+ " id=" + component.getClientId(facesContext));
}
@@ -58,25 +75,24 @@ public class LabelRenderer extends Layou
String forValue = ComponentUtils.findClientIdFor(component, facesContext);
- createClassAttribute(component);
-
String clientId = component.getClientId(facesContext);
writer.startElement(HtmlConstants.DIV, component);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeClassAttribute();
+ final Classes classes = Classes.create(component);
// todo: remove after 1.5.0 (see begin of method)
if (output != null) {
+ writer.writeClassAttribute(classes);
Style style = new Style(facesContext, output);
writer.writeStyleAttribute(style);
}
writer.startElement(HtmlConstants.A, component);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(classes);
writer.startElement(HtmlConstants.LABEL, component);
writer.writeIdAttribute(clientId);
if (forValue != null) {
writer.writeAttribute(HtmlAttributes.FOR, forValue, false);
}
- writer.writeClassAttribute();
+ writer.writeClassAttribute(classes);
HtmlRendererUtils.renderTip(component, writer);
@@ -95,32 +111,4 @@ public class LabelRenderer extends Layou
}
writer.endElement(HtmlConstants.DIV);
}
-
- private void createClassAttribute(UIComponent component) {
-
- String rendererType = component.getRendererType().toLowerCase(Locale.ENGLISH);
- String name = getRendererName(rendererType);
-
- UIComponent parent = findParent(component);
- StyleClasses styleClasses = StyleClasses.ensureStyleClasses(component);
- styleClasses.updateClassAttribute(parent, name);
- styleClasses.addMarkupClass(component, name);
-
- }
-
- private UIComponent findParent(UIComponent component) {
- UIComponent parent = component.getParent();
- if (component != parent.getFacet(Facets.LABEL)) {
-
- // try to find belonging component
- // this can only success if the component was rendered (created) before this label
- parent = ComponentUtils.findFor(component);
- }
- if (parent == null) {
- parent = component;
- }
- return parent;
- }
-
}
-
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/LinkRenderer.java Tue Jul 20 10:05:56 2010
@@ -22,8 +22,6 @@ package org.apache.myfaces.tobago.render
* $Id$
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UICommand;
import org.apache.myfaces.tobago.component.UILink;
@@ -32,6 +30,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.util.Deprecation;
import org.apache.myfaces.tobago.renderkit.CommandRendererBase;
import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -39,6 +38,8 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -84,7 +85,7 @@ public class LinkRenderer extends Comman
Style style = new Style(facesContext, link);
writer.writeStyleAttribute(style);
HtmlRendererUtils.renderDojoDndItem(component, writer, true);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(link));
writer.writeIdAttribute(clientId);
writer.writeNameAttribute(clientId);
HtmlRendererUtils.renderTip(link, writer);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/MessagesRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,9 +17,6 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.CreateComponentUtils;
import org.apache.myfaces.tobago.component.Facets;
@@ -33,17 +30,21 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.component.UIPopup;
import org.apache.myfaces.tobago.config.Configurable;
+import org.apache.myfaces.tobago.context.Markup;
+import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
@@ -76,9 +77,8 @@ public class MessagesRenderer extends La
}
if (facesContext.getMessages().hasNext()) { // in ie empty span gets a height
writer.startElement(HtmlConstants.SPAN, messages);
- writer.writeClassAttribute("tobago-validation-message");
- Style style = new Style(facesContext, messages);
- writer.writeStyleAttribute(style);
+ writer.writeClassAttribute(Classes.create(messages));
+ writer.writeStyleAttribute(new Style(facesContext, messages));
// with id
String focusId = null;
@@ -176,7 +176,6 @@ public class MessagesRenderer extends La
okButtonAttributes.put(Attributes.LABEL, ResourceManagerUtils.getPropertyNotNull(
facesContext, "tobago", "tobago.message.confirmation.okay"));
okButtonAttributes.put("popupClose", "immediate");
- return;
}
/*
@@ -202,9 +201,8 @@ public class MessagesRenderer extends La
writer.writeAttribute(HtmlAttributes.FOR, clientId, false);
}
writer.writeAttribute(HtmlAttributes.TITLE, detail, true);
- StyleClasses classes = new StyleClasses();
- classes.addMarkupClass("messages", message.getSeverity().toString().toLowerCase());
- writer.writeClassAttribute(classes);
+ final Markup markup = ComponentUtils.markupOfSeverity(message.getSeverity());
+ writer.writeClassAttribute(Classes.create(messages, "item", markup));
boolean writeEmptyText = true;
if (summary != null && messages.isShowSummary()) {
writer.writeText(summary);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Tue Jul 20 10:05:56 2010
@@ -36,6 +36,7 @@ import org.apache.myfaces.tobago.interna
import org.apache.myfaces.tobago.internal.util.ResponseUtils;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.PageRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Overflow;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -552,7 +553,7 @@ public class PageRenderer extends PageRe
// todo: check if it is empty
writer.startElement(HtmlConstants.DIV, page);
- writer.writeClassAttribute("tobago-page-menuStore");
+ writer.writeClassAttribute(Classes.create(page, "menuStore"));
ResponseWriterDivider divider = ResponseWriterDivider.getInstance(facesContext, MenuBarRenderer.DIVIDER);
divider.writeOutAndCleanUp(facesContext);
writer.endElement(HtmlConstants.DIV);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PopupRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,19 +17,20 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UIPopup;
+import org.apache.myfaces.tobago.context.Markup;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
import org.apache.myfaces.tobago.internal.layout.LayoutContext;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -47,15 +48,22 @@ public class PopupRenderer extends Layou
@Override
public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
+
+ UIPopup popup = (UIPopup) component;
+
if (facesContext instanceof TobagoFacesContext) {
- ((TobagoFacesContext) facesContext).getPopups().add((UIPopup) component);
+ ((TobagoFacesContext) facesContext).getPopups().add(popup);
}
// TODO: where to put this code, it is good here?
TobagoFacesContext tobagoContext = (TobagoFacesContext) facesContext;
tobagoContext.getScriptBlocks().add("jQuery(document).ready(function() {Tobago.setupPopup();});");
- super.prepareRender(facesContext, component);
+ super.prepareRender(facesContext, popup);
+
+ if (popup.isModal()) {
+ popup.setCurrentMarkup(popup.getCurrentMarkup().add(Markup.MODAL));
+ }
}
@Override
@@ -101,11 +109,7 @@ public class PopupRenderer extends Layou
}
style.setZIndex(zIndex);
writer.writeStyleAttribute(style);
- StyleClasses styleClasses = StyleClasses.ensureStyleClasses(popup);
- if (popup.isModal()) {
- styleClasses.addClass("popup", "modal");
- }
- writer.writeClassAttribute(styleClasses);
+ writer.writeClassAttribute(Classes.create(popup));
}
@Override
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ProgressRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ProgressRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ProgressRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ProgressRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,23 +17,18 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
-import org.apache.myfaces.tobago.context.ResourceManagerUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UICommand;
import org.apache.myfaces.tobago.component.UIProgress;
+import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -45,12 +40,11 @@ public class ProgressRenderer extends La
private static final Logger LOG = LoggerFactory.getLogger(ProgressRenderer.class);
- public void encodeEnd(FacesContext facesContext,
- UIComponent uiComponent) throws IOException {
+ public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
- UIProgress component = (UIProgress) uiComponent;
+ UIProgress progress = (UIProgress) component;
- BoundedRangeModel model = (BoundedRangeModel) component.getValue();
+ BoundedRangeModel model = (BoundedRangeModel) progress.getValue();
if (model == null) {
LOG.warn("'null' value found! Using dummy Model instead!");
@@ -62,7 +56,7 @@ public class ProgressRenderer extends La
String value1 = Integer.toString(model.getValue());
String value2 = Integer.toString(model.getMaximum() - model.getValue());
- Object title = component.getAttributes().get(Attributes.TIP);
+ Object title = progress.getAttributes().get(Attributes.TIP);
if (title == null) {
title = Integer.toString(100 * model.getValue()
/ (model.getMaximum() - model.getMinimum())) + " %";
@@ -75,7 +69,7 @@ public class ProgressRenderer extends La
String width2 = value2;
if (width != null) {
- int value = (width -1) * model.getValue()
+ int value = (width - 1) * model.getValue()
/ (model.getMaximum() - model.getMinimum());
width1 = Integer.toString(value);
width2 = Integer.toString((width - 2) - value);
@@ -83,15 +77,12 @@ public class ProgressRenderer extends La
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- writer.startElement(HtmlConstants.SPAN, component);
- writer.writeClassAttribute();
+ writer.startElement(HtmlConstants.SPAN, progress);
+ writer.writeClassAttribute(Classes.create(progress));
writer.writeAttribute(HtmlAttributes.TITLE, String.valueOf(title), true);
writer.startElement(HtmlConstants.IMG, null);
- StyleClasses color1Classes = new StyleClasses();
- color1Classes.addClass("progress", "color1");
- color1Classes.addMarkupClass(component, "progress", "color1");
- writer.writeClassAttribute(color1Classes);
+ writer.writeClassAttribute(Classes.create(progress, "color1"));
writer.writeAttribute(HtmlAttributes.SRC, image, false);
writer.writeAttribute(HtmlAttributes.ALT, String.valueOf(title), true);
writer.writeAttribute(HtmlAttributes.WIDTH, width1, false);
@@ -99,10 +90,7 @@ public class ProgressRenderer extends La
writer.endElement(HtmlConstants.IMG);
writer.startElement(HtmlConstants.IMG, null);
- StyleClasses color2Classes = new StyleClasses();
- color2Classes.addClass("progress", "color2");
- color2Classes.addMarkupClass(component, "progress", "color2");
- writer.writeClassAttribute(color2Classes);
+ writer.writeClassAttribute(Classes.create(progress, "color2"));
writer.writeAttribute(HtmlAttributes.SRC, image, false);
writer.writeAttribute(HtmlAttributes.ALT, String.valueOf(title), true);
writer.writeAttribute(HtmlAttributes.WIDTH, width2, false);
@@ -110,7 +98,7 @@ public class ProgressRenderer extends La
writer.endElement(HtmlConstants.IMG);
writer.endElement(HtmlConstants.SPAN);
- UIComponent facet = component.getFacet("complete");
+ UIComponent facet = progress.getFacet("complete");
if (model.getValue() == model.getMaximum() && facet != null
&& facet instanceof UICommand) {
UICommand command = (UICommand) facet;
@@ -120,4 +108,3 @@ public class ProgressRenderer extends La
}
}
-
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/RichTextEditorRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,8 +17,6 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.CreateComponentUtils;
import org.apache.myfaces.tobago.component.Facets;
@@ -30,14 +28,16 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.renderkit.HtmlUtils;
import org.apache.myfaces.tobago.renderkit.InputRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.EditableValueHolder;
import javax.faces.component.UIComponent;
@@ -96,11 +96,8 @@ public class RichTextEditorRenderer exte
TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
- StyleClasses containerClasses = StyleClasses.ensureStyleClassesCopy(input);
- containerClasses.addClass("richTextEditor", "container");
-
writer.startElement(HtmlConstants.DIV, input);
- writer.writeClassAttribute(containerClasses);
+ writer.writeClassAttribute(Classes.create(input, "container"));
Style style = new Style(facesContext, input);
writer.writeStyleAttribute(style);
@@ -117,9 +114,6 @@ public class RichTextEditorRenderer exte
String content = getCurrentValue(facesContext, input);
- StyleClasses bodyClasses = StyleClasses.ensureStyleClassesCopy(input);
- bodyClasses.addClass("richTextEditor", "body");
-
if (previewState) {
writer.startElement(HtmlConstants.INPUT, input);
writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
@@ -128,7 +122,7 @@ public class RichTextEditorRenderer exte
writer.endElement(HtmlConstants.INPUT);
writer.startElement(HtmlConstants.DIV, input);
- writer.writeClassAttribute(bodyClasses);
+ writer.writeClassAttribute(Classes.create(input, "body"));
writer.writeIdAttribute(clientId);
writer.writeStyleAttribute(style);
@@ -138,7 +132,7 @@ public class RichTextEditorRenderer exte
writer.endElement(HtmlConstants.DIV);
} else {
writer.startElement(HtmlConstants.TEXTAREA, input);
- writer.writeClassAttribute(bodyClasses);
+ writer.writeClassAttribute(Classes.create(input, "body"));
writer.writeNameAttribute(clientId);
writer.writeIdAttribute(clientId);
writer.writeStyleAttribute(style);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,11 +17,10 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectBooleanCheckbox;
import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -29,6 +28,8 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
@@ -82,7 +83,7 @@ public class SelectBooleanCheckboxRender
writer.startElement(HtmlConstants.DIV, select);
writer.writeStyleAttribute(new Style(facesContext, select));
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyCheckboxRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,19 +17,20 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UISelectManyCheckbox;
import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.HtmlInputTypes;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
@@ -65,7 +66,7 @@ public class SelectManyCheckboxRenderer
writer.startElement(HtmlConstants.OL, select);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectManyListboxRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,16 +17,17 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UISelectManyListbox;
import org.apache.myfaces.tobago.renderkit.SelectManyRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -67,7 +68,7 @@ public class SelectManyListboxRenderer e
}
Style style = new Style(facesContext, select);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
writer.writeAttribute(HtmlAttributes.MULTIPLE, HtmlAttributes.MULTIPLE, false);
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,18 +17,19 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UISelectOneChoice;
import org.apache.myfaces.tobago.renderkit.HtmlUtils;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.VariableResolverUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -69,7 +70,7 @@ public class SelectOneChoiceRenderer ext
}
Style style = new Style(facesContext, select);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,11 +17,10 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UISelectOneListbox;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -29,6 +28,8 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -68,7 +69,7 @@ public class SelectOneListboxRenderer ex
}
Style style = new Style(facesContext, select);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
HtmlRendererUtils.renderTip(select, writer);
writer.writeAttribute(HtmlAttributes.SIZE, 2); // should be greater 1
if (!ComponentUtils.getBooleanAttribute(select, Attributes.REQUIRED)) {
Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneRadioRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,13 +17,12 @@ package org.apache.myfaces.tobago.render
* limitations under the License.
*/
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.UISelectOneRadio;
import org.apache.myfaces.tobago.config.Configurable;
import org.apache.myfaces.tobago.context.TobagoFacesContext;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.renderkit.SelectOneRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
import org.apache.myfaces.tobago.renderkit.css.Style;
import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -31,6 +30,8 @@ import org.apache.myfaces.tobago.renderk
import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
@@ -76,7 +77,7 @@ public class SelectOneRadioRenderer exte
writer.startElement(HtmlConstants.OL, select);
writer.writeStyleAttribute(style);
- writer.writeClassAttribute();
+ writer.writeClassAttribute(Classes.create(select));
if (title != null) {
writer.writeAttribute(HtmlAttributes.TITLE, title, true);
}