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 2013/04/29 15:34:49 UTC

svn commit: r1477055 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/ tobago-core/src/main/java/org/apache/myfaces/tobago/util/ tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/ tobago-core/src/...

Author: lofwyr
Date: Mon Apr 29 13:34:48 2013
New Revision: 1477055

URL: http://svn.apache.org/r1477055
Log:
TOBAGO-1145: The tobago-deprecation.jar will be reduced in Tobago 2.0

Added:
    myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java
      - copied unchanged from r1469744, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/StyleClasses.java
Removed:
    myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/renderkit/html/StyleClassesUnitTest.java
Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java?rev=1477055&r1=1477054&r2=1477055&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/webapp/TobagoResponseWriterBase.java Mon Apr 29 13:34:48 2013
@@ -19,11 +19,8 @@
 
 package org.apache.myfaces.tobago.internal.webapp;
 
-import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.internal.util.Deprecation;
-import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -264,15 +261,15 @@ public abstract class TobagoResponseWrit
   }
 
   @Override
+  /**
+   * @deprecated Since Tobago 2.0.0
+   */
   @Deprecated
   public String getStyleClasses() {
     if (component == null) {
       return null;
     }
-    StyleClasses clazz = (StyleClasses) component.getAttributes().get(Attributes.STYLE_CLASS);
-    if (clazz != null) {
-      return clazz.toString();
-    }
+    Deprecation.LOG.error("Can't get style classes.");
     return null;
   }
 
@@ -281,11 +278,7 @@ public abstract class TobagoResponseWrit
    */
   @Deprecated
   public void writeClassAttribute() throws IOException {
-    Deprecation.LOG.warn("Please use writeClassAttribute(org.apache.myfaces.tobago.renderkit.css.Classes)");
-    StyleClasses clazz = (StyleClasses) component.getAttributes().get(Attributes.STYLE_CLASS);
-    if (clazz != null) {
-      writeAttribute(HtmlAttributes.CLASS, clazz.toString(), false);
-    }
+    Deprecation.LOG.error("Please use writeClassAttribute(org.apache.myfaces.tobago.renderkit.css.Classes)");
   }
 
 

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1477055&r1=1477054&r2=1477055&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Mon Apr 29 13:34:48 2013
@@ -33,9 +33,9 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.component.AbstractUIInput;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPage;
 import org.apache.myfaces.tobago.internal.component.AbstractUIPopup;
+import org.apache.myfaces.tobago.internal.util.Deprecation;
 import org.apache.myfaces.tobago.internal.util.FindComponentUtils;
 import org.apache.myfaces.tobago.renderkit.RendererBase;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -470,24 +470,13 @@ public class ComponentUtils {
   }
 
   /**
-   * @deprecated Please define a {@link Markup} and set it to the component with
+   * @deprecated since 1.5.0
+   * Please define a {@link Markup} and set it to the component with
    * {@link SupportsMarkup#setMarkup(Markup markup)} before the rendering phase.
    */
   @Deprecated
   public static void setStyleClasses(UIComponent component, String styleClasses) {
-    if (styleClasses != null) {
-      if (UIComponentTag.isValueReference(styleClasses)) {
-        component.setValueBinding(Attributes.STYLE_CLASS, createValueBinding(styleClasses));
-      } else {
-        String[] classes = splitList(styleClasses);
-        if (classes.length > 0) {
-          StyleClasses styles = StyleClasses.ensureStyleClasses(component);
-          for (String clazz : classes) {
-            styles.addFullQualifiedClass(clazz);
-          }
-        }
-      }
-    }
+    Deprecation.LOG.warn("style class " + styleClasses);
   }
 
   /**

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java?rev=1477055&r1=1477054&r2=1477055&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java Mon Apr 29 13:34:48 2013
@@ -25,7 +25,6 @@ import org.apache.myfaces.tobago.renderk
 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.StyleClasses;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -135,15 +134,6 @@ public abstract class TobagoResponseWrit
 
   /**
    * Write the class attribute. The value will not escaped.
-   * @deprecated since Tobago 1.5.0
-   */
-  @Deprecated
-  public void writeClassAttribute(StyleClasses styleClasses) throws IOException {
-    writeAttribute(HtmlAttributes.CLASS, styleClasses.toString(), false);
-  }
-
-  /**
-   * Write the class attribute. The value will not escaped.
    * <br/>
    * <b>Note:</b> For backward compatibility the value of the Attribute
    * <code>{@link org.apache.myfaces.tobago.component.Attributes#STYLE_CLASS}</code>

Modified: myfaces/tobago/trunk/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/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java?rev=1477055&r1=1477054&r2=1477055&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/util/HtmlRendererUtils.java Mon Apr 29 13:34:48 2013
@@ -42,7 +42,6 @@ import org.apache.myfaces.tobago.renderk
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
 import org.apache.myfaces.tobago.renderkit.html.JsonUtils;
-import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.apache.myfaces.tobago.util.FacetUtils;
@@ -126,12 +125,13 @@ public final class HtmlRendererUtils {
     }
   }
 
+  /**
+   * @deprecated Since Tobago 2.0.0
+   */
+  @Deprecated
   public static void createCssClass(FacesContext facesContext, UIComponent component) {
     String rendererName = getRendererName(facesContext, component);
-    if (rendererName != null) {
-      StyleClasses classes = StyleClasses.ensureStyleClasses(component);
-      classes.updateClassAttributeAndMarkup(component, rendererName);
-    }
+    Deprecation.LOG.error("Can't render style class for renderer " + rendererName);
   }
 
   public static String getRendererName(FacesContext facesContext, UIComponent component) {
@@ -577,10 +577,6 @@ public final class HtmlRendererUtils {
     if (objDndData != null) {
       writer.writeAttribute("dndData", String.valueOf(objDndData), false);
     }
-    if (addStyle && (null != objDndType || null != objDndData)) {
-      StyleClasses styles = StyleClasses.ensureStyleClasses(component);
-      styles.addFullQualifiedClass("dojoDndItem");
-    }
   }
 
   private static String createDojoDndType(UIComponent component, String clientId, String dojoType) {
@@ -808,18 +804,7 @@ public final class HtmlRendererUtils {
    */
   @Deprecated
   public static void removeStyleClasses(UIComponent cell) {
-    Object obj = cell.getAttributes().get(Attributes.STYLE_CLASS);
-    if (obj != null && obj instanceof StyleClasses && cell.getRendererType() != null) {
-      StyleClasses styleClasses = (StyleClasses) obj;
-      if (!styleClasses.isEmpty()) {
-        String rendererName = cell.getRendererType().substring(0, 1).toLowerCase(Locale.ENGLISH)
-            + cell.getRendererType().substring(1);
-        styleClasses.removeTobagoClasses(rendererName);
-      }
-      if (styleClasses.isEmpty()) {
-        cell.getAttributes().remove(Attributes.STYLE_CLASS);
-      }
-    }
+    Deprecation.LOG.warn("cell = '" + cell + "'");
   }
 
   public static void encodeContextMenu(FacesContext facesContext, TobagoResponseWriter writer, UIComponent parent)