X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.views.swt%2Fsrc%2Forg%2Fsimantics%2Fviews%2Fswt%2FModelledView.java;h=f32fac6865c545fa43e3e3c4beb7da984ffd4368;hp=f50954857e7d3611d7956968ece2559d6f9bf8ea;hb=19308b2d36f9a4b37c3f81757ae8acd213b7823e;hpb=9214a600c9401b06057fc2c10ea86a0ce0218d87 diff --git a/bundles/org.simantics.views.swt/src/org/simantics/views/swt/ModelledView.java b/bundles/org.simantics.views.swt/src/org/simantics/views/swt/ModelledView.java index f50954857..f32fac686 100644 --- a/bundles/org.simantics.views.swt/src/org/simantics/views/swt/ModelledView.java +++ b/bundles/org.simantics.views.swt/src/org/simantics/views/swt/ModelledView.java @@ -36,9 +36,8 @@ import org.simantics.db.VirtualGraph; import org.simantics.db.WriteGraph; import org.simantics.db.common.request.WriteRequest; import org.simantics.db.common.request.WriteResultRequest; -import org.simantics.db.common.utils.Logger; import org.simantics.db.exception.DatabaseException; -import org.simantics.db.exception.ServiceNotFoundException; +import org.simantics.db.exception.RuntimeDatabaseException; import org.simantics.db.layer0.util.RemoverUtil; import org.simantics.db.layer0.variable.Variable; import org.simantics.db.management.ISessionContext; @@ -49,6 +48,8 @@ import org.simantics.scl.runtime.function.Function1; import org.simantics.ui.workbench.IPropertyPage; import org.simantics.utils.ui.jface.ActiveSelectionProvider; import org.simantics.views.swt.client.base.SWTRoot; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * To use this class, first model your view contents in .pgraph files according @@ -67,6 +68,8 @@ import org.simantics.views.swt.client.base.SWTRoot; */ public class ModelledView extends SimanticsView implements IPartListener2 { + private static final Logger LOGGER = LoggerFactory.getLogger(ModelledView.class); + public static final int TIME_BEFORE_DISPOSE_WHEN_HIDDEN = 30000; // ms private static final boolean DEBUG = false; @@ -114,10 +117,8 @@ public class ModelledView extends SimanticsView implements IPartListener2 { return runtime; } }); - } catch (ServiceNotFoundException e) { - Logger.defaultLogError(e); - } catch (DatabaseException e) { - Logger.defaultLogError(e); + } catch (RuntimeDatabaseException | DatabaseException e) { + LOGGER.error("Failed to initialize modelled widget support runtime scenegraph", e); } support = new ModelledSupport(this); @@ -204,8 +205,7 @@ public class ModelledView extends SimanticsView implements IPartListener2 { } catch (DatabaseException e) { - e.printStackTrace(); - Logger.defaultLogError(e); + LOGGER.error("Failed to create modelled controls", e); } @@ -291,10 +291,8 @@ public class ModelledView extends SimanticsView implements IPartListener2 { RemoverUtil.remove(graph, rt); } }); - } catch (ServiceNotFoundException e) { - Logger.defaultLogError(e); - } catch (DatabaseException e) { - Logger.defaultLogError(e); + } catch (RuntimeDatabaseException | DatabaseException e) { + LOGGER.error("Failed to dispose of the modelled widget support runtime scenegraph", e); } }