import org.simantics.db.common.request.UniqueRead;\r
import org.simantics.db.common.utils.NameUtils;\r
import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.util.Layer0Utils;\r
import org.simantics.db.procedure.Listener;\r
import org.simantics.db.request.Read;\r
-import org.simantics.db.service.XSupport;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.modeling.ui.Activator;\r
import org.simantics.operation.Layer0X;\r
Layer0 L0 = Layer0.getInstance(graph);\r
Layer0X L0X = Layer0X.getInstance(graph);\r
StructuralResource2 STR = StructuralResource2.getInstance(graph);\r
+\r
+ boolean typeIsImmutable = graph.isImmutable(data.componentType)\r
+ || graph.hasStatement(data.componentType, STR.ComponentType_Locked)\r
+ || Layer0Utils.isPublished(graph, data.componentType)\r
+ || Layer0Utils.isContainerPublished(graph, data.componentType);\r
+\r
for(Resource relation : graph.getObjects(data.componentType, L0.DomainOf)) {\r
if(graph.isSubrelationOf(relation, L0.HasProperty)) {\r
String name = graph.getRelatedValue(relation, L0.HasName);\r
\r
String valid = expression != null ? DerivedPropertiesSection.validateMonitorExpression(graph, data.componentType, relation, expression) : null; \r
\r
- boolean immutable = graph.isImmutable(relation);\r
+ boolean immutable = typeIsImmutable || graph.isImmutable(relation);\r
ComponentTypeViewerPropertyInfo info =\r
new ComponentTypeViewerPropertyInfo(relation, name, type, defaultValue, numberType, unit, label, description, expression, valid, immutable);\r
\r
}\r
}\r
Collections.sort(result);\r
- XSupport xs = graph.peekService(XSupport.class);\r
- boolean immutable = xs != null ? xs.getImmutable(data.componentType) : false;\r
- return new ComponentTypePropertiesResult(result, connectionPoints, immutable);\r
+ return new ComponentTypePropertiesResult(result, connectionPoints, typeIsImmutable);\r
}\r
}, new Listener<ComponentTypePropertiesResult>() {\r
@Override\r