@Override protected synchronized void updateSelection(ISelection selection) { fCurrentSelection = selection; super.updateSelection(selection); }
/** * Handles an invalid selection. * <p> * This framework method is called if a model change picked up by a viewer * results in an invalid selection. For instance if an element contained in * the selection has been removed from the viewer, the viewer is free to * either remove the element from the selection or to pick another element * as its new selection. The default implementation of this method calls * <code>updateSelection</code>. Subclasses may override it to implement * a different strategy for picking a new selection when the old selection * becomes invalid. * </p> * * @param invalidSelection * the selection before the viewer was updated * @param newSelection * the selection after the update, or <code>null</code> if none */ protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) { updateSelection(newSelection); SelectionChangedEvent event = new SelectionChangedEvent(this, newSelection); firePostSelectionChanged(event); }
/** * Handles an invalid selection. * <p> * This framework method is called if a model change picked up by a viewer * results in an invalid selection. For instance if an element contained in * the selection has been removed from the viewer, the viewer is free to * either remove the element from the selection or to pick another element * as its new selection. The default implementation of this method calls * <code>updateSelection</code>. Subclasses may override it to implement * a different strategy for picking a new selection when the old selection * becomes invalid. * </p> * * @param invalidSelection * the selection before the viewer was updated * @param newSelection * the selection after the update, or <code>null</code> if none */ protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) { updateSelection(newSelection); SelectionChangedEvent event = new SelectionChangedEvent(this, newSelection); firePostSelectionChanged(event); }
/** * Handles an invalid selection. * <p> * This framework method is called if a model change picked up by a viewer * results in an invalid selection. For instance if an element contained in * the selection has been removed from the viewer, the viewer is free to * either remove the element from the selection or to pick another element * as its new selection. The default implementation of this method calls * <code>updateSelection</code>. Subclasses may override it to implement * a different strategy for picking a new selection when the old selection * becomes invalid. * </p> * * @param invalidSelection * the selection before the viewer was updated * @param newSelection * the selection after the update, or <code>null</code> if none */ protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) { updateSelection(newSelection); SelectionChangedEvent event = new SelectionChangedEvent(this, newSelection); firePostSelectionChanged(event); }
/** * Handles a select event from the widget. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * * @param event * the SWT selection event */ protected void handleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
/** * Handles a select event from the widget. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * * @param event * the SWT selection event */ protected void handleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
/** * Handles a select event from the widget. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * * @param event * the SWT selection event */ protected void handleSelect(SelectionEvent event) { // handle case where an earlier selection listener disposed the control. Control control = getControl(); if (control != null && !control.isDisposed()) { updateSelection(getSelection()); } }
setSelectionToWidget(selection, reveal); ISelection sel = getSelection(); updateSelection(sel); firePostSelectionChanged(new SelectionChangedEvent(this, sel)); } else {
setSelectionToWidget(selection, reveal); ISelection sel = getSelection(); updateSelection(sel); firePostSelectionChanged(new SelectionChangedEvent(this, sel)); } else {
setSelectionToWidget(selection, reveal); ISelection sel = getSelection(); updateSelection(sel); firePostSelectionChanged(new SelectionChangedEvent(this, sel)); } else {
/** * Handles a double-click select event from the widget. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * * @param event * the SWT selection event */ protected void handleDoubleSelect(SelectionEvent event) { // This method is reimplemented in AbstractTreeViewer to fix bug 108102. // 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) { selection = new StructuredSelection(event.item.getData()); } else { selection = getSelection(); updateSelection(selection); } fireDoubleClick(new DoubleClickEvent(this, selection)); } }
/** * Handles a double-click select event from the widget. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * * @param event * the SWT selection event */ protected void handleDoubleSelect(SelectionEvent event) { // This method is reimplemented in AbstractTreeViewer to fix bug 108102. // 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) { selection = new StructuredSelection(event.item.getData()); } else { selection = getSelection(); updateSelection(selection); } fireDoubleClick(new DoubleClickEvent(this, selection)); } }