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 2015/10/08 16:55:06 UTC

svn commit: r1707558 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/ tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/ tobago-core/src/test/java/org/apache/myfaces/tobago/renderk...

Author: lofwyr
Date: Thu Oct  8 14:55:05 2015
New Revision: 1707558

URL: http://svn.apache.org/viewvc?rev=1707558&view=rev
Log:
TOBAGO-1489: Refactoring: using enums (also for attributes in taglib)

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SuggestRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeCommandRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIconRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeListboxRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeMenuNodeRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeNodeRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/DataAttributes.java Thu Oct  8 14:55:05 2015
@@ -24,238 +24,179 @@ package org.apache.myfaces.tobago.render
  * These attributes may transport data to DOM which are not standardized.
  * The format is "data-tobago-*" which is conform to HTML 5, but also works in older browsers.
  */
-public final class DataAttributes {
+public enum DataAttributes {
 
   /**
    * The index of the column of a sheet. This index means the position of the rendered column. It can differ, if there
    * are tc:column with rendered=false.
    */
-  public static final String COLUMN_INDEX = "data-tobago-column-index";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String COLUMNINDEX = COLUMN_INDEX;
+    COLUMN_INDEX("data-tobago-column-index"),
 
   /**
    * TBD: needed? may replace with VALUE?
    * Custom command attribute. Is used to mark different client side JavaScript buttons.
    * Should only contain the command name as a keyword, for security reasons.
    */
-  public static final String COMMAND = "data-tobago-command";
+  COMMAND("data-tobago-command"),
 
   /**
    * The list of commands attached to an element.
    */
-  public static final String COMMANDS = "data-tobago-commands";
-
-  /**
-   * Reference to the corresponding date input field. Used for date picker popups.
-   *
-   * @deprecated Since 2.0.0. It's no longer needed, because this is resolved by JavaScript now.
-   */
-  @Deprecated
-  public static final String DATE_INPUT_ID = "data-tobago-date-input-id";
+  COMMANDS("data-tobago-commands"),
 
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String DATEINPUTID = DATE_INPUT_ID;
-
-  /**
-   * Marker for the OK-button of the date picker popup.
-   *
-   * @deprecated Since 2.0.0. It's no longer needed, because this is resolved by JavaScript now.
-   */
-  @Deprecated
-  public static final String DATE_PICKER_OK = "data-tobago-date-picker-ok";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String DATEPICKEROK = DATE_PICKER_OK;
-
-  public static final String DATE_TIME_I18N = "data-tobago-date-time-i18n";
+  DATE_TIME_I18N("data-tobago-date-time-i18n"),
 
   /**
    * Holds the day of a calendar control.
    */
-  public static final String DAY = "data-tobago-day";
+  DAY("data-tobago-day"),
 
   /**
    * Custom disabled attribute. Use for element, that don't have the disabled attribute.
    */
-  public static final String DISABLED = "data-tobago-disabled";
+  DISABLED("data-tobago-disabled"),
 
-  public static final String DISMISS = "data-dismiss";
+  DISMISS("data-dismiss"),
 
   /**
    * Custom form attribute. Used to show the virtual form of the component.
    */
-  public static final String DEFAULT = "data-tobago-default";
+  DEFAULT("data-tobago-default"),
 
-  public static final String DELAY = "data-tobago-delay";
+  DELAY("data-tobago-delay"),
 
-  public static final String FOR = "data-tobago-for";
+  FOR("data-tobago-for"),
 
   /**
    * Holds the id of the first row in a sheet.
    */
-  public static final String FIRST = "data-tobago-first";
+  FIRST("data-tobago-first"),
 
   /*
    * Holds the index of the row in a sheet, if the sheed has a rowRendered attribute.
    */
-  public static final String ROW_INDEX = "data-tobago-row-index";
+  ROW_INDEX("data-tobago-row-index"),
 
   /**
    * Holds the first day of a week of a calendar control.
    */
-  public static final String FIRST_DAY_OF_WEEK = "data-tobago-first-day-of-week";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String FIRSTDAYOFWEEK = FIRST_DAY_OF_WEEK;
+  FIRST_DAY_OF_WEEK("data-tobago-first-day-of-week"),
 
   /**
    * Defines a maximum value.
    */
-  public static final String MAX = "data-tobago-max";
+  MAX("data-tobago-max"),
 
   /**
    * Holds the month of a calendar control.
    */
-  public static final String MONTH = "data-tobago-month";
+  MONTH("data-tobago-month"),
 
   /**
    * Holds the names of the months of a calendar control.
    */
-  public static final String MONTH_NAMES = "data-tobago-month-names";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String MONTHNAMES = MONTH_NAMES;
+  MONTH_NAMES("data-tobago-month-names"),
 
-  public static final String PARTIAL_IDS = "data-tobago-partial-ids";
+  PARTIAL_IDS("data-tobago-partial-ids"),
 
-  public static final String PARTIAL_ACTION = "data-tobago-partial-action";
+  PARTIAL_ACTION("data-tobago-partial-action"),
 
   /**
    * Custom attribute to describe a pattern, e. g. for an date input field.
    */
-  public static final String PATTERN = "data-tobago-pattern";
+  PATTERN("data-tobago-pattern"),
 
   /**
    * Custom reload attribute. Used to reload a panel.
    */
-  public static final String RELOAD = "data-tobago-reload";
+  RELOAD("data-tobago-reload"),
 
-  public static final String ROW_ACTION = "data-tobago-row-action";
+  ROW_ACTION("data-tobago-row-action"),
 
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String ROWACTION = ROW_ACTION;
-
-  public static final String SELECTION_MODE = "data-tobago-selection-mode";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SELECTIONMODE = SELECTION_MODE;
+  SELECTION_MODE("data-tobago-selection-mode"),
 
   /**
    * The selectable attribute e. g. for trees.
    */
-  public static final String SELECTABLE = "data-tobago-selectable";
+  SELECTABLE("data-tobago-selectable"),
 
   /**
    * Reference to a sheet.
    */
-  public static final String SHEET_ID = "data-tobago-sheet-id";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SHEETID = SHEET_ID;
+  SHEET_ID("data-tobago-sheet-id"),
 
   /**
    * Alternate to the src attribute, to implement a hover effect.
    */
-  public static final String SRC_HOVER = "data-tobago-src-hover";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SRCHOVER = SRC_HOVER;
+  SRC_HOVER("data-tobago-src-hover"),
 
   /**
    * Alternate to the src attribute, to implement a hover effect.
    */
-  public static final String SRC_DEFAULT = "data-tobago-src-default";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SRCDEFAULT = SRC_DEFAULT;
+  SRC_DEFAULT("data-tobago-src-default"),
 
   /**
    * Alternate to the src attribute, icon open and close.
    */
-  public static final String SRC_CLOSE = "data-tobago-src-close";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SRCCLOSE = SRC_CLOSE;
+  SRC_CLOSE("data-tobago-src-close"),
 
   /**
    * Alternate to the src attribute, icon open and close.
    */
-  public static final String SRC_OPEN = "data-tobago-src-open";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String SRCOPEN = SRC_OPEN;
+  SRC_OPEN("data-tobago-src-open"),
 
   /**
    * A way to transport style data in JSON format to the browser. With CSP the normal style attribute isn't allowed.
    */
-  public static final String STYLE = "data-tobago-style";
+  STYLE("data-tobago-style"),
 
-  public static final String SUGGEST_DATA = "data-tobago-suggest-data";
+  SUGGEST_DATA("data-tobago-suggest-data"),
 
-  public static final String SUGGEST_DELAY = "data-tobago-suggest-delay";
+  SUGGEST_DELAY("data-tobago-suggest-delay"),
 
-  public static final String SUGGEST_MAX_ITEMS = "data-tobago-suggest-max-items";
+  SUGGEST_MAX_ITEMS("data-tobago-suggest-max-items"),
 
-  public static final String SUGGEST_MIN_CHARS = "data-tobago-suggest-min-chars";
+  SUGGEST_MIN_CHARS("data-tobago-suggest-min-chars"),
 
-  public static final String SUGGEST_TOTAL_COUNT = "data-tobago-suggest-total-count";
+  SUGGEST_TOTAL_COUNT("data-tobago-suggest-total-count"),
 
-  public static final String SUGGEST_UPDATE = "data-tobago-suggest-update";
+  SUGGEST_UPDATE("data-tobago-suggest-update"),
 
-  public static final String TARGET = "data-target";
+  TARGET("data-target"),
 
-  public static final String TO_PAGE = "data-tobago-to-page";
+  TO_PAGE("data-tobago-to-page"),
 
-  public static final String TOGGLE = "data-toggle";
+  TOGGLE("data-toggle"),
 
-  public static final String TRANSITION = "data-tobago-transition";
+  TRANSITION("data-tobago-transition"),
 
   /**
    * Id of the parent node in a tree node.
    */
-  public static final String TREE_PARENT = "data-tobago-tree-parent";
-
-  /** @deprecated Since 1.5.11 */
-  @Deprecated
-  public static final String TREEPARENT = TREE_PARENT;
+  TREE_PARENT("data-tobago-tree-parent"),
 
   /**
    * Defines the unit, e. g. to differ between hours, minutes and seconds in a time control.
    */
-  public static final String UNIT = "data-tobago-unit";
+  UNIT("data-tobago-unit"),
 
   /**
    * Holds the value (for tags, that don't have a value in HTML).
    */
-  public static final String VALUE = "data-tobago-value";
+  VALUE("data-tobago-value"),
 
   /**
    * Holds the year of a calendar control.
    */
-  public static final String YEAR = "data-tobago-year";
+  YEAR("data-tobago-year");
+
+  private final String value;
+
+  DataAttributes(String value) {
+    this.value = value;
+  }
 
+  public String getValue() {
+    return value;
+  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java Thu Oct  8 14:55:05 2015
@@ -173,7 +173,8 @@ public abstract class TobagoResponseWrit
       final String json = style.encodeJson();
       if (json.length() > 2) { // empty "{}" needs not to be written
         final FacesContext facesContext = FacesContext.getCurrentInstance();
-        writeAttribute(DataAttributes.STYLE, json, style.needsToBeEscaped() || AjaxUtils.isAjaxRequest(facesContext));
+        writeAttribute(
+            DataAttributes.STYLE.getValue(), json, style.needsToBeEscaped() || AjaxUtils.isAjaxRequest(facesContext));
         // in case of AJAX we need to escape the " as long we use
         // org.apache.myfaces.tobago.internal.webapp.JsonResponseWriter
       }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/DataAttributesUnitTest.java Thu Oct  8 14:55:05 2015
@@ -22,26 +22,24 @@ package org.apache.myfaces.tobago.render
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.lang.reflect.Field;
-
 public class DataAttributesUnitTest {
 
   @Test
   public void testAttributeNames() throws IllegalAccessException {
-    for (final Field field : DataAttributes.class.getFields()) {
+    for (final DataAttributes d : DataAttributes.values()) {
 
-      if (field.getAnnotation(Deprecated.class) != null) {
-        // ignore the check for deprecated fields
-        continue;
-      }
-      final String value = (String) field.get(null);
+// todo      if (d.getAnnotation(Deprecated.class) != null) {
+//        // ignore the check for deprecated fields
+//        continue;
+//      }
+      final String value = d.getValue();
       Assert.assertTrue("Regexp check: value='" + value + "'", value.matches("data(-tobago)?(-[a-z0-9]+)*-[a-z0-9]+"));
 
       final String extension
           = value.startsWith("data-tobago-")
           ? value.substring("data-tobago-".length())
           : value.substring("data-".length());
-      final String name = field.getName();
+      final String name = d.name();
       Assert.assertEquals(name, extension.toUpperCase().replaceAll("-", "_"));
     }
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ButtonRenderer.java Thu Oct  8 14:55:05 2015
@@ -73,7 +73,7 @@ public class ButtonRenderer extends Comm
 
     if (!disabled) {
       final CommandMap map = new CommandMap(new Command(facesContext, button));
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
 
       writer.writeAttribute(HtmlAttributes.HREF, "#", false);
 
@@ -105,7 +105,7 @@ public class ButtonRenderer extends Comm
 
     if (button instanceof UIButton && ((UIButton) component).isDefaultCommand()) {
       final AbstractUIForm form = ComponentUtils.findAncestor(component, AbstractUIForm.class);
-      writer.writeAttribute(DataAttributes.DEFAULT, form.getClientId(facesContext), false);
+      writer.writeAttribute(DataAttributes.DEFAULT.getValue(), form.getClientId(facesContext), false);
     }
     writer.flush(); // force closing the start tag
 

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CalendarRenderer.java Thu Oct  8 14:55:05 2015
@@ -19,17 +19,8 @@
 
 package org.apache.myfaces.tobago.renderkit.html.standard.standard.tag;
 
-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.model.CalendarModel;
-import org.apache.myfaces.tobago.model.DateModel;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Style;
-import org.apache.myfaces.tobago.renderkit.html.DataAttributes;
-import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
@@ -37,11 +28,6 @@ import org.apache.myfaces.tobago.webapp.
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Locale;
 
 public class CalendarRenderer extends RendererBase {
 
@@ -51,157 +37,10 @@ public class CalendarRenderer extends Re
     final UICalendar output = (UICalendar) component;
     final String id = output.getClientId(facesContext);
 
-    final Locale locale = facesContext.getViewRoot().getLocale();
-
-    final Object value = output.getValue();
-    final Calendar calendar;
-    if (value instanceof Calendar) {
-      calendar = (Calendar) value;
-    } else { 
-      calendar = new GregorianCalendar();
-      if (value instanceof Date) {
-        calendar.setTime((Date) value);
-      }
-    }
-    final CalendarModel model = new CalendarModel(calendar);
-
-    // rendering
     final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-
-    writer.startElement(HtmlElements.DIV, component);
+    writer.startElement(HtmlElements.SPAN, component);
     writer.writeIdAttribute(id);
-    writer.writeClassAttribute(Classes.create(output), output.getCustomClass());
-    HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
-    final Style style = output.getStyle();
-    writer.writeStyleAttribute(style);
-    final String dateInputId = (String) output.getAttributes().get(Attributes.DATE_INPUT_ID);
-    if (dateInputId != null) {
-      writer.writeAttribute(DataAttributes.DATE_INPUT_ID, dateInputId, false);
-    }
-    writer.writeAttribute(DataAttributes.DAY, Integer.toString(calendar.get(Calendar.YEAR)), false);
-    writer.writeAttribute(DataAttributes.MONTH, Integer.toString(1 + calendar.get(Calendar.MONTH)), false);
-    writer.writeAttribute(DataAttributes.YEAR, Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)), false);
-
-    writer.writeAttribute(DataAttributes.FIRST_DAY_OF_WEEK, Integer.toString(calendar.getFirstDayOfWeek()), false);
-    writer.writeAttribute(DataAttributes.MONTH_NAMES, getMonthNames(locale), false);
-
-    // begin header
-    writer.startElement(HtmlElements.DIV, null);
-    writer.writeClassAttribute(Classes.create(output, "row"));
-
-    writer.startElement(HtmlElements.IMG, null);
-    writer.writeClassAttribute(Classes.create(output, "header"));
-    writer.writeAttribute(HtmlAttributes.ALT, "", false);
-    writer.writeAttribute(HtmlAttributes.SRC,
-        ResourceManagerUtils.getImage(facesContext, "image/calendarFastPrev"), false);
-    writer.writeAttribute(DataAttributes.COMMAND, "fastPrev", false);
-    writer.endElement(HtmlElements.IMG);
-
-    writer.startElement(HtmlElements.IMG, null);
-    writer.writeClassAttribute(Classes.create(output, "header"));
-    writer.writeAttribute(HtmlAttributes.ALT, "", false);
-    writer.writeAttribute(HtmlAttributes.SRC,
-        ResourceManagerUtils.getImage(facesContext, "image/calendarPrev"), false);
-    writer.writeAttribute(DataAttributes.COMMAND, "prev", false);
-    writer.endElement(HtmlElements.IMG);
-
-    writer.startElement(HtmlElements.SPAN, null);
-    writer.writeClassAttribute(Classes.create(output, "header"));
-
-    writer.startElement(HtmlElements.SPAN, null);
-    writer.writeAttribute(DataAttributes.COMMAND, "month", false);
-    writer.writeText(new SimpleDateFormat("MMMMM", locale).format(calendar.getTime()));
-    writer.endElement(HtmlElements.SPAN);
-
-    writer.writeText(" "); // non breaking space
-
-    writer.startElement(HtmlElements.SPAN, null);
-    writer.writeAttribute(DataAttributes.COMMAND, "year", false);
-    writer.writeText(new SimpleDateFormat("yyyy", locale).format(calendar.getTime()));
+    writer.writeText("[tc:calender is currently not implemented]");
     writer.endElement(HtmlElements.SPAN);
-
-    writer.endElement(HtmlElements.SPAN);
-
-    writer.startElement(HtmlElements.IMG, null);
-    writer.writeClassAttribute(Classes.create(output, "header"));
-    writer.writeAttribute(HtmlAttributes.ALT, "", false);
-    writer.writeAttribute(HtmlAttributes.SRC,
-        ResourceManagerUtils.getImage(facesContext, "image/calendarNext"), false);
-    writer.writeAttribute(DataAttributes.COMMAND, "next", false);
-    writer.endElement(HtmlElements.IMG);
-
-    writer.startElement(HtmlElements.IMG, null);
-    writer.writeClassAttribute(Classes.create(output, "header"));
-    writer.writeAttribute(HtmlAttributes.ALT, "", false);
-    writer.writeAttribute(HtmlAttributes.SRC,
-        ResourceManagerUtils.getImage(facesContext, "image/calendarFastNext"), false);
-    writer.writeAttribute(DataAttributes.COMMAND, "fastNext", false);
-    writer.endElement(HtmlElements.IMG);
-
-    writer.endElement(HtmlElements.DIV);
-    // end header
-
-    // begin weeks
-    writer.startElement(HtmlElements.DIV, null);
-    writer.writeClassAttribute(Classes.create(output, "row"));
-
-    final SimpleDateFormat dayInWeekFormat = new SimpleDateFormat("E", locale);
-    for (int dayIt = 0; dayIt < 7; ++dayIt) {
-      final DateModel date = model.getDate(0, dayIt);
-      String dayName = dayInWeekFormat.format(date.getCalendar().getTime());
-      if (dayName != null && dayName.length() > 2) {
-        dayName = dayName.substring(0, 2);
-      }
-
-      writer.startElement(HtmlElements.SPAN, null);
-      writer.writeClassAttribute(Classes.create(output, "dayOfWeek"));
-      writer.writeText(dayName);
-      writer.endElement(HtmlElements.SPAN);
-    }
-
-    writer.endElement(HtmlElements.DIV);
-    // end weeks
-
-    // begin grid
-    writer.startElement(HtmlElements.DIV, null);
-    writer.writeClassAttribute(Classes.create(output, "grid"));
-    for (int week = 0; week < 6; ++week) {
-      writer.startElement(HtmlElements.DIV, null);
-      writer.writeClassAttribute(Classes.create(output, "row"));
-
-      for (int dayIt = 0; dayIt < 7; ++dayIt) {
-        final DateModel date = model.getDate(week, dayIt);
-        final String dayDescription = String.valueOf(date.getDay());
-
-        writer.startElement(HtmlElements.SPAN, null);
-        writer.writeClassAttribute(
-            Classes.create(output, "day", date.getMonth() == model.getMonth() ? null : Markup.DISABLED));
-
-        writer.writeText(dayDescription);
-
-        writer.endElement(HtmlElements.SPAN);
-      }
-      writer.endElement(HtmlElements.DIV);
-    }
-    writer.endElement(HtmlElements.DIV);
-    // end grid
-
-    writer.endElement(HtmlElements.DIV);
-  }
-  
-  private String getMonthNames(final Locale locale) {
-    final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM", locale);
-    final StringBuilder buffer = new StringBuilder(64);
-    final Calendar calendar = Calendar.getInstance();
-    calendar.set(2000, Calendar.JANUARY, 1);
-    for (int month = 0; month < 12; ++month) {
-      if (month > 0) {
-        buffer.append(',');
-      }
-      buffer.append(dateFormat.format(calendar.getTime()));
-      calendar.add(java.util.Calendar.MONTH, 1);
-    }
-    return buffer.toString();
   }
-
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/CommandRenderer.java Thu Oct  8 14:55:05 2015
@@ -72,7 +72,7 @@ public class CommandRenderer extends Com
       writer.startElement(HtmlElements.A, link);
 
       final CommandMap map = new CommandMap(new Command(facesContext, link));
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
 
       writer.writeAttribute(HtmlAttributes.HREF, "#", false);
 
@@ -90,7 +90,7 @@ public class CommandRenderer extends Com
     writer.writeStyleAttribute(link.getStyle());
     if (link.isParentOfCommands()) {
       writer.writeClassAttribute(BootstrapClass.DROPDOWN_TOGGLE); // todo: CSS classes
-      writer.writeAttribute(DataAttributes.TOGGLE, "dropdown", false);
+      writer.writeAttribute(DataAttributes.TOGGLE.getValue(), "dropdown", false);
     } else {
       writer.writeClassAttribute(Classes.create(link), link.getCustomClass());
     }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java Thu Oct  8 14:55:05 2015
@@ -46,9 +46,9 @@ public class DateRenderer extends InRend
     final AbstractUIDate date = (AbstractUIDate) input;
 
     super.writeAdditionalAttributes(facesContext, writer, date);
-    writer.writeAttribute(DataAttributes.PATTERN, date.getPattern(), true);
+    writer.writeAttribute(DataAttributes.PATTERN.getValue(), date.getPattern(), true);
     final DateTimeI18n dateTimeI18n = DateTimeI18n.valueOf(facesContext.getViewRoot().getLocale());
-    writer.writeAttribute(DataAttributes.DATE_TIME_I18N, JsonUtils.encode(dateTimeI18n), true);
+    writer.writeAttribute(DataAttributes.DATE_TIME_I18N.getValue(), JsonUtils.encode(dateTimeI18n), true);
   }
 
   @Override

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/LinkRenderer.java Thu Oct  8 14:55:05 2015
@@ -59,7 +59,7 @@ public class LinkRenderer extends Comman
       writer.startElement(HtmlElements.A, link);
 
       final CommandMap map = new CommandMap(new Command(facesContext, link));
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
 
       writer.writeAttribute(HtmlAttributes.HREF, "#", false);
 

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MenuCommandRenderer.java Thu Oct  8 14:55:05 2015
@@ -157,9 +157,9 @@ public class MenuCommandRenderer extends
     }
     writer.writeClassAttribute(css);
     if (!disabled) {
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
     }
-    writer.writeAttribute(DataAttributes.VALUE, value, true);
+    writer.writeAttribute(DataAttributes.VALUE.getValue(), value, true);
 
     if (command != null) {
       HtmlRendererUtils.writeDataAttributes(facesContext, writer, command);
@@ -180,8 +180,8 @@ public class MenuCommandRenderer extends
         final String imageHover = ResourceManagerUtils
             .getImageOrDisabledImage(facesContext, image + "Hover", disabled, true);
         if (imageHover != null) {
-          writer.writeAttribute(DataAttributes.SRC_DEFAULT, imageWithPath, false);
-          writer.writeAttribute(DataAttributes.SRC_HOVER, imageHover, false);
+          writer.writeAttribute(DataAttributes.SRC_DEFAULT.getValue(), imageWithPath, false);
+          writer.writeAttribute(DataAttributes.SRC_HOVER.getValue(), imageHover, false);
         }
 
         writer.writeAttribute(HtmlAttributes.ALT, "", true);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/MessagesRenderer.java Thu Oct  8 14:55:05 2015
@@ -118,7 +118,7 @@ public class MessagesRenderer extends Re
           writer.startElement(HtmlElements.BUTTON, null);
           writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON, false);
           writer.writeClassAttribute(BootstrapClass.CLOSE);
-          writer.writeAttribute(DataAttributes.DISMISS, "alert", false);
+          writer.writeAttribute(DataAttributes.DISMISS.getValue(), "alert", false);
           writer.writeAttribute(Aria.ACTIVEDESCENDANT.getValue(), "Close", false); // todo: i18n
           writer.startElement(HtmlElements.SPAN, null);
           writer.writeAttribute(Aria.HIDDEN.getValue(), Boolean.TRUE.toString(), false);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/NavRenderer.java Thu Oct  8 14:55:05 2015
@@ -113,8 +113,8 @@ public class NavRenderer extends Rendere
     writer.startElement(HtmlElements.BUTTON, null);
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON, false);
     writer.writeClassAttribute(BootstrapClass.NAVBAR_TOGGLE, BootstrapClass.COLLAPSED);
-    writer.writeAttribute(DataAttributes.TOGGLE, "collapse", false);
-    writer.writeAttribute(DataAttributes.TARGET, JQueryUtils.escapeIdForHtml(navbarId), true);
+    writer.writeAttribute(DataAttributes.TOGGLE.getValue(), "collapse", false);
+    writer.writeAttribute(DataAttributes.TARGET.getValue(), JQueryUtils.escapeIdForHtml(navbarId), true);
     writer.writeAttribute("aria-expanded", Boolean.FALSE.toString(), false);
     writer.writeAttribute("aria-controls", navbarId, false);
 

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PageRenderer.java Thu Oct  8 14:55:05 2015
@@ -236,7 +236,7 @@ public class PageRenderer extends Render
     }
     writer.writeAttribute(HtmlAttributes.ACTION, formAction, true);
     if (partialAction != null) {
-      writer.writeAttribute(DataAttributes.PARTIAL_ACTION, partialAction, true);
+      writer.writeAttribute(DataAttributes.PARTIAL_ACTION.getValue(), partialAction, true);
     }
     if (LOG.isDebugEnabled()) {
       LOG.debug("partial action = " + partialAction);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/PanelRenderer.java Thu Oct  8 14:55:05 2015
@@ -74,7 +74,7 @@ public class PanelRenderer extends Rende
       final UIComponent facetReload = panel.getFacet(Facets.RELOAD);
       if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
         final UIReload update = (UIReload) facetReload;
-        writer.writeAttribute(DataAttributes.RELOAD, Integer.toString(update.getFrequency()), false);
+        writer.writeAttribute(DataAttributes.RELOAD.getValue(), Integer.toString(update.getFrequency()), false);
       }
     }
     HtmlRendererUtils.renderCommandFacet(panel, facesContext, writer);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Thu Oct  8 14:55:05 2015
