]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Externalize strings in org.simantics.debug.ui 03/2503/3
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 28 Nov 2018 14:55:17 +0000 (16:55 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 7 Dec 2018 16:07:02 +0000 (18:07 +0200)
gitlab #210

Change-Id: Ie9366b4ce9f0530df946bed292a918fc7f6ac7f3

25 files changed:
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebugger.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebuggerEditor.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/GraphDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/Messages.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/ResourceSearch.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/SearchResourceDialog.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/SessionDebugger.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/SessionDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/VariableDebugger.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/VariableDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebugger.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebuggerEditor.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebuggerView.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/Messages.java [new file with mode: 0644]
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/messages.properties [new file with mode: 0644]
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/Activator.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/DebugUtils.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/GraphDebuggerAdapter.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/GraphDebuggerEditorAdapter.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/GraphicalDebuggerEditorAdapter.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/Messages.java [new file with mode: 0644]
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/SearchResourceHandler.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/TGEditorAdapter.java
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/messages.properties [new file with mode: 0644]
bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/messages.properties

index c3b3ab8b94792ea4dc12942eae7455ed26568d91..46d31fabe50516ba107b7d38a7f78460119aab8b 100644 (file)
@@ -44,6 +44,7 @@ import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.jface.resource.ColorDescriptor;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.resource.LocalResourceManager;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWTError;
 import org.eclipse.swt.browser.Browser;
@@ -138,9 +139,9 @@ public class GraphDebugger extends Composite {
         void historyChanged();
     }
 
-    private static final String                         STATEMENT_PART_SEPARATOR  = ",";
-    private final static String                         DEFAULT_DEBUGGER_CSS_FILE = "debugger.css";
-    private final static String                         DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE;
+    private static final String                         STATEMENT_PART_SEPARATOR  = ","; //$NON-NLS-1$
+    private final static String                         DEFAULT_DEBUGGER_CSS_FILE = "debugger.css"; //$NON-NLS-1$
+    private final static String                         DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE; //$NON-NLS-1$
 
     private static int                                  RESOURCE_NAME_MAX_LENGTH  = 1000;
     private static int                                  RESOURCE_VALUE_MAX_SIZE = 16384;
@@ -213,7 +214,7 @@ public class GraphDebugger extends Composite {
      */
     public GraphDebugger(Composite parent, int style, final Session session, Resource resource) {
         super(parent, style);
-        Assert.isNotNull(session, "session is null");
+        Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
         this.session = session;
         this.currentElement = resource;
         this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
@@ -235,7 +236,7 @@ public class GraphDebugger extends Composite {
      * When given to setStatus, indicates that the message shouldn't be touched
      * since <code>null</code> has a different meaning.
      */
-    private static final String DONT_TOUCH = "DONT_TOUCH";
+    private static final String DONT_TOUCH = "DONT_TOUCH"; //$NON-NLS-1$
 
     protected void setStatus(String message, String error) {
         IStatusLineManager status = WorkbenchUtils.getStatusLine(site);
@@ -269,7 +270,7 @@ public class GraphDebugger extends Composite {
                 if (!css.exists()) {
                     URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(DEFAULT_DEBUGGER_CSS_PATH), null);
                     if (url == null)
-                        throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'");
+                        throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                     cssPath = FileUtils.copyResource(url, css, true).toURI().toString();
                 } else {
                     cssPath = css.toURI().toString();
@@ -281,7 +282,7 @@ public class GraphDebugger extends Composite {
         }
     }
 
-    private static final String PROMPT_TEXT = "Enter resource ID (RID) or URI";
+    private static final String PROMPT_TEXT = Messages.GraphDebugger_EnterResourceIDorURI;
 
     public void createResourceText(final Composite parent) {
         final Text text = new Text(parent, SWT.BORDER);
@@ -292,7 +293,7 @@ public class GraphDebugger extends Composite {
         text.addFocusListener(new FocusListener() {    
             @Override
             public void focusLost(FocusEvent e) {
-                if (text.getText().trim().equals("")) {
+                if (text.getText().trim().equals("")) { //$NON-NLS-1$
                     text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
                     text.setText(PROMPT_TEXT);
                 }
@@ -301,7 +302,7 @@ public class GraphDebugger extends Composite {
             public void focusGained(FocusEvent e) {
                 if (text.getText().trim().equals(PROMPT_TEXT)) {
                     text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_BLACK));
-                    text.setText("");
+                    text.setText(""); //$NON-NLS-1$
                 }
                 text.selectAll();
             }
@@ -317,7 +318,7 @@ public class GraphDebugger extends Composite {
         });
 
         final Button button = new Button(parent, SWT.FLAT);
-        button.setText("&Lookup");
+        button.setText(Messages.GraphDebugger_Lookup);
         button.setEnabled(false);
         GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(false, false).applyTo(button);
 
@@ -349,7 +350,7 @@ public class GraphDebugger extends Composite {
             @Override
             public void modifyText(ModifyEvent e) {
                 String input = text.getText().trim();
-                if (!input.equals(PROMPT_TEXT) && !input.equals(""))
+                if (!input.equals(PROMPT_TEXT) && !input.equals("")) //$NON-NLS-1$
                     button.setEnabled(true);
                 else
                     button.setEnabled(false);
@@ -362,21 +363,21 @@ public class GraphDebugger extends Composite {
         input = input.trim();
 
         SerialisationSupport support = session.getService(SerialisationSupport.class);
-        if (input.startsWith("$")) {
+        if (input.startsWith("$")) { //$NON-NLS-1$
             try {
                 Resource r = support.getResource(Long.parseLong(input.substring(1)));
                 changeLocation(r);
             } catch (NumberFormatException e1) {
                 // Ignore, may happen for crap input
-                setStatus(DONT_TOUCH, "Invalid '$'-prefixed input, expected resource ID");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidPrefixedInput);
             } catch (Exception e1) {
                 ErrorLogger.defaultLogError(e1);
-                setStatus(DONT_TOUCH, "Resource ID lookup failed. See Error Log.");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusResourceIDFailed);
             }
             return;
         }
 
-        String[] parts = input.split("-");
+        String[] parts = input.split("-"); //$NON-NLS-1$
 
         if (parts.length == 1) {
             try {
@@ -390,10 +391,10 @@ public class GraphDebugger extends Composite {
                 }
             } catch (NumberFormatException e1) {
                 // Ignore, may happen for crap input
-                setStatus(DONT_TOUCH, "Invalid input, expected transient resource ID");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInput);
             } catch (Exception e1) {
                 ErrorLogger.defaultLogError(e1);
-                setStatus(DONT_TOUCH, "Transient resource ID lookup failed. See Error Log.");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusTransientResourceID);
             }
         } else if (parts.length == 2) {
             try {
@@ -404,10 +405,10 @@ public class GraphDebugger extends Composite {
                 changeLocation(r);
             } catch (NumberFormatException e1) {
                 // Ignore, may happen for crap input
-                setStatus(DONT_TOUCH, "Invalid input, expected index & cluster IDs");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInputExpectIdxClusterIds);
             } catch (Exception e1) {
                 ErrorLogger.defaultLogError(e1);
-                setStatus(DONT_TOUCH, "Index & cluster -based lookup failed. See Error Log.");
+                setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusIndexLookpuFailed);
             }
         }
 
@@ -415,7 +416,7 @@ public class GraphDebugger extends Composite {
         try {
             // First check that the input really is a proper URI.
             String uri = input;
-            if (!input.equals("http:/") && input.endsWith("/"))
+            if (!input.equals("http:/") && input.endsWith("/")) //$NON-NLS-1$ //$NON-NLS-2$
                 uri = input.substring(0, input.length() - 1);
             new URI(uri);
             Resource r = session.syncRequest( Queries.resource( uri ) );
@@ -425,20 +426,20 @@ public class GraphDebugger extends Composite {
             // Ignore, this is not a proper URI at all.
         } catch (ResourceNotFoundException e1) {
             // Ok, this was an URI, but no resource was found.
-            setStatus(DONT_TOUCH, "Resource for URI '" + input + "' not found");
+            setStatus(DONT_TOUCH, NLS.bind( Messages.GraphDebugger_StatusResourceforURI , input )); 
             return;
         } catch (DatabaseException e1) {
-            setStatus(DONT_TOUCH, "URI lookup failed. See Error Log.");
+            setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusURIlookupFailed);
             ErrorLogger.defaultLogError(e1);
         }
 
-        setStatus(DONT_TOUCH, "Invalid input, resource ID or URI expected");
+        setStatus(DONT_TOUCH, Messages.GraphDebugger_StatusInvalidInputResIdORURIExpected);
     }
 
     public Label createDropLabel(Composite parent) {
         final Label label = new Label(parent, SWT.BORDER);
         label.setAlignment(SWT.CENTER);
-        label.setText("Drag a resource here to examine it in this debugger!");
+        label.setText(Messages.GraphDebugger_LabelDragResource);
         label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
         GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).hint(SWT.DEFAULT, 20).span(2, 1).grab(true, false).applyTo(label);
 
@@ -537,29 +538,29 @@ public class GraphDebugger extends Composite {
             @Override
             public void changing(LocationEvent event) {
                 String location = event.location;
-                if (location.startsWith("simantics:browser"))
-                    location = "about:" + location.substring(17);
+                if (location.startsWith("simantics:browser")) //$NON-NLS-1$
+                    location = "about:" + location.substring(17); //$NON-NLS-1$
                 //System.out.println("changing: location=" + location);
 
                 // Do not follow links that are meant as actions that are
                 // handled below.
                 event.doit = false;
-                if ("about:blank".equals(location)) {
+                if ("about:blank".equals(location)) { //$NON-NLS-1$
                     // Just changing to the same old blank url is ok since it
                     // allows the browser to refresh itself.
                     event.doit = true;
                 }
 
-                if (location.startsWith("about:-link")) {
-                    String target = location.replace("about:-link", "");
+                if (location.startsWith("about:-link")) { //$NON-NLS-1$
+                    String target = location.replace("about:-link", ""); //$NON-NLS-1$ //$NON-NLS-2$
                     Resource element = links.getRight(target);
                     if (element == currentElement) {
                         event.doit = false;
                         return;
                     }
                     changeLocation(element);
-                } else if (location.startsWith("about:-remove")) {
-                    String target = location.replace("about:-remove", "");
+                } else if (location.startsWith("about:-remove")) { //$NON-NLS-1$
+                    String target = location.replace("about:-remove", ""); //$NON-NLS-1$ //$NON-NLS-2$
                     String n[] = target.split(STATEMENT_PART_SEPARATOR);
                     if (n.length != 3)
                         return;
@@ -571,10 +572,10 @@ public class GraphDebugger extends Composite {
                     // Make sure this is what the use wants.
                     MessageDialog md = new MessageDialog(
                             getShell(),
-                            "Confirm action...",
+                            Messages.GraphDebugger_ConfirmActionsDots,
                             null,
-                            "This action will remove the selected statement.\nAre you sure you want to proceed with this action?",
-                            MessageDialog.QUESTION, new String[] { "Cancel", "Continue" }, 0);
+                            Messages.GraphDebugger_ConfirmActionsDotsMsg,
+                            MessageDialog.QUESTION, new String[] { Messages.GraphDebugger_Cancel, Messages.GraphDebugger_Continue }, 0);
                     if (md.open() != 1) {
                         return;
                     }
@@ -602,8 +603,8 @@ public class GraphDebugger extends Composite {
 
                     }, parameter -> refreshBrowser()
                     );
-                } else if (location.startsWith("about:-edit-value")) {
-                    String target = location.replace("about:-edit-value", "");
+                } else if (location.startsWith("about:-edit-value")) { //$NON-NLS-1$
+                    String target = location.replace("about:-edit-value", ""); //$NON-NLS-1$ //$NON-NLS-2$
                     final Resource o = links.getRight(target);
 
                     session.asyncRequest(new ReadRequest() {
@@ -620,7 +621,7 @@ public class GraphDebugger extends Composite {
                                 public void run() {
                                     InputDialog dialog = new InputDialog(
                                             getShell(),
-                                            "Edit Value",
+                                            Messages.GraphDebugger_EditValue,
                                             null,
                                             previousValue,
                                             new IInputValidator() {
@@ -660,7 +661,7 @@ public class GraphDebugger extends Composite {
                                             {
                                                 Label label = new Label(composite, SWT.NONE);
                                                 label.moveAbove(getText());
-                                                label.setText("Input new property value. For numeric vector values, separate numbers with comma (',').");
+                                                label.setText(Messages.GraphDebugger_InputNewPropertyValue);
                                                 GridData data = new GridData(GridData.GRAB_HORIZONTAL
                                                         | GridData.HORIZONTAL_ALIGN_FILL
                                                         | GridData.VERTICAL_ALIGN_CENTER);
@@ -797,48 +798,48 @@ public class GraphDebugger extends Composite {
                 if (o instanceof byte[]) {
                     byte[] arr = (byte[]) o;
                     byte[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("byte", Arrays.toString(arr2), arr.length);
+                    return truncated("byte", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof int[]) {
                     int[] arr = (int[]) o;
                     int[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("int", Arrays.toString(arr2), arr.length);
+                    return truncated("int", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof long[]) {
                     long[] arr = (long[]) o;
                     long[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("long", Arrays.toString(arr2), arr.length);
+                    return truncated("long", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof float[]) {
                     float[] arr = (float[]) o;
                     float[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("float", Arrays.toString(arr2), arr.length);
+                    return truncated("float", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof double[]) {
                     double[] arr = (double[]) o;
                     double[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("double", Arrays.toString(arr2), arr.length);
+                    return truncated("double", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof boolean[]) {
                     boolean[] arr = (boolean[]) o;
                     boolean[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("boolean", Arrays.toString(arr2), arr.length);
+                    return truncated("boolean", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof Object[]) {
                     Object[] arr = (Object[]) o;
                     Object[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("Object", Arrays.toString(arr2), arr.length);
+                    return truncated("Object", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else {
-                    return "Unknown big array " + o.getClass();
+                    return "Unknown big array " + o.getClass(); //$NON-NLS-1$
                 }
             } else {
-                return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o);
+                return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         return null;
     }
 
     protected String truncated(String type, String string, int originalLength) {
-        return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string;
+        return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
     
     public static String htmlEscape(String s)
     {
-        return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br/>");
+        return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
     }
 
     /**
@@ -876,7 +877,7 @@ public class GraphDebugger extends Composite {
 //                                     Object v = graph.getValue(r, b);
 //                                     Serializer s = Bindings.getSerializerUnchecked(b);
 //                                     int size = s.getSize(v);
-                                   name = "Approx. " + valueSize + " byte literal of type " + type.toSingleLineString();
+                                   name = "Approx. " + valueSize + " byte literal of type " + type.toSingleLineString(); //$NON-NLS-1$ //$NON-NLS-2$
                                } else {                                        
                                        Binding b = Bindings.getBinding(type);
                                        Object v = graph.getValue(r, b);
@@ -896,7 +897,7 @@ public class GraphDebugger extends Composite {
                 }
                 
                 if(name.isEmpty()) {
-                       name = "<empty value>";
+                       name = "<empty value>"; //$NON-NLS-1$
                 }
                 
             }
@@ -914,7 +915,7 @@ public class GraphDebugger extends Composite {
                 //if(name.isEmpty())
                 name = DebugUtils.getSafeLabel(graph, r);
                 if (name.isEmpty())
-                    name = "<empty name>";
+                    name = "<empty name>"; //$NON-NLS-1$
             }
 //            ClusteringSupport support = graph.getSession().getService(ClusteringSupport.class);
 //            if(name == null)
@@ -956,36 +957,36 @@ public class GraphDebugger extends Composite {
                 // Don't know how I encountered this but it seems to be possible in some cases..
                 // Resource obj = graph.getSingleObject(r, L0.HasObject);
                 Resource obj = graph.getPossibleObject(r, L0.HasObject);
-                String tmp = htmlEscape( (pred == null ? "No predicate ?" : getResourceName(graph, pred)) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" );
+                String tmp = htmlEscape( (pred == null ? "No predicate ?" : getResourceName(graph, pred)) + " -> " + (obj == null ? "No object ?" : getResourceName(graph, obj)) + " (Assertion)" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                 name = tmp.substring(0, Math.min(80, tmp.length()));
             } else {
                 String resourceName = getResourceName(graph, r);
-                if(resourceName.equals("Inverse")) {
+                if(resourceName.equals("Inverse")) { //$NON-NLS-1$
                     Resource inverse = graph.getPossibleInverse(r);
                     if(inverse != null && graph.hasStatement(inverse, L0.ConsistsOf, r))
-                        resourceName = getResourceName(graph, inverse) + "/Inverse";
+                        resourceName = getResourceName(graph, inverse) + "/Inverse"; //$NON-NLS-1$
                 }
                 String tmp = htmlEscape( resourceName );
                 name = tmp.substring(0, Math.min(80, tmp.length()));
             }
             
         } catch (OutOfMemoryError e) {
-            name = "OutOfMemoryError";
+            name = "OutOfMemoryError"; //$NON-NLS-1$
         }
-        String ret = "<a href=\"simantics:browser-link" + getLinkString(r) + "\">"
+        String ret = "<a href=\"simantics:browser-link" + getLinkString(r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
         + name
-        + "</a>";
+        + "</a>"; //$NON-NLS-1$
         if (graph.isInstanceOf(r, L0.Literal)) {
-            ret += "&nbsp;<a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">"
-            + "(edit)"
-            + "</a>";
+            ret += "&nbsp;<a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
+            + "(edit)" //$NON-NLS-1$
+            + "</a>"; //$NON-NLS-1$
         }
         return ret;
     }
 
     private String getStatementRemoveRef(Resource s, Resource p, Resource o) {
-        return "<a href=\"simantics:browser-remove" + getStatementString(s, p, o)
-        + "\" title=\"Remove this statement\">X</a>";
+        return "<a href=\"simantics:browser-remove" + getStatementString(s, p, o) //$NON-NLS-1$
+        + "\" title=\"Remove this statement\">X</a>"; //$NON-NLS-1$
     }
 
     private void updatePred(StringBuffer content, ReadGraph graph, Resource subj, Resource pred, List<Resource[]> stats) throws DatabaseException {
@@ -1002,7 +1003,7 @@ public class GraphDebugger extends Composite {
 
             // Make a note if the statement was acquired.
             if(!stmSubject.equals(subj)) {
-                objects[i][3] = " (in " + getResourceRef(graph, stmSubject) + ")";
+                objects[i][3] = " (in " + getResourceRef(graph, stmSubject) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
 
@@ -1016,39 +1017,39 @@ public class GraphDebugger extends Composite {
 
         // Output table rows
         for (int i = 0; i < objects.length; ++i) {
-            content.append("<tr>");
+            content.append("<tr>"); //$NON-NLS-1$
             // Predicate column
             if (i == 0)
-                content.append("<td rowspan=\"").append(objects.length).append("\" valign=\"top\">").append(getResourceRef(graph, pred)).append("</td>");
+                content.append("<td rowspan=\"").append(objects.length).append("\" valign=\"top\">").append(getResourceRef(graph, pred)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
             // Object column
-            if (objects[i][3] == null) content.append("<td>");
-            else content.append("<td class=\"acquired\">");
+            if (objects[i][3] == null) content.append("<td>"); //$NON-NLS-1$
+            else content.append("<td class=\"acquired\">"); //$NON-NLS-1$
 
             content.append(objects[i][2]);
             if (objects[i][3] != null)
                 content.append(objects[i][3]);
 
-            content.append("</td>");
+            content.append("</td>"); //$NON-NLS-1$
             
             VirtualGraphSupport vgs = graph.getService(VirtualGraphSupport.class);
             VirtualGraph vg = vgs.getGraph(graph, subj, pred, links.getRight(objects[i][0]));
             
             if(vg != null) {
-                content.append("<td>").append(vg.toString()).append("</td>");
+                content.append("<td>").append(vg.toString()).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
             } else {
-                content.append("<td>DB</td>");
+                content.append("<td>DB</td>"); //$NON-NLS-1$
             }
             
 
             // Statement remove -link column
             // Only allowed for non-acquired statements.
             if (objects[i][3] == null) {
-                content.append("<td class=\"remove\">");
+                content.append("<td class=\"remove\">"); //$NON-NLS-1$
                 content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
-                content.append("</td>");
+                content.append("</td>"); //$NON-NLS-1$
             }
-            content.append("</tr>");
+            content.append("</tr>"); //$NON-NLS-1$
         }
     }
 
@@ -1057,13 +1058,13 @@ public class GraphDebugger extends Composite {
         // Generate output content from statements
         String ref = getResourceRef(graph, tag);
 
-        content.append("<tr>");
-        content.append("<td rowspan=\"1\" colspan=\"3\" valign=\"top\">").append(ref).append("</td>");
+        content.append("<tr>"); //$NON-NLS-1$
+        content.append("<td rowspan=\"1\" colspan=\"3\" valign=\"top\">").append(ref).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
         //content.append("<td>" + name + "</td>");
-        content.append("<td class=\"remove\">");
+        content.append("<td class=\"remove\">"); //$NON-NLS-1$
         content.append(getStatementRemoveRef(subj, tag, subj));
-        content.append("</td>");
-        content.append("</tr>");
+        content.append("</td>"); //$NON-NLS-1$
+        content.append("</tr>"); //$NON-NLS-1$
 
     }
 
@@ -1101,15 +1102,15 @@ public class GraphDebugger extends Composite {
             try {
                 cur = OrderedSetUtils.next(graph, subj, cur);
             } catch(DatabaseException e) {
-                list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>");
+                list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>"); //$NON-NLS-1$ //$NON-NLS-2$
                 Resource inv = graph.getPossibleInverse(subj);
                 for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) {
                     if(stat.getSubject().equals(cur)) {
                         if(stat.getPredicate().equals(subj)) {
-                            list.add("next " + getResourceRef(graph, stat.getObject()));
+                            list.add("next " + getResourceRef(graph, stat.getObject())); //$NON-NLS-1$
                         }
                         else if(stat.getPredicate().equals(inv)) {
-                            list.add("prev " + getResourceRef(graph, stat.getObject()));
+                            list.add("prev " + getResourceRef(graph, stat.getObject())); //$NON-NLS-1$
                         }
                     }
                 }
@@ -1122,15 +1123,15 @@ public class GraphDebugger extends Composite {
 
         // Output table rows
         for (int i = 0; i < list.size() ; ++i) {
-            content.append("<tr>");
+            content.append("<tr>"); //$NON-NLS-1$
             // Predicate column
             if (i == 0)
-                content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Ordered Set Elements</td>");
+                content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Ordered Set Elements</td>"); //$NON-NLS-1$ //$NON-NLS-2$
 
             // Object column
-            content.append("<td>");
+            content.append("<td>"); //$NON-NLS-1$
             content.append(list.get(i));
-            content.append("</td>");
+            content.append("</td>"); //$NON-NLS-1$
 
             // Statement remove -link column
             // Only allowed for non-acquired statements.
@@ -1139,7 +1140,7 @@ public class GraphDebugger extends Composite {
                 content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
                 content.append("</td>");
             }*/
-            content.append("</tr>");
+            content.append("</tr>"); //$NON-NLS-1$
         }
     }
 
@@ -1158,15 +1159,15 @@ public class GraphDebugger extends Composite {
 
         // Output table rows
         for (int i = 0; i < list.size() ; ++i) {
-            content.append("<tr>");
+            content.append("<tr>"); //$NON-NLS-1$
             // Predicate column
             if (i == 0)
-                content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Linked List Elements</td>");
+                content.append("<td rowspan=\"").append(list.size()).append("\" valign=\"top\">Linked List Elements</td>"); //$NON-NLS-1$ //$NON-NLS-2$
 
             // Object column
-            content.append("<td>");
+            content.append("<td>"); //$NON-NLS-1$
             content.append(list.get(i));
-            content.append("</td><td>DB</td>");
+            content.append("</td><td>DB</td>"); //$NON-NLS-1$
 
             // Statement remove -link column
             // Only allowed for non-acquired statements.
@@ -1175,7 +1176,7 @@ public class GraphDebugger extends Composite {
                 content.append(getStatementRemoveRef(subj, pred, links.getRight(objects[i][0])));
                 content.append("</td>");
             }*/
-            content.append("</tr>");
+            content.append("</tr>"); //$NON-NLS-1$
         }
     }
 
@@ -1186,11 +1187,11 @@ public class GraphDebugger extends Composite {
         StringBuffer content = new StringBuffer();
 
         // Generate HTML -page
-        content.append("<html>\n<head>\n")
+        content.append("<html>\n<head>\n") //$NON-NLS-1$
         .append(getHead())
-        .append("\n</head>\n")
-        .append("<body>\n")
-        .append("<div id=\"mainContent\">\n\n");
+        .append("\n</head>\n") //$NON-NLS-1$
+        .append("<body>\n") //$NON-NLS-1$
+        .append("<div id=\"mainContent\">\n\n"); //$NON-NLS-1$
 
         for (Resource r : resources) {
             if (r == null)
@@ -1201,14 +1202,14 @@ public class GraphDebugger extends Composite {
                 uri = graph.syncRequest(new ResourceToPossibleURI(r));
             } catch (Exception e) {
                 ErrorLogger.defaultLogError(e);
-                uri = "Cannot get URI: " + e.getMessage();
+                uri = "Cannot get URI: " + e.getMessage(); //$NON-NLS-1$
             }
 
             // Top DIV
-            content.append("<div id=\"top\">\n");
-            content.append("<table class=\"top\">\n");
+            content.append("<div id=\"top\">\n"); //$NON-NLS-1$
+            content.append("<table class=\"top\">\n"); //$NON-NLS-1$
             if (uri != null) {
-                content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n");
+                content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
             XSupport xs = graph.getService(XSupport.class);
@@ -1226,57 +1227,57 @@ public class GraphDebugger extends Composite {
                     obj = statement.getObject();
                     map.add(predicate, new Resource[] {subject, obj});
                 } catch (Throwable e) {
-                    ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e);
+                    ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                 }
             }
             SerialisationSupport ss = graph.getSession().getService(SerialisationSupport.class);
             ClusteringSupport support = graph.getSession().getService(ClusteringSupport.class);
-            content.append("<tr><td class=\"top_key\">Identifiers</td><td class=\"top_value\">");
-            content.append("<span id=\"resource_id\">")
-            .append(" RID = $").append(r.getResourceId())
-            .append(" Resource Key = ").append(ss.getTransientId(r))
-            .append(" CID = ").append(support.getCluster(r));
-            content.append("</span></td>");
+            content.append("<tr><td class=\"top_key\">Identifiers</td><td class=\"top_value\">"); //$NON-NLS-1$
+            content.append("<span id=\"resource_id\">") //$NON-NLS-1$
+            .append(" RID = $").append(r.getResourceId()) //$NON-NLS-1$
+            .append(" Resource Key = ").append(ss.getTransientId(r)) //$NON-NLS-1$
+            .append(" CID = ").append(support.getCluster(r)); //$NON-NLS-1$
+            content.append("</span></td>"); //$NON-NLS-1$
             if (immutable)
-                content.append("<td class=\"remove\">[IMMUTABLE]</td>");
-            content.append("</tr>\n");
+                content.append("<td class=\"remove\">[IMMUTABLE]</td>"); //$NON-NLS-1$
+            content.append("</tr>\n"); //$NON-NLS-1$
  
             boolean isClusterSet = support.isClusterSet(r);
             Resource parentSet = support.getClusterSetOfCluster(r);
             String parentSetURI = parentSet != null ? graph.getPossibleURI(parentSet) : null;
             
-            content.append("<tr><td class=\"top_key\">Clustering</td><td class=\"top_value\">");
-            content.append("<span id=\"resource_id\">");
+            content.append("<tr><td class=\"top_key\">Clustering</td><td class=\"top_value\">"); //$NON-NLS-1$
+            content.append("<span id=\"resource_id\">"); //$NON-NLS-1$
             
             if(parentSetURI != null)
-                content.append(" Containing cluster set = ").append(parentSetURI);
+                content.append(" Containing cluster set = ").append(parentSetURI); //$NON-NLS-1$
             else if (parentSet != null)
-               content.append(" Containing cluster set = ").append(parentSet.toString());
+               content.append(" Containing cluster set = ").append(parentSet.toString()); //$NON-NLS-1$
             else 
-                content.append(" Not in any cluster set ");
+                content.append(" Not in any cluster set "); //$NON-NLS-1$
             
-            content.append("</span></td>");
+            content.append("</span></td>"); //$NON-NLS-1$
             if (isClusterSet)
-                content.append("<td class=\"remove\">[CLUSTER SET]</td>");
-            content.append("</tr>\n");
+                content.append("<td class=\"remove\">[CLUSTER SET]</td>"); //$NON-NLS-1$
+            content.append("</tr>\n"); //$NON-NLS-1$
             
             // If the resource has a value, show it.
             String resourceValue = getResourceValue(graph, r);
             if (resourceValue != null) {
                 content
-                .append("<tr><td class=\"top_key\">Attached value</td><td class=\"top_value\">")
+                .append("<tr><td class=\"top_key\">Attached value</td><td class=\"top_value\">") //$NON-NLS-1$
                 .append(htmlEscape(resourceValue))
-                .append("</td></tr>\n");
+                .append("</td></tr>\n"); //$NON-NLS-1$
             }
 
             // Close #top
-            content.append("</table>\n");
-            content.append("</div>\n");
+            content.append("</table>\n"); //$NON-NLS-1$
+            content.append("</div>\n"); //$NON-NLS-1$
 
-            content.append("\n<div id=\"data\">\n");
-            content.append("<table>\n")
-            .append("<tr><th>Predicate</th><th>Object</th><th>Graph</th></tr>")
-            .append("<tr><td class=\"subtitle\" colspan=\"3\">Basic information</td></tr>");
+            content.append("\n<div id=\"data\">\n"); //$NON-NLS-1$
+            content.append("<table>\n") //$NON-NLS-1$
+            .append("<tr><th>Predicate</th><th>Object</th><th>Graph</th></tr>") //$NON-NLS-1$
+            .append("<tr><td class=\"subtitle\" colspan=\"3\">Basic information</td></tr>"); //$NON-NLS-1$
 
             boolean isOrderedSet = graph.isInstanceOf(r, L0.OrderedSet);
             boolean isLinkedList = graph.isInstanceOf(r, L0.List);
@@ -1291,7 +1292,7 @@ public class GraphDebugger extends Composite {
                     updatePred(content, graph, r, pred, map.remove(pred));
 
             // TAGS
-            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Tags</td></tr>");
+            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Tags</td></tr>"); //$NON-NLS-1$
             for(Statement stm : statements) {
                 if(stm.getSubject().equals(stm.getObject())) {
                     updateTag(content, graph, r, stm.getPredicate());
@@ -1300,7 +1301,7 @@ public class GraphDebugger extends Composite {
             }
 
             // ORDERED SETS
-            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Ordered Sets</td></tr>");
+            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Ordered Sets</td></tr>"); //$NON-NLS-1$
             for(Statement stm : statements) {
                 Resource predicate = stm.getPredicate();
                 if(graph.isInstanceOf(stm.getPredicate(), L0.OrderedSet)) {
@@ -1320,7 +1321,7 @@ public class GraphDebugger extends Composite {
             }
 
             // IS RELATED TO
-            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Is Related To</td></tr>");
+            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Is Related To</td></tr>"); //$NON-NLS-1$
 
             // ELEMENTS OF ORDERED SET
             if(isOrderedSet) {
@@ -1328,7 +1329,7 @@ public class GraphDebugger extends Composite {
                 try {
                     updateOrderedSet(content, graph, r);
                 } catch (ValidationException e) {
-                    content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>");
+                    content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>"); //$NON-NLS-1$ //$NON-NLS-2$
                 }
             }
 
@@ -1338,7 +1339,7 @@ public class GraphDebugger extends Composite {
                 try {
                     updateLinkedList(content, graph, r);
                 } catch (ValidationException e) {
-                    content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN LINKED LIST:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>");
+                    content.append("<td colspan=\"3\"><span style=\"color:red;font-weight:bold\">BROKEN LINKED LIST:<br/></span><span style=\"color:red\">").append(e.getMessage()).append("</span></td>"); //$NON-NLS-1$ //$NON-NLS-2$
                 }
             }
 
@@ -1348,7 +1349,7 @@ public class GraphDebugger extends Composite {
             for(Resource pred : preds) {
                 String str = htmlEscape( getResourceName(graph, pred) );
                 if(str == null)
-                    str = "<null>";
+                    str = "<null>"; //$NON-NLS-1$
                 strmap.put(pred, str);
             }
             Arrays.sort(preds, new Comparator<Resource>() {
@@ -1362,17 +1363,17 @@ public class GraphDebugger extends Composite {
                     updatePred(content, graph, r, pred, map.get(pred));
 
             // OTHER STATEMENTS
-            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Other statements</td></tr>");
+            content.append("<tr><td class=\"subtitle\" colspan=\"3\">Other statements</td></tr>"); //$NON-NLS-1$
             for(Resource pred : preds)
                 if(!graph.isSubrelationOf(pred, L0.IsRelatedTo))
                     updatePred(content, graph, r, pred, map.get(pred));
-            content.append("</table>\n");
+            content.append("</table>\n"); //$NON-NLS-1$
         }
         // Close #data
-        content.append("</div>\n\n");
+        content.append("</div>\n\n"); //$NON-NLS-1$
         // Close #mainContent
-        content.append("</div>\n");
-        content.append("</body>\n</html>\n");
+        content.append("</div>\n"); //$NON-NLS-1$
+        content.append("</body>\n</html>\n"); //$NON-NLS-1$
 
         // Update content
         final String finalContent = content.toString();
@@ -1409,7 +1410,7 @@ public class GraphDebugger extends Composite {
                         Serializer s = Bindings.getSerializerUnchecked(b);
                         int size = s.getSize(v);
                         if (size > RESOURCE_VALUE_MAX_SIZE) {
-                            return "Approx. " + size + " byte literal of type " + type.toSingleLineString();
+                            return "Approx. " + size + " byte literal of type " + type.toSingleLineString(); //$NON-NLS-1$ //$NON-NLS-2$
                         } else {
                             return b.toString(v, false);
                         }
@@ -1434,7 +1435,7 @@ public class GraphDebugger extends Composite {
             return NameUtils.getSafeName(g, r);
         } catch(Throwable throwable) {
             ErrorLogger.defaultLogError(throwable);
-            return "<font color=\"red\"><i>"+throwable.getClass().getName()+"</i> "+throwable.getMessage()+"</font>";
+            return "<font color=\"red\"><i>"+throwable.getClass().getName()+"</i> "+throwable.getMessage()+"</font>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
     }
 
@@ -1531,9 +1532,9 @@ public class GraphDebugger extends Composite {
 //    }
 
     private String getHead() {
-        String result = "";
+        String result = ""; //$NON-NLS-1$
         if (cssPath != null) {
-            result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">";
+            result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">"; //$NON-NLS-1$ //$NON-NLS-2$
         }
         return result;
     }
index 8cabe294812cbc30bb2b51237516cac3e68dab96..890036afcb623fbeeba3dc03367a06ed7eb5b45c 100644 (file)
@@ -38,7 +38,7 @@ import org.simantics.utils.ui.LayoutUtils;
 
 public class GraphDebuggerEditor extends ResourceEditorPart {
 
-    public static final String EDITOR_ID = "org.simantics.debug.graphDebuggerEditor";
+    public static final String EDITOR_ID = "org.simantics.debug.graphDebuggerEditor"; //$NON-NLS-1$
 
     private GraphDebugger      debugger;
     private IAction            backAction;
@@ -120,8 +120,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class RefreshAction extends Action {
         public RefreshAction() {
-            super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
-            setToolTipText("Refresh");
+            super(Messages.GraphDebuggerEditor_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerEditor_RefreshTT);
         }
         @Override
         public void run() {
@@ -131,8 +131,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class FindAction extends Action {
         public FindAction() {
-            super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
-            setToolTipText("Find Resource");
+            super(Messages.GraphDebuggerEditor_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerEditor_FindTT);
         }
         @Override
         public void run() {
@@ -142,8 +142,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class AddStatementAction extends Action {
         public AddStatementAction() {
-            super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add Statement Between Existing Resources");
+            super(Messages.GraphDebuggerEditor_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerEditor_AddStatementTT);
         }
         @Override
         public void run() {
@@ -157,8 +157,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class AddResourceAction extends Action {
         public AddResourceAction() {
-            super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add New Related Resource");
+            super(Messages.GraphDebuggerEditor_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerEditor_AddResourceTT);
         }
         @Override
         public void run() {
@@ -172,8 +172,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class BackAction extends Action {
         public BackAction() {
-            super("Back", Action.AS_PUSH_BUTTON);
-            setToolTipText("Back");
+            super(Messages.GraphDebuggerEditor_Back, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphDebuggerEditor_BackTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -186,8 +186,8 @@ public class GraphDebuggerEditor extends ResourceEditorPart {
 
     class ForwardAction extends Action {
         public ForwardAction() {
-            super("Forward", Action.AS_PUSH_BUTTON);
-            setToolTipText("Forward");
+            super(Messages.GraphDebuggerEditor_Forward, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphDebuggerEditor_ForwardTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
index 7d9d67b2ad3161506e584e139d6cf75afe79e266..b7b71da99c76640856575938384851e1de50b763 100644 (file)
@@ -38,7 +38,7 @@ import org.simantics.utils.ui.LayoutUtils;
 
 public class GraphDebuggerView extends ViewPart {
 
-    public static final String VIEW_ID              = "org.simantics.debug.graphDebugger";
+    public static final String VIEW_ID              = "org.simantics.debug.graphDebugger"; //$NON-NLS-1$
 
 //    private final boolean      DEFAULT_RECYCLE_VIEW = true;
 
@@ -139,8 +139,8 @@ public class GraphDebuggerView extends ViewPart {
 //
     class RefreshAction extends Action {
         public RefreshAction() {
-            super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
-            setToolTipText("Refresh");
+            super(Messages.GraphDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerView_Refresh);
         }
         @Override
         public void run() {
@@ -150,8 +150,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class BackAction extends Action {
         public BackAction() {
-            super("Back", Action.AS_PUSH_BUTTON);
-            setToolTipText("Back");
+            super(Messages.GraphDebuggerView_Back, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphDebuggerView_BackTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -163,8 +163,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class ForwardAction extends Action {
         public ForwardAction() {
-            super("Forward", Action.AS_PUSH_BUTTON);
-            setToolTipText("Forward");
+            super(Messages.GraphDebuggerView_Forward, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphDebuggerView_ForwardTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
@@ -176,8 +176,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class HomeAction extends Action {
         public HomeAction() {
-            super("Home", Action.AS_PUSH_BUTTON);
-            setToolTipText("Navigate to root library");
+            super(Messages.GraphDebuggerView_Home, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphDebuggerView_HomeTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
         }
@@ -189,8 +189,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class FindAction extends Action {
         public FindAction() {
-            super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
-            setToolTipText("Find Resource");
+            super(Messages.GraphDebuggerView_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerView_FindTT);
         }
         @Override
         public void run() {
@@ -200,8 +200,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class AddStatementAction extends Action {
         public AddStatementAction() {
-            super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add Statement Between Existing Resources");
+            super(Messages.GraphDebuggerView_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerView_AddStatementTT);
         }
         @Override
         public void run() {
@@ -215,8 +215,8 @@ public class GraphDebuggerView extends ViewPart {
 
     class AddResourceAction extends Action {
         public AddResourceAction() {
-            super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add New Related Resource");
+            super(Messages.GraphDebuggerView_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphDebuggerView_AddResourceTT);
         }
         @Override
         public void run() {
index dbf553d6701e158681ce69141d6e995b30073d41..a3e100b01e19195e738244eb99cbdc0097078070 100644 (file)
@@ -24,9 +24,66 @@ import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
 
-       public static String Name_adaption_problem;
-       public static String Name_formulation_problem;
+       public static String GraphDebugger_Cancel;
+       public static String GraphDebugger_ConfirmActionsDots;
+       public static String GraphDebugger_ConfirmActionsDotsMsg;
+       public static String GraphDebugger_Continue;
+       public static String GraphDebugger_EditValue;
+       public static String GraphDebugger_EnterResourceIDorURI;
+       public static String GraphDebugger_InputNewPropertyValue;
+       public static String GraphDebugger_LabelDragResource;
+       public static String GraphDebugger_Lookup;
+       public static String GraphDebugger_StatusIndexLookpuFailed;
+       public static String GraphDebugger_StatusInvalidInput;
+       public static String GraphDebugger_StatusInvalidInputExpectIdxClusterIds;
+       public static String GraphDebugger_StatusInvalidInputResIdORURIExpected;
+       public static String GraphDebugger_StatusInvalidPrefixedInput;
+       public static String GraphDebugger_StatusResourceforURI;
+       public static String GraphDebugger_StatusResourceIDFailed;
+       public static String GraphDebugger_StatusTransientResourceID;
+       public static String GraphDebugger_StatusURIlookupFailed;
+       public static String GraphDebuggerEditor_AddResource;
+       public static String GraphDebuggerEditor_AddResourceTT;
+       public static String GraphDebuggerEditor_AddStatement;
+       public static String GraphDebuggerEditor_AddStatementTT;
+       public static String GraphDebuggerEditor_Back;
+       public static String GraphDebuggerEditor_BackTT;
+       public static String GraphDebuggerEditor_Find;
+       public static String GraphDebuggerEditor_FindTT;
+       public static String GraphDebuggerEditor_Forward;
+       public static String GraphDebuggerEditor_ForwardTT;
+       public static String GraphDebuggerEditor_Refresh;
+       public static String GraphDebuggerEditor_RefreshTT;
+       public static String GraphDebuggerView_AddResource;
+       public static String GraphDebuggerView_AddResourceTT;
+       public static String GraphDebuggerView_AddStatement;
+       public static String GraphDebuggerView_AddStatementTT;
+       public static String GraphDebuggerView_Back;
+       public static String GraphDebuggerView_BackTT;
+       public static String GraphDebuggerView_Find;
+       public static String GraphDebuggerView_FindTT;
+       public static String GraphDebuggerView_Forward;
+       public static String GraphDebuggerView_ForwardTT;
+       public static String GraphDebuggerView_Home;
+       public static String GraphDebuggerView_HomeTT;
+       public static String GraphDebuggerView_Refresh;
 
+       public static String SearchResourceDialog_ActivatorResourceLabelProviderFailed;
+       public static String SearchResourceDialog_EnterNameResURIOrId;
+       public static String SearchResourceDialog_SeperatorLblPreviouslySelected;
+       public static String SearchResourceDialog_ShowInBrowser;
+       public static String SessionDebuggerView_ActivatorUnexpectedException;
+       public static String SessionDebuggerView_ActivatorUnexpectedIOException;
+       public static String SessionDebuggerView_Shell;
+       public static String SessionDebuggerView_WroteCommand;
+       public static String VariableDebugger_DragResourceToDebugger;
+       public static String VariableDebugger_Lookup;
+       public static String VariableDebugger_TextToolTip;
+       public static String VariableDebuggerView_Back;
+       public static String VariableDebuggerView_Forward;
+       public static String VariableDebuggerView_Home;
+       public static String VariableDebuggerView_HomeTT;
+       public static String VariableDebuggerView_Refresh;
        private static final String BUNDLE_NAME = "org.simantics.debug.ui.messages"; //$NON-NLS-1$
 
        static {
index 743cf4b6a26cce05c664897da974d8e5c2c71acd..0032a98fbf4290004d87d9fca91fc007dbe73515 100644 (file)
@@ -167,7 +167,7 @@ public class ResourceSearch extends ReadRequest {
     public void run(ReadGraph g) {
         try {
             if (!asyncListening && resFoundQueue!=null) resFoundQueue.g = g;
-            Resource root = g.getResource("http:/");
+            Resource root = g.getResource("http:/"); //$NON-NLS-1$
             Layer0 L0 = Layer0.getInstance(g);
             LinkedList<Resource> queue = new LinkedList<Resource>();
             queue.add(root);
index 4eca4e550638513f0d65d00ecf45ab57540a32a4..8532be1ae28a6cce6b97a280d399d399a2040897 100644 (file)
@@ -85,13 +85,13 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
      */
     private static final int DEFAULT_MAX_INDEX_HITS = 1000;
 
-    private static final Pattern ID_PATTERN = Pattern.compile("\\$([0-9]+)");
+    private static final Pattern ID_PATTERN = Pattern.compile("\\$([0-9]+)"); //$NON-NLS-1$
 
     private static final String SEARCH_RESOURCE_DIALOG = "SearchResourceDialog"; //$NON-NLS-1$
 
     private static final int SHOW_IN_BROWSER_ID = IDialogConstants.CLIENT_ID + 1;
 
-    private static final String SHOW_IN_BROWSER_LABEL = "Show In Browser";
+    private static final String SHOW_IN_BROWSER_LABEL = Messages.SearchResourceDialog_ShowInBrowser;
 
     private Session session;
     @SuppressWarnings("unused")
@@ -103,7 +103,7 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
         @Override
         public String getText(Object element) {
             if (element == null)
-                return "null";
+                return "null"; //$NON-NLS-1$
             // This may happen if multiple choice is enabled
             if (element instanceof String)
                 return (String) element;
@@ -117,15 +117,15 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
                         String name = NameUtils.getSafeName(g, r);
                         String uri = DebugUtils.getPossibleRootRelativePath(g, r);
                         return
-                                "[" + r.getResourceId() + "] - "
+                                "[" + r.getResourceId() + "] - " //$NON-NLS-1$ //$NON-NLS-2$
                                 + name
-                                + (uri != null ? " - " : "")
-                                + (uri != null ? uri : "");
+                                + (uri != null ? " - " : "") //$NON-NLS-1$ //$NON-NLS-2$
+                                + (uri != null ? uri : ""); //$NON-NLS-1$
                     }
                 });
             } catch (DatabaseException e) {
-                Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Resource label provider failed unexpectedly.", e));
-                return "";
+                Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SearchResourceDialog_ActivatorResourceLabelProviderFailed, e));
+                return ""; //$NON-NLS-1$
             }
         }
     };
@@ -137,7 +137,7 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
         @Override
         public String getText(Object element) {
             if (element==null)
-                return "null";
+                return "null"; //$NON-NLS-1$
             return element.toString();
         }
         @Override
@@ -162,19 +162,19 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
         this.session = s;
         this.selection = selection;
         this.labelProvider = new ElementLabelProvider(shell.getDisplay());
-        setMessage("Enter name, resource URI or ID");
+        setMessage(Messages.SearchResourceDialog_EnterNameResURIOrId);
         setListLabelProvider(labelProvider);
         setDetailsLabelProvider(detailsLabelProvider);
         setTitle(title);
         //setInitialPattern("*", FilteredItemsSelectionDialog.FULL_SELECTION);
         setSelectionHistory(new ResourceSelectionHistory());
-        setSeparatorLabel("Previously selected above, others below");
+        setSeparatorLabel(Messages.SearchResourceDialog_SeperatorLblPreviouslySelected);
     }
 
     @Override
     protected void configureShell(Shell shell) {
         this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), shell);
-        setImage((Image) resourceManager.get(BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")));
+        setImage((Image) resourceManager.get(BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"))); //$NON-NLS-1$
         super.configureShell(shell);
     }
 
@@ -221,16 +221,16 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
                             try {
                                 return DebugUtils.getSafeLabel(g, r);
                             } catch (Exception ex) {
-                                System.out.println("Exception thrown from restoreItemFromMemento");
+                                System.out.println("Exception thrown from restoreItemFromMemento"); //$NON-NLS-1$
                             }
                         } catch (Throwable t) {}
-                        return "" + r.getResourceId();
+                        return "" + r.getResourceId(); //$NON-NLS-1$
                     }
                 });
                 if (name==null) return null;
                 return new LabeledResource(name, r);
             } catch (NumberFormatException | DatabaseException e) {
-                LOGGER.info("Search memento restoration failed.", e);
+                LOGGER.info("Search memento restoration failed.", e); //$NON-NLS-1$
                 return null;
             }
         }
@@ -266,7 +266,7 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
         public ItemsFilterWithSearchResults() {
             
             final String pattern = getPattern();
-            final boolean findUris = pattern.trim().startsWith("http:/");
+            final boolean findUris = pattern.trim().startsWith("http:/"); //$NON-NLS-1$
             final long referencedResourceId = referencedResourceId(pattern);
             final boolean findIds = referencedResourceId != 0;
 
@@ -307,8 +307,8 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
                                 IResourceFilter rf = resourceFilter;
                                 String filter = getFilterForResourceFilter(rf);
                                 if (!filter.isEmpty())
-                                    filter += " AND ";
-                                filter += "Name:" + pattern + "*";
+                                    filter += " AND "; //$NON-NLS-1$
+                                filter += "Name:" + pattern + "*"; //$NON-NLS-1$ //$NON-NLS-2$
 
                                 Layer0 L0 = Layer0.getInstance(graph);
 
@@ -438,7 +438,7 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
     @SuppressWarnings("unchecked")
     @Override
     public String getElementName(Object item) {
-        return ((Container<Resource>)item).get().getResourceId()+"";
+        return ((Container<Resource>)item).get().getResourceId()+""; //$NON-NLS-1$
         //return item.toString();
     }
 
@@ -464,12 +464,12 @@ public class SearchResourceDialog extends FilteredItemsSelectionDialog {
 
     private String getFilterForResourceFilter(IResourceFilter filter) {
         if (filter == null || filter == ResourceSearch.FILTER_ALL)
-            return "";
+            return ""; //$NON-NLS-1$
         if (filter == ResourceSearch.FILTER_RELATIONS)
-            return "Types:Relation"; 
+            return "Types:Relation";  //$NON-NLS-1$
         if (filter == ResourceSearch.FILTER_TYPES)
-            return "Types:Type"; 
-        return "";
+            return "Types:Type";  //$NON-NLS-1$
+        return ""; //$NON-NLS-1$
     }
 
 }
index 820f5d6029937f530e4af2a5cb0ea9fb193d3dd7..fcbc93234ab1fd5a917699c13220faa308d3245a 100644 (file)
@@ -65,7 +65,7 @@ public class SessionDebugger extends Composite {
      */
     public SessionDebugger(Composite parent, int style, final Session session) {
         super(parent, style);
-        Assert.isNotNull(session, "session is null");
+        Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
         this.session = session;
         updater = new MergingGraphRequestProcessor(session, 100);
         
index 0e0363fa87ec842b59a65d9119db15cc2a4a4135..1426afa6dc08af020fbabbf9cf619c4987265b7c 100644 (file)
@@ -22,6 +22,7 @@ import java.util.Set;
 
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.custom.CTabFolder;
@@ -51,7 +52,7 @@ import org.simantics.views.swt.SimanticsView;
 @SuppressWarnings("deprecation")
 public class SessionDebuggerView extends SimanticsView {
 
-    public static final String VIEW_ID = "org.simantics.debug.sessionDebugger";
+    public static final String VIEW_ID = "org.simantics.debug.sessionDebugger"; //$NON-NLS-1$
 
     private CTabFolder folder;
     private Text commandLine;
@@ -63,7 +64,7 @@ public class SessionDebuggerView extends SimanticsView {
 
     @Override
     protected Set<String> getBrowseContexts() {
-        return Collections.singleton("");
+        return Collections.singleton(""); //$NON-NLS-1$
     }
 
     private CTabItem createItem(int index, CTabFolder folder, Control control) {
@@ -101,14 +102,14 @@ public class SessionDebuggerView extends SimanticsView {
                     if (historyPosition < 0) {
                         return;
                     } else if (historyPosition == 0) {
-                        commandLine.setText("");
+                        commandLine.setText(""); //$NON-NLS-1$
                         historyPosition = -1;
                     } else {
                         commandLine.setText(history.get(--historyPosition));
                     }
                 } else if (e.keyCode == SWT.ESC) {
                     historyPosition = -1;
-                    commandLine.setText("");
+                    commandLine.setText(""); //$NON-NLS-1$
                 } else if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
                     applyCommand(commandLine.getText());
                 }
@@ -116,7 +117,7 @@ public class SessionDebuggerView extends SimanticsView {
         });
 
         CTabItem shellItem = createItem(0, folder, shell);
-        shellItem.setText("Shell");
+        shellItem.setText(Messages.SessionDebuggerView_Shell);
 
 //        SessionDebugger deprecated = new SessionDebugger(folder, SWT.NONE, Simantics.getSession());
 //        deprecated.initializeUI();
@@ -140,7 +141,7 @@ public class SessionDebuggerView extends SimanticsView {
         } catch (DatabaseException e) {
             Activator.getDefault().getLog().log(
                     new Status(IStatus.ERROR, Activator.PLUGIN_ID,
-                            "Unexpected exception while applying command " + command, e));
+                            Messages.SessionDebuggerView_ActivatorUnexpectedException + command, e));
         }
     }
 
@@ -152,16 +153,16 @@ public class SessionDebuggerView extends SimanticsView {
                 Path p = (Path) output;
                 long size = Files.size(p);
                 if (size < (1L << 16)) {
-                    terminal.addFirst(new String(Files.readAllBytes(p), "UTF-8"));
+                    terminal.addFirst(new String(Files.readAllBytes(p), "UTF-8")); //$NON-NLS-1$
                 }
-                terminal.addFirst("Wrote command '" + command + "' output to file " + p);
+                terminal.addFirst(NLS.bind(Messages.SessionDebuggerView_WroteCommand ,new Object[] { command  , p})); 
             } catch (IOException e) {
                 Activator.getDefault().getLog().log(
                         new Status(IStatus.ERROR, Activator.PLUGIN_ID,
-                                "Unexpected I/O exception while applying command " + command, e));
+                                NLS.bind(Messages.SessionDebuggerView_ActivatorUnexpectedIOException , new Object[]{ command, e})));
             }
         } else {
-            throw new IllegalArgumentException("Unsupported output argument type " + output);
+            throw new IllegalArgumentException("Unsupported output argument type " + output); //$NON-NLS-1$
         }
         if (terminal.size() > 10)
             terminal.removeLast();
@@ -176,7 +177,7 @@ public class SessionDebuggerView extends SimanticsView {
     private void apply(String command, Object data) {
         if (data instanceof String) {
             SWTUtils.asyncExec(commandLine, () -> {
-                commandLine.setText("");
+                commandLine.setText(""); //$NON-NLS-1$
                 addHistory(command, data);
                 console.setText(formatTerminal());
             });
@@ -184,33 +185,33 @@ public class SessionDebuggerView extends SimanticsView {
             SWTUtils.asyncExec(commandLine, () -> {
                 try {
                     addHistory(command, dumpListenerReport((ListenerReport) data));
-                    commandLine.setText("");
+                    commandLine.setText(""); //$NON-NLS-1$
                     console.setText(formatTerminal());
                 } catch (IOException e) {
                     Activator.getDefault().getLog().log(
                             new Status(IStatus.ERROR, Activator.PLUGIN_ID,
-                                    "Unexpected I/O exception while applying command " + command, e));
+                                    Messages.SessionDebuggerView_ActivatorUnexpectedIOException + command, e));
                 }
             });
         }
     }
 
     private Path dumpListenerReport(ListenerReport data) throws IOException {
-        File f = Simantics.getTempfile("debug", "listenerReport");
-        try (PrintStream out = new PrintStream(f, "UTF-8")) {
-            out.print("<pre>");
+        File f = Simantics.getTempfile("debug", "listenerReport"); //$NON-NLS-1$ //$NON-NLS-2$
+        try (PrintStream out = new PrintStream(f, "UTF-8")) { //$NON-NLS-1$
+            out.print("<pre>"); //$NON-NLS-1$
             data.print(out);
-            out.print("</pre>");
+            out.print("</pre>"); //$NON-NLS-1$
         }
         return f.toPath();
     }
 
     private String formatTerminal() {
         StringBuilder b = new StringBuilder();
-        b.append("<html><head/><body>\n");
+        b.append("<html><head/><body>\n"); //$NON-NLS-1$
         for (String s : terminal)
-            b.append(s).append("<br/>\n");
-        b.append("</body></html>");
+            b.append(s).append("<br/>\n"); //$NON-NLS-1$
+        b.append("</body></html>"); //$NON-NLS-1$
         return b.toString();
     }
 
index 9c02bbe2a70806dfb8833e9b7a23a12310e7a015..697a589395dae9eab29af679020ee53780d6b444 100644 (file)
@@ -102,12 +102,12 @@ public class VariableDebugger extends Composite {
         void historyChanged();
     }
 
-    private final static String                         DEFAULT_DEBUGGER_CSS_FILE = "debugger.css";
-    private final static String                         DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE;
+    private final static String                         DEFAULT_DEBUGGER_CSS_FILE = "debugger.css"; //$NON-NLS-1$
+    private final static String                         DEFAULT_DEBUGGER_CSS_PATH = "css/" + DEFAULT_DEBUGGER_CSS_FILE; //$NON-NLS-1$
 
     private static int                                  RESOURCE_NAME_MAX_LENGTH  = 1000;
 
-       private final Charset                               utf8 = Charset.forName("UTF-8");
+       private final Charset                               utf8 = Charset.forName("UTF-8"); //$NON-NLS-1$
 
     private final LocalResourceManager                  resourceManager;
 
@@ -157,7 +157,7 @@ public class VariableDebugger extends Composite {
                             if (!browser.isDisposed())
                                 browser.setText(content);
                             if (!updateTriggerCounter.isDisposed())
-                                updateTriggerCounter.setText(updateCount + "/" + triggerCounter);
+                                updateTriggerCounter.setText(updateCount + "/" + triggerCounter); //$NON-NLS-1$
                         }
                     });
                 }
@@ -181,7 +181,7 @@ public class VariableDebugger extends Composite {
      */
     public VariableDebugger(Composite parent, int style, final Session session, String initialURI) {
         super(parent, style);
-        Assert.isNotNull(session, "session is null");
+        Assert.isNotNull(session, "session is null"); //$NON-NLS-1$
         this.session = session;
         this.currentElement = initialURI;
         this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
@@ -222,7 +222,7 @@ public class VariableDebugger extends Composite {
                 if (!css.exists()) {
                     URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(DEFAULT_DEBUGGER_CSS_PATH), null);
                     if (url == null)
-                        throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'");
+                        throw new FileNotFoundException("Could not find '" + DEFAULT_DEBUGGER_CSS_PATH + "' in bundle '" + Activator.PLUGIN_ID + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                     cssPath = FileUtils.copyResource(url, css, true).toURI().toString();
                 } else {
                     cssPath = css.toURI().toString();
@@ -238,7 +238,7 @@ public class VariableDebugger extends Composite {
     public Label createDropLabel(Composite parent) {
         final Label label = new Label(parent, SWT.BORDER | SWT.FLAT);
         label.setAlignment(SWT.CENTER);
-        label.setText("  Drag a resource or a variable here to examine it in this debugger!  ");
+        label.setText(Messages.VariableDebugger_DragResourceToDebugger);
         label.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
         GridData data = new GridData(SWT.LEFT, SWT.FILL, false, false);
         label.setLayoutData(data);
@@ -316,7 +316,7 @@ public class VariableDebugger extends Composite {
         text.setLayoutData(data);
 
         Button button = new Button(parent, SWT.NONE);
-        button.setText("Lookup");
+        button.setText(Messages.VariableDebugger_Lookup);
         GridData data2 = new GridData(SWT.FILL, SWT.FILL, false, false);
         button.setLayoutData(data2);
 
@@ -347,7 +347,7 @@ public class VariableDebugger extends Composite {
     protected Text createUpdateTriggerCounter(Composite parent) {
         Text label = new Text(parent, SWT.BORDER | SWT.FLAT);
         label.setEditable(false);
-        label.setToolTipText("Amount of Screen/Listener Updates Received for Shown Variable");
+        label.setToolTipText(Messages.VariableDebugger_TextToolTip);
         GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
         .grab(false, false).hint(32, SWT.DEFAULT).applyTo(label);
         updateTriggerCounter = label;
@@ -385,21 +385,21 @@ public class VariableDebugger extends Composite {
             @Override
             public void changing(LocationEvent event) {
                 String location = event.location;
-                if (location.startsWith("simantics:browser"))
-                    location = "about:" + location.substring(17);
+                if (location.startsWith("simantics:browser")) //$NON-NLS-1$
+                    location = "about:" + location.substring(17); //$NON-NLS-1$
                 //System.out.println("changing: location=" + location);
 
                 // Do not follow links that are meant as actions that are
                 // handled below.
                 event.doit = false;
-                if ("about:blank".equals(location)) {
+                if ("about:blank".equals(location)) { //$NON-NLS-1$
                     // Just changing to the same old blank url is ok since it
                     // allows the browser to refresh itself.
                     event.doit = true;
                 }
 
-                if (location.startsWith("about:-link")) {
-                    String target = location.replace("about:-link", "");
+                if (location.startsWith("about:-link")) { //$NON-NLS-1$
+                    String target = location.replace("about:-link", ""); //$NON-NLS-1$ //$NON-NLS-2$
                     try {
                         byte[] bytes = Base64.decode(target);
                         String url = new String(bytes, utf8);
@@ -411,8 +411,8 @@ public class VariableDebugger extends Composite {
                     } catch (IOException e) {
                         ErrorLogger.defaultLogError(e);
                     }
-                } else if (location.startsWith("about:-remove")) {
-                } else if (location.startsWith("about:-edit-value")) {
+                } else if (location.startsWith("about:-remove")) { //$NON-NLS-1$
+                } else if (location.startsWith("about:-edit-value")) { //$NON-NLS-1$
                 }
             }
         });
@@ -508,43 +508,43 @@ public class VariableDebugger extends Composite {
                 if (o instanceof byte[]) {
                     byte[] arr = (byte[]) o;
                     byte[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("byte", Arrays.toString(arr2), arr.length);
+                    return truncated("byte", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof int[]) {
                     int[] arr = (int[]) o;
                     int[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("int", Arrays.toString(arr2), arr.length);
+                    return truncated("int", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof long[]) {
                     long[] arr = (long[]) o;
                     long[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("long", Arrays.toString(arr2), arr.length);
+                    return truncated("long", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof float[]) {
                     float[] arr = (float[]) o;
                     float[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("float", Arrays.toString(arr2), arr.length);
+                    return truncated("float", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof double[]) {
                     double[] arr = (double[]) o;
                     double[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("double", Arrays.toString(arr2), arr.length);
+                    return truncated("double", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof boolean[]) {
                     boolean[] arr = (boolean[]) o;
                     boolean[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("boolean", Arrays.toString(arr2), arr.length);
+                    return truncated("boolean", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else if (o instanceof Object[]) {
                     Object[] arr = (Object[]) o;
                     Object[] arr2 = Arrays.copyOf(arr, RESOURCE_NAME_MAX_LENGTH);
-                    return truncated("Object", Arrays.toString(arr2), arr.length);
+                    return truncated("Object", Arrays.toString(arr2), arr.length); //$NON-NLS-1$
                 } else {
-                    return "Unknown big array " + o.getClass();
+                    return "Unknown big array " + o.getClass(); //$NON-NLS-1$
                 }
             } else {
-                return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o);
+                return o.getClass().getComponentType() + "[" + length + "] = " + ObjectUtils.toString(o); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         return null;
     }
 
     protected String truncated(String type, String string, int originalLength) {
-        return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string;
+        return type + "[" + RESOURCE_NAME_MAX_LENGTH + "/" + originalLength + "] = " + string; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 
     protected String getVariableName(ReadGraph graph, Variable r) {
@@ -563,7 +563,7 @@ public class VariableDebugger extends Composite {
             for(VariableConnectionPointDescriptor v : c.getConnectionPointDescriptors(graph, null)) {
                 result.add(v.getRelativeRVI(graph, base));
             }
-            return "c " + result.toString();
+            return "c " + result.toString(); //$NON-NLS-1$
         } else if (clazz.isArray()) {
             if(int[].class == clazz) {
                 return Arrays.toString((int[])o);
@@ -591,10 +591,10 @@ public class VariableDebugger extends Composite {
             Object value = r.getValue(graph);
             if(value instanceof Resource) return getResourceRef(graph, (Resource)value);
             else if (value instanceof Variable) return getVariableRef(graph, (Variable)value);
-            else return value != null ? getValue(graph, r, value) : "null";
+            else return value != null ? getValue(graph, r, value) : "null"; //$NON-NLS-1$
         } catch (Throwable e) {
             try {
-                Logger.defaultLogError("getValue " + r.getURI(graph), e);
+                Logger.defaultLogError("getValue " + r.getURI(graph), e); //$NON-NLS-1$
             } catch (DatabaseException e1) {
                 Logger.defaultLogError(e1);
             }
@@ -605,7 +605,7 @@ public class VariableDebugger extends Composite {
     protected String getDatatype(ReadGraph graph, Variable r) {
         try {
             Datatype dt = r.getPossibleDatatype(graph);
-            return dt != null ? dt.toSingleLineString() : "undefined";
+            return dt != null ? dt.toSingleLineString() : "undefined"; //$NON-NLS-1$
         } catch (Exception e) {
             return e.getMessage();
         }
@@ -616,9 +616,9 @@ public class VariableDebugger extends Composite {
     }
 
     private String getVariableRef(ReadGraph graph, Variable r) throws DatabaseException {
-        String ret = "<a href=\"simantics:browser-link" + getLinkString(graph, r) + "\">"
+        String ret = "<a href=\"simantics:browser-link" + getLinkString(graph, r) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
         + getVariableName(graph, r)
-        + "</a>";
+        + "</a>"; //$NON-NLS-1$
 //        if (graph.isInstanceOf(r, L0.Literal)) {
 //            ret += "&nbsp;<a class=\"edit-link\" href=\"simantics:browser-edit-value" + getLinkString(r) + "\">"
 //            + "(edit value)"
@@ -645,11 +645,11 @@ public class VariableDebugger extends Composite {
 //        } catch (Exception e) {
 //            e.printStackTrace();
 //        }
-        content.append("<tr>");
-        content.append("<td>").append(getVariableRef(graph, property)).append("</td>");
-        content.append("<td>").append(getValue(graph, property)).append("</td>");
-        content.append("<td>").append(getDatatype(graph, property)).append("</td>");
-        content.append("</tr>");
+        content.append("<tr>"); //$NON-NLS-1$
+        content.append("<td>").append(getVariableRef(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+        content.append("<td>").append(getValue(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+        content.append("<td>").append(getDatatype(graph, property)).append("</td>"); //$NON-NLS-1$ //$NON-NLS-2$
+        content.append("</tr>"); //$NON-NLS-1$
     }
 
     protected String getRVIString(ReadGraph graph, Variable var) throws DatabaseException {
@@ -657,7 +657,7 @@ public class VariableDebugger extends Composite {
         try {
             return var.getRVI(graph).toString(graph);
         } catch (Throwable e) {
-            return "No RVI";
+            return "No RVI"; //$NON-NLS-1$
         }
         
     }
@@ -669,9 +669,9 @@ public class VariableDebugger extends Composite {
         StringBuilder content = new StringBuilder();
 
         // Generate HTML -page
-        content.append("<html><head>").append(getHead()).append("</head>\n");
-        content.append("<body>\n");
-        content.append("<div id=\"mainContent\">\n");
+        content.append("<html><head>").append(getHead()).append("</head>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+        content.append("<body>\n"); //$NON-NLS-1$
+        content.append("<div id=\"mainContent\">\n"); //$NON-NLS-1$
         for (String uri : uris) {
             //System.out.println("URI: " + uri);
             Variable var = Variables.getPossibleVariable(graph, uri);
@@ -690,14 +690,14 @@ public class VariableDebugger extends Composite {
             }
             
             // Begin #top DIV
-            content.append("<div id=\"top\">\n");
-            content.append("<table class=\"top\">\n");
-            content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n");
-            content.append("<tr><td class=\"top_key\">RVI</td><td class=\"top_value\"><span id=\"uri\">").append(rviString).append("</span></td></tr>\n");
-            content.append("<tr><td class=\"top_key\">Class</td><td class=\"top_value\"><span id=\"class\">").append(var.getClass().getCanonicalName()).append("</span></td></tr>\n");
-            content.append("<tr><td class=\"top_key\">Solver node</td><td class=\"top_value\"><span id=\"class\">").append(node).append("</span></td></tr>\n");
-            content.append("</table>\n");
-            content.append("</div>\n");
+            content.append("<div id=\"top\">\n"); //$NON-NLS-1$
+            content.append("<table class=\"top\">\n"); //$NON-NLS-1$
+            content.append("<tr><td class=\"top_key\">URI</td><td class=\"top_value\"><span id=\"uri\">").append(uri).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+            content.append("<tr><td class=\"top_key\">RVI</td><td class=\"top_value\"><span id=\"uri\">").append(rviString).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+            content.append("<tr><td class=\"top_key\">Class</td><td class=\"top_value\"><span id=\"class\">").append(var.getClass().getCanonicalName()).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+            content.append("<tr><td class=\"top_key\">Solver node</td><td class=\"top_value\"><span id=\"class\">").append(node).append("</span></td></tr>\n"); //$NON-NLS-1$ //$NON-NLS-2$
+            content.append("</table>\n"); //$NON-NLS-1$
+            content.append("</div>\n"); //$NON-NLS-1$
             // Close #top DIV
 
             // Content
@@ -709,7 +709,7 @@ public class VariableDebugger extends Composite {
                 }
             } catch (DatabaseException e) {
                 // This may happen if the Variable implementation is broken
-                ErrorLogger.defaultLogError("Broken variable child retrieval implementation or serious modelling error encountered. See exception for details.", e);
+                ErrorLogger.defaultLogError("Broken variable child retrieval implementation or serious modelling error encountered. See exception for details.", e); //$NON-NLS-1$
             }
 
             TreeMap<String, Variable> map2 = new TreeMap<String, Variable>();
@@ -720,37 +720,37 @@ public class VariableDebugger extends Composite {
                 }
             } catch (DatabaseException e) {
                 // This may happen if the Variable implementation is broken
-                ErrorLogger.defaultLogError("Broken variable property retrieval implementation or serious modelling error encountered. See exception for details.", e);
+                ErrorLogger.defaultLogError("Broken variable property retrieval implementation or serious modelling error encountered. See exception for details.", e); //$NON-NLS-1$
             }
 
-            content.append("\n<div id=\"data\">\n");
-            content.append("<table>\n");
+            content.append("\n<div id=\"data\">\n"); //$NON-NLS-1$
+            content.append("<table>\n"); //$NON-NLS-1$
 
-            content.append("<tr><th>Child</th></tr>");
+            content.append("<tr><th>Child</th></tr>"); //$NON-NLS-1$
             for (Variable child : map.values()) {
-                content.append("<tr><td>").append(getVariableRef(graph, child)).append("</td></tr>");
+                content.append("<tr><td>").append(getVariableRef(graph, child)).append("</td></tr>"); //$NON-NLS-1$ //$NON-NLS-2$
             }
 
-            content.append("<tr><th>Property</th><th>Value</th><th>Datatype</th></tr>");
+            content.append("<tr><th>Property</th><th>Value</th><th>Datatype</th></tr>"); //$NON-NLS-1$
             for (Variable property : map2.values()) {
                 updateProperty(content, graph, property);
             }
             // Close #data
-            content.append("</div>\n\n");
+            content.append("</div>\n\n"); //$NON-NLS-1$
         }
 
         // Close #mainContent
-        content.append("</div>\n");
-        content.append("</body></html>\n");
+        content.append("</div>\n"); //$NON-NLS-1$
+        content.append("</body></html>\n"); //$NON-NLS-1$
 
         // Update content
         return content.toString();
     }
 
     private String getHead() {
-        String result = "";
+        String result = ""; //$NON-NLS-1$
         if (cssPath != null) {
-            result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">";
+            result = "<link href=\"" + cssPath + "\" rel=\"stylesheet\" type=\"text/css\">"; //$NON-NLS-1$ //$NON-NLS-2$
         }
         return result;
     }
index 6edd79ad299d87a10bfaf9719f06f77ba87e72ee..48234434e213ae04b37e4754e71037bc7aa721f2 100644 (file)
@@ -35,7 +35,7 @@ import org.simantics.utils.ui.LayoutUtils;
 
 public class VariableDebuggerView extends ViewPart {
 
-    public static final String VIEW_ID              = "org.simantics.debug.variableDebugger";
+    public static final String VIEW_ID              = "org.simantics.debug.variableDebugger"; //$NON-NLS-1$
 
     private ResourceInput      input;
 
@@ -115,7 +115,7 @@ public class VariableDebuggerView extends ViewPart {
 //
     class RefreshAction extends Action {
         public RefreshAction() {
-            super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+            super(Messages.VariableDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
         }
         @Override
         public void run() {
@@ -125,7 +125,7 @@ public class VariableDebuggerView extends ViewPart {
 
     class BackAction extends Action {
         public BackAction() {
-            super("Back", Action.AS_PUSH_BUTTON);
+            super(Messages.VariableDebuggerView_Back, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -137,7 +137,7 @@ public class VariableDebuggerView extends ViewPart {
 
     class ForwardAction extends Action {
         public ForwardAction() {
-            super("Forward", Action.AS_PUSH_BUTTON);
+            super(Messages.VariableDebuggerView_Forward, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
@@ -149,8 +149,8 @@ public class VariableDebuggerView extends ViewPart {
 
     class HomeAction extends Action {
         public HomeAction() {
-            super("Home", Action.AS_PUSH_BUTTON);
-            setToolTipText("Navigate to root library");
+            super(Messages.VariableDebuggerView_Home, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.VariableDebuggerView_HomeTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
         }
index fef011b8d4efdcc754d314d23f8df5003ce53b59..c8a89fa9e619327ce221c7465f8161e4b8675b96 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Set;
 import javax.swing.SwingUtilities;
 
 import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.layout.GridData;
@@ -114,7 +115,7 @@ public class GraphicalDebugger extends GraphDebugger {
        
        public GraphvizComponent2 createGraph(Composite parent) {
                graph = new Graph();
-               graph.setRankdir("LR");
+               graph.setRankdir("LR"); //$NON-NLS-1$
                graphVizComponent = new GraphvizComponent2(parent, SWT.NONE);
                SwingUtilities.invokeLater(new Runnable() {
                        
@@ -195,8 +196,8 @@ public class GraphicalDebugger extends GraphDebugger {
                if (n == null) {
                        n = new Node(graph);
                        if (!r.isPersistent()) {
-                               n.setShape("box");
-                               n.setFontColor("blue");
+                               n.setShape("box"); //$NON-NLS-1$
+                               n.setFontColor("blue"); //$NON-NLS-1$
                        }
                        nodeMap.map(r, n);
                }
@@ -205,20 +206,20 @@ public class GraphicalDebugger extends GraphDebugger {
        
        @SuppressWarnings("unused")
        protected void appendLabel(Node node, String text) {
-               String label = node.get("label");
+               String label = node.get("label"); //$NON-NLS-1$
                if (true) {
                        if (label == null || label.length() == 0)
                                label = text;//escape(text);
                        else {
                                label = label.substring(1,label.length()-1);
-                               label += "<br/>"+text;
+                               label += "<br/>"+text; //$NON-NLS-1$
                        }
-                       label = "<" + label + ">";
+                       label = "<" + label + ">"; //$NON-NLS-1$ //$NON-NLS-2$
                } else {
                        if (label == null || label.length() == 0)
                                label = text;
                        else {
-                               label += " "+text;
+                               label += " "+text; //$NON-NLS-1$
                        }
                        
                }
@@ -232,7 +233,7 @@ public class GraphicalDebugger extends GraphDebugger {
                L0 = Layer0.getInstance(g);
                
                graph = new Graph();
-               graph.setRankdir("LR");
+               graph.setRankdir("LR"); //$NON-NLS-1$
                
                nodeMap.clear();
                edgeMap.clear();
@@ -266,8 +267,8 @@ public class GraphicalDebugger extends GraphDebugger {
                continue;
             Node node = getResourceRef(g, r);
             if (r.equals(getDebuggerLocation())) {
-               node.setFillColor("#aaffaa");
-                               node.setStyle("filled");
+               node.setFillColor("#aaffaa"); //$NON-NLS-1$
+                               node.setStyle("filled"); //$NON-NLS-1$
             }
           //Node node = getOrCreate(r);
             processed.add(r);
@@ -279,10 +280,10 @@ public class GraphicalDebugger extends GraphDebugger {
                 uri = g.syncRequest(new ResourceToPossibleURI(r));
             } catch (Exception e) {
                 e.printStackTrace();
-                uri = "Cannot get URI: " + e.getMessage();
+                uri = "Cannot get URI: " + e.getMessage(); //$NON-NLS-1$
             }
             if (uri != null)
-               appendLabel(node, "URI: " + uri);
+               appendLabel(node, "URI: " + uri); //$NON-NLS-1$
                 //content.append("\t\t<div class=\"monospaced\">" + uri + "</div><br/>");
 
             Collection<Statement> statements = g.getStatements(r, L0.IsWeaklyRelatedTo);
@@ -298,12 +299,12 @@ public class GraphicalDebugger extends GraphDebugger {
                     map.add(predicate, new Resource[] {subject, obj});
                 } catch (Throwable e) {
                     e.printStackTrace();
-                    ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e);
+                    ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                 }
             }
             ClusteringSupport support = g.getSession().getService(ClusteringSupport.class);
             //content.append("<h3>" + " ["+ r.getResourceId() + "-" + support.getCluster(r) + "] " + "</h3>\n");
-            appendLabel(node,  " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]");
+            appendLabel(node,  " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             
             //content.append("<table>\n");
             //content.append("<tr><th>Predicate</th><th>Object</th></tr>");
@@ -324,7 +325,7 @@ public class GraphicalDebugger extends GraphDebugger {
             //content.append("<tr><td class=\"subtitle\" colspan=\"2\">Tags</td></tr>");
             for(Statement stm : statements) {
                 if(stm.getSubject().equals(stm.getObject())) {
-                    updateTag(node, g, r, stm.getPredicate(), "Tag");
+                    updateTag(node, g, r, stm.getPredicate(), "Tag"); //$NON-NLS-1$
                     map.remove(stm.getPredicate());
                 }
             }
@@ -334,7 +335,7 @@ public class GraphicalDebugger extends GraphDebugger {
             for(Statement stm : statements) {
                 Resource predicate = stm.getPredicate();
                 if(g.isInstanceOf(stm.getPredicate(), L0.OrderedSet)) {
-                    updateTag(node, g, r, stm.getPredicate(), "Ordered Set");
+                    updateTag(node, g, r, stm.getPredicate(), "Ordered Set"); //$NON-NLS-1$
                     map.remove(stm.getPredicate());
                 }
                 Resource inverse = g.getPossibleInverse(predicate);
@@ -366,7 +367,7 @@ public class GraphicalDebugger extends GraphDebugger {
             for(Resource pred : preds) {
                 String str = htmlEscape(getResourceName(g, pred));
                 if(str == null)
-                    str = "<null>";
+                    str = "<null>"; //$NON-NLS-1$
                 strmap.put(pred, str);
             }
             Arrays.sort(preds, new Comparator<Resource>() {
@@ -429,10 +430,10 @@ public class GraphicalDebugger extends GraphDebugger {
             if(!stmSubject.equals(subj)) {
                 Node asserted = getResourceRef(graph, stmSubject);
                 Edge e = new Edge(this.graph, objects[i].node, asserted);
-                e.setLabel("Asserted in");
+                e.setLabel(Messages.GraphicalDebugger_AssertedIn);
                 
-                objects[i].node.setFillColor("#ffaaaa");
-                objects[i].node.setStyle("filled");
+                objects[i].node.setFillColor("#ffaaaa"); //$NON-NLS-1$
+                objects[i].node.setStyle("filled"); //$NON-NLS-1$
             }
         }
 
@@ -506,7 +507,7 @@ public class GraphicalDebugger extends GraphDebugger {
                 cur = OrderedSetUtils.next(graph, subj, cur);
             } catch(DatabaseException e) {
                Edge edge = new Edge(this.graph, node, node);
-               edge.setLabel("Broken Ordered Set");
+               edge.setLabel(Messages.GraphicalDebugger_BrockenOrderedSet);
                 //list.add("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>");
 //                Resource inv = graph.getPossibleInverse(subj);
 //                for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) {
@@ -528,7 +529,7 @@ public class GraphicalDebugger extends GraphDebugger {
         }
         for (int i = 0; i < list.size() ; ++i) {
                 Edge e = new Edge(this.graph, node, list.get(i));
-                e.setLabel("Oredered set item " + i);
+                e.setLabel(NLS.bind(Messages.GraphicalDebugger_OrderedSetItem , i));
         }
 
         // Output table rows
index 4c87b8a6d887a9c40e57d6f0aeb2447967ba1686..9e89ef3287b53825932bf72bb08203e4fa8e2721 100644 (file)
@@ -38,7 +38,7 @@ import org.simantics.utils.ui.LayoutUtils;
 
 public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
-    public static final String EDITOR_ID = "org.simantics.debug.graphicalDebuggerEditor";
+    public static final String EDITOR_ID = "org.simantics.debug.graphicalDebuggerEditor"; //$NON-NLS-1$
 
     private GraphicalDebugger      debugger;
     private IAction            backAction;
@@ -135,7 +135,7 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
     class RefreshAction extends Action {
         public RefreshAction() {
-            super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+            super(Messages.GraphicalDebuggerEditor_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
         }
         @Override
         public void run() {
@@ -145,8 +145,8 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
     class FindAction extends Action {
         public FindAction() {
-            super("Find", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png"));
-            setToolTipText("Find Resource");
+            super(Messages.GraphicalDebuggerEditor_Find, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_blue.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphicalDebuggerEditor_FindTT);
         }
         @Override
         public void run() {
@@ -156,8 +156,8 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
     class AddStatementAction extends Action {
         public AddStatementAction() {
-            super("AddStatement", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add Statement Between Existing Resources");
+            super(Messages.GraphicalDebuggerEditor_AddStatement, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphicalDebuggerEditor_AddStatementTT);
         }
         @Override
         public void run() {
@@ -170,8 +170,8 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
     }
     class AddResourceAction extends Action {
         public AddResourceAction() {
-            super("AddResource", BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png"));
-            setToolTipText("Add New Related Resource");
+            super(Messages.GraphicalDebuggerEditor_AddResource, BundleUtils.getImageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/cog_add.png")); //$NON-NLS-2$
+            setToolTipText(Messages.GraphicalDebuggerEditor_AddResourceTT);
         }
         @Override
         public void run() {
@@ -184,8 +184,8 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
     }
     class BackAction extends Action {
         public BackAction() {
-            super("Back", Action.AS_PUSH_BUTTON);
-            setToolTipText("Back");
+            super(Messages.GraphicalDebuggerEditor_Back, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphicalDebuggerEditor_BackTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -198,8 +198,8 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
     class ForwardAction extends Action {
         public ForwardAction() {
-            super("Forward", Action.AS_PUSH_BUTTON);
-            setToolTipText("Forward");
+            super(Messages.GraphicalDebuggerEditor_Forward, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphicalDebuggerEditor_ForwardTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
@@ -212,7 +212,7 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
     
     class DecreaseDepthAction extends Action {
         public DecreaseDepthAction() {
-            super("Decrease", Action.AS_PUSH_BUTTON);
+            super(Messages.GraphicalDebuggerEditor_Decrease, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -224,7 +224,7 @@ public class GraphicalDebuggerEditor extends ResourceEditorPart {
 
     class IncreaseDepthAction extends Action {
         public IncreaseDepthAction() {
-            super("Increase", Action.AS_PUSH_BUTTON);
+            super(Messages.GraphicalDebuggerEditor_Increase, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
index 1c17001f012e6ff26f6b6901b0fce70cd492f43c..a47f48e23eaad757a509ad3295ebe1e326f04878 100644 (file)
@@ -32,7 +32,7 @@ import org.simantics.utils.ui.LayoutUtils;
 
 public class GraphicalDebuggerView extends ViewPart {
 
-    public static final String VIEW_ID              = "org.simantics.debug.graphicalDebugger";
+    public static final String VIEW_ID              = "org.simantics.debug.graphicalDebugger"; //$NON-NLS-1$
 
 //    private final boolean      DEFAULT_RECYCLE_VIEW = true;
 
@@ -128,7 +128,7 @@ public class GraphicalDebuggerView extends ViewPart {
 //
     class RefreshAction extends Action {
         public RefreshAction() {
-            super("Refresh", BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif"));
+            super(Messages.GraphicalDebuggerView_Refresh, BundleUtils.getImageDescriptorFromPlugin(SimanticsUI.PLUGIN_ID, "icons/refresh.gif")); //$NON-NLS-2$
         }
         @Override
         public void run() {
@@ -138,7 +138,7 @@ public class GraphicalDebuggerView extends ViewPart {
 
     class BackAction extends Action {
         public BackAction() {
-            super("Back", Action.AS_PUSH_BUTTON);
+            super(Messages.GraphicalDebuggerView_Back, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -150,7 +150,7 @@ public class GraphicalDebuggerView extends ViewPart {
 
     class ForwardAction extends Action {
         public ForwardAction() {
-            super("Forward", Action.AS_PUSH_BUTTON);
+            super(Messages.GraphicalDebuggerView_Forward, Action.AS_PUSH_BUTTON);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
@@ -162,8 +162,8 @@ public class GraphicalDebuggerView extends ViewPart {
 
     class HomeAction extends Action {
         public HomeAction() {
-            super("Home", Action.AS_PUSH_BUTTON);
-            setToolTipText("Navigate to root library");
+            super(Messages.GraphicalDebuggerView_Home, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphicalDebuggerView_HomeTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ETOOL_HOME_NAV_DISABLED));
         }
@@ -175,8 +175,8 @@ public class GraphicalDebuggerView extends ViewPart {
     
     class DecreaseDepthAction extends Action {
         public DecreaseDepthAction() {
-            super("Decrease", Action.AS_PUSH_BUTTON);
-            setToolTipText("Decrease Depth");
+            super(Messages.GraphicalDebuggerView_Decrease, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphicalDebuggerView_DecreaseTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));
         }
@@ -188,8 +188,8 @@ public class GraphicalDebuggerView extends ViewPart {
 
     class IncreaseDepthAction extends Action {
         public IncreaseDepthAction() {
-            super("Increase", Action.AS_PUSH_BUTTON);
-            setToolTipText("Increase Depth");
+            super(Messages.GraphicalDebuggerView_Increase, Action.AS_PUSH_BUTTON);
+            setToolTipText(Messages.GraphicalDebuggerView_IncreaseTT);
             setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
             setDisabledImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));
         }
diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/Messages.java b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/Messages.java
new file mode 100644 (file)
index 0000000..12721b4
--- /dev/null
@@ -0,0 +1,39 @@
+package org.simantics.debug.ui.graph;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.simantics.debug.ui.graph.messages"; //$NON-NLS-1$
+       public static String GraphicalDebugger_AssertedIn;
+       public static String GraphicalDebugger_BrockenOrderedSet;
+       public static String GraphicalDebugger_OrderedSetItem;
+       public static String GraphicalDebuggerEditor_AddResource;
+       public static String GraphicalDebuggerEditor_AddResourceTT;
+       public static String GraphicalDebuggerEditor_AddStatement;
+       public static String GraphicalDebuggerEditor_AddStatementTT;
+       public static String GraphicalDebuggerEditor_Back;
+       public static String GraphicalDebuggerEditor_BackTT;
+       public static String GraphicalDebuggerEditor_Decrease;
+       public static String GraphicalDebuggerEditor_Find;
+       public static String GraphicalDebuggerEditor_FindTT;
+       public static String GraphicalDebuggerEditor_Forward;
+       public static String GraphicalDebuggerEditor_ForwardTT;
+       public static String GraphicalDebuggerEditor_Increase;
+       public static String GraphicalDebuggerEditor_Refresh;
+       public static String GraphicalDebuggerView_Back;
+       public static String GraphicalDebuggerView_Decrease;
+       public static String GraphicalDebuggerView_DecreaseTT;
+       public static String GraphicalDebuggerView_Forward;
+       public static String GraphicalDebuggerView_Home;
+       public static String GraphicalDebuggerView_HomeTT;
+       public static String GraphicalDebuggerView_Increase;
+       public static String GraphicalDebuggerView_IncreaseTT;
+       public static String GraphicalDebuggerView_Refresh;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/messages.properties b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/messages.properties
new file mode 100644 (file)
index 0000000..9565a60
--- /dev/null
@@ -0,0 +1,25 @@
+GraphicalDebugger_AssertedIn=Asserted in\r
+GraphicalDebugger_BrockenOrderedSet=Broken Ordered Set\r
+GraphicalDebugger_OrderedSetItem=Ordered set item {0}\r
+GraphicalDebuggerEditor_AddResource=AddResource\r
+GraphicalDebuggerEditor_AddResourceTT=Add New Related Resource\r
+GraphicalDebuggerEditor_AddStatement=AddStatement\r
+GraphicalDebuggerEditor_AddStatementTT=Add Statement Between Existing Resources\r
+GraphicalDebuggerEditor_Back=Back\r
+GraphicalDebuggerEditor_BackTT=Back\r
+GraphicalDebuggerEditor_Decrease=Decrease\r
+GraphicalDebuggerEditor_Find=Find\r
+GraphicalDebuggerEditor_FindTT=Find Resource\r
+GraphicalDebuggerEditor_Forward=Forward\r
+GraphicalDebuggerEditor_ForwardTT=Forward\r
+GraphicalDebuggerEditor_Increase=Increase\r
+GraphicalDebuggerEditor_Refresh=Refresh\r
+GraphicalDebuggerView_Back=Back\r
+GraphicalDebuggerView_Decrease=Decrease\r
+GraphicalDebuggerView_DecreaseTT=Decrease Depth\r
+GraphicalDebuggerView_Forward=Forward\r
+GraphicalDebuggerView_Home=Home\r
+GraphicalDebuggerView_HomeTT=Navigate to root library\r
+GraphicalDebuggerView_Increase=Increase\r
+GraphicalDebuggerView_IncreaseTT=Increase Depth\r
+GraphicalDebuggerView_Refresh=Refresh\r
index c69746d923308ff5453d0ff6c8a4fbdf8b815bfe..70aa098039d007976ff911f936ccf0edcb276eae 100644 (file)
@@ -20,7 +20,7 @@ import org.osgi.framework.BundleContext;
 public class Activator extends AbstractUIPlugin {
 
        // The plug-in ID
-       public static final String PLUGIN_ID = "org.simantics.debug.ui";
+       public static final String PLUGIN_ID = "org.simantics.debug.ui"; //$NON-NLS-1$
 
        // The shared instance
        private static Activator plugin;
index 306f7f9613c6d4a9f593c565524f546d14f46275..67ebb19ee46e6de414c38bb9e595d6a12b1dcd78 100644 (file)
@@ -44,7 +44,7 @@ public class DebugUtils {
         if (stm != null) {
             String label = NameUtils.getSafeLabel(graph, r);
             if (!label.isEmpty() && !stm.isAsserted(r))
-                name += " (" + label + ")";
+                name += " (" + label + ")"; //$NON-NLS-1$ //$NON-NLS-2$
         }
         return name;
     }
@@ -80,14 +80,14 @@ public class DebugUtils {
     public static void addResource(Session s, GraphDebugger debugger) throws DatabaseException {
         Shell shell = debugger.getShell();
 
-        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Create New Resource");
+        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_CreateNewResource);
         rld.setBlockOnOpen(true);
         rld.setResourceFilter(ResourceSearch.FILTER_TYPES);
 
         Resource subject_ = debugger.getDebuggerLocation();
         if (subject_ == null) {
             rld.setBlockOnOpen(true);
-            rld.setMessage("Select Subject");
+            rld.setMessage(Messages.DebugUtils_SelectSubject);
             rld.setInitialSelections(new Object[] {});
             if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
             if (rld.getResult()==null) return;
@@ -97,13 +97,13 @@ public class DebugUtils {
 
         rld.setBlockOnOpen(true);
         rld.setResourceFilter(ResourceSearch.FILTER_RELATIONS);
-        rld.setMessage("Select Predicate");
+        rld.setMessage(Messages.DebugUtils_SelectPredicate);
         rld.setInitialSelections(new Object[] {});
         if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
         if (rld.getResult()==null) return;
         final Resource predicate = ((Container<Resource>)rld.getResult()[0]).get();
 
-        rld.setMessage("Select Type of New Object Instance");
+        rld.setMessage(Messages.DebugUtils_SelectTypeOfNewObjectInstance);
         rld.setResourceFilter(ResourceSearch.FILTER_TYPES);
         rld.setInitialSelections(new Object[] {});
         if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
@@ -127,12 +127,12 @@ public class DebugUtils {
     @SuppressWarnings("unchecked")
     public static void addStatement(Session s, GraphDebugger debugger) throws DatabaseException {
         Shell shell = debugger.getShell();
-        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Create New Statement");
+        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_CreateNewStatement);
 
         Resource subject_ = debugger.getDebuggerLocation();
         if (subject_ == null) {
             rld.setBlockOnOpen(true);
-            rld.setMessage("Select Subject");
+            rld.setMessage(Messages.DebugUtils_SelectSubject);
             rld.setInitialSelections(new Object[] {});
             if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
             if (rld.getResult()==null) return;
@@ -142,14 +142,14 @@ public class DebugUtils {
 
         rld.setBlockOnOpen(true);
         rld.setResourceFilter(ResourceSearch.FILTER_RELATIONS);
-        rld.setMessage("Select Predicate");
+        rld.setMessage(Messages.DebugUtils_SelectPredicate);
         rld.setInitialSelections(new Object[] {});
         if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
         if (rld.getResult()==null) return;
         final Resource predicate = ((Container<Resource>)rld.getResult()[0]).get();
 
         rld.setResourceFilter(ResourceSearch.FILTER_ALL);
-        rld.setMessage("Select Object");
+        rld.setMessage(Messages.DebugUtils_SelectObject);
         rld.setInitialSelections(new Object[] {});
         if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
         if (rld.getResult()==null) return;
@@ -165,7 +165,7 @@ public class DebugUtils {
 
     public static void find(Session s, GraphDebugger debugger) {
         Shell shell = debugger.getShell();
-        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, "Select Resource to View");
+        SearchResourceDialog rld = new SearchResourceDialog(s, false, shell, Messages.DebugUtils_SelectResourceToView);
         rld.setBlockOnOpen(true);
         if (rld.open()!=org.eclipse.jface.window.Window.OK) return;
         if (rld.getResult()==null) return;
index e61a955fb51bab18ef2d7c92da04709a0a805192..71ae91414afdae4728f8f3b670c1c381861f5a9c 100644 (file)
@@ -24,7 +24,7 @@ import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 public class GraphDebuggerAdapter extends AbstractResourceEditorAdapter {
 
     public GraphDebuggerAdapter() {
-        super("Graph Debugger View", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+        super(Messages.GraphDebuggerAdapter_GraphDebuggerView, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
     }
 
     @Override
index 1ef8a2543368fcc2dc1a6138447bd9df8295006c..6039f82875b75f2daa837c08b203e86f143c1cb4 100644 (file)
@@ -25,7 +25,7 @@ import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 public class GraphDebuggerEditorAdapter extends AbstractResourceEditorAdapter {
 
     public GraphDebuggerEditorAdapter() {
-        super("Graph Debugger", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+        super(Messages.GraphDebuggerEditorAdapter_GraphDebugger, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-2$
     }
 
     @Override
index 600520a23517d2fc154f431b29e2a13a87027911..d98edc4c4bcf32a0fb27cdeb97bc5dba08b90a78 100644 (file)
@@ -23,7 +23,7 @@ import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
 public class GraphicalDebuggerEditorAdapter extends AbstractResourceEditorAdapter {
 
     public GraphicalDebuggerEditorAdapter() {
-        super("Graphical Debugger", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+        super(Messages.GraphicalDebuggerEditorAdapter_GraphicalDebugger, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
     }
 
     @Override
diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/Messages.java b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/Messages.java
new file mode 100644 (file)
index 0000000..35479a8
--- /dev/null
@@ -0,0 +1,26 @@
+package org.simantics.debug.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.simantics.debug.ui.internal.messages"; //$NON-NLS-1$
+       public static String DebugUtils_CreateNewResource;
+       public static String DebugUtils_CreateNewStatement;
+       public static String DebugUtils_SelectObject;
+       public static String DebugUtils_SelectPredicate;
+       public static String DebugUtils_SelectResourceToView;
+       public static String DebugUtils_SelectSubject;
+       public static String DebugUtils_SelectTypeOfNewObjectInstance;
+       public static String GraphDebuggerAdapter_GraphDebuggerView;
+       public static String GraphDebuggerEditorAdapter_GraphDebugger;
+       public static String GraphicalDebuggerEditorAdapter_GraphicalDebugger;
+       public static String SearchResourceHandler_OpenResource;
+       public static String TGEditorAdapter_OntologyViewer;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
index bf36166452ff9de727d8fa5fdb4b11f00cb1f68f..49917f909af776db185225a8405e12c46ec2977c 100644 (file)
@@ -41,7 +41,7 @@ public class SearchResourceHandler extends AbstractHandler {
     public Object execute(ExecutionEvent event) throws ExecutionException {
         Shell shell = HandlerUtil.getActiveShellChecked(event);
         Session session = Simantics.getSession();
-        SearchResourceDialog rld = new SearchResourceDialog(session, false, shell, "Open Resource");
+        SearchResourceDialog rld = new SearchResourceDialog(session, false, shell, Messages.SearchResourceHandler_OpenResource);
         rld.setResourceFilter(ResourceSearch.FILTER_ALL);
         rld.setBlockOnOpen(true);
         rld.open();
index a941ecbc39b920435c1869368e6baf336443003c..84d50b88e0bf7fec6b1f53babfce78829e7ebe48 100644 (file)
@@ -25,10 +25,10 @@ import org.simantics.ui.workbench.editor.AbstractResourceEditorAdapter;
  */
 public class TGEditorAdapter extends AbstractResourceEditorAdapter {
 
-       public static final String EDITOR_ID = "org.simantics.modeling.ui.pgraphEditor";
+       public static final String EDITOR_ID = "org.simantics.modeling.ui.pgraphEditor"; //$NON-NLS-1$
        
     public TGEditorAdapter() {
-        super("Ontology Viewer", SimanticsUI.getImageDescriptor("icons/etool16/bug.png"));
+        super(Messages.TGEditorAdapter_OntologyViewer, SimanticsUI.getImageDescriptor("icons/etool16/bug.png")); //$NON-NLS-1$
     }
 
     @Override
diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/messages.properties b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/internal/messages.properties
new file mode 100644 (file)
index 0000000..9240ce0
--- /dev/null
@@ -0,0 +1,12 @@
+DebugUtils_CreateNewResource=Create New Resource\r
+DebugUtils_CreateNewStatement=Create New Statement\r
+DebugUtils_SelectObject=Select Object\r
+DebugUtils_SelectPredicate=Select Predicate\r
+DebugUtils_SelectResourceToView=Select Resource to View\r
+DebugUtils_SelectSubject=Select Subject\r
+DebugUtils_SelectTypeOfNewObjectInstance=Select Type of New Object Instance\r
+GraphDebuggerAdapter_GraphDebuggerView=Graph Debugger View\r
+GraphDebuggerEditorAdapter_GraphDebugger=Graph Debugger\r
+GraphicalDebuggerEditorAdapter_GraphicalDebugger=Graphical Debugger\r
+SearchResourceHandler_OpenResource=Open Resource\r
+TGEditorAdapter_OntologyViewer=Ontology Viewer\r
index dbdce7c4f6e94e745938886170f85631150ac3f9..a37e47dc43b57756f8b4c8d82cde26dd71f938bf 100644 (file)
@@ -9,6 +9,64 @@
 # Contributors:
 #     VTT Technical Research Centre of Finland - initial API and implementation
 ###############################################################################
+GraphDebugger_Cancel=Cancel
+GraphDebugger_ConfirmActionsDots=Confirm action...
+GraphDebugger_ConfirmActionsDotsMsg=This action will remove the selected statement.\nAre you sure you want to proceed with this action?
+GraphDebugger_Continue=Continue
+GraphDebugger_EditValue=Edit Value
+GraphDebugger_EnterResourceIDorURI=Enter resource ID (RID) or URI
+GraphDebugger_InputNewPropertyValue=Input new property value. For numeric vector values, separate numbers with comma (',').
+GraphDebugger_LabelDragResource=Drag a resource here to examine it in this debugger\!
+GraphDebugger_Lookup=&Lookup
+GraphDebugger_StatusIndexLookpuFailed=Index & cluster -based lookup failed. See Error Log.
+GraphDebugger_StatusInvalidInput=Invalid input, expected transient resource ID
+GraphDebugger_StatusInvalidInputExpectIdxClusterIds=Invalid input, expected index & cluster IDs
+GraphDebugger_StatusInvalidInputResIdORURIExpected=Invalid input, resource ID or URI expected
+GraphDebugger_StatusInvalidPrefixedInput=Invalid '$'-prefixed input, expected resource ID
+GraphDebugger_StatusResourceforURI=Resource for URI ''{0}'' not found
+GraphDebugger_StatusResourceIDFailed=Resource ID lookup failed. See Error Log.
+GraphDebugger_StatusTransientResourceID=Transient resource ID lookup failed. See Error Log.
+GraphDebugger_StatusURIlookupFailed=URI lookup failed. See Error Log.
+GraphDebuggerEditor_AddResourceTT=Add New Related Resource
+GraphDebuggerEditor_AddStatement=AddStatement
+GraphDebuggerEditor_AddStatementTT=Add Statement Between Existing Resources
+GraphDebuggerEditor_Back=Back
+GraphDebuggerEditor_BackTT=Back
+GraphDebuggerEditor_Find=Find
+GraphDebuggerEditor_FindTT=Find Resource
+GraphDebuggerEditor_Forward=Forward
+GraphDebuggerEditor_ForwardTT=Forward
+GraphDebuggerEditor_Refresh=Refresh
+GraphDebuggerEditor_RefreshTT=Refresh
 
-Name_adaption_problem = <p>GraphDebugger: name adaption problem in {0}</p>
-Name_formulation_problem = <p>GraphDebugger: unknown name formulation problem in {0}</p>
\ No newline at end of file
+
+GraphDebuggerEditor_AddResource=AddResource
+GraphDebuggerView_AddResource=AddResource
+GraphDebuggerView_AddResourceTT=Add New Related Resource
+GraphDebuggerView_AddStatement=AddStatement
+GraphDebuggerView_AddStatementTT=Add Statement Between Existing Resources
+GraphDebuggerView_Back=Back
+GraphDebuggerView_BackTT=Back
+GraphDebuggerView_Find=Find
+GraphDebuggerView_FindTT=Find Resource
+GraphDebuggerView_Forward=Forward
+GraphDebuggerView_ForwardTT=Forward
+GraphDebuggerView_Home=Home
+GraphDebuggerView_HomeTT=Navigate to root library
+GraphDebuggerView_Refresh=Refresh
+SearchResourceDialog_ActivatorResourceLabelProviderFailed=Resource label provider failed unexpectedly.
+SearchResourceDialog_EnterNameResURIOrId=Enter name, resource URI or ID
+SearchResourceDialog_SeperatorLblPreviouslySelected=Previously selected above, others below
+SearchResourceDialog_ShowInBrowser=Show In Browser
+SessionDebuggerView_ActivatorUnexpectedException=Unexpected exception while applying command 
+SessionDebuggerView_ActivatorUnexpectedIOException=Unexpected I/O exception while applying command {0}{1}
+SessionDebuggerView_Shell=Shell
+SessionDebuggerView_WroteCommand=Wrote command ''{0}'' output to file {1}
+VariableDebugger_DragResourceToDebugger=\ \ Drag a resource or a variable here to examine it in this debugger\!  
+VariableDebugger_Lookup=Lookup
+VariableDebugger_TextToolTip=Amount of Screen/Listener Updates Received for Shown Variable
+VariableDebuggerView_Back=Back
+VariableDebuggerView_Forward=Forward
+VariableDebuggerView_Home=Home
+VariableDebuggerView_HomeTT=Navigate to root library
+VariableDebuggerView_Refresh=Refresh