]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/e4/DiagramViewer.java
Remove usage of deprecated SimanticsUI-methods
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagramEditor / e4 / DiagramViewer.java
index 61afc48f439a34724a8806f3cab6efd3b117aa48..d0bf18b836a3521621fde2d93d04c735fcc05a23 100644 (file)
@@ -158,7 +158,6 @@ import org.simantics.ui.workbench.TitleUpdater;
 import org.simantics.ui.workbench.ToolTipRequest;
 import org.simantics.ui.workbench.editor.input.InputValidationCombinators;
 import org.simantics.utils.DataContainer;
-import org.simantics.utils.datastructures.Callback;
 import org.simantics.utils.datastructures.hints.HintContext;
 import org.simantics.utils.datastructures.hints.HintListenerAdapter;
 import org.simantics.utils.datastructures.hints.IHintContext;
@@ -340,7 +339,7 @@ public class DiagramViewer
 
     protected Set<String> getPropertyPageContexts() {
         try {
-            return BrowseContext.getBrowseContextClosure(SimanticsUI.getSession(), defaultPropertyBrowseContexts);
+            return BrowseContext.getBrowseContextClosure(Simantics.getSession(), defaultPropertyBrowseContexts);
         } catch (DatabaseException e) {
             ExceptionUtils.logAndShowError("Failed to load modeled browse contexts for property page, see exception for details.", e);
             return defaultPropertyBrowseContexts;
@@ -362,7 +361,7 @@ public class DiagramViewer
     }
 
     protected void initSession() {
-        sessionContextProvider = SimanticsUI.getSessionContextProvider();
+        sessionContextProvider = Simantics.getSessionContextProvider();
         sessionContext = sessionContextProvider.getSessionContext();
     }
 
@@ -804,12 +803,9 @@ public class DiagramViewer
                        CommonDBUtils.selectClusterSet(graph, diagramResource);
                     DiagramGraphUtil.setDiagramDesc(graph, diagramResource, desc);
                 }
-            }, new Callback<DatabaseException>() {
-                @Override
-                public void run(DatabaseException parameter) {
-                    if (parameter != null)
-                        ErrorLogger.defaultLogError("Failed to write default diagram page description to database, see exception for details", parameter);
-                }
+            }, e -> {
+                if (e != null)
+                    ErrorLogger.defaultLogError("Failed to write default diagram page description to database, see exception for details", e);
             });
         }
 
@@ -961,7 +957,7 @@ public class DiagramViewer
         // Set initial part name according to the name given by IEditorInput
         host.doSetPartName(getResourceEditorInput().getName());
 
-        Session session = SimanticsUI.peekSession();
+        Session session = Simantics.peekSession();
         if (session != null) {
             Supplier<Boolean> disposedCallback = () -> disposed;
             Display display = part.getContext().get(Shell.class).getDisplay();