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 [3/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-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.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/SheetRenderer.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/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Tue Jul 20 10:05:56 2010
@@ -21,6 +21,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.CreateComponentUtils;
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.component.SupportsMarkup;
 import org.apache.myfaces.tobago.component.UIColumnEvent;
 import org.apache.myfaces.tobago.component.UIColumnSelector;
 import org.apache.myfaces.tobago.component.UICommand;
@@ -28,6 +29,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UIMenuCommand;
 import org.apache.myfaces.tobago.component.UIReload;
 import org.apache.myfaces.tobago.component.UISheet;
+import org.apache.myfaces.tobago.context.Markup;
 import org.apache.myfaces.tobago.context.ResourceManager;
 import org.apache.myfaces.tobago.context.ResourceManagerFactory;
 import org.apache.myfaces.tobago.context.ResourceManagerUtils;
@@ -38,11 +40,11 @@ import org.apache.myfaces.tobago.layout.
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.model.SheetState;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
+import org.apache.myfaces.tobago.renderkit.css.Classes;
 import org.apache.myfaces.tobago.renderkit.css.Position;
 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.CommandRendererHelper;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
@@ -98,7 +100,7 @@ public class SheetRenderer extends Layou
     // Outer sheet div
     writer.startElement(HtmlConstants.DIV, sheet);
     writer.writeIdAttribute(sheetId);
-    writer.writeClassAttribute("tobago-sheet-outer-div");
+    writer.writeClassAttribute(Classes.create(sheet, "outer"));
     writer.writeStyleAttribute(style);
     UICommand clickAction = null;
     UICommand dblClickAction = null;
@@ -234,7 +236,7 @@ public class SheetRenderer extends Layou
 
     writer.startElement(HtmlConstants.DIV, null);
     writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "data_div");
