]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/NewComponentType.java
Add utility class org.simantics.modeling.help.HelpContexts
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / NewComponentType.java
index 920c30453f36d54f4befbb97f8115a392f67a21e..f187762cacba3a3df813a6fc5975e2444c7c994e 100644 (file)
@@ -42,7 +42,8 @@ public class NewComponentType {
         String defaultName = graph.getRelatedValue(indexRoot, MOD.StructuralModel_HasDefaultComponentTypeName, Bindings.STRING);
         String name = NameUtils.findFreshName(graph, defaultName, library);
         graph.claimLiteral(componentType, L0.HasName, name + "@1");
-        graph.claimLiteral(componentType, L0X.HasGeneratedNamePrefix, "");
+        // #7457: replaced by assertion in STR.ComponentType
+        //graph.claimLiteral(componentType, L0X.HasGeneratedNamePrefix, "");
 
         // Substructure
         Resource substructureType = graph.getSingleObject(indexRoot, MOD.StructuralModel_HasComponentTypeSubstructureType);
@@ -62,9 +63,12 @@ public class NewComponentType {
 
         Resource symbolDiagramType = graph.getPossibleObject(indexRoot, MOD.StructuralModel_HasSymbolDiagramType);
         if(symbolDiagramType == null) symbolDiagramType = DIA.Composite;
-        
+
+        Resource symbolType = graph.getPossibleObject(indexRoot, MOD.StructuralModel_HasSymbolType);
+        if(symbolType == null) symbolType = DIA.DefinedElement;
+
         // Symbol
-        Resource symbol = new ModelingUtils(graph).createSymbol2("Symbol", symbolDiagramType);
+        Resource symbol = new ModelingUtils(graph).createSymbol2("Symbol", symbolDiagramType, symbolType);
         graph.claim(componentType, MOD.ComponentTypeToSymbol, symbol);
         graph.claim(componentType, L0.ConsistsOf, symbol);