You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/02/24 20:06:14 UTC
svn commit: r915926 - in /pivot/trunk:
core/src/org/apache/pivot/collections/ArrayList.java
core/test/org/apache/pivot/collections/test/ArrayListTest.java
wtk/src/org/apache/pivot/wtk/TablePane.java
Author: gbrown
Date: Wed Feb 24 19:06:14 2010
New Revision: 915926
URL: http://svn.apache.org/viewvc?rev=915926&view=rev
Log:
Add new toArray() overload to ArrayList; make TablePane.Row non-final.
Modified:
pivot/trunk/core/src/org/apache/pivot/collections/ArrayList.java
pivot/trunk/core/test/org/apache/pivot/collections/test/ArrayListTest.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java
Modified: pivot/trunk/core/src/org/apache/pivot/collections/ArrayList.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/collections/ArrayList.java?rev=915926&r1=915925&r2=915926&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/collections/ArrayList.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/collections/ArrayList.java Wed Feb 24 19:06:14 2010
@@ -408,6 +408,10 @@
return items.length;
}
+ public Object[] toArray() {
+ return Arrays.copyOf(items, length);
+ }
+
public T[] toArray(Class<? extends T[]> type) {
return Arrays.copyOf(items, length, type);
}
Modified: pivot/trunk/core/test/org/apache/pivot/collections/test/ArrayListTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/collections/test/ArrayListTest.java?rev=915926&r1=915925&r2=915926&view=diff
==============================================================================
--- pivot/trunk/core/test/org/apache/pivot/collections/test/ArrayListTest.java (original)
+++ pivot/trunk/core/test/org/apache/pivot/collections/test/ArrayListTest.java Wed Feb 24 19:06:14 2010
@@ -32,6 +32,9 @@
list.insert("D", 2);
list.insert("A", 0);
+ Object[] array = list.toArray();
+ assertEquals(array[0], "A");
+
assertEquals(ArrayList.binarySearch(list, "A"), 0);
list.remove(0, 1);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java?rev=915926&r1=915925&r2=915926&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TablePane.java Wed Feb 24 19:06:14 2010
@@ -32,7 +32,7 @@
/**
* Represents a table pane row.
*/
- public static final class Row implements Sequence<Component>, Iterable<Component> {
+ public static class Row implements Sequence<Component>, Iterable<Component> {
private int height;
private boolean relative;
private boolean highlighted;
@@ -665,7 +665,7 @@
/**
* Component that can be used as filler for empty cells.
*/
- public static class Filler extends Component {
+ public static final class Filler extends Component {
public Filler() {
installThemeSkin(Filler.class);
}