+
+ IPostSelectionProvider psp = (IPostSelectionProvider)control.getExplorer().getAdapter(IPostSelectionProvider.class);
+ psp.addPostSelectionChangedListener(new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+
+// ISelection selection = (ISelection)control.getExplorer().getWidgetSelection();
+ if (site != null) {
+ ISelectionProvider sp = site.getSelectionProvider();
+ if (sp != null) {
+ sp.setSelection(event.getSelection());
+ }
+ }
+
+ }
+
+ });
+
+ control.addListenerToControl(SWT.Selection, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+
+ if(selectionListener != null)
+ selectionListener.apply(event);
+
+ ISelection selection = (ISelection)control.getExplorer().getWidgetSelection();
+ // [Tuukka@2012-04-08] Disabled this because it was causing
+ // horrible selection feedback effects in the Model Browser
+ // view that is using it. It causes the browser to react to
+ // external selections which were initially published as its own
+ // with a delay.
+ //System.out.println("selection: " + selection);
+// if(publishSelection != null && publishSelection) {
+// if (site != null) {
+// ISelectionProvider sp = site.getSelectionProvider();
+// if (sp != null) {
+// sp.setSelection(selection);
+// }
+// }
+// }
+
+ propertyCallback.apply("selection", selection);
+
+ lastSelection = selection;
+
+ }
+
+ });
+