]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewProceduralComponentType.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / actions / NewProceduralComponentType.java
index daa21c384d2cc94e48a9b02899c925e33d363e96..3169275493d27f2855b845445840def6ab1eeb0e 100644 (file)
@@ -63,8 +63,8 @@ public class NewProceduralComponentType implements ActionFactory {
         // Name
         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, "");
+        graph.claimLiteral(componentType, L0.HasName, name + "@1"); //$NON-NLS-1$
+        graph.claimLiteral(componentType, L0X.HasGeneratedNamePrefix, ""); //$NON-NLS-1$
 
         // Substructure
 //        Resource substructureType = graph.getSingleObject(indexRoot, MOD.StructuralModel_HasComponentTypeSubstructureType);
@@ -83,13 +83,13 @@ public class NewProceduralComponentType implements ActionFactory {
 //        }
 
         graph.addLiteral(componentType, STR.ProceduralComponentType_code, STR.ProceduralComponentType_code_Inverse, 
-                STR.ProceduralComponentTypeCode, "[]", Bindings.STRING);
+                STR.ProceduralComponentTypeCode, "[]", Bindings.STRING); //$NON-NLS-1$
         
         Resource symbolDiagramType = graph.getPossibleObject(indexRoot, MOD.StructuralModel_HasSymbolDiagramType);
         if(symbolDiagramType == null) symbolDiagramType = DIA.Composite;
         
         // Symbol
-        Resource symbol = new ModelingUtils(graph).createSymbol2("Symbol", symbolDiagramType);
+        Resource symbol = new ModelingUtils(graph).createSymbol2("Symbol", symbolDiagramType); //$NON-NLS-1$
         graph.claim(componentType, MOD.ComponentTypeToSymbol, symbol);
         graph.claim(componentType, L0.ConsistsOf, symbol);
         
@@ -107,7 +107,7 @@ public class NewProceduralComponentType implements ActionFactory {
         return new Runnable() {
             @Override
             public void run() {
-                Job job = new DatabaseJob("New User Component") {
+                Job job = new DatabaseJob(Messages.NewProceduralComponentType_NewUserComponent) {
                     @Override
                     protected IStatus run(IProgressMonitor monitor) {
                         try {
@@ -116,12 +116,12 @@ public class NewProceduralComponentType implements ActionFactory {
                                 public void perform(WriteGraph graph) throws DatabaseException {
                                     graph.markUndoPoint();
                                     Resource r = NewProceduralComponentType.create(graph, library);
-                                    Layer0Utils.addCommentMetadata(graph, "Created new Procedural Component Type " + graph.getPossibleRelatedValue2(r, Layer0.getInstance(graph).HasName, Bindings.STRING));
+                                    Layer0Utils.addCommentMetadata(graph, "Created new Procedural Component Type " + graph.getPossibleRelatedValue2(r, Layer0.getInstance(graph).HasName, Bindings.STRING)); //$NON-NLS-1$
                                 }
                             });
                             return Status.OK_STATUS;
                         } catch (DatabaseException e) {
-                            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Failed to create new user component.", e); 
+                            return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.NewProceduralComponentType_ActivatorFailedToCreateNewUserComponent, e); 
                         }
                     }
                 };