X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fui%2FWorkbenchSelectionProvider.java;h=5bd73f97a463b74f0ecb4f84842ac454a903212d;hp=aa50762782398a452ff6cb8116e61592d62d9d53;hb=a0b1831418eba8870ca849ef2cd85823aa7bfa0a;hpb=fdbe87627e92805701d0672fbe8f1dc60b7f7b00 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java index aa5076278..5bd73f97a 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/ui/WorkbenchSelectionProvider.java @@ -23,7 +23,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IWorkbenchPartSite; -import org.simantics.Logger; import org.simantics.db.exception.DatabaseException; import org.simantics.diagram.elements.AdaptableImmutableProxyElement; import org.simantics.g2d.canvas.ICanvasContext; @@ -35,10 +34,12 @@ import org.simantics.g2d.diagram.participant.Selection; import org.simantics.g2d.element.ElementHints; import org.simantics.g2d.element.IElement; import org.simantics.ui.selection.WorkbenchSelectionUtils; -import org.simantics.utils.datastructures.hints.IHintObservable; import org.simantics.utils.datastructures.hints.IHintContext.Key; +import org.simantics.utils.datastructures.hints.IHintObservable; import org.simantics.utils.threads.IThreadWorkQueue; import org.simantics.utils.threads.ThreadUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A canvas participant that listens to the #0 mouse selection and provides it @@ -48,6 +49,8 @@ import org.simantics.utils.threads.ThreadUtils; */ public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implements IPostSelectionProvider, ElementJSON { + private static final Logger LOGGER = LoggerFactory.getLogger(WorkbenchSelectionProvider.class); + private static final long POST_SELECTION_DELAY = 300; @Dependency protected Selection selection; @@ -216,7 +219,7 @@ public class WorkbenchSelectionProvider extends AbstractCanvasParticipant implem try { return Optional.ofNullable( WorkbenchSelectionUtils.getPossibleJSON(sel) ); } catch (DatabaseException e) { - Logger.defaultLogError(e); + LOGGER.error("Unexpected failure while constructing JSON from element " + element, e); return Optional.empty(); } }