aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2007-07-13 06:38:57 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2007-07-13 06:38:57 +0000
commitcedeabc17225ee4b32cf718486a3d391c7b20298 (patch)
tree90cb130e980dbc51c479d662d647d2a8bb5d89fb /src
parent039a0f1491f9fcf73089c51ac44160954a954cb3 (diff)
downloadvaadin-framework-cedeabc17225ee4b32cf718486a3d391c7b20298.tar.gz
vaadin-framework-cedeabc17225ee4b32cf718486a3d391c7b20298.zip
disabled reordering on row header column, fixed "slot indicator" for FF
svn changeset:1850/svn branch:trunk
Diffstat (limited to 'src')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java39
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css7
2 files changed, 37 insertions, 9 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
index 5688fa1f0b..8711cc83f8 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java
@@ -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;
}
diff --git a/src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css b/src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css
index b35da03269..0da1ecb283 100644
--- a/src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css
+++ b/src/com/itmill/toolkit/terminal/gwt/public/component-themes/common/css/common.css
@@ -21,7 +21,7 @@ select {
filter: alpha(opacity:30);
}
-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;