-    writer.writeClassAttribute("tobago-sheet-body-div ");
+    writer.writeClassAttribute(Classes.create(sheet, "body"));
     Style sheetBodyStyle = new Style(bodyStyle);
     if (!showHeader) {
       bodyStyle.setPaddingTop(Measure.ZERO);
@@ -251,7 +253,7 @@ public class SheetRenderer extends Layou
     writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
     writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
     writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
-    writer.writeClassAttribute("tobago-sheet-body-table");
+    writer.writeClassAttribute(Classes.create(sheet, "bodyTable"));
     writer.writeStyleAttribute(sheetBodyStyle);
 
     if (columnWidths != null) {
@@ -281,7 +283,6 @@ public class SheetRenderer extends Layou
         break;
       }
       odd = !odd;
-      final String rowClass = odd ? "tobago-sheet-row-odd" : "tobago-sheet-row-even";
 
       if (LOG.isDebugEnabled()) {
         LOG.debug("var       " + var);
@@ -289,7 +290,7 @@ public class SheetRenderer extends Layou
       }
 
       writer.startElement(HtmlConstants.TR, null);
-      writer.writeClassAttribute(rowClass);
+      writer.writeClassAttribute(Classes.create(sheet, "row", odd ? Markup.ODD : Markup.EVEN));
       if (rowIndex == sheet.getFirst()) {
         writer.writeAttribute("rowIndexInModel", Integer.toString(sheet.getFirst()), false);
       }
@@ -298,21 +299,19 @@ public class SheetRenderer extends Layou
       for (UIColumn column : renderedColumnList) {
         columnIndex++;
 
-        StyleClasses tdClass = new StyleClasses();
-        tdClass.addClass("sheet", "cell-td"); // XXX not a standard compliant name
-        tdClass.addMarkupClass(column, "column");
+        writer.startElement(HtmlConstants.TD, column);
+
+        Markup markup = column instanceof SupportsMarkup ? ((SupportsMarkup) column).getMarkup() : Markup.NULL;
+        if (markup == null) {
+          markup = Markup.NULL;
+        }
         if (columnIndex == 0) {
-          tdClass.addClass("sheet", "cell-first-column"); // XXX not a standard compliant name
+          markup = markup.add(Markup.FIRST);
         }
         if (hasClickAction) {
-          tdClass.addClass("sheet", "cell-clickable");
+          markup = markup.add(Markup.CLICKABLE);
         }
-        StyleClasses cellClass = StyleClasses.ensureStyleClasses(column);
-        tdClass.addClasses(cellClass);
-
-        writer.startElement(HtmlConstants.TD, column);
-
-        writer.writeClassAttribute(tdClass.toString());
+        writer.writeClassAttribute(Classes.create(sheet, "cell", markup));
         final String align = (String) column.getAttributes().get(Attributes.ALIGN);
         if (align != null) {
           Style alignStyle = new Style();
@@ -323,7 +322,7 @@ public class SheetRenderer extends Layou
         if (column instanceof UIColumnSelector) {
           final boolean disabled = ComponentUtils.getBooleanAttribute(column, Attributes.DISABLED);
           writer.startElement(HtmlConstants.IMG, null);
-          writer.writeClassAttribute("tobago-sheet-column-selector");
+          writer.writeClassAttribute(Classes.create(sheet, "columnSelector"));
           if (disabled) {
             writer.writeAttribute(HtmlAttributes.SRC, selectorDisabled, false);
             writer.writeAttribute("disabled", "true", false);
@@ -360,7 +359,7 @@ public class SheetRenderer extends Layou
       }
 
       writer.startElement(HtmlConstants.TD, null);
-      writer.writeClassAttribute("tobago-sheet-cell-td tobago-sheet-cell-filler");
+      writer.writeClassAttribute(Classes.create(sheet, "cell"));
       writer.write(" ");
       writer.endElement(HtmlConstants.TD);
 
@@ -384,21 +383,18 @@ public class SheetRenderer extends Layou
           facesContext, sheet, writer, resourceManager, contextPath, sheetId, renderedColumnList, tableBodyWidth);
     }
 
-    final String showRowRange = checkPagingAttribute(sheet.getShowRowRange());
-    final String showPageRange = checkPagingAttribute(sheet.getShowPageRange());
-    final String showDirectLinks = checkPagingAttribute(sheet.getShowDirectLinks());
-
     if (sheet.isPagingVisible()) {
       Style footerStyle = new Style();
       footerStyle.setWidth(sheet.getCurrentWidth());
       footerStyle.setHeight(footerHeight);
 
       writer.startElement(HtmlConstants.DIV, sheet);
-      writer.writeClassAttribute("tobago-sheet-footer");
+      writer.writeClassAttribute(Classes.create(sheet, "footer"));
       writer.writeStyleAttribute(footerStyle);
 
-
-      if (isNotNone(showRowRange)) {
+      // show row range
+      final Markup showRowRange = markupForLeftCenterRight(sheet.getShowRowRange());
+      if (showRowRange != Markup.NULL) {
         UICommand pagerCommand = (UICommand) sheet.getFacet(Facets.PAGER_ROW);
         if (pagerCommand == null) {
           pagerCommand = createPagingCommand(application, PageAction.TO_ROW, false);
@@ -407,12 +403,10 @@ public class SheetRenderer extends Layou
         String pagingOnClick = new CommandRendererHelper(facesContext, pagerCommand).getOnclickDoubleQuoted();
         final String pagerCommandId = pagerCommand.getClientId(facesContext);
 
-        final String className = "tobago-sheet-paging-rows-span tobago-sheet-paging-span-" + showRowRange;
-
         writer.startElement(HtmlConstants.SPAN, null);
         writer.writeAttribute(HtmlAttributes.ONCLICK,
             "tobagoSheetEditPagingRow(this, '" + pagerCommandId + "', '" + pagingOnClick + "')", true);
-        writer.writeClassAttribute(className);
+        writer.writeClassAttribute(Classes.create(sheet, "pagingOuter", showRowRange));
         writer.writeAttribute(HtmlAttributes.TITLE,
             ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetPagingInfoRowPagingTip"), true);
         writer.writeText("");
@@ -420,18 +414,19 @@ public class SheetRenderer extends Layou
         writer.endElement(HtmlConstants.SPAN);
       }
 
-
-      if (isNotNone(showDirectLinks)) {
-        final String className = "tobago-sheet-paging-links-span tobago-sheet-paging-span-" + showDirectLinks;
-
+      // show direct links
+      final Markup showDirectLinks = markupForLeftCenterRight(sheet.getShowDirectLinks());
+      if (showDirectLinks != Markup.NULL) {
         writer.startElement(HtmlConstants.SPAN, null);
-        writer.writeClassAttribute(className);
+        writer.writeClassAttribute(Classes.create(sheet, "pagingOuter", showDirectLinks));
         writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "pagingLinks");
         writeDirectPagingLinks(writer, facesContext, application, sheet);
         writer.endElement(HtmlConstants.SPAN);
       }
 
-      if (isNotNone(showPageRange)) {
+      // show page range
+      final Markup showPageRange = markupForLeftCenterRight(sheet.getShowPageRange());
+      if (showPageRange != Markup.NULL) {
         UICommand pagerCommand = (UICommand) sheet.getFacet(Facets.PAGER_PAGE);
         if (pagerCommand == null) {
           pagerCommand = createPagingCommand(application, PageAction.TO_PAGE, false);
@@ -439,10 +434,9 @@ public class SheetRenderer extends Layou
         }
         String pagingOnClick = new CommandRendererHelper(facesContext, pagerCommand).getOnclickDoubleQuoted();
         final String pagerCommandId = pagerCommand.getClientId(facesContext);
-        final String className = "tobago-sheet-paging-pages-span tobago-sheet-paging-span-" + showPageRange;
 
         writer.startElement(HtmlConstants.SPAN, null);
-        writer.writeClassAttribute(className);
+        writer.writeClassAttribute(Classes.create(sheet, "pagingOuter", showPageRange));
         writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "pagingPages");
         writer.writeText("");
 
@@ -450,7 +444,7 @@ public class SheetRenderer extends Layou
         link(facesContext, application, atBeginning, PageAction.FIRST, sheet);
         link(facesContext, application, atBeginning, PageAction.PREV, sheet);
         writer.startElement(HtmlConstants.SPAN, null);
-        writer.writeClassAttribute("tobago-sheet-paging-pages-text");
+        writer.writeClassAttribute(Classes.create(sheet, "pagingText"));
         writer.writeAttribute(HtmlAttributes.ONCLICK,
             "tobagoSheetEditPagingRow(this, '" + pagerCommandId + "', '" + pagingOnClick + "')", true);
         writer.writeAttribute(HtmlAttributes.TITLE,
@@ -589,6 +583,19 @@ public class SheetRenderer extends Layou
         : Measure.ZERO;
   }
   
+  private Markup markupForLeftCenterRight(String name) {
+    if ("left".equals(name)) {
+      return Markup.LEFT;
+    }
+    if ("center".equals(name)) {
+      return Markup.CENTER;
+    }
+    if ("right".equals(name)) {
+      return Markup.RIGHT;
+    }
+    return Markup.NULL;
+  }
+
   private String checkPagingAttribute(String name) {
     if (isNotNone(name)) {
       return name;
@@ -639,8 +646,8 @@ public class SheetRenderer extends Layou
     writer.startElement(HtmlConstants.IMG, null);
     writer.writeIdAttribute(data.getClientId(facesContext)
         + ComponentUtils.SUB_SEPARATOR + "pagingPages" + ComponentUtils.SUB_SEPARATOR + command.getToken());
-    writer.writeClassAttribute("tobago-sheet-footer-pager-button"
-        + (disabled ? " tobago-sheet-footer-pager-button-disabled" : ""));
+    Classes pagerClasses = Classes.createIgnoreCheck(data, "footerPagerButton", disabled ? Markup.DISABLED : null);
+    writer.writeClassAttribute(pagerClasses);
     writer.writeAttribute(HtmlAttributes.SRC, image, false);
     writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
@@ -658,7 +665,7 @@ public class SheetRenderer extends Layou
     // begin rendering header
     writer.startElement(HtmlConstants.DIV, null);
     writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "header_div");
-    writer.writeClassAttribute("tobago-sheet-header-div");
+    writer.writeClassAttribute(Classes.create(sheet, "headerDiv"));
     Style style = new Style();
     style.setWidth(headerWidth);
     writer.writeStyleAttribute(style);
@@ -670,7 +677,7 @@ public class SheetRenderer extends Layou
     }
     writer.startElement(HtmlConstants.SPAN, null);
     writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "header_box_filler");
-    writer.writeClassAttribute("tobago-sheet-header tobago-sheet-header-filler");
+    writer.writeClassAttribute(Classes.create(sheet, "header"));
     writer.writeStyleAttribute("width:0px");
 
     writer.endElement(HtmlConstants.SPAN);
@@ -679,13 +686,13 @@ public class SheetRenderer extends Layou
   }
 
   private void renderColumnHeader(
-      FacesContext facesContext, TobagoResponseWriter writer, UISheet component, int columnIndex, UIColumn column,
+      FacesContext facesContext, TobagoResponseWriter writer, UISheet sheet, int columnIndex, UIColumn column,
       ResourceManager resourceManager, String contextPath)
       throws IOException {
-    String sheetId = component.getClientId(facesContext);
+    String sheetId = sheet.getClientId(facesContext);
     Application application = facesContext.getApplication();
 
-    Integer divWidth = component.getWidthList().get(columnIndex);
+    Integer divWidth = sheet.getWidthList().get(columnIndex);
     Style divStyle = new Style();
     divWidth = divWidth - 6; // leftBorder + leftPadding + rightPadding + rightBorder = 6, todo: use Style Constructor
     divStyle.setWidth(Measure.valueOf(divWidth));
@@ -696,7 +703,6 @@ public class SheetRenderer extends Layou
 
     writer.startElement(HtmlConstants.SPAN, null);
     writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "header_box_" + columnIndex);
-    String headerClass = "tobago-sheet-header";
     writer.writeStyleAttribute(divStyle);
     String tip = (String) column.getAttributes().get(Attributes.TIP);
     if (tip == null) {
@@ -710,6 +716,8 @@ public class SheetRenderer extends Layou
       // Todo: change description in ColumnTagDeclaration after implementing it.
     }
 
+    Markup markup = Markup.NULL;
+
     // sorting
 
     String sorterImage = null;
@@ -733,30 +741,30 @@ public class SheetRenderer extends Layou
       }
       tip += ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetTipSorting");
 
-      headerClass += " tobago-sheet-header-sortable";
+      markup.add(Markup.SORTABLE);
 
-      SheetState sheetState = component.getSheetState(facesContext);
+      SheetState sheetState = sheet.getSheetState(facesContext);
       if (column.getId().equals(sheetState.getSortedColumnId())) {
         String sortTitle;
         if (sheetState.isAscending()) {
           sorterImage = contextPath + resourceManager.getImage(facesContext, "image/ascending.gif");
           sortTitle = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetAscending");
-          headerClass += " tobago-sheet-header-ascending";
+          markup.add(Markup.ASCENDING);
         } else {
           sorterImage = contextPath + resourceManager.getImage(facesContext, "image/descending.gif");
           sortTitle = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "sheetDescending");
-          headerClass += " tobago-sheet-header-descending";
+          markup.add(Markup.DESCENDING);
         }
         if (sortTitle != null) {
           tip += " - " + sortTitle;
         }
       }
     }
-    writer.writeClassAttribute(headerClass);
+    writer.writeClassAttribute(Classes.create(sheet, "header", markup));
     writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
 
     if (column instanceof UIColumnSelector) {
-      renderColumnSelectorHeader(facesContext, writer, component, column);
+      renderColumnSelectorHeader(facesContext, writer, sheet, column);
     } else {
       String label = (String) column.getAttributes().get(Attributes.LABEL);
       if (label != null) {
@@ -776,19 +784,13 @@ public class SheetRenderer extends Layou
     writer.endElement(HtmlConstants.SPAN);
 
     // resizing
-    String resizerClass;
-    if (column instanceof UIColumnSelector) {
-      resizerClass = "tobago-sheet-header-resize";
-    } else {
-      resizerClass = "tobago-sheet-header-resize tobago-sheet-header-resize-cursor";
-    }
-
     if (ComponentUtils.getBooleanAttribute(column, Attributes.RESIZABLE)) {
       writer.startElement(HtmlConstants.SPAN, null);
-      writer.writeClassAttribute("tobago-sheet-header-resize-outer");
+      writer.writeClassAttribute(Classes.create(sheet, "headerSpacerOuter"));
       writer.startElement(HtmlConstants.SPAN, null);
-      writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "header_resizer_" + columnIndex);
-      writer.writeClassAttribute(resizerClass);
+      writer.writeIdAttribute(sheetId + ComponentUtils.SUB_SEPARATOR + "header_spacer_" + columnIndex);
+      Markup resizeMarkup = column instanceof UIColumnSelector ? Markup.NULL : Markup.RESIZABLE;
+      writer.writeClassAttribute(Classes.create(sheet, "headerSpacer", resizeMarkup));
       writer.write("  "); // is needed for IE6
       writer.endElement(HtmlConstants.SPAN);
       writer.endElement(HtmlConstants.SPAN);
@@ -797,15 +799,15 @@ public class SheetRenderer extends Layou
 
 
   protected void renderColumnSelectorHeader(
-      FacesContext facesContext, TobagoResponseWriter writer, UISheet component, UIColumn column)
+      FacesContext facesContext, TobagoResponseWriter writer, UISheet sheet, UIColumn column)
       throws IOException {
 
     writer.startElement(HtmlConstants.DIV, null);
     writer.writeIdAttribute(column.getClientId(facesContext));
-    writer.writeClassAttribute("tobago-sheet-selector-menu");
+    writer.writeClassAttribute(Classes.create(sheet, "selectorMenu"));
     writer.endElement(HtmlConstants.DIV);
 
-    if (UISheet.MULTI.equals(component.getSelectable())) {
+    if (UISheet.MULTI.equals(sheet.getSelectable())) {
       UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
           facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "selectorMenu");
       menu.setTransient(true);
@@ -839,22 +841,22 @@ public class SheetRenderer extends Layou
   }
 
   private void writeDirectPagingLinks(
-      TobagoResponseWriter writer, FacesContext facesContext, Application application, UISheet data)
+      TobagoResponseWriter writer, FacesContext facesContext, Application application, UISheet sheet)
       throws IOException {
-    UICommand pagerCommand = (UICommand) data.getFacet(Facets.PAGER_PAGE);
+    UICommand pagerCommand = (UICommand) sheet.getFacet(Facets.PAGER_PAGE);
     if (pagerCommand == null) {
       pagerCommand = createPagingCommand(
           application, PageAction.TO_PAGE, false);
-      data.getFacets().put(Facets.PAGER_PAGE, pagerCommand);
+      sheet.getFacets().put(Facets.PAGER_PAGE, pagerCommand);
     }
     String pagerCommandId = pagerCommand.getClientId(facesContext);
     String onclick = new CommandRendererHelper(facesContext, pagerCommand).getOnclickDoubleQuoted();
     String hrefPostfix = "', '" + onclick + "');";
 
-    int linkCount = ComponentUtils.getIntAttribute(data, Attributes.DIRECT_LINK_COUNT);
+    int linkCount = ComponentUtils.getIntAttribute(sheet, Attributes.DIRECT_LINK_COUNT);
     linkCount--;  // current page needs no link
     ArrayList<Integer> prevs = new ArrayList<Integer>(linkCount);
-    int page = data.getPage();
+    int page = sheet.getPage();
     for (int i = 0; i < linkCount && page > 1; i++) {
       page--;
       if (page > 0) {
@@ -863,8 +865,8 @@ public class SheetRenderer extends Layou
     }
 
     ArrayList<Integer> nexts = new ArrayList<Integer>(linkCount);
-    page = data.getPage();
-    for (int i = 0; i < linkCount && page < data.getPages(); i++) {
+    page = sheet.getPage();
+    for (int i = 0; i < linkCount && page < sheet.getPages(); i++) {
       page++;
       if (page > 1) {
         nexts.add(page);
@@ -901,34 +903,33 @@ public class SheetRenderer extends Layou
           name = "1";
         }
       }
-      writeLinkElement(writer, name, Integer.toString(skip),
+      writeLinkElement(writer, sheet, name, Integer.toString(skip),
           pagerCommandId, hrefPostfix, true);
     }
     for (Integer prev : prevs) {
       name = prev.toString();
-      writeLinkElement(writer, name, name, pagerCommandId, hrefPostfix, true);
+      writeLinkElement(writer, sheet, name, name, pagerCommandId, hrefPostfix, true);
     }
-    name = Integer.toString(data.getPage());
-    writeLinkElement(writer, name, name, pagerCommandId, hrefPostfix, false);
+    name = Integer.toString(sheet.getPage());
+    writeLinkElement(writer, sheet, name, name, pagerCommandId, hrefPostfix, false);
 
     for (Integer next : nexts) {
       name = next.toString();
-      writeLinkElement(writer, name, name, pagerCommandId, hrefPostfix, true);
+      writeLinkElement(writer, sheet, name, name, pagerCommandId, hrefPostfix, true);
     }
 
-    skip = nexts.size() > 0 ? nexts.get(nexts.size() - 1) : data.getPages();
-    if (skip < data.getPages()) {
+    skip = nexts.size() > 0 ? nexts.get(nexts.size() - 1) : sheet.getPages();
+    if (skip < sheet.getPages()) {
       skip += linkCount / 2;
       skip++;
       name = "...";
-      if (skip > data.getPages()) {
-        skip = data.getPages();
+      if (skip > sheet.getPages()) {
+        skip = sheet.getPages();
         if ((nexts.get(nexts.size() - 1)) == skip - 1) {
           name = Integer.toString(skip);
         }
       }
-      writeLinkElement(writer, name, Integer.toString(skip), pagerCommandId,
-          hrefPostfix, true);
+      writeLinkElement(writer, sheet, name, Integer.toString(skip), pagerCommandId, hrefPostfix, true);
     }
   }
 
@@ -943,12 +944,13 @@ public class SheetRenderer extends Layou
     return link;
   }
 
-  private void writeLinkElement(TobagoResponseWriter writer, String str, String skip,
-                                String id, String hrefPostfix, boolean makeLink)
+  private void writeLinkElement(
+      TobagoResponseWriter writer, UISheet sheet, String str, String skip, String id, String hrefPostfix,
+      boolean makeLink)
       throws IOException {
     String type = makeLink ? HtmlConstants.A : HtmlConstants.SPAN;
     writer.startElement(type, null);
-    writer.writeClassAttribute("tobago-sheet-paging-links-link");
+    writer.writeClassAttribute(Classes.create(sheet, "pagingLink"));
     if (makeLink) {
       writer.writeIdAttribute(id + ComponentUtils.SUB_SEPARATOR + "link_" + skip);
       writer.writeAttribute(

Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.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/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Tue Jul 20 10:05:56 2010
@@ -29,6 +29,7 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.UITab;
 import org.apache.myfaces.tobago.component.UITabGroup;
 import org.apache.myfaces.tobago.component.UIToolBar;
+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.event.TabChangeEvent;
@@ -38,12 +39,12 @@ import org.apache.myfaces.tobago.layout.
 import org.apache.myfaces.tobago.layout.Measure;
 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.Overflow;
 import org.apache.myfaces.tobago.renderkit.css.Position;
 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.JQueryUtils;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
@@ -117,10 +118,7 @@ public class TabGroupRenderer extends La
 
     writer.startElement(HtmlConstants.DIV, null);
     writer.writeIdAttribute(clientId);
-    //HtmlRendererUtils.renderDojoDndItem(tabGroup, writer, false);
-    //TODO writer.writeClassAttribute("dojoDndItem");
-    StyleClasses classes = (StyleClasses) tabGroup.getAttributes().get(Attributes.STYLE_CLASS);
-    writer.writeClassAttribute(classes);
+    writer.writeClassAttribute(Classes.create(tabGroup));
 
     // AJAX
     HtmlRendererUtils.writeScriptLoader(facesContext, SCRIPTS, ArrayUtils.EMPTY_STRING_ARRAY);
@@ -301,7 +299,7 @@ public class TabGroupRenderer extends La
       header.setWidth(map.getWidth());
     }
     writer.writeStyleAttribute(header);
-    writer.writeClassAttribute("tobago-tab-header");
+    writer.writeClassAttribute(Classes.create(tabGroup, "header"));
 
     UITab activeTab = null;
 
@@ -319,18 +317,12 @@ public class TabGroupRenderer extends La
           }
 
           LabelWithAccessKey label = new LabelWithAccessKey(tab);
-          StyleClasses outerClass = new StyleClasses();
-          StyleClasses innerClass = new StyleClasses();
           if (virtualTab == index) {
-            outerClass.addClass("tab", "selected-outer");
-            innerClass.addClass("tab", "selected-inner");
+            tab.setCurrentMarkup(tab.getCurrentMarkup().add(Markup.SELECTED));
             activeTab = tab;
           } else {
-            outerClass.addClass("tab", "unselected-outer");
-            innerClass.addClass("tab", "unselected-inner");
+            tab.setCurrentMarkup(tab.getCurrentMarkup().remove(Markup.SELECTED));
           }
-          outerClass.addMarkupClass(tab, "tab", "outer");
-          innerClass.addMarkupClass(tab, "tab", "outer");
           Style labelStyle = new Style();
           int borderWidth = 1;
           labelStyle.setWidth(tabList.getWidthList().get(index).subtract(borderWidth * 2));
@@ -340,22 +332,18 @@ public class TabGroupRenderer extends La
           writer.startElement(HtmlConstants.SPAN, tab);
           writer.writeStyleAttribute(labelStyle);
 
-          writer.writeClassAttribute(outerClass);
+          writer.writeClassAttribute(Classes.create(tab, "outer"));
           writer.startElement(HtmlConstants.SPAN, tab);
 
-          writer.writeClassAttribute(innerClass);
+          writer.writeClassAttribute(Classes.create(tab, "inner"));
 
           writer.startElement(HtmlConstants.SPAN, tab);
           String tabId = clientId + "__" + virtualTab + "__" + index;
           writer.writeIdAttribute(tabId);
 
-          if (tab.isDisabled()) {
-            writer.writeClassAttribute("tobago-tab-disabled");
-          } else {
-            writer.writeClassAttribute("tobago-tab-link");
-            if (onclick != null) {
-              writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);
-            }
+          writer.writeClassAttribute(Classes.create(tab, "link"));
+          if (!tab.isDisabled() && onclick != null) {
+            writer.writeAttribute(HtmlAttributes.ONCLICK, onclick, true);
           }
           if (label.getText() != null) {
             HtmlRendererUtils.writeLabelWithAccessKey(writer, label);
@@ -408,7 +396,7 @@ public class TabGroupRenderer extends La
     styleTabFulFill.setWidth(width.subtract(sumWidth).subtract(toolbarWidth));
 
     writer.startElement(HtmlConstants.SPAN, tabGroup);
-    writer.writeClassAttribute("tobago-tab-fulfill");
+    writer.writeClassAttribute(Classes.create(tabGroup, "fulfill"));
     writer.writeStyleAttribute(styleTabFulFill);
 
     writer.endElement(HtmlConstants.SPAN);
@@ -418,7 +406,7 @@ public class TabGroupRenderer extends La
         
     if (tabGroup.isShowNavigationBar()) {
       UIToolBar toolBar = createToolBar(facesContext, tabGroup, virtualTab, switchType, tabList);
-      renderToolBar(facesContext, writer, toolBar, width.subtract(toolbarWidth), toolBarContentWidth);
+      renderToolBar(facesContext, writer, tabGroup, toolBar, width.subtract(toolbarWidth), toolBarContentWidth);
     }
 
     Style body = new Style();
@@ -496,14 +484,15 @@ public class TabGroupRenderer extends La
   }
   
   private void renderToolBar(
-      FacesContext facesContext, TobagoResponseWriter writer, UIToolBar toolBar, Measure left, Measure width)
+      FacesContext facesContext, TobagoResponseWriter writer, UITabGroup tabGroup, UIToolBar toolBar,
+      Measure left, Measure width)
       throws IOException {
     writer.startElement(HtmlConstants.DIV, null);
     Style style = new Style();
     style.setWidth(width);
     style.setLeft(left);
     writer.writeStyleAttribute(style);
-    writer.writeClassAttribute("tobago-tabGroup-toolBar");
+    writer.writeClassAttribute(Classes.create(tabGroup, "toolBar"));
     RenderUtils.encode(facesContext, toolBar);
     writer.endElement(HtmlConstants.DIV);
   }
@@ -512,10 +501,7 @@ public class TabGroupRenderer extends La
       throws IOException {
 
     writer.startElement(HtmlConstants.DIV, null);
-    StyleClasses classes = new StyleClasses();
-    classes.addClass("tab", "content");
-    classes.addMarkupClass(activeTab, "tab", "content");
-    writer.writeClassAttribute(classes);
+    writer.writeClassAttribute(Classes.create(activeTab, "content"));
 
     if (body != null) {
       Style body2 = new Style(body);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.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/TextAreaRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java Tue Jul 20 10:05:56 2010
@@ -17,27 +17,20 @@ package org.apache.myfaces.tobago.render
  * limitations under the License.
  */
 
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.UITextarea;
-//import org.apache.myfaces.tobago.context.Capability;
 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.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;
@@ -78,7 +71,7 @@ public class TextAreaRenderer extends In
     }
     HtmlRendererUtils.renderDojoDndItem(component, writer, true);
 
-    writer.writeClassAttribute();
+    writer.writeClassAttribute(Classes.create(input));
     Style style = new Style(facesContext, input);
     writer.writeStyleAttribute(style);
     if (onchange != null) {
@@ -126,10 +119,9 @@ public class TextAreaRenderer extends In
     }
     boolean required = ComponentUtils.getBooleanAttribute(input, Attributes.REQUIRED);
     if (required || maxLength > 0) {
-      String rendererName = HtmlRendererUtils.getRendererName(facesContext, input);
       final String[] cmds = {
           "new Tobago.In(\"" + input.getClientId(facesContext) + "\", true ,\""
-                  + StyleClasses.PREFIX + rendererName + "\" " + (maxLength > -1? "," + maxLength: "")  + "  );"
+              + Classes.required(input) + "\" " + (maxLength > -1 ? "," + maxLength : "") + "  );"
       };
       HtmlRendererUtils.writeScriptLoader(facesContext, null, cmds);
     }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-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/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.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/TimeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java Tue Jul 20 10:05:56 2010
@@ -24,15 +24,16 @@ package org.apache.myfaces.tobago.render
 
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.UITime;
+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.util.DateFormatUtils;
 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;
@@ -71,18 +72,18 @@ public class TimeRenderer extends InputR
       return;
     }
 
-    UITime input = (UITime) component;
+    UITime time = (UITime) component;
 
-    String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, input);
-    String currentValue = getCurrentValue(facesContext, input);
+    String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, time);
+    String currentValue = getCurrentValue(facesContext, time);
     if (LOG.isDebugEnabled()) {
       LOG.debug("currentValue = '" + currentValue + "'");
     }
 
 
     String converterPattern = "HH:mm";
-    if (input.getConverter() != null) {
-      Converter converter = input.getConverter();
+    if (time.getConverter() != null) {
+      Converter converter = time.getConverter();
       if (converter instanceof DateTimeConverter) {
         String pattern = DateFormatUtils.findPattern((DateTimeConverter) converter);
         if (pattern != null && pattern.indexOf('s') > -1) {
@@ -93,7 +94,7 @@ public class TimeRenderer extends InputR
 
     boolean hasSeconds = converterPattern.indexOf('s') > -1;
 
-    Object value = input.getValue();
+    Object value = time.getValue();
     Date date;
     if (value instanceof Date) {
       date = (Date) value;
@@ -107,26 +108,26 @@ public class TimeRenderer extends InputR
     String minute = new SimpleDateFormat("mm").format(date);
     String second = new SimpleDateFormat("ss").format(date);
 
-    String id = input.getClientId(facesContext);
+    String id = time.getClientId(facesContext);
     final String idPrefix = id + ComponentUtils.SUB_SEPARATOR;
     TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-    writer.startElement(HtmlConstants.DIV, input);
-    writer.writeClassAttribute();
-    Style style = new Style(facesContext, input);
+    writer.startElement(HtmlConstants.DIV, time);
+    writer.writeClassAttribute(Classes.create(time));
+    Style style = new Style(facesContext, time);
     writer.writeStyleAttribute(style);
 
-    writer.startElement(HtmlConstants.DIV, input);
+    writer.startElement(HtmlConstants.DIV, time);
     writer.writeAttribute(HtmlAttributes.ID, idPrefix + "borderDiv", false);
-    writer.writeClassAttribute("tobago-time-borderDiv"
-        + (hasSeconds ? " tobago-time-borderDiv-seconds" : ""));
+    writer.writeClassAttribute(Classes.createIgnoreCheck(
+        time, "borderDiv", hasSeconds ? Markup.valueOf("seconds") : null));
 
 
-    writeInput(writer, input, idPrefix + "hour", hour, true, title);
-    writeInputSeparator(writer, ":");
-    writeInput(writer, input, idPrefix + "minute", minute, false, title);
+    writeInput(writer, time, idPrefix + "hour", hour, true, title);
+    writeInputSeparator(writer, time, ":");
+    writeInput(writer, time, idPrefix + "minute", minute, false, title);
     if (hasSeconds) {
-      writeInputSeparator(writer, ":");
-      writeInput(writer, input, idPrefix + "second", second, false, title);
+      writeInputSeparator(writer, time, ":");
+      writeInput(writer, time, idPrefix + "second", second, false, title);
     }
 
     writer.endElement(HtmlConstants.DIV);
@@ -135,13 +136,13 @@ public class TimeRenderer extends InputR
     String imageSrc = "image/timeIncrement.gif";
     writer.startElement(HtmlConstants.IMG, null);
     writer.writeIdAttribute(imageId);
-    writer.writeClassAttribute("tobago-time-inc-image"
-        + (hasSeconds ? " tobago-time-image-seconds" : ""));
+    writer.writeClassAttribute(Classes.createIgnoreCheck(
+        time, "incImage", hasSeconds ? Markup.valueOf("seconds") : null));
     writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getImageWithPath(facesContext, imageSrc), true);
     writer.writeAttribute(HtmlAttributes.ALT, "", false); // TODO: tip
 
-    if (!(ComponentUtils.getBooleanAttribute(input, Attributes.DISABLED)
-        || ComponentUtils.getBooleanAttribute(input, Attributes.READONLY))) {
+    if (!(ComponentUtils.getBooleanAttribute(time, Attributes.DISABLED)
+        || ComponentUtils.getBooleanAttribute(time, Attributes.READONLY))) {
       writer.writeAttribute(HtmlAttributes.ONCLICK, "tbgIncTime(this)", false);
     }
     writer.endElement(HtmlConstants.IMG);
@@ -150,30 +151,30 @@ public class TimeRenderer extends InputR
     imageSrc = "image/timeDecrement.gif";
     writer.startElement(HtmlConstants.IMG, null);
     writer.writeIdAttribute(imageId);
-    writer.writeClassAttribute("tobago-time-dec-image"
-        + (hasSeconds ? " tobago-time-image-seconds" : ""));
+    writer.writeClassAttribute(Classes.createIgnoreCheck(
+        time, "decImage", hasSeconds ? Markup.valueOf("seconds") : null));
     writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtils.getImageWithPath(facesContext, imageSrc), true);
     writer.writeAttribute(HtmlAttributes.ALT, "", false); // TODO: tip
-    if (!(ComponentUtils.getBooleanAttribute(input, Attributes.DISABLED)
-        || ComponentUtils.getBooleanAttribute(input, Attributes.READONLY))) {
+    if (!(ComponentUtils.getBooleanAttribute(time, Attributes.DISABLED)
+        || ComponentUtils.getBooleanAttribute(time, Attributes.READONLY))) {
       writer.writeAttribute(HtmlAttributes.ONCLICK, "tbgDecTime(this)", false);
     }
     writer.endElement(HtmlConstants.IMG);
 
-    writer.startElement(HtmlConstants.INPUT, input);
+    writer.startElement(HtmlConstants.INPUT, time);
     writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
     writer.writeIdAttribute(id + ":converterPattern");
     writer.writeAttribute(HtmlAttributes.VALUE, converterPattern, true);
     writer.endElement(HtmlConstants.INPUT);
 
-    writer.startElement(HtmlConstants.INPUT, input);
+    writer.startElement(HtmlConstants.INPUT, time);
     writer.writeAttribute(HtmlAttributes.TYPE, "hidden", false);
     writer.writeIdAttribute(id);
     writer.writeNameAttribute(id);
     writer.writeAttribute(HtmlAttributes.VALUE, hour + ":" + minute + ":" + second, false);
     writer.endElement(HtmlConstants.INPUT);
 
-    String dateTextBoxId = (String) input.getAttributes().get(Attributes.DATE_INPUT_ID);
+    String dateTextBoxId = (String) time.getAttributes().get(Attributes.DATE_INPUT_ID);
 
     if (dateTextBoxId != null) {
       String[] cmds = {"tbgInitTimeParse('" + id + "', '" + dateTextBoxId + "');"};
@@ -183,9 +184,9 @@ public class TimeRenderer extends InputR
     writer.endElement(HtmlConstants.DIV);
   }
 
-  private void writeInputSeparator(TobagoResponseWriter writer, String sep) throws IOException {
+  private void writeInputSeparator(TobagoResponseWriter writer, UITime time, String sep) throws IOException {
     writer.startElement(HtmlConstants.SPAN, null);
-    writer.writeClassAttribute("tobago-time-sep");
+    writer.writeClassAttribute(Classes.create(time, "sep"));
     writer.writeText(sep);
     writer.endElement(HtmlConstants.SPAN);
   }
@@ -201,10 +202,7 @@ public class TimeRenderer extends InputR
     }
     writer.writeAttribute(HtmlAttributes.TITLE, title, true);
 
-    StyleClasses styleClasses = new StyleClasses();
-    //styleClasses.updateClassAttributeAndMarkup(input, "time");
-    styleClasses.addClass("time", "input");
-    writer.writeClassAttribute(styleClasses);
+    writer.writeClassAttribute(Classes.create(input, "input"));
     writer.writeAttribute(HtmlAttributes.READONLY, ComponentUtils.getBooleanAttribute(input, Attributes.READONLY));
     writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtils.getBooleanAttribute(input, Attributes.DISABLED));
     if (!(ComponentUtils.getBooleanAttribute(input, Attributes.DISABLED)

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.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/TreeNodeRenderer.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/TreeNodeRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TreeNodeRenderer.java Tue Jul 20 10:05:56 2010
@@ -145,7 +145,7 @@ public class TreeNodeRenderer extends Co
       writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
       if (!alreadyExists) {
         writer.startElement(HtmlConstants.DIV, null);
-        writer.writeClassAttribute(Classes.simple(tree, "level"));
+        writer.writeClassAttribute(Classes.create(tree, "level"));
         Style levelStyle = new Style();
         levelStyle.setLeft(Measure.valueOf(level * 160)); // xxx 160 should be configurable
         writer.writeStyleAttribute(levelStyle);
@@ -155,14 +155,14 @@ public class TreeNodeRenderer extends Co
           writer.startElement(HtmlConstants.SELECT, null);
           writer.writeAttribute(HtmlAttributes.DISABLED, true);
           writer.writeAttribute(HtmlAttributes.SIZE, 2); // must be > 1, but the size comes from the layout
-          writer.writeClassAttribute(Classes.simple(tree, "select"));
+          writer.writeClassAttribute(Classes.create(tree, "select"));
           writer.endElement(HtmlConstants.SELECT);
         }
       }
 
       writer.startElement(HtmlConstants.SELECT, node);
       writer.writeIdAttribute(id + ComponentUtils.SUB_SEPARATOR + "select");
-      writer.writeClassAttribute(Classes.simple(tree, "select"));
+      writer.writeClassAttribute(Classes.create(tree, "select"));
       if (!expanded) {
         Style selectStyle = new Style();
         selectStyle.setDisplay(Display.NONE);
@@ -251,15 +251,13 @@ public class TreeNodeRenderer extends Co
       }
 
       // div class (css)
-      final Classes classes;
+      String classes;
+      classes = Classes.create(node).getStringValue(); // XXX: not nice, menu may use its own renderer
       if (isMenu) {
+        classes = classes + " " + Classes.create(node, "menu").getStringValue();
         if (marked) {
-          classes = Classes.full(node, new String[] {"menu", "marker"});
-        } else {
-          classes = Classes.full(node, "menu");
+          classes = classes + " " + Classes.create(node, "marker").getStringValue(); // TODO: marker as markup 
         }
-      } else {
-        classes = Classes.full(node);
       }
       writer.writeClassAttribute(classes);
 
@@ -330,7 +328,7 @@ public class TreeNodeRenderer extends Co
     }
     String src = expanded ? menuOpen : menuClose;
     writer.startElement(HtmlConstants.IMG, null);
-    writer.writeClassAttribute(Classes.simple(node, "menuIcon"));
+    writer.writeClassAttribute(Classes.create(node, "menuIcon"));
     writer.writeIdAttribute(id + "-menuIcon");
     writer.writeAttribute("src", src, true);
     writer.writeAttribute("onclick", onclick, true);
@@ -348,7 +346,7 @@ public class TreeNodeRenderer extends Co
 
     for (Boolean junction : junctions) {
       writer.startElement(HtmlConstants.IMG, null);
-      writer.writeClassAttribute(Classes.simple(node, "junction"));
+      writer.writeClassAttribute(Classes.create(node, "junction"));
       if (junction && !menuMode && showJunctions) {
         writer.writeAttribute("src", perpendicular, true);
       } else {
@@ -367,7 +365,7 @@ public class TreeNodeRenderer extends Co
         || !showRootJunction && level == 0
         || !showRootJunction && !showRoot && level == 1)) {
       writer.startElement(HtmlConstants.IMG, null);
-      writer.writeClassAttribute(Classes.simple(node, "junction"));
+      writer.writeClassAttribute(Classes.create(node, "junction"));
       writer.writeIdAttribute(id + "-junction");
 
       String gif = folder && expanded
@@ -398,7 +396,7 @@ public class TreeNodeRenderer extends Co
 
     if (showIcons) {
       writer.startElement(HtmlConstants.IMG, null);
-      writer.writeClassAttribute(Classes.simple(node, "icon"));
+      writer.writeClassAttribute(Classes.create(node, "icon"));
       writer.writeIdAttribute(id + "-icon"); //XXX may not okay with naming conventions
 
       writer.writeAttribute("src", source, true);
@@ -448,7 +446,7 @@ public class TreeNodeRenderer extends Co
       }
     }
     if (marked) {
-      writer.writeClassAttribute(Classes.simple(node, "marker"));
+      writer.writeClassAttribute(Classes.create(node, "marker"));
     }
     String tip = node.getTip();
     if (tip != null) {

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/style/style.css?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/msie/style/style.css Tue Jul 20 10:05:56 2010
@@ -27,18 +27,14 @@ fieldset.tobago-box {
   padding-left: 10px;
 }
 
-.tobago-box-header-toolbar-div {
-  right: -5px;
-}
-
-.tobago-box-toolbar-div {
+.tobago-box-toolbarOuter {
   top: -15px;
   right: -2px;
   height: 31px;
 /*  padding-top: 1px;*/
 }
 
-.tobago-box-toolbar-span {
+.tobago-box-toolbarInner {
   padding-bottom: 0px;
 }
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/style/style.css?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/opera/style/style.css Tue Jul 20 10:05:56 2010
@@ -22,7 +22,7 @@
 
 /* sheet ------------------------------------------------------------------ */
 
-.tobago-sheet-header-resize-cursor {
+.tobago-sheet-headerSpacer-markup-resizable {
   /* Opera 10.10 doesn't know col-resize */
 	cursor: e-resize;
 }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js Tue Jul 20 10:05:56 2010
@@ -177,14 +177,14 @@ function initCalendar(id) {
         var monthAfterClick = month;
         if (d <= 0) {
           d = prevMonthLength + d;
-          styleClass = "tobago-calendar-day-disabled";
+          styleClass = "tobago-calendar-day-markup-disabled";
           monthAfterClick = month - 1;
         } else if (d > monthLength) {
-          styleClass = "tobago-calendar-day-disabled";
+          styleClass = "tobago-calendar-day-markup-disabled";
           d -= monthLength;
           monthAfterClick = month + 1;
         } else if (d == day) {
-          styleClass = "tobago-calendar-day-selected";
+          styleClass = "tobago-calendar-day-markup-selected";
         }
         el.className = styleClass;
         el.innerHTML = d;
@@ -350,7 +350,7 @@ function tbgTimerInputFocus(input, hour)
 //  LOG.debug("focus " + input.id + " hourMode=" + hour);
   input.parentNode.parentNode.selectedId = input.id;
   input.parentNode.parentNode.hourMode = hour;
-  Tobago.addCssClass(input, "tobago-time-input-selected");
+  Tobago.addCssClass(input, "tobago-time-input-markup-selected");
   input.oldValue = input.value;
 }
 
@@ -372,7 +372,7 @@ function tbgTimerInputBlur(input) {
     }
   }
   tbgSetTimeInputValue(input, value)
-  Tobago.removeCssClass(input, "tobago-time-input-selected");
+  Tobago.removeCssClass(input, "tobago-time-input-markup-selected");
 //  LOG.debug("value  4= " + input.value);
 }
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tab.js Tue Jul 20 10:05:56 2010
@@ -34,7 +34,7 @@ function tobago_nextTab(type, controlId,
   for (i = selectedIndex + 1; i < size; i++) {
     var tab = document.getElementById(controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
     //LOG.error("Search " + controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
-    if (tab && tab.className.indexOf('tobago-tab-disabled') == -1) {
+    if (tab && tab.className.indexOf('tobago-tab-link-markup-disabled') == -1) {
       //LOG.error("Selected Index: " + selectedIndex);
       selectedIndex = i;
       break;
@@ -53,7 +53,7 @@ function tobago_previousTab(type, contro
 
   for (i = selectedIndex - 1; i >= 0; i--) {
     var tab = document.getElementById(controlId + Tobago.SUB_COMPONENT_SEP2 + selectedIndex + Tobago.SUB_COMPONENT_SEP2 + i);
-    if (tab && tab.className.indexOf('tobago-tab-disabled') == -1) {
+    if (tab && tab.className.indexOf('tobago-tab-link-markup-disabled') == -1) {
       selectedIndex = i;
       break;
     }
@@ -89,4 +89,4 @@ function tobago_requestTab(controlId, se
   }
 
   Tobago.submitAction(null /*todo: source*/, controlId);
-}
\ No newline at end of file
+}

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-sheet.js?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/tobago-sheet.js Tue Jul 20 10:05:56 2010
@@ -43,7 +43,7 @@ function tobagoSheetEditPagingRow(span, 
       input.type='text';
       input.id=hiddenId;
       input.name=hiddenId;
-      input.className = "tobago-sheet-paging-input";
+      input.className = "tobago-sheet-pagingInput";
       input.onClickCommand = onClickCommand;
       Tobago.addEventListener(input, 'blur', delayedHideInput);
       //Tobago.addEventListener(input, 'keyup', keyUp);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Tue Jul 20 10:05:56 2010
@@ -37,14 +37,14 @@ legend.tobago-box {
   overflow: auto;
 }
 
-.tobago-box-toolbar-div {
+.tobago-box-toolbarOuter {
   position: relative;
   top: -36px;
   right: -12px;
 
 }
 
-.tobago-box-toolbar-span {
+.tobago-box-toolbarInner {
   position: absolute;
   top: 0;
   right: 0;
@@ -69,7 +69,7 @@ legend.tobago-box {
   cursor: pointer;
 }
 
-.tobago-button-disabled {
+.tobago-button-markup-disabled {
   cursor: default;
 }
 
@@ -88,11 +88,11 @@ table.tobago-calendar-header {
   width: 100%;
 }
 
-th.tobago-calendar-header-center {
+th.tobago-calendar-headerCenter {
   width: 100%;
 }
 
-th.tobago-calendar-inner-header {
+th.tobago-calendar-headerInner {
   width: 14%;
 }
 
@@ -100,17 +100,17 @@ img.tobago-calendar-header {
   cursor: pointer;
 }
 
-td.tobago-calendar-day, td.tobago-calendar-day-disabled, td.tobago-calendar-day-selected {
+td.tobago-calendar-day, td.tobago-calendar-day-markup-disabled, td.tobago-calendar-day-markup-selected {
   width: 14%;
   text-align: center;
   cursor: pointer;
 }
 
-td.tobago-calendar-day-disabled {
+td.tobago-calendar-day-markup-disabled {
   color: #999999;
 }
 
-td.tobago-calendar-day-selected {
+td.tobago-calendar-day-markup-selected {
   background-color: #ffffff;
 }
 
@@ -128,22 +128,22 @@ td.tobago-calendar-day-selected {
   margin: 0;
 }
 
-.tobago-date-required {
+.tobago-date-markup-required {
   background-image: url( "../image/required.gif" );
   background-position: 3px 50%;
   background-repeat: no-repeat;
 }
 
-.tobago-date-readonly {
+.tobago-date-markup-readonly {
   background: #bbccdd;
 }
 
-.tobago-date-disabled {
+.tobago-date-markup-disabled {
   color: #778899;
   background: #bbccdd;
 }
 
-.tobago-date-error {
+.tobago-date-markup-error, .tobago-date-markup-fatal {
   border-style: solid;
   border-color: #ff0000;
 }
@@ -160,7 +160,7 @@ td.tobago-calendar-day-selected {
   height: 25px;
 }
 
-.tobago-file-error {
+.tobago-file-markup-error, .tobago-file-markup-fatal {
   border-color: #ff0000;
 }
 
@@ -215,24 +215,24 @@ div.tobago-gridLayout-first-column {
   text-align: right;
 }
 
-.tobago-in-required {
+.tobago-in-markup-required {
   background: url("../image/required.gif") no-repeat 3px 50%;
 }
 
-.tobago-in-readonly {
+.tobago-in-markup-readonly {
   background: #bbccdd;
 }
 
-.tobago-in-disabled {
+.tobago-in-markup-disabled {
   color: #778899;
   background: #bbccdd;
 }
 
-.tobago-in-error {
+.tobago-in-markup-error, .tobago-in-markup-fatal {
   border: 2px solid #ff0000;
 }
 
-.tobago-in-suggest-popup {
+.tobago-in-suggestPopup {
   position: absolute;
   overflow: hidden;
   width: 250px;
@@ -245,15 +245,15 @@ div.tobago-gridLayout-first-column {
   -moz-box-sizing: border-box;
 }
 
-.tobago-in-suggest-popup li {
+.tobago-in-suggestPopup li {
   white-space: nowrap;
 }
 
-.tobago-in-suggest-popup li.selected {
+.tobago-in-suggestPopup li.selected {
   background-color: #ffb;
 }
 
-.tobago-in-suggest-popup ul {
+.tobago-in-suggestPopup ul {
   list-style-type: none;
   margin: 0;
   padding: 0;
@@ -290,7 +290,7 @@ label.tobago-label {
 /*  background: #ccddee; */
 }
 
-.tobago-label-disabled {
+.tobago-label-markup-disabled {
   color: #778899;
 }
 
@@ -413,13 +413,13 @@ iframe.tobago-menu-ie6bugfix {
 
 /* messages --------------------------------------------------- */
 
-.tobago-validation-message {
-  color: red;
+.tobago-messages {
+  color: #FF0000;
   white-space: nowrap;
 }
 
-.tobago-messages-markup-info {
-  color: black;
+.tobago-messages-item-markup-info {
+  color: #000000;
 }
 
 /* object ------------------------------------------------------------------ */
@@ -490,6 +490,24 @@ iframe.tobago-menu-ie6bugfix {
   filter: progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);
 }
 
+/* progress -------------------------------------------------------------- */
+
+img.tobago-progress-color1 {
+  background: #aabbcc;
+  border-width: 1px 0 1px 1px;
+  height: 1.4ex;
+}
+
+img.tobago-progress-color2 {
+  background: #ddeeff;
+  border-width: 1px 1px 1px 0;
+  height: 1.4ex;
+}
+
+span.tobago-progress {
+  white-space: nowrap;
+}
+
 /* selectBooleanCheckbox --------------------------------------------------- */
 
 .tobago-selectBooleanCheckbox {
@@ -498,11 +516,11 @@ iframe.tobago-menu-ie6bugfix {
   margin-bottom: 2px;
 }
 
-.tobago-selectBooleanCheckbox-disabled {
+.tobago-selectBooleanCheckbox-markup-disabled {
   color: #778899;
 }
 
-.tobago-selectBooleanCheckbox-error {
+.tobago-selectBooleanCheckbox-markup-error {
   border: 2px solid #ff0000;
 }
 
@@ -515,7 +533,7 @@ iframe.tobago-menu-ie6bugfix {
   margin: 0;
 }
 
-.tobago-selectManyCheckbox-disabled  {
+.tobago-selectManyCheckbox-markup-disabled  {
   color: #778899;
 }
 
@@ -523,7 +541,7 @@ iframe.tobago-menu-ie6bugfix {
   display: inline;
 }
 
-.tobago-selectManyCheckbox-error label {
+.tobago-selectManyCheckbox-markup-error label {
   border: 1px solid #FF0000;
 }
 
@@ -536,16 +554,16 @@ iframe.tobago-menu-ie6bugfix {
   height: 25px;
 }
 
-.tobago-selectManyListbox-readonly {
+.tobago-selectManyListbox-markup-readonly {
   background-color: #bbccdd;
 }
 
-.tobago-selectManyListbox-disabled {
+.tobago-selectManyListbox-markup-disabled {
   color: #778899;
   background: #bbccdd;
 }
 
-.tobago-selectManyListbox-error {
+.tobago-selectManyListbox-markup-error {
   border-style: solid;
   border-color: #ff0000;
 }
@@ -557,15 +575,15 @@ iframe.tobago-menu-ie6bugfix {
   background: #ffffff;
 }
 
-.tobago-selectOneChoice-disabled {
+.tobago-selectOneChoice-markup-disabled {
   background: #c0c0c0;
 }
 
-.tobago-selectOneChoice-readonly {
+.tobago-selectOneChoice-markup-readonly {
  background-color: #bbccdd;
 }
 
-.tobago-selectOneChoice-error {
+.tobago-selectOneChoice-markup-error {
   border-style: solid;
   border-color: #ff0000;
 }
@@ -577,16 +595,16 @@ iframe.tobago-menu-ie6bugfix {
   color: #000000;
 }
 
-.tobago-selectOneListbox-disabled {
+.tobago-selectOneListbox-markup-disabled {
   color: #778899;
   background: #bbccdd;
 }
 
-.tobago-selectOneListbox-readonly {
+.tobago-selectOneListbox-markup-readonly {
   background-color: #bbccdd;
 }
 
-.tobago-selectOneListbox-error {
+.tobago-selectOneListbox-markup-error {
   border-style: solid;
   border-color: #ff0000;
 }
@@ -600,7 +618,7 @@ iframe.tobago-menu-ie6bugfix {
   margin: 0;
 }
 
-.tobago-selectOneRadio-disabled  {
+.tobago-selectOneRadio-markup-disabled  {
   color: #778899;
 }
 
@@ -608,7 +626,7 @@ iframe.tobago-menu-ie6bugfix {
   display: inline;
 }
 
-.tobago-selectOneRadio-error label {
+.tobago-selectOneRadio-markup-error label {
   border: 1px solid #FF0000;
 }
 
@@ -618,12 +636,12 @@ iframe.tobago-menu-ie6bugfix {
   position: absolute;
 }
 
-hr.tobago-separator {
+.tobago-separator hr {
   border: 1px inset #000000;
   margin: 0;
 }
 
-.tobago-separator-start {
+.tobago-separator-start hr {
   width: 20px;
   position: static;
 }
@@ -642,12 +660,12 @@ hr.tobago-separator {
 
 /* sheet ------------------------------------------------------------------ */
 
-.tobago-sheet-outer-div {
+.tobago-sheet-outer {
   overflow: hidden;
   position: relative;
 }
 
-.tobago-sheet-header-div {
+.tobago-sheet-headerDiv {
   height: 20px;
   width: 100%;
   overflow: hidden;
@@ -677,21 +695,21 @@ hr.tobago-separator {
   text-align: center;
 }
 
-.tobago-sheet-header-ascending span, .tobago-sheet-header-descending span {
+.tobago-sheet-header-markup-ascending span, .tobago-sheet-header-markup-descending span {
   margin-right: 15px;
 }
 
-.tobago-sheet-header-ascending img, .tobago-sheet-header-descending img {
+.tobago-sheet-header-markup-ascending img, .tobago-sheet-header-markup-descending img {
   position: absolute;
   right: 5px;
   top: 6px;
 }
 
-.tobago-sheet-header-sortable {
+.tobago-sheet-header-markup-sortable {
    cursor: pointer;
 }
 
-.tobago-sheet-header-resize-outer {
+.tobago-sheet-headerSpacerOuter {
   display: inline-block;
   position: relative;
 	width: 0;
@@ -699,7 +717,7 @@ hr.tobago-separator {
   z-index: 4;
 }
 
-.tobago-sheet-header-resize {
+.tobago-sheet-headerSpacer {
   position: absolute;
   left: -5px;
   top: 0;
@@ -708,11 +726,11 @@ hr.tobago-separator {
 	overflow: hidden;
 }
 
-.tobago-sheet-header-resize-cursor {
+.tobago-sheet-headerSpacer-markup-resizable {
 	cursor: col-resize; /* col-resize is allowed in CSS3+IE6, opera has a separate definition */
 }
 
-.tobago-sheet-body-div {
+.tobago-sheet-body {
   overflow: auto;
   padding-top: 20px;
   position: absolute;
@@ -721,26 +739,26 @@ hr.tobago-separator {
   background: #ebf4fd;
 }
 
-.tobago-sheet-cell-td {
+.tobago-sheet-cell {
   padding-left: 0;
   padding-right: 0;
   vertical-align: top;
   overflow: hidden;
 }
 
-.tobago-sheet-cell-clickable {
+.tobago-sheet-cell-markup-clickable {
    cursor: pointer;
 }
 
-.tobago-sheet-row-odd {
+.tobago-sheet-row-markup-odd {
   background: #ffffff;
 }
 
-.tobago-sheet-row-even {
+.tobago-sheet-row-markup-even {
   background: #d8e9fb;
 }
 
-.tobago-sheet-row-selected {
+.tobago-sheet-row-markup-selected {
 	background: highlight;
 	color: highlighttext;
 }
@@ -753,22 +771,22 @@ hr.tobago-separator {
   overflow: hidden;
 }
 
-.tobago-sheet-paging-span-left {
+.tobago-sheet-pagingOuter-markup-left {
   position : absolute;
   top: 0;
   left: 0;
 }
-.tobago-sheet-paging-span-center {
+.tobago-sheet-pagingOuter-markup-center {
 
 }
 
-.tobago-sheet-paging-span-right {
+.tobago-sheet-pagingOuter-markup-right {
   position : absolute;
   top: 0;
   right: 0;
 }
 
-.tobago-sheet-paging-input {
+.tobago-sheet-pagingInput {
   position: relative;
   width: 30px;
   height: 16px;
@@ -779,46 +797,38 @@ hr.tobago-separator {
   text-align: center;
 }
 
-.tobago-sheet-paging-pages-span {
+.tobago-sheet-pagingOuter {
   vertical-align: top;
+  cursor: pointer;
 }
 
-.tobago-sheet-paging-pages-text {
+.tobago-sheet-pagingText {
   cursor: pointer;
   padding-right: 5px;
   vertical-align: top;
 }
 
-.tobago-sheet-footer-pager-button {
+.tobago-sheet-footerPagerButton {
   cursor: pointer;
   vertical-align: top;
 }
 
-.tobago-sheet-footer-pager-button-disabled {
+.tobago-sheet-footerPagerButton-markup-disabled {
   cursor: auto;
 }
 
-.tobago-sheet-paging-rows-span {
-  cursor: pointer;
-  vertical-align: top;
-}
-
-.tobago-sheet-paging-links-span {
-  vertical-align: top;
-}
-
-.tobago-sheet-paging-links-link {
+.tobago-sheet-pagingLink {
   padding-left: 2px;
   padding-right: 2px;
   vertical-align: top;
 }
 
-a:link.tobago-sheet-paging-links-link, a:visited.tobago-sheet-paging-links-link,
-a:active.tobago-sheet-paging-links-link {
+a:link.tobago-sheet-pagingLink, a:visited.tobago-sheet-pagingLink,
+a:active.tobago-sheet-pagingLink {
   color: #000000;
 }
 
-.tobago-sheet-selector-menu {
+.tobago-sheet-selectorMenu {
   width: 15px;
   height:15px;
   position: relative;
@@ -900,43 +910,32 @@ div.tobago-richTextEditor-body {
   height: 100%;
 }
 
-.tobago-tab-header {
+.tobago-tabGroup-header {
   position: relative;
 }
 
-.tobago-tab-selected-outer {
+.tobago-tab-outer {
   border-color: #ddeeff #778899 #ddeeff #ddeeff;
-  border-width: 1px 1px 0 1px;
+  border-width: 1px 1px 1px 1px;
   border-style: solid;
-  padding: 0 0 0 0;
   position: relative;
-  height: 18px;
   display: inline-block;
   vertical-align: bottom;
   text-align: center;
 }
 
-.tobago-tab-selected-inner {
-  margin: 0 1px;
-  white-space: nowrap;
-}
-
-.tobago-tab-unselected-outer {
-  border-color: #ddeeff #778899 #ddeeff #ddeeff;
-  border-width: 1px 1px 1px 1px;
-  border-style: solid;
-  position: relative;
-  display: inline-block;
-  vertical-align: bottom;
-  text-align: center;
+.tobago-tab-outer-markup-selected {
+  border-width: 1px 1px 0 1px;
+  padding: 0 0 0 0;
+  height: 18px;
 }
 
-.tobago-tab-unselected-inner {
+.tobago-tab-inner {
   margin: 0 1px;
   white-space: nowrap;
 }
 
-.tobago-tab-fulfill {
+.tobago-tabGroup-fulfill {
   border-color: #ddeeff;
   border-width: 0 0 1px 0;
   display: inline-block;
@@ -964,29 +963,6 @@ div.tobago-tabGroup-toolBar {
   white-space: nowrap;
 }
 
-a:link.tab, a:visited.tab, a:active.tab {
-  font-family: arial, helvetica, sans-serif;
-  color: #000000;
-  text-decoration: none;
-  white-space: nowrap;
-}
-
-img.tobago-progress-color1 {
-  background: #aabbcc;
-  border-width: 1px 0 1px 1px;
-  height: 1.4ex;
-}
-
-img.tobago-progress-color2 {
-  background: #ddeeff;
-  border-width: 1px 1px 1px 0;
-  height: 1.4ex;
-}
-
-span.tobago-progress {
-  white-space: nowrap;
-}
-
 /* textArea ---------------------------------------------------------------- */
 
 .tobago-textArea {
@@ -1000,22 +976,22 @@ span.tobago-progress {
   margin: 0;
 }
 
-.tobago-textArea-readonly {
+.tobago-textArea-markup-readonly {
   background: #bbccdd;
 }
 
-.tobago-textArea-disabled {
+.tobago-textArea-markup-disabled {
   color: #778899;
   background: #bbccdd;
 }
 
-/*.tobago-textArea-required {
+/*.tobago-textArea-markup-required {
    background-image: url( "../image/required.gif" );
    background-position: 3px 3px;
    background-repeat: no-repeat;
 } */
 
-.tobago-textArea-error {
+.tobago-textArea-markup-error, .tobago-textArea-markup-fatal {
   border-style: solid;
   border-color: #ff0000;
 }
@@ -1032,7 +1008,7 @@ span.tobago-progress {
   left: 0;
 }
 
-.tobago-time-borderDiv-seconds {
+.tobago-time-borderDiv-markup-seconds {
   width: 87px;
 }
 
@@ -1046,28 +1022,28 @@ span.tobago-progress {
   text-align: center;
 }
 
-.tobago-time-input-selected {
+.tobago-time-input-markup-selected {
   border: 1px solid yellow;
 }
 
 .tobago-time-sep {
 }
 
-.tobago-time-inc-image {
+.tobago-time-incImage, .tobago-time-decImage {
   position: absolute;
-  top: 1px;
   left: 63px;
   cursor: pointer;
 }
 
-.tobago-time-dec-image {
-  position: absolute;
+.tobago-time-incImage {
+  top: 1px;
+}
+
+.tobago-time-decImage {
   top: 11px;
-  left: 63px;
-  cursor: pointer;
 }
 
-.tobago-time-image-seconds {
+.tobago-time-incImage-markup-seconds, .tobago-time-decImage-markup-seconds {
   left: 92px;
 }
 

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/BoxRenderer.java Tue Jul 20 10:05:56 2010
@@ -21,12 +21,11 @@ import org.apache.myfaces.tobago.compone
 import org.apache.myfaces.tobago.component.Facets;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.component.UIBox;
-import org.apache.myfaces.tobago.component.UIToolBar;
 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.StyleClasses;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -35,7 +34,6 @@ import javax.faces.component.UIComponent
 import javax.faces.component.UIPanel;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
-import java.util.Map;
 
 public class BoxRenderer extends BoxRendererBase {
 
@@ -81,7 +79,7 @@ without shadow
     String clientId = box.getClientId(facesContext);
     writer.startElement(HtmlConstants.DIV, box);
     HtmlRendererUtils.renderDojoDndItem(box, writer, true);
-    writer.writeClassAttribute();
+    writer.writeClassAttribute(Classes.create(box));
     writer.writeIdAttribute(clientId);
     writer.writeStyleAttribute(new Style(facesContext, box));
     writer.writeJavascript("Tobago.addAjaxComponent(\"" + clientId + "\");");
@@ -98,10 +96,7 @@ without shadow
     if (hasShadow) {
       // shadow begin
       writer.startElement(HtmlConstants.DIV, box);
-
-      StyleClasses classes = new StyleClasses();
-      classes.addClass("box", "shadow");
-      writer.writeClassAttribute(classes);
+      writer.writeClassAttribute(Classes.create(box, "shadow"));
 
       Style shadow = new Style();
       shadow.setWidth(box.getCurrentWidth().subtract(1));
@@ -110,10 +105,7 @@ without shadow
 
       // border begin
       writer.startElement(HtmlConstants.DIV, box);
-
-      classes = new StyleClasses();
-      classes.addClass("box", "border");
-      writer.writeClassAttribute(classes);
+      writer.writeClassAttribute(Classes.create(box, "border"));
 
       Style border = new Style();
       border.setWidth(box.getCurrentWidth().subtract(3));
@@ -123,7 +115,7 @@ without shadow
 
     UIComponent label = box.getFacet(Facets.LABEL);
     writer.startElement(HtmlConstants.DIV, null);
-    writer.writeClassAttribute("tobago-box-header");
+    writer.writeClassAttribute(Classes.create(box, "header"));
     String labelString = (String) box.getAttributes().get(Attributes.LABEL);
     if (label != null) {
       RenderUtils.encode(facesContext, label);
@@ -134,7 +126,7 @@ without shadow
 
     UIPanel toolbar = (UIPanel) box.getFacet(Facets.TOOL_BAR);
     if (toolbar != null) {
-      renderToolbar(facesContext, writer, toolbar);
+      renderToolbar(facesContext, writer, box, toolbar);
     }
     
     if (hasShadow) {
@@ -145,7 +137,7 @@ without shadow
     }
 
     writer.startElement(HtmlConstants.DIV, null);
-    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
     final Style style = new Style(facesContext, box);
     final Measure offsetLeft = getOffsetLeft(facesContext, box);
     final Measure offsetRight = getOffsetRight(facesContext, box);
@@ -166,14 +158,9 @@ without shadow
   }
 
   protected void renderToolbar(
-      FacesContext facesContext, TobagoResponseWriter writer, UIPanel toolbar) throws IOException {
-    final Map attributes = toolbar.getAttributes();
-    String className = "tobago-box-header-toolbar-div";
-    if (UIToolBar.LABEL_OFF.equals(attributes.get(Attributes.LABEL_POSITION))) {
-      className += " tobago-box-header-toolbar-label_off";
-    }
+      FacesContext facesContext, TobagoResponseWriter writer, UIBox box, UIPanel toolbar) throws IOException {
     writer.startElement(HtmlConstants.DIV, null);
-    writer.writeClassAttribute(className);
+    writer.writeClassAttribute(Classes.create(box, "headerToolbar"));
     toolbar.setRendererType(RendererTypes.BOX_TOOL_BAR);
     RenderUtils.encode(facesContext, toolbar);
     writer.endElement(HtmlConstants.DIV);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java?rev=965782&r1=965781&r2=965782&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java Tue Jul 20 10:05:56 2010
@@ -18,10 +18,10 @@ package org.apache.myfaces.tobago.render
  */
 
 import org.apache.myfaces.tobago.component.UITab;
+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.HtmlConstants;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
@@ -37,7 +37,7 @@ public class TabGroupRenderer
       throws IOException {
 
     writer.startElement(HtmlConstants.DIV, null);
-    writer.writeClassAttribute("tobago-tab-shadow");
+    writer.writeClassAttribute(Classes.create(activeTab, "shadow"));
     if (body != null) {
       Style body1 = new Style(body);
       // TODO get border width
@@ -48,10 +48,7 @@ public class TabGroupRenderer
     }
 
     writer.startElement(HtmlConstants.DIV, null);
-    StyleClasses classes = new StyleClasses();
-    classes.addClass("tab", "content");
-    classes.addMarkupClass(activeTab, "tab", "content");
-    writer.writeClassAttribute(classes);
+    writer.writeClassAttribute(Classes.create(activeTab, "content"));
 
     if (body != null) {
       Style body2 = new Style(body);