Removed unnecessary dependencies on org.apache.log4j
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagramEditor / DiagramViewerSelectionProvider.java
index b7ea5ac78a1efff4769b267fdaa7ddf565cdea41..d9d14c37eada50ab64cddc9a9e55c0e94cf64249 100644 (file)
@@ -17,7 +17,6 @@ import org.simantics.db.layer0.SelectionHints;
 import org.simantics.db.layer0.request.PossibleModel;
 import org.simantics.db.layer0.variable.Variable;
 import org.simantics.db.layer0.variable.Variables;
-import org.simantics.diagram.Logger;
 import org.simantics.diagram.flag.FlagUtil;
 import org.simantics.diagram.stubs.DiagramResource;
 import org.simantics.diagram.ui.DiagramModelHints;
@@ -36,6 +35,8 @@ import org.simantics.ui.selection.WorkbenchSelectionContentType;
 import org.simantics.utils.DataContainer;
 import org.simantics.utils.threads.IThreadWorkQueue;
 import org.simantics.utils.ui.ErrorLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @author Antti Villberg
@@ -44,6 +45,8 @@ public class DiagramViewerSelectionProvider extends WorkbenchSelectionProvider {
 
     protected static class SelectionElement extends AdaptableHintContext {
 
+        private static final Logger LOGGER = LoggerFactory.getLogger(SelectionElement.class);
+
         final public Resource runtime;
         final public Resource element;
 
@@ -108,7 +111,7 @@ public class DiagramViewerSelectionProvider extends WorkbenchSelectionProvider {
                         }
                     });
                 } catch (DatabaseException e) {
-                    Logger.defaultLogError(e);
+                    LOGGER.error("WorkbenchSelectionElement.getContent failed for type AnyVariable", e);
                 }
             }
             else if(contentType instanceof ParentVariable) {
@@ -117,10 +120,7 @@ public class DiagramViewerSelectionProvider extends WorkbenchSelectionProvider {
                     return (T) type.processor.sync(new ResourceRead2<Variable>(runtime, element) {
                         @Override
                         public Variable perform(ReadGraph graph) throws DatabaseException {
-
                             DiagramResource DIA = DiagramResource.getInstance(graph);
-                            ModelingResources MOD = ModelingResources.getInstance(graph);
-                            Layer0 L0 = Layer0.getInstance(graph);
 
                             String uri = graph.getPossibleRelatedValue(resource, DIA.RuntimeDiagram_HasVariable);
                             if (uri == null)
@@ -134,7 +134,7 @@ public class DiagramViewerSelectionProvider extends WorkbenchSelectionProvider {
                         }
                     });
                 } catch (DatabaseException e) {
-                    Logger.defaultLogError(e);
+                    LOGGER.error("WorkbenchSelectionElement.getContent failed for type ParentVariable", e);
                 }
             }