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 2008/01/25 18:49:33 UTC
svn commit: r615286 - in /myfaces/tobago/trunk/core/src:
main/java/org/apache/myfaces/tobago/layout/Grid.java
test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java
Author: lofwyr
Date: Fri Jan 25 09:49:32 2008
New Revision: 615286
URL: http://svn.apache.org/viewvc?rev=615286&view=rev
Log:
clean up
Modified:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Grid.java
myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java
Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Grid.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Grid.java?rev=615286&r1=615285&r2=615286&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Grid.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Grid.java Fri Jan 25 09:49:32 2008
@@ -122,6 +122,20 @@
return errorIndexes.contains(j * grid.getColumnCount() + i);
}
+ /**
+ * Prints the state of the grid as an Unicode shape like this:
+ * âââ³ââ³ââ³ââ¯ââ
+ * âââââââââââ
+ * â ââââââââ¿ââ«
+ * ââ¬ââ¬âââââââ
+ * â£ââââââââââ«
+ * ââââ¬âââââââ
+ * â£ââââââââââ©
+ * ââââââââ¬âââ
+ * â¡ââ¿ââ¿ââââââ¤
+ * ââââââââ¬âââ
+ * âââ´ââ´ââºââ¹ââ
+ */
@Override
public String toString() {
Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java?rev=615286&r1=615285&r2=615286&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/GridUnitTest.java Fri Jan 25 09:49:32 2008
@@ -198,31 +198,18 @@
+ "âââ´ââ´ââ´ââ´ââ\n", grid.toString());
grid.add(new ComponentCell(null), 1, 2);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 3);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 2, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 3, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 3);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 3, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 2);
- System.out.println(grid);
grid.add(new ComponentCell(null), 2, 1);
- System.out.println(grid);
grid.add(new ComponentCell(null), 1, 1);
- System.out.println(grid);
assertEquals(5, grid.getColumnCount());
assertEquals(5, grid.getRowCount());
assertEquals(""
@@ -237,55 +224,5 @@
+ "â£ââ¿ââââââââ¨\n"
+ "ââââââââ¬ââ¬â\n"
+ "âââ·ââ»ââ»ââ»ââ\n", grid.toString());
- for (int j = 0; j < 5; j++) {
- for (int i = 0; i < 5; i++) {
- Cell cell = grid.get(i, j);
- switch (j * 5 + i) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 7:
- case 10:
- case 12:
- case 13:
- case 14:
- case 15:
- case 19:
- case 20:
- case 22:
- assertTrue(cell instanceof ComponentCell);
- break;
- case 4:
- case 5:
- case 6:
- case 8:
- case 9:
- case 11:
- case 16:
- case 17:
- case 18:
- case 21:
- case 23:
- case 24:
- assertTrue("i=" + i + " j=" + j, cell instanceof SpanCell);
- break;
- default:
- fail();
- }
- }
- }
-// âââ³ââ³ââ³ââ¯ââ
-// âââââââââââ
-// â ââââââââ¿ââ«
-// âââââââââââ
-// â£ââââââââââ«
-// âââââââââââ
-// â£ââââââââââ«
-// âââââââââââ
-// â£ââ¿ââââââââ¨
-// âââââââââââ
-// âââ·ââ»ââ»ââ»ââ
-
}
}