]> source.dussan.org Git - vaadin-framework.git/commitdiff
disabled reordering on row header column, fixed "slot indicator" for FF
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 13 Jul 2007 06:38:57 +0000 (06:38 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 13 Jul 2007 06:38:57 +0000 (06:38 +0000)
svn changeset:1850/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css

index 5688fa1f0bd4d28d5bff034fbc9e0025b52d23c7..8711cc83f84c973e806e91f5cf2dcb61a74374b5 100644 (file)
@@ -176,9 +176,7 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
        private void updateVisibleColumns(UIDL c) {
                if(!initializedAndAttached) {
                        // add empty cell for col headers
-                       tHead.addAvailableCell(new HeaderCell(
-                                       "0",
-                                       ""));
+                       tHead.addAvailableCell(new RowHeadersHeaderCell());
                        Iterator it = c.getChildIterator();
                        while(it.hasNext()) {
                                UIDL col = (UIDL) it.next();
@@ -708,7 +706,7 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
                        floatingCopyOfHeaderCell = null;
                }
                
-               private void handleCaptionEvent(Event event) {
+               protected void handleCaptionEvent(Event event) {
                        switch (DOM.eventGetType(event)) {
                        case Event.ONMOUSEDOWN:
                                client.console.log("HeaderCaption: mouse down");
@@ -834,6 +832,23 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
 
        }
        
+       /**
+        * HeaderCell that is header cell for row headers.
+        * 
+        * Reordering disabled and clicking on it resets sorting.
+        */
+       public class RowHeadersHeaderCell extends HeaderCell {
+               
+               RowHeadersHeaderCell() {
+                       super("0", "");
+               }
+
+               protected void handleCaptionEvent(Event event) {
+                       // NOP: RowHeaders cannot be reordered
+                       // TODO It'd be nice to reset sorting here
+               }
+       }
+       
        public class TableHead extends Panel implements IActionOwner {
                
                private static final int COLUMN_SELECTOR_WIDTH = 10;
@@ -986,9 +1001,13 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
                private void focusSlot(int index) {
                        removeSlotFocus();
                        if(index > 0)
-                               DOM.setStyleAttribute(DOM.getChild(tr, index - 1), "borderRight", "2px solid black");
+                               DOM.setStyleAttribute(
+                                               DOM.getFirstChild(DOM.getChild(tr, index - 1)), 
+                                               "borderRight", "2px solid black");
                        else
-                               DOM.setStyleAttribute(DOM.getChild(tr, index), "borderLeft", "2px solid black");
+                               DOM.setStyleAttribute(
+                                               DOM.getFirstChild(DOM.getChild(tr, index)), 
+                                               "borderLeft", "2px solid black");
                        focusedSlot = index;
                }
 
@@ -996,9 +1015,13 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll
                        if(focusedSlot < 0)
                                return;
                        if(focusedSlot == 0)
-                               DOM.setStyleAttribute(DOM.getChild(tr, focusedSlot), "borderLeft", "none");
+                               DOM.setStyleAttribute(
+                                               DOM.getFirstChild(DOM.getChild(tr, focusedSlot)), 
+                                               "borderLeft", "none");
                        else if( focusedSlot > 0)
-                               DOM.setStyleAttribute(DOM.getChild(tr, focusedSlot - 1), "borderRight", "none");
+                               DOM.setStyleAttribute(
+                                               DOM.getFirstChild(DOM.getChild(tr, focusedSlot - 1)), 
+                                               "borderRight", "none");
                        focusedSlot = -1;
                }
                
index b35da032695f71bffe8e4bae99234268de417cb1..0da1ecb283e69a3e269d0aa8a57f706048e6e1ba 100644 (file)
@@ -21,7 +21,7 @@ select {
        filter: alpha(opacity:30);\r
 }
 
-i-contextmenu {
+.i-contextmenu {
        background: #fff;       
        border: #000;
 }
@@ -31,6 +31,11 @@ i-contextmenu {
        
 }
 
+/* disabled row in column selector */
+.off {
+       font-style: italic;
+}
+
 .iscrolltable-header table {
        border-collapse:collapse;
        margin:0;