]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Remove listener works better in SysdynModel if it actually removes and does not try...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 5 Oct 2010 12:07:49 +0000 (12:07 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 5 Oct 2010 12:07:49 +0000 (12:07 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@18225 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/BasicExpression.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/viewUtils/SysdynDatasetSelectionListener.java
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java

index 79acf421cfaf7a0fd06ad5bb24143292634d449c..58d265f9a3218b36d8b9b463e6609c9d9d08a20d 100644 (file)
@@ -112,7 +112,6 @@ public class BasicExpression implements IExpression {
                     SysdynResource sr = SysdynResource.getInstance(g);\r
                     Resource expression = g.getPossibleObject(variable, sr.HasExpression);\r
                     if(ExpressionUtils.isParameter(currentText)) {\r
-                       System.out.println(expressionType);\r
                        if(!expressionType.equals(sr.ConstantExpression))\r
                                expressionType = sr.ParameterExpression;\r
                     } else {\r
index 5e6f41687e67b625288887a445ec9902d8c202f7..db69a53ec9c7e0425eaa165d853aef395629431f 100644 (file)
@@ -130,6 +130,7 @@ public abstract class SysdynDatasetSelectionListener implements ISelectionListen
                                ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
                                for(Resource resource : resources) {\r
                                        Variable variable = getVariable(g, resource, runtime);\r
+                                       if(variable == null) continue;\r
                                        Collection<SysdynDataSet> activeDataSets = loadAllActive(g, Variables.getRVI(g, variable).substring(1), getSysdynModel(g, Variables.getModel(g, variable)));\r
                                        if(activeDataSets != null && !activeDataSets.isEmpty())\r
                                                datasets.addAll(activeDataSets);\r
index d49606ae16cc11d3b6e00864a05007702d1f6672..b331f6ea1895a1fea4b91cc9ab77926f005f6314 100644 (file)
@@ -329,7 +329,7 @@ public class SysdynModel implements IMappingListener, IModel {
 \r
        public void removeResultListener(Runnable listener) {\r
                synchronized(resultListeners) {\r
-                       resultListeners.add(listener);\r
+                       resultListeners.remove(listener);\r
                }\r
        }\r
 \r