]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ProceduralComponentInstanceViewer.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / componentTypeEditor / ProceduralComponentInstanceViewer.java
index d35ea9f9328f1ffa3b254115bae7d8cb5b1cd8de..d7abea5dabb4f37e64a20d9515e080000a8bcbb6 100644 (file)
@@ -46,12 +46,12 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
                 Resource inputResource = getInputResource();
                 Variable context = Variables.getPossibleVariable(graph, inputResource);
                 if(context == null)
-                    return createErrorGraph("Couldn't create variable for the resource.");
+                    return createErrorGraph(Messages.ProceduralComponentInstanceViewer_CouldnotCreateVariableForResource);
                 try {
                     List<SubstructureElement> proceduralDesc = 
                             Functions.getProceduralDesc(graph, context);
                     if(proceduralDesc == null)
-                        return createErrorGraph("Component does not have a procedural substructure.");
+                        return createErrorGraph(Messages.ProceduralComponentInstanceViewer_NoProceduralSubstructure);
                     return createGraph(graph, proceduralDesc);
                 } catch(DatabaseException e) {
                     e.printStackTrace();
@@ -97,7 +97,7 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
     
     private static Graph createErrorGraph(String description) {
         Graph graph = new Graph();
-        new Node(graph, description).setShape("rectangle");
+        new Node(graph, description).setShape("rectangle"); //$NON-NLS-1$
         return graph;
     }
     
@@ -115,7 +115,7 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
             Node node = connectionPoints.get(interface_.relation);
             if(node == null) {
                 node = new Node(graph);
-                node.setShape("diamond");
+                node.setShape("diamond"); //$NON-NLS-1$
                 node.setLabel(nameOf(g, interface_.relation));
                 connectionPoints.put(interface_.relation, node);
             }
@@ -125,21 +125,21 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
 
     private static Graph createGraph(ReadGraph g, List<SubstructureElement> proceduralDesc) throws DatabaseException {
         Graph graph = new Graph();
-        graph.setRankdir("LR");
+        graph.setRankdir("LR"); //$NON-NLS-1$
         THashMap<String, Node> components = new THashMap<String, Node>();
         for(SubstructureElement element : proceduralDesc)
             if(element instanceof Component) {
                 Component component = (Component)element;
                 Record record = new Record();
-                record.add(component.name + " : " + nameOf(g, component.type));
+                record.add(component.name + " : " + nameOf(g, component.type)); //$NON-NLS-1$
                 StringBuilder b = new StringBuilder();
                 boolean first = true;
                 for(Property property : component.properties) {
                     if(first)
                         first = false;
                     else
-                        b.append("\\n");
-                    b.append(nameOf(g, property.relation) + " = " + property.value);
+                        b.append("\\n"); //$NON-NLS-1$
+                    b.append(nameOf(g, property.relation) + " = " + property.value); //$NON-NLS-1$
                 }
                 record.add(b.toString());
                 components.put(component.name, record.toNode(graph));
@@ -155,7 +155,7 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
                     Edge edge = new Edge(cp1.first, cp2.first);
                     if(cp1.second != null) {
                         if(cp2.second != null)
-                            edge.setLabel(cp1.second + "-" + cp2.second);
+                            edge.setLabel(cp1.second + "-" + cp2.second); //$NON-NLS-1$
                         else
                             edge.setLabel(cp1.second);
                     }
@@ -166,7 +166,7 @@ public class ProceduralComponentInstanceViewer extends ResourceEditorPart {
                 }
                 else {
                     Node p = new Node(graph);
-                    p.setShape("point");
+                    p.setShape("point"); //$NON-NLS-1$
                     boolean first = true;
                     for(ConnectionPoint cp : cps) {
                         Pair<Node, String> cp1 = getCp(g, graph, components, connectionPoints, cp);