diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java index d13fd5e022..4847ffaf8a 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/photon/org/eclipse/swt/dnd/TableDragUnderEffect.java @@ -14,31 +14,13 @@ package org.eclipse.swt.dnd; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; -class TableDragUnderEffect extends DragUnderEffect { +class TableDragAndDropEffect extends DragAndDropEffect { private Table table; - private TableItem currentItem; - private TableItem[] selection = new TableItem[0]; - private int currentEffect = DND.FEEDBACK_NONE; -TableDragUnderEffect(Table table) { +TableDragAndDropEffect(Table table) { this.table = table; } -void show(int effect, int x, int y) { - TableItem item = null; - if (effect != DND.FEEDBACK_NONE) item = findItem(x, y); - if (item == null) effect = DND.FEEDBACK_NONE; - if (currentEffect != effect && currentEffect == DND.FEEDBACK_NONE) { - selection = table.getSelection(); - table.setSelection(new TableItem[0]); - } - boolean restoreSelection = currentEffect != effect && effect == DND.FEEDBACK_NONE; - setDragUnderEffect(effect, item); - if (restoreSelection) { - table.setSelection(selection); - selection = new TableItem[0]; - } -} -private TableItem findItem(int x, int y){ +Widget getItem(int x, int y) { if (table == null) return null; Point coordinates = new Point(x, y); coordinates = table.toControl(coordinates); @@ -53,17 +35,6 @@ private TableItem findItem(int x, int y){ if (item != null) return item; } return null; - -} -private void setDragUnderEffect(int effect, TableItem item) { - if (currentItem != item) { - if (item == null) { - table.setSelection(new TableItem[0]); - } else { - table.setSelection(new TableItem[] {item}); - } - currentItem = item; - } - currentEffect = effect; + } } |