]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ProceduralComponentTypeEditorNamingService.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / componentTypeEditor / ProceduralComponentTypeEditorNamingService.java
index be448e64b75a8969a7006eb6b3bf2211a8a2fe1d..1366354b81e3f8df951f2b084907c3d1691d13d3 100644 (file)
@@ -3,6 +3,7 @@ package org.simantics.modeling.ui.componentTypeEditor;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.IEditorInput;
 import org.simantics.NameLabelMode;
 import org.simantics.NameLabelUtil;
@@ -34,10 +35,10 @@ public class ProceduralComponentTypeEditorNamingService extends EditorNamingServ
         if (input instanceof IResourceEditorInput) {
             Resource code = ((IResourceEditorInput) input).getResource();
             if (code != null) {
-                return truncated(getPropertyOwnerName(graph, code) + " (Code)", 256);
+                return truncated(getPropertyOwnerName(graph, code) + " (Code)", 256); //$NON-NLS-1$
             }
         }
-        return "Unsupported input: " + input;
+        return NLS.bind(Messages.ProceduralComponentTypeEditorNamingService_UnsupportedInput, input);
     }
 
     @Override
@@ -50,7 +51,7 @@ public class ProceduralComponentTypeEditorNamingService extends EditorNamingServ
                 return sb.toString();
             }
         }
-        return "Unsupported input: " + input;
+        return NLS.bind(Messages.ProceduralComponentTypeEditorNamingService_UnsupportedInput, input);
     }
 
     private StringBuilder getTooltip(ReadGraph graph, String editorId, IResourceEditorInput input, StringBuilder sb) throws DatabaseException {
@@ -66,14 +67,14 @@ public class ProceduralComponentTypeEditorNamingService extends EditorNamingServ
                 ResourceArray path = getPathInIndexRoot(graph, owner);
                 for (int i = path.size() - 2; i > 0; --i) {
                     String segment = NameLabelUtil.modalName(graph, path.get(i), mode);
-                    if (segment.contains("/"))
-                        segment = "\"" + segment + "\"";
+                    if (segment.contains("/")) //$NON-NLS-1$
+                        segment = "\"" + segment + "\""; //$NON-NLS-1$ //$NON-NLS-2$
 
-                    sb.append(segment).append("/");
+                    sb.append(segment).append("/"); //$NON-NLS-1$
                 }
                 sb.append(name);
                 String rootLabel = NameLabelUtil.modalName(graph, root, mode);
-                sb.append(" (" + rootLabel + ")");
+                sb.append(" (" + rootLabel + ")"); //$NON-NLS-1$ //$NON-NLS-2$
                 return sb;
             }
         }
@@ -85,7 +86,7 @@ public class ProceduralComponentTypeEditorNamingService extends EditorNamingServ
         Layer0 L0 = Layer0.getInstance(graph);
         Resource owner = graph.getPossibleObject(property, L0.PropertyOf);
         if (owner == null)
-            return "No owner (Code)";
+            return "No owner (Code)"; //$NON-NLS-1$
         return graph.getPossibleRelatedValue(owner, L0.HasName);
     }