]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/jface/BaseSelectionProvider.java
Revert "Usability fixes for GraphExplorerImpl -related WB selection propagation"
[simantics/platform.git] / bundles / org.simantics.utils.ui / src / org / simantics / utils / ui / jface / BaseSelectionProvider.java
index 55ec0241b151540a9005b0f9ae842f7d685a3392..b2e6d921548618c790aa910bb3ee43713c2bda37 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2018 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
  * in Industry THTH ry.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
@@ -20,7 +20,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.simantics.utils.ObjectUtils;
 
 /**
  * BaseSelectionProvider is a base implementation ISelectionProvider -interface.
@@ -40,7 +39,7 @@ import org.simantics.utils.ObjectUtils;
  */
 public class BaseSelectionProvider implements ISelectionProvider {
 
-    protected ListenerList<ISelectionChangedListener> selectionListeners = new ListenerList<>();
+    protected ListenerList selectionListeners = new ListenerList();
 
     protected ISelection selection = StructuredSelection.EMPTY;
 
@@ -60,14 +59,6 @@ public class BaseSelectionProvider implements ISelectionProvider {
         return selection;
     }
 
-    public void clearListeners() {
-        clearSelectionChangedListeners();
-    }
-
-    public void clearSelectionChangedListeners() {
-        selectionListeners.clear();
-    }
-
     public void removeSelectionChangedListener(ISelectionChangedListener listener) {
         selectionListeners.remove(listener);
     }
@@ -115,15 +106,14 @@ public class BaseSelectionProvider implements ISelectionProvider {
      * 
      * @param selection the new selection
      */
-    public boolean setAndFireNonEqualSelection(ISelection selection) {
+    public void setAndFireNonEqualSelection(ISelection selection) {
         ISelection old = getSelection();
-        if (ObjectUtils.objectEquals(old, selection))
-            return false;
+        if (selection == old)
+            return;
 
         this.selection = selection;
-        if (selection != null)
+        if (selection != null && !selection.equals(old))
             fireSelection(selection);
-        return true;
     }
 
     public boolean selectionEquals(ISelection s) {