}
super.removedFromContext(ctx);
}
-
- @HintListener(Class = Selection.class, Field = "SELECTION0")
- public void hintChanged(IHintObservable sender, Key key, Object oldValue, Object newValue) {
- Iterable<?> selection = (Iterable<?>) newValue;
+
+ public void fireSelection(Iterable<?> selection) {
final ISelection s = constructAdaptableSelection(selection);
swt.asyncExec(new Runnable() {
@Override
});
}
+ @HintListener(Class = Selection.class, Field = "SELECTION0")
+ public void hintChanged(IHintObservable sender, Key key, Object oldValue, Object newValue) {
+ Iterable<?> selection = (Iterable<?>) newValue;
+ fireSelection(selection);
+ }
+
@HintListener(Class = Selection.class, Field = "SELECTION0")
public void hintRemoved(IHintObservable sender, Key key, Object oldValue) {
//System.out.println("selection removed: " + oldValue);
- final ISelection s = constructAdaptableSelection(Collections.emptyList());
- swt.asyncExec(new Runnable() {
- @Override
- public void run() {
- currentSelection = s;
- fireSelectionChanged(s);
- schedulePostSelectionChanged(s);
- }
- });
+ fireSelection(Collections.emptyList());
}
// Post selection changed scheduling helper.
*******************************************************************************/
package org.simantics.modeling.ui.diagramEditor;
+import java.util.Collections;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
mon.worked(10);
END(task);
+ viewer.selectionProvider.fireSelection(Collections.emptyList());
+
// Zoom to fit if no previous view transform is available
task = BEGIN("DV.scheduleZoomToFit");
viewer.scheduleZoomToFit(diagram);