Removed unnecessary dependencies on org.apache.log4j
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / participant / PopulateSelectionDropParticipant.java
index 3e1140a07f358b3fbef42905254677d99bed65aa..0731bd90d7f3c542797e6c4f590e77d27324ba92 100644 (file)
@@ -24,10 +24,8 @@ import java.util.List;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.simantics.db.Session;
 import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.Logger;
 import org.simantics.diagram.adapter.GraphToDiagramSynchronizer;
 import org.simantics.g2d.diagram.DiagramHints;
-import org.simantics.g2d.diagram.DiagramMutator;
 import org.simantics.g2d.diagram.DiagramUtils;
 import org.simantics.g2d.diagram.IDiagram;
 import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
@@ -42,11 +40,14 @@ import org.simantics.g2d.element.IElement;
 import org.simantics.scenegraph.g2d.snap.ISnapAdvisor;
 import org.simantics.ui.dnd.LocalObjectTransfer;
 import org.simantics.ui.dnd.LocalObjectTransferable;
-import org.simantics.utils.datastructures.Callback;
 import org.simantics.utils.logging.TimeLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 abstract public class PopulateSelectionDropParticipant extends AbstractDiagramParticipant implements IDropTargetParticipant {
 
+       private static final Logger LOGGER = LoggerFactory.getLogger(PopulateSelectionDropParticipant.class);
+
        public abstract List<ElementClassDragItem> getElements(Session session, IStructuredSelection selection) throws DatabaseException;
        
        protected GraphToDiagramSynchronizer synchronizer;
@@ -96,12 +97,8 @@ abstract public class PopulateSelectionDropParticipant extends AbstractDiagramPa
 
                                }
 
-                       } catch (UnsupportedFlavorException e) {
-                               Logger.defaultLogError(e);
-                       } catch (IOException e) {
-                               Logger.defaultLogError(e);
-                       } catch (DatabaseException e) {
-                               Logger.defaultLogError(e);
+                       } catch (DatabaseException | IOException | UnsupportedFlavorException e) {
+                               LOGGER.error("Unexpected failure", e);
                        }
 
                }