X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FcomponentTypeEditor%2FComponentTypeViewer.java;h=f88ad39fa5bd351732044e6feaa028624068ac71;hp=3cc4bbbf3ce68aa6d08f2b99438fad0190e134bc;hb=c160c0a55f;hpb=089832880807e21e696b5f321a81fa93473c07a9 diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeViewer.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeViewer.java index 3cc4bbbf3..f88ad39fa 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeViewer.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeViewer.java @@ -45,9 +45,9 @@ import org.simantics.db.common.NamedResource; import org.simantics.db.common.request.UniqueRead; import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.util.Layer0Utils; import org.simantics.db.procedure.Listener; import org.simantics.db.request.Read; -import org.simantics.db.service.XSupport; import org.simantics.layer0.Layer0; import org.simantics.modeling.ui.Activator; import org.simantics.operation.Layer0X; @@ -173,6 +173,12 @@ public class ComponentTypeViewer { Layer0 L0 = Layer0.getInstance(graph); Layer0X L0X = Layer0X.getInstance(graph); StructuralResource2 STR = StructuralResource2.getInstance(graph); + + boolean typeIsImmutable = graph.isImmutable(data.componentType) + || graph.hasStatement(data.componentType, STR.ComponentType_Locked) + || Layer0Utils.isPublished(graph, data.componentType) + || Layer0Utils.isContainerPublished(graph, data.componentType); + for(Resource relation : graph.getObjects(data.componentType, L0.DomainOf)) { if(graph.isSubrelationOf(relation, L0.HasProperty)) { String name = graph.getRelatedValue(relation, L0.HasName); @@ -216,7 +222,7 @@ public class ComponentTypeViewer { String valid = expression != null ? DerivedPropertiesSection.validateMonitorExpression(graph, data.componentType, relation, expression) : null; - boolean immutable = graph.isImmutable(relation); + boolean immutable = typeIsImmutable || graph.isImmutable(relation); ComponentTypeViewerPropertyInfo info = new ComponentTypeViewerPropertyInfo(relation, name, type, defaultValue, numberType, unit, label, description, expression, valid, immutable); @@ -242,9 +248,7 @@ public class ComponentTypeViewer { } } Collections.sort(result); - XSupport xs = graph.peekService(XSupport.class); - boolean immutable = xs != null ? xs.getImmutable(data.componentType) : false; - return new ComponentTypePropertiesResult(result, connectionPoints, immutable); + return new ComponentTypePropertiesResult(result, connectionPoints, typeIsImmutable); } }, new Listener() { @Override