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 2016/02/18 00:31:11 UTC
svn commit: r1730976 - in
/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src:
main/java/org/apache/myfaces/tobago/internal/taglib/component/
main/java/org/apache/myfaces/tobago/layout/
main/java/org/apache/myfaces/tobago/renderkit/css/ test/java/org...
Author: lofwyr
Date: Wed Feb 17 23:31:11 2016
New Revision: 1730976
URL: http://svn.apache.org/viewvc?rev=1730976&view=rev
Log:
TOBAGO-1501: Refactoring: using further enums
* simplify name tests
Added:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/PositionUnitTest.java
Modified:
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java
myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/Style.java
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java?rev=1730976&r1=1730975&r2=1730976&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/StyleTagDeclaration.java Wed Feb 17 23:31:11 2016
@@ -243,7 +243,7 @@ public interface StyleTagDeclaration ext
@TagAttribute()
@UIComponentTagAttribute(
type = "org.apache.myfaces.tobago.layout.Position",
- allowedValues = {Position.STRING_ABSOLUTE, Position.STRING_RELATIVE, Position.STRING_FIXED})
+ allowedValues = {Position.ABSOLUTE, Position.RELATIVE, Position.FIXED})
void setPosition(String position);
/**
Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/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?rev=1730976&r1=1730975&r2=1730976&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/Position.java Wed Feb 17 23:31:11 2016
@@ -31,28 +31,18 @@ public enum Position {
fixed;
// static; XXX not possible
- private String value;
-
/**
* Internal constant to use in annotations. Please use {@link Position#absolute}
*/
- public static final String STRING_ABSOLUTE = "absolute";
+ public static final String ABSOLUTE = "absolute";
/**
* Internal constant to use in annotations. Please use {@link Position#relative}
*/
- public static final String STRING_RELATIVE = "relative";
+ public static final 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;
- }
+ public static final String FIXED = "fixed";
}
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=1730976&r1=1730975&r2=1730976&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 Wed Feb 17 23:31:11 2016
@@ -272,7 +272,7 @@ public class Style implements Serializab
}
if (position != null) {
buf.append("position:");
- buf.append(position.getValue());
+ buf.append(position.name());
buf.append(';');
}
if (backgroundImage != null) {
@@ -408,7 +408,7 @@ public class Style implements Serializab
}
if (position != null) {
buf.append("\"position\":\"");
- buf.append(position.getValue());
+ buf.append(position.name());
buf.append("\",");
}
if (backgroundImage != null) {
Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/PositionUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/PositionUnitTest.java?rev=1730976&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/PositionUnitTest.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/PositionUnitTest.java Wed Feb 17 23:31:11 2016
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.layout;
+
+import org.apache.myfaces.tobago.util.EnumUnitTest;
+import org.junit.Test;
+
+public class PositionUnitTest extends EnumUnitTest {
+
+ @Test
+ public void testNames() throws IllegalAccessException, NoSuchFieldException {
+ testNames(Position.class);
+ }
+}
\ No newline at end of file