diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-27 13:38:13 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-08-27 13:38:13 +0300 |
commit | 5964acd1e7ea2a00681fc49525f4f10e5dfa06fe (patch) | |
tree | dc0c01c12664e567c75d9165eb80457a8a7e5c85 /client | |
parent | 2af52b6102051fd9289778c35a1a74c58d51bf02 (diff) | |
parent | 9a32e217f2cb89887b2a46934b992ff32e880ba1 (diff) | |
download | vaadin-framework-5964acd1e7ea2a00681fc49525f4f10e5dfa06fe.tar.gz vaadin-framework-5964acd1e7ea2a00681fc49525f4f10e5dfa06fe.zip |
Merge remote-tracking branch 'origin/6.8'
Conflicts:
server/src/com/vaadin/ui/Select.java
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index 345eebc8aa..dcec10f86f 100644 --- a/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/client/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -5256,6 +5256,27 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return false; } + /** + * Checks if the row represented by the row key has been selected + * + * @param key + * The generated row key + */ + private boolean rowKeyIsSelected(int rowKey) { + // Check single selections + if (selectedRowKeys.contains("" + rowKey)) { + return true; + } + + // Check range selections + for (SelectionRange r : selectedRowRanges) { + if (r.inRange(getRenderedRowByKey("" + rowKey))) { + return true; + } + } + return false; + } + protected void startRowDrag(Event event, final int type, Element targetTdOrTr) { VTransferable transferable = new VTransferable(); @@ -5274,18 +5295,37 @@ public class VScrollTable extends FlowPanel implements HasWidgets, VDragEvent ev = VDragAndDropManager.get().startDrag( transferable, event, true); if (dragmode == DRAGMODE_MULTIROW && isMultiSelectModeAny() - && selectedRowKeys.contains("" + rowKey)) { - ev.createDragImage( - (Element) scrollBody.tBodyElement.cast(), true); + && rowKeyIsSelected(rowKey)) { + + // Create a drag image of ALL rows (ie6,7 has a different + // DOM structure) + if(BrowserInfo.get().isIE6() || BrowserInfo.get().isIE7()){ + ev.createDragImage(scrollBody.getElement(), true); + } else { + ev.createDragImage( + (Element) scrollBody.tBodyElement.cast(), true); + } + + // Hide rows which are not selected Element dragImage = ev.getDragImage(); int i = 0; for (Iterator<Widget> iterator = scrollBody.iterator(); iterator .hasNext();) { VScrollTableRow next = (VScrollTableRow) iterator .next(); - Element child = (Element) dragImage.getChild(i++); - if (!selectedRowKeys.contains("" + next.rowKey)) { - child.getStyle().setVisibility(Visibility.HIDDEN); + + Element child; + if(BrowserInfo.get().isIE6() || BrowserInfo.get().isIE7()){ + child = (Element) dragImage.getChild(1) + .getChild(0) + .getChild(i++); + } else { + child = (Element) dragImage.getChild(i++); + } + + if (!rowKeyIsSelected(next.rowKey)) { + child.getStyle().setVisibility( + Visibility.HIDDEN); } } } else { |