From: Marko Luukkainen Date: Fri, 14 Sep 2018 10:43:53 +0000 (+0000) Subject: Merge "Expose History REST API implementation to other plug-ins" X-Git-Tag: v1.43.0~136^2~376 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=2b9f0288f5cba92ea1584e3d84e8d919f1277230;hp=d3e012391b3e1cf74d238ac2afecb66eec4d1e1b Merge "Expose History REST API implementation to other plug-ins" --- diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StructuredProperty.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StructuredProperty.java new file mode 100644 index 000000000..fa6469c3f --- /dev/null +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StructuredProperty.java @@ -0,0 +1,10 @@ +package org.simantics.db.layer0.variable; + +/** + * Java interface for StructuredProperty SCL value type. + * + * @author Tuukka Lehtonen + * @since 1.36.0 + */ +public interface StructuredProperty { +} \ No newline at end of file diff --git a/bundles/org.simantics.layer0/graph/Layer0.pgraph b/bundles/org.simantics.layer0/graph/Layer0.pgraph index 5fe74ec01..225a4f17e 100644 --- a/bundles/org.simantics.layer0/graph/Layer0.pgraph +++ b/bundles/org.simantics.layer0/graph/Layer0.pgraph @@ -22,6 +22,7 @@ L0.Entity : L0.Type >-- L0.identifier L0.GUID + ==> "GUID" >-- L0.typeURI L0.String @@ -42,7 +43,7 @@ L0.Entity : L0.Type @L0.assert L0.Entity.methods _ : L0.Value -L0.Entity.methods --> L0.Value "StructuredProperty" " createVariableMap :: [Resource] -> VariableMap diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorPart.java b/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorPart.java index 1cd72de63..ca06a5d7b 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorPart.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorPart.java @@ -20,7 +20,10 @@ import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.PartInitException; +import org.eclipse.ui.internal.PartSite; +import org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor; import org.eclipse.ui.part.EditorPart; import org.simantics.Simantics; import org.simantics.db.Resource; @@ -98,11 +101,25 @@ public abstract class ResourceEditorPart extends EditorPart implements IResource * @param partName */ protected void safeSetPartName(String partName) { - if (!disposed) { + if (!disposed && checkCompatibilityPartNotBeingDisposed()) { // this is to fix bug https://gitlab.simantics.org/simantics/platform/issues/117 setPartName(partName); } } + @SuppressWarnings("restriction") + private boolean checkCompatibilityPartNotBeingDisposed() { + IWorkbenchPartSite site = getSite(); + if (site instanceof PartSite) { + PartSite partSite = (PartSite) getSite(); + Object object = partSite.getModel().getObject(); + if (object instanceof CompatibilityEditor) { + CompatibilityEditor editor = (CompatibilityEditor) object; + return !editor.isBeingDisposed(); + } + } + return true; + } + /** * Safely sets title tooltip for parts whose IEditorInput is not yet disposed (e.g. * removed from database)