From: Jussi Koskela Date: Wed, 22 Mar 2017 11:14:39 +0000 (+0200) Subject: Opening symbol code editor / symbol drop handler code editor fails X-Git-Tag: v1.28.0~43 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=706ad7f73f5a6abc75585f3f0cd8e25675928d63;p=simantics%2Fplatform.git Opening symbol code editor / symbol drop handler code editor fails Opening symbol code editor / symbol drop handler code editor fails if there is no existing code available. refs #7106 Change-Id: Iceea446030237819878fda58a40a557b5f03f91a --- diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolCodeDocumentProvider2.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolCodeDocumentProvider2.java index 921ee6299..9c9ebfe9e 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolCodeDocumentProvider2.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolCodeDocumentProvider2.java @@ -72,7 +72,7 @@ public class SymbolCodeDocumentProvider2 extends SCLModuleEditorDocumentProvider errorHappened = false; return graph.getRelatedValue(text, L0.SCLValue_expression, Bindings.STRING); } - throw new DatabaseException("No symbol code was defined."); + return ""; } protected void updateAnnotations() { diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolDropHandlerDocumentProvider.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolDropHandlerDocumentProvider.java index 7394ef410..48c258d47 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolDropHandlerDocumentProvider.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/SymbolDropHandlerDocumentProvider.java @@ -72,7 +72,7 @@ public class SymbolDropHandlerDocumentProvider extends SCLModuleEditorDocumentPr errorHappened = false; return graph.getRelatedValue(text, L0.SCLValue_expression, Bindings.STRING); } - throw new DatabaseException("No symbol code was defined."); + return ""; } protected void updateAnnotations() {