X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.common%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fcommon%2Fstate%2FIdentifiedStatePersistor.java;fp=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FIdentifiedStatePersistor.java;h=0a417bd389c32ca8b2368888c3fb3ebef06fe2dc;hp=5a3bb75b225af675b90ca05a2bbb021343ba8965;hb=97e8b055b8ad16f1d799c81898fee075780a5a83;hpb=72d52b5910e1ed0141b6768ef700e7321ac05553 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/IdentifiedStatePersistor.java b/bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/state/IdentifiedStatePersistor.java similarity index 89% rename from bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/IdentifiedStatePersistor.java rename to bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/state/IdentifiedStatePersistor.java index 5a3bb75b2..0a417bd38 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/IdentifiedStatePersistor.java +++ b/bundles/org.simantics.browsing.ui.common/src/org/simantics/browsing/ui/common/state/IdentifiedStatePersistor.java @@ -1,4 +1,4 @@ -package org.simantics.browsing.ui.swt; +package org.simantics.browsing.ui.common.state; import java.io.File; import java.nio.file.Files; @@ -11,13 +11,16 @@ import org.simantics.browsing.ui.ExplorerState; import org.simantics.browsing.ui.NodeContext; import org.simantics.browsing.ui.StatePersistor; import org.simantics.databoard.util.StringUtil; -import org.simantics.db.common.utils.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Tuukka Lehtonen */ public class IdentifiedStatePersistor implements StatePersistor { + private static final Logger LOGGER = LoggerFactory.getLogger(IdentifiedStatePersistor.class); + protected final String id; public IdentifiedStatePersistor(String id) { @@ -40,7 +43,7 @@ public class IdentifiedStatePersistor implements StatePersistor { if (bean != null && memento != null) Files.write(memento, bean.serialize()); } catch (Throwable t) { - Logger.defaultLogError(t); + LOGGER.error("Failed to serialize ExplorerState " + state, t); } } @@ -52,7 +55,7 @@ public class IdentifiedStatePersistor implements StatePersistor { stateBean.deserialize( Files.readAllBytes(path) ); return toState(stateBean); } catch (Throwable t) { - Logger.defaultLogError(t); + LOGGER.error("Failed to deserialize ExplorerState from " + path, t); return ExplorerState.EMPTY; } }