@Override protected void handleDoubleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { // If the double-clicked element can be obtained from the event, use // it // otherwise get it from the control. Some controls like List do // not have the notion of item. // For details, see bug 90161 [Navigator] DefaultSelecting folders // shouldn't always expand first one ISelection selection; if (event.item != null && event.item.getData() != null) { // changes to fix bug 108102 follow TreePath treePath = getTreePathFromItem((Item) event.item); selection = new TreeSelection(treePath); // end of changes } else { selection = getSelection(); updateSelection(selection); } fireDoubleClick(new DoubleClickEvent(this, selection)); } }
@Override protected void handleDoubleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { // If the double-clicked element can be obtained from the event, use // it // otherwise get it from the control. Some controls like List do // not have the notion of item. // For details, see bug 90161 [Navigator] DefaultSelecting folders // shouldn't always expand first one ISelection selection; if (event.item != null && event.item.getData() != null) { // changes to fix bug 108102 follow TreePath treePath = getTreePathFromItem((Item) event.item); selection = new TreeSelection(treePath); // end of changes } else { selection = getSelection(); updateSelection(selection); } fireDoubleClick(new DoubleClickEvent(this, selection)); } }
protected void handleDoubleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { // If the double-clicked element can be obtained from the event, use // it // otherwise get it from the control. Some controls like List do // not have the notion of item. // For details, see bug 90161 [Navigator] DefaultSelecting folders // shouldn't always expand first one ISelection selection; // RAP [if] Add a check for disposed item - see bug 413920 if (event.item != null && !event.item.isDisposed() && event.item.getData() != null) { // if (event.item != null && event.item.getData() != null) { // changes to fix bug 108102 follow TreePath treePath = getTreePathFromItem((Item) event.item); selection = new TreeSelection(treePath); // end of changes } else { selection = getSelection(); updateSelection(selection); } fireDoubleClick(new DoubleClickEvent(this, selection)); } }