@@ -151,14 +151,14 @@ public class SheetRenderer extends Rende
     final UIComponent facetReload = sheet.getFacet(Facets.RELOAD);
     if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
       final UIReload update = (UIReload) facetReload;
-      writer.writeAttribute(DataAttributes.RELOAD, update.getFrequency());
+      writer.writeAttribute(DataAttributes.RELOAD.getValue(), update.getFrequency());
     }
     final String[] clientIds = ComponentUtils.evaluateClientIds(facesContext, sheet, sheet.getRenderedPartially());
     if (clientIds.length > 0) {
-      writer.writeAttribute(DataAttributes.PARTIAL_IDS, JsonUtils.encode(clientIds), true);
+      writer.writeAttribute(DataAttributes.PARTIAL_IDS.getValue(), JsonUtils.encode(clientIds), true);
     }
-    writer.writeAttribute(DataAttributes.SELECTION_MODE, sheet.getSelectable().name(), false);
-    writer.writeAttribute(DataAttributes.FIRST, Integer.toString(sheet.getFirst()), false);
+    writer.writeAttribute(DataAttributes.SELECTION_MODE.getValue(), sheet.getSelectable().name(), false);
+    writer.writeAttribute(DataAttributes.FIRST.getValue(), Integer.toString(sheet.getFirst()), false);
 
     final boolean rowAction = HtmlRendererUtils.renderSheetCommands(sheet, facesContext, writer);
 
@@ -280,7 +280,7 @@ public class SheetRenderer extends Rende
       writer.startElement(HtmlElements.TR, null);
       if (rowRendered instanceof Boolean) {
         // if rowRendered attribute is set we need the rowIndex on the client
-        writer.writeAttribute(DataAttributes.ROW_INDEX, rowIndex);
+        writer.writeAttribute(DataAttributes.ROW_INDEX.getValue(), rowIndex);
       }
       final boolean selected = selectedRows.contains(rowIndex);
       final String[] rowMarkups = (String[]) sheet.getAttributes().get("rowMarkup");
@@ -299,7 +299,7 @@ public class SheetRenderer extends Rende
       }
       final String parentId = sheet.getRowParentClientId();
       if (parentId != null) {
-        writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
+        writer.writeAttribute(DataAttributes.TREE_PARENT.getValue(), parentId, false);
       }
 
       int columnIndex = -1;
@@ -745,7 +745,7 @@ public class SheetRenderer extends Rende
     writer.writeAttribute(HtmlAttributes.SRC, image, false);
     writer.writeAttribute(HtmlAttributes.TITLE, tip, true);
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
-    writer.writeAttribute(DataAttributes.DISABLED, disabled);
+    writer.writeAttribute(DataAttributes.DISABLED.getValue(), disabled);
     writer.endElement(HtmlElements.IMG);
   }
 
@@ -836,7 +836,7 @@ public class SheetRenderer extends Rende
               final Command click = new Command(
                   sortCommand.getClientId(facesContext), null, null, null, clientIds, null, null, null, null, null);
               map.setClick(click);
-              writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+              writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
 
               if (tip == null) {
                 tip = "";
@@ -998,7 +998,7 @@ public class SheetRenderer extends Rende
     menuItem.setLabel(ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", label));
     menuItem.setMarkup(markup);
     menuItem.setOmit(true);
-    ComponentUtils.putDataAttributeWithPrefix(menuItem, DataAttributes.SHEET_ID, sheetId);
+    ComponentUtils.putDataAttributeWithPrefix(menuItem, DataAttributes.SHEET_ID.getValue(), sheetId);
     menu.getChildren().add(menuItem);
   }
 
@@ -1129,7 +1129,7 @@ public class SheetRenderer extends Rende
     writer.startElement(innerElement, null);
     writer.writeClassAttribute(Classes.create(sheet, "pagingLink"));
     if (pagingLinkType == PagingLinkType.NORMAL) {
-      writer.writeAttribute(DataAttributes.TO_PAGE, toPage);
+      writer.writeAttribute(DataAttributes.TO_PAGE.getValue(), toPage);
       writer.writeAttribute(HtmlAttributes.HREF, "#", false);
     }
     writer.flush();

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SuggestRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SuggestRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SuggestRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SuggestRenderer.java Thu Oct  8 14:55:05 2015
@@ -52,11 +52,11 @@ public class SuggestRenderer extends Ren
       totalCount = list.size();
     }
 
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_MIN_CHARS), suggest.getMinimumCharacters());
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_DELAY), suggest.getDelay());
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_MAX_ITEMS), suggest.getMaximumItems());
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_UPDATE), suggest.isUpdate());
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_TOTAL_COUNT), totalCount);
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_MIN_CHARS.getValue()), suggest.getMinimumCharacters());
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_DELAY.getValue()), suggest.getDelay());
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_MAX_ITEMS.getValue()), suggest.getMaximumItems());
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_UPDATE.getValue()), suggest.isUpdate());
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_TOTAL_COUNT.getValue()), totalCount);
 
 // tbd    final String title
 // tbd       = ResourceManagerUtils.getPropertyNotNull(facesContext, "tobago", "tobago.in.inputSuggest.moreElements");
@@ -66,7 +66,7 @@ public class SuggestRenderer extends Ren
       array[i] = list.get(i).getLabel();
     }
 
-    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_DATA), JsonUtils.encode(array));
+    ComponentUtils.putDataAttribute(in, cut(DataAttributes.SUGGEST_DATA.getValue()), JsonUtils.encode(array));
 
     super.prepareRender(facesContext, component);
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TabGroupRenderer.java Thu Oct  8 14:55:05 2015
@@ -111,7 +111,7 @@ public class TabGroupRenderer extends Re
     final String[] clientIds
         = ComponentUtils.evaluateClientIds(facesContext, tabGroup, tabGroup.getRenderedPartially());
     if (clientIds.length > 0) {
-      writer.writeAttribute(DataAttributes.PARTIAL_IDS, JsonUtils.encode(clientIds), true);
+      writer.writeAttribute(DataAttributes.PARTIAL_IDS.getValue(), JsonUtils.encode(clientIds), true);
     }
 
     writer.startElement(HtmlElements.INPUT, null);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRenderer.java Thu Oct  8 14:55:05 2015
@@ -60,7 +60,7 @@ public class ToolBarRenderer extends Ren
     writer.startElement(HtmlElements.BUTTON, null);
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON, false);
     writer.writeClassAttribute(BootstrapClass.NAVBAR_TOGGLE);
-    writer.writeAttribute(DataAttributes.TOGGLE, "collapse", false);
+    writer.writeAttribute(DataAttributes.TOGGLE.getValue(), "collapse", false);
     writer.writeAttribute("data-target", JQueryUtils.escapeIdForHtml(toolBar.getClientId(facesContext)), true);
 
     writer.startElement(HtmlElements.SPAN, null);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ToolBarRendererBase.java Thu Oct  8 14:55:05 2015
@@ -284,11 +284,11 @@ public abstract class ToolBarRendererBas
       writer.writeIdAttribute(command.getClientId(facesContext));
     }
     if (map != null) {
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
     }
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, command);
     if (value != null) {
-      writer.writeAttribute(DataAttributes.VALUE, value, true);
+      writer.writeAttribute(DataAttributes.VALUE.getValue(), value, true);
     }
 
     // render icon

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeCommandRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeCommandRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeCommandRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeCommandRenderer.java Thu Oct  8 14:55:05 2015
@@ -83,7 +83,7 @@ public class TreeCommandRenderer extends
     } else {
       writer.startElement(HtmlElements.A, command);
       final CommandMap map = new CommandMap(new Command(facesContext, command));
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(map), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(map), true);
       writer.writeNameAttribute(clientId);
     }
     writer.writeStyleAttribute(style);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIconRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIconRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIconRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeIconRenderer.java Thu Oct  8 14:55:05 2015
@@ -111,8 +111,8 @@ public class TreeIconRenderer extends Re
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, image);
     writer.writeAttribute(HtmlAttributes.SRC, source, true);
     if (folder) {
-      writer.writeAttribute(DataAttributes.SRC_OPEN, openSource, true);
-      writer.writeAttribute(DataAttributes.SRC_CLOSE, closedSource, true);
+      writer.writeAttribute(DataAttributes.SRC_OPEN.getValue(), openSource, true);
+      writer.writeAttribute(DataAttributes.SRC_CLOSE.getValue(), closedSource, true);
     }
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
     writer.endElement(HtmlElements.IMG);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeListboxRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeListboxRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeListboxRenderer.java Thu Oct  8 14:55:05 2015
@@ -103,7 +103,7 @@ public class TreeListboxRenderer extends
       writer.writeNameAttribute(clientId + AbstractUITree.SELECT_STATE);
       writer.writeIdAttribute(clientId + AbstractUITree.SELECT_STATE);
       writer.writeAttribute(HtmlAttributes.VALUE, ";", false);
-      writer.writeAttribute(DataAttributes.SELECTION_MODE, tree.getSelectable().name(), false);
+      writer.writeAttribute(DataAttributes.SELECTION_MODE.getValue(), tree.getSelectable().name(), false);
       writer.endElement(HtmlElements.INPUT);
     }
 
@@ -165,7 +165,7 @@ public class TreeListboxRenderer extends
     writer.startElement(HtmlElements.SELECT, tree);
     writer.writeClassAttribute(Classes.create(tree, "select"));
     if (parentId != null) {
-      writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
+      writer.writeAttribute(DataAttributes.TREE_PARENT.getValue(), parentId, false);
     }
 
     writer.writeAttribute(HtmlAttributes.SIZE, 9); // must be > 1, but the real size comes from the layout

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeMenuNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeMenuNodeRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeMenuNodeRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeMenuNodeRenderer.java Thu Oct  8 14:55:05 2015
@@ -61,7 +61,7 @@ public class TreeMenuNodeRenderer extend
     writer.writeClassAttribute(Classes.create(node));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, node);
     if (parentId != null) {
-      writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
+      writer.writeAttribute(DataAttributes.TREE_PARENT.getValue(), parentId, false);
     }
 
     // In the case of a sheet, we need not hiding the node, because the whole TR will be hidden.
@@ -110,8 +110,8 @@ public class TreeMenuNodeRenderer extend
     writer.startElement(HtmlElements.IMG, null);
     writer.writeClassAttribute(Classes.create(node, "toggle"));
     writer.writeAttribute(HtmlAttributes.SRC, src, false);
-    writer.writeAttribute(DataAttributes.SRC_OPEN, srcOpen, false);
-    writer.writeAttribute(DataAttributes.SRC_CLOSE, srcClose, false);
+    writer.writeAttribute(DataAttributes.SRC_OPEN.getValue(), srcOpen, false);
+    writer.writeAttribute(DataAttributes.SRC_CLOSE.getValue(), srcClose, false);
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
     writer.endElement(HtmlElements.IMG);
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeNodeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeNodeRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeNodeRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeNodeRenderer.java Thu Oct  8 14:55:05 2015
@@ -56,7 +56,7 @@ public class TreeNodeRenderer extends Tr
     writer.writeClassAttribute(Classes.create(node));
     HtmlRendererUtils.writeDataAttributes(facesContext, writer, node);
     if (parentId != null) {
-      writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
+      writer.writeAttribute(DataAttributes.TREE_PARENT.getValue(), parentId, false);
     }
 
     Style style = node.getStyle();

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/TreeRenderer.java Thu Oct  8 14:55:05 2015
@@ -89,7 +89,7 @@ public class TreeRenderer extends Render
 
     final Selectable selectable = tree.getSelectable();
     if (selectable.isSupportedByTree()) {
-      writer.writeAttribute(DataAttributes.SELECTABLE, selectable.name(), false);
+      writer.writeAttribute(DataAttributes.SELECTABLE.getValue(), selectable.name(), false);
     }
 
     final SelectedState selectedState = tree.getSelectedState();

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java?rev=1707558&r1=1707557&r2=1707558&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java Thu Oct  8 14:55:05 2015
@@ -305,7 +305,7 @@ public final class HtmlRendererUtils {
       }
     }
     if (commandMap != null) {
-      writer.writeAttribute(DataAttributes.COMMANDS, JsonUtils.encode(commandMap), true);
+      writer.writeAttribute(DataAttributes.COMMANDS.getValue(), JsonUtils.encode(commandMap), true);
     }
   }
 
@@ -328,7 +328,7 @@ public final class HtmlRendererUtils {
       }
     }
     if (commandMap != null) {
-      writer.writeAttribute(DataAttributes.ROW_ACTION, JsonUtils.encode(commandMap), true);
+      writer.writeAttribute(DataAttributes.ROW_ACTION.getValue(), JsonUtils.encode(commandMap), true);
       return true;
     }
     return false;