myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1702488 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/ tobago-extension/tobago-sandbox/src/main/java/org/apache/myf...
Date Fri, 11 Sep 2015 14:56:28 GMT
Author: lofwyr
Date: Fri Sep 11 14:56:27 2015
New Revision: 1702488

URL: http://svn.apache.org/r1702488
Log:
TOBAGO-1489: Optimize enums used for attributes in taglib.
* Position

Added:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java
      - copied, changed from r1701980, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Position.java
Removed:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Position.java
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java

Copied: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java
(from r1701980, myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Position.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java?p2=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java&p1=myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Position.java&r1=1701980&r2=1702488&rev=1702488&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Position.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java
Fri Sep 11 14:56:27 2015
@@ -17,21 +17,41 @@
  * under the License.
  */
 
-package org.apache.myfaces.tobago.renderkit.css;
+package org.apache.myfaces.tobago.layout;
 
+/**
+ * Values for position used with CSS.
+ *
+ * Note: the enums are not capitalized, because of problems with {@link java.beans.PropertyEditor}.
+ */
 public enum Position {
 
-  ABSOLUTE("absolute"),
-  RELATIVE("relative"),
-  FIXED("fixed"), // not supported in IE 6
-  STATIC("static");
+  absolute,
+  relative,
+  fixed;
+//  static; XXX not possible
 
   private String value;
 
-  Position(final String value) {
-    this.value = value;
-  }
-
+  /**
+   * Internal constant to use in annotations. Please use {@link Position#absolute}
+   */
+  public static final String STRING_ABSOLUTE = "absolute";
+
+  /**
+   * Internal constant to use in annotations. Please use {@link Position#relative}
+   */
+  public static final String STRING_RELATIVE = "relative";
+
+  /**
+   * Internal constant to use in annotations. Please use {@link Position#fixed}
+   */
+  public static final String STRING_FIXED = "fixed";
+
+
+  /**
+   * @deprecated Since Tobago 3.0.0 Please use {@link Position:name}
+   */
   public String getValue() {
     return value;
   }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java?rev=1702488&r1=1702487&r2=1702488&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
Fri Sep 11 14:56:27 2015
@@ -24,6 +24,7 @@ import org.apache.myfaces.tobago.layout.
 import org.apache.myfaces.tobago.layout.LayoutComponent;
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.layout.Position;
 import org.apache.myfaces.tobago.layout.TextAlign;
 
 import javax.faces.context.FacesContext;
@@ -96,7 +97,7 @@ public class Style implements Serializab
     // if there are a position coordinates, activate absolute positioning
     // XXX String "Page" is not nice here
     if ((left != null || top != null) && !rendererType.contains("Page")) {
-      position = Position.ABSOLUTE;
+      position = Position.absolute;
     }
 
     if (layout instanceof LayoutComponent) { // fixme

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java?rev=1702488&r1=1702487&r2=1702488&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/sandbox/standard/tag/NumberSliderRenderer.java
Fri Sep 11 14:56:27 2015
@@ -24,7 +24,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Position;
+import org.apache.myfaces.tobago.layout.Position;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -147,7 +147,7 @@ public class NumberSliderRenderer extend
     writer.startElement(HtmlElements.DIV, null);
     writer.writeIdAttribute(getIdForSliderHandle(facesContext, slider));
     final Style handleStyle = new Style();
-    handleStyle.setPosition(Position.RELATIVE);
+    handleStyle.setPosition(Position.relative);
     handleStyle.setTop(Measure.valueOf(-6));
     handleStyle.setWidth(Measure.valueOf(12));
     handleStyle.setHeight(Measure.valueOf(6));

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java?rev=1702488&r1=1702487&r2=1702488&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java
(original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SplitLayoutRenderer.java
Fri Sep 11 14:56:27 2015
@@ -30,7 +30,7 @@ import org.apache.myfaces.tobago.layout.
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.css.Classes;
-import org.apache.myfaces.tobago.renderkit.css.Position;
+import org.apache.myfaces.tobago.layout.Position;
 import org.apache.myfaces.tobago.renderkit.css.Style;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlElements;
@@ -148,8 +148,9 @@ public class SplitLayoutRenderer extends
       style.setLeft(Measure.valueOf(0));
       style.setTop(Measure.valueOf(Measure.valueOf(secondComponent.getTop().subtract(5))));
     }
+    // todo: use CSS class
     style.setDisplay(Display.BLOCK);
-    style.setPosition(Position.ABSOLUTE);
+    style.setPosition(Position.absolute);
     return style;
   }
 }



Mime
View raw message