]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ReferenceResolverBase.java
Fire selection change events on every selection change
[simantics/platform.git] / bundles / org.simantics.structural.synchronization.client / src / org / simantics / structural / synchronization / base / ReferenceResolverBase.java
index ef781f3df4f5d2035a2eb616a1e7273e546ebac3..33b5d9bdcf424675a281c2279892a489a9ba8ebe 100644 (file)
@@ -8,6 +8,9 @@ import java.util.Collections;
 
 import org.simantics.databoard.util.URIStringUtils;
 import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
+import org.simantics.structural.synchronization.utils.ComponentBase;
+import org.simantics.structural.synchronization.utils.Solver;
+import org.slf4j.Logger;
 
 abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
        
@@ -92,7 +95,7 @@ abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
                     String message = "Couldn't resolve " + connectionPoint +
                             ", because child " + segment + " does not exist.";
                     if(eventHandler == null)
-                        System.err.println(message);
+                        getLogger().warn(message);
                     else
                         eventHandler.reportProblem(message);
                     return;
@@ -115,7 +118,7 @@ abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
 
     private static void fullPathOfComponent(StringBuilder b, ComponentBase<?> component) {
         if(component != null) {
-            fullPathOfComponent(b, component.parent);
+            fullPathOfComponent(b, component.getParent());
             b.append("/").append(component.solverComponentName);
         }
     }
@@ -139,14 +142,15 @@ abstract public class ReferenceResolverBase<T extends ComponentBase<T>> {
                 }
             });
             Collections.sort(pending);
-            System.out.println("Still pending:");
+            getLogger().info("Still pending:");
             for(String p : pending)
-                System.out.println("    " + p);
+                getLogger().info("    " + p);
         }
     }
 
     public void resolvePendingSelfReferences() {
         // Can be customized in subclasses
     }
-
+    
+    public abstract Logger getLogger();
 }