]> source.dussan.org Git - vaadin-framework.git/commitdiff
table: colsel changes
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 5 Sep 2007 08:19:15 +0000 (08:19 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 5 Sep 2007 08:19:15 +0000 (08:19 +0000)
svn changeset:2197/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java

index 6f78fcd627b012770bcb4239f2439dbe11a1c686..e946e8ab109f6f0be7b6ac500bc45b2c334075bd 100644 (file)
@@ -1176,16 +1176,24 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
                }
 
                public IAction[] getActions() {
-                       String[] cols;
+                       Object[] cols;
                        if(IScrollTable.this.columnReordering) {
                                cols = columnOrder;
                        } else {
+                               // if columnReordering is disabled, we need different way to get all available columns
                                cols = visibleColOrder;
+                               cols = new Object[visibleColOrder.length + collapsedColumns.size()];
+                               int i;
+                               for (i = 0; i < visibleColOrder.length; i++) {
+                                       cols[i] = visibleColOrder[i];
+                               }
+                               for(Iterator it = collapsedColumns.iterator();it.hasNext();)
+                                       cols[i++] = it.next();
                        }
                        IAction[] actions= new IAction[cols.length];
                        
                        for (int i = 0; i < cols.length; i++) {
-                               String cid = cols[i];
+                               String cid = (String) cols[i];
                                HeaderCell c = getHeaderCell(cid);
                                VisibleColumnAction a = new VisibleColumnAction(c.getColKey());
                                a.setCaption(c.getCaption());
@@ -1196,14 +1204,6 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
                        return actions;
                }
 
-               private Iterator getAvailableColumnKeyIterator() {
-                       return availableCells.keySet().iterator();
-               }
-
-               private int getAvailableColumnCount() {
-                       return availableCells.size();
-               }
-
                public ApplicationConnection getClient() {
                        return client;
                }