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:37:48 UTC

svn commit: r1730978 - 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/ test/java/org/apache/myfaces/tobago/layout/

Author: lofwyr
Date: Wed Feb 17 23:37:48 2016
New Revision: 1730978

URL: http://svn.apache.org/viewvc?rev=1730978&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/ShowPositionUnitTest.java
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ShowPosition.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.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/SheetTagDeclaration.java?rev=1730978&r1=1730977&r2=1730978&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/SheetTagDeclaration.java Wed Feb 17 23:37:48 2016
@@ -149,9 +149,9 @@ public interface SheetTagDeclaration
   @TagAttribute
   @UIComponentTagAttribute(
       type = "org.apache.myfaces.tobago.layout.ShowPosition",
-      defaultValue = ShowPosition.STRING_CENTER,
+      defaultValue = ShowPosition.CENTER,
       allowedValues = {
-          ShowPosition.STRING_LEFT, ShowPosition.STRING_CENTER, ShowPosition.STRING_RIGHT, ShowPosition.STRING_NONE
+          ShowPosition.LEFT, ShowPosition.CENTER, ShowPosition.RIGHT, ShowPosition.NONE
       },
       defaultCode = "org.apache.myfaces.tobago.layout.ShowPosition.center")
   void setShowDirectLinks(String showDirectLinks);
@@ -164,9 +164,9 @@ public interface SheetTagDeclaration
   @TagAttribute
   @UIComponentTagAttribute(
       type = "org.apache.myfaces.tobago.layout.ShowPosition",
-      defaultValue = ShowPosition.STRING_RIGHT,
+      defaultValue = ShowPosition.RIGHT,
       allowedValues = {
-          ShowPosition.STRING_LEFT, ShowPosition.STRING_CENTER, ShowPosition.STRING_RIGHT, ShowPosition.STRING_NONE
+          ShowPosition.LEFT, ShowPosition.CENTER, ShowPosition.RIGHT, ShowPosition.NONE
       },
       defaultCode = "org.apache.myfaces.tobago.layout.ShowPosition.right")
   void setShowPageRange(String showPageRange);
@@ -179,9 +179,9 @@ public interface SheetTagDeclaration
   @TagAttribute
   @UIComponentTagAttribute(
       type = "org.apache.myfaces.tobago.layout.ShowPosition",
-      defaultValue = ShowPosition.STRING_LEFT,
+      defaultValue = ShowPosition.LEFT,
       allowedValues = {
-          ShowPosition.STRING_LEFT, ShowPosition.STRING_CENTER, ShowPosition.STRING_RIGHT, ShowPosition.STRING_NONE
+          ShowPosition.LEFT, ShowPosition.CENTER, ShowPosition.RIGHT, ShowPosition.NONE
       },
       defaultCode = "org.apache.myfaces.tobago.layout.ShowPosition.left")
   void setShowRowRange(String showRowRange);

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ShowPosition.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ShowPosition.java?rev=1730978&r1=1730977&r2=1730978&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ShowPosition.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ShowPosition.java Wed Feb 17 23:37:48 2016
@@ -26,8 +26,8 @@ public enum ShowPosition {
   right,
   none;
 
-  public static final String STRING_LEFT = "left";
-  public static final String STRING_CENTER = "center";
-  public static final String STRING_RIGHT = "right";
-  public static final String STRING_NONE = "none";
+  public static final String LEFT = "left";
+  public static final String CENTER = "center";
+  public static final String RIGHT = "right";
+  public static final String NONE = "none";
 }

Added: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/ShowPositionUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/ShowPositionUnitTest.java?rev=1730978&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/ShowPositionUnitTest.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/test/java/org/apache/myfaces/tobago/layout/ShowPositionUnitTest.java Wed Feb 17 23:37:48 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 ShowPositionUnitTest extends EnumUnitTest {
+
+  @Test
+  public void testNames() throws IllegalAccessException, NoSuchFieldException {
+    testNames(ShowPosition.class);
+  }
+}
\ No newline at end of file