]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.message.ui/src/org/simantics/message/ui/LogView.java
Externalize strings
[simantics/platform.git] / bundles / org.simantics.message.ui / src / org / simantics / message / ui / LogView.java
index b71cb3cded05f7de514060b789014186e9bb71d7..a9d685be387c9e358ecc861f3a0fe5d095c9a13c 100644 (file)
@@ -361,7 +361,7 @@ public class LogView extends ViewPart implements ILogListener {
                */
                fMessageDescription = new Browser(sashForm, SWT.NONE);
                fMessageDescription.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-               fMessageDescription.setText("<html><head></head><body><p>Select a message to show its description here.</p></body></html>");
+               fMessageDescription.setText("<html><head></head><body><p>Select a message to show its description here.</p></body></html>"); //$NON-NLS-1$
                fMessageDescription.addLocationListener(new LocationListener() {
                    @Override
                    public void changed(LocationEvent event) {
@@ -371,7 +371,7 @@ public class LogView extends ViewPart implements ILogListener {
                    public void changing(LocationEvent event) {
                        //System.out.println("changing: " + event);
                        String location = event.location;
-                       if ("about:blank".equals(location)) {
+                       if ("about:blank".equals(location)) { //$NON-NLS-1$
                            event.doit = true;
                        } else {
                            event.doit = false;
@@ -413,7 +413,7 @@ public class LogView extends ViewPart implements ILogListener {
                 IStructuredSelection s = (IStructuredSelection) event.getSelection();
                 if (s.isEmpty()) {
                     //fMessageDescription.setText("Select a message to show its description here.", false, false);
-                    fMessageDescription.setText("<html><head></head><body><pre>Select a message to show its description here.</pre></body></html>");
+                    fMessageDescription.setText("<html><head></head><body><pre>Select a message to show its description here.</pre></body></html>"); //$NON-NLS-1$
                 } else {
                     AbstractEntry entry = (AbstractEntry) s.getFirstElement();
                     if (entry instanceof LogEntry) {
@@ -427,11 +427,7 @@ public class LogView extends ViewPart implements ILogListener {
                         // truncation enables us to show even lengthy messages.
                         if (msg.length() > Short.MAX_VALUE) {
                             StringBuilder truncated = new StringBuilder();
-                            truncated.append("... [truncated ");
-                            truncated.append(msg.length() - (Short.MAX_VALUE - 100));
-                            truncated.append(" out of ");
-                            truncated.append(msg.length());
-                            truncated.append(" characters]");
+                            truncated.append( NLS.bind(Messages.LogView_Truncated, msg.length() - (Short.MAX_VALUE - 100), msg.length()));                            
                             msg = msg.substring(0, Short.MAX_VALUE - 100) + truncated;
                         }
                         try {
@@ -596,11 +592,11 @@ public class LogView extends ViewPart implements ILogListener {
 
     @SuppressWarnings("unused")
     private Action createTestAction() {
-        Action action = new Action("Test") {
+        Action action = new Action("Test") { //$NON-NLS-1$
             public void run() {
-                IStatus s1 = new Status(IStatus.INFO, Activator.PLUGIN_ID, "Test message 1", null); 
-                IStatus s2 = new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Test message 2", null); 
-                IStatus s3 = new DetailStatus(IStatus.ERROR, Activator.PLUGIN_ID, "This is the short message.", HtmlUtil.p("A multi-lined message...\n<br/>continuing...<br/><br/>still...<br/>Error occurred, report at " + HtmlUtil.a("http://www.simantics.org", "simantics.org")), null); 
+                IStatus s1 = new Status(IStatus.INFO, Activator.PLUGIN_ID, "Test message 1", null);  //$NON-NLS-1$
+                IStatus s2 = new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Test message 2", null);  //$NON-NLS-1$
+                IStatus s3 = new DetailStatus(IStatus.ERROR, Activator.PLUGIN_ID, "This is the short message.", HtmlUtil.p("A multi-lined message...\n<br/>continuing...<br/><br/>still...<br/>Error occurred, report at {0}" + HtmlUtil.a("http://www.simantics.org", "simantics.org")), null);  //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-1$
                 MessageService.defaultLog(s1);
                 MessageService.defaultLog(s2);
                 MessageService.defaultLog(s3);
@@ -608,16 +604,16 @@ public class LogView extends ViewPart implements ILogListener {
 //                Activator.getDefault().getLog().log(s2);
 //                Activator.getDefault().getLog().log(s3);
 
-                MultiStatus s4 = new MultiStatus(Activator.PLUGIN_ID, 0, "Test message 4", new Exception());
-                s4.merge(new Status(IStatus.INFO, Activator.PLUGIN_ID, "MultiStatus Test 1", null));
-                s4.merge(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "MultiStatus Test 2", null));
-                s4.merge(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "MultiStatus Test 3", null));
+                MultiStatus s4 = new MultiStatus(Activator.PLUGIN_ID, 0, "Test message 4", new Exception()); //$NON-NLS-1$
+                s4.merge(new Status(IStatus.INFO, Activator.PLUGIN_ID, "MultiStatus Test 1", null)); //$NON-NLS-1$
+                s4.merge(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "MultiStatus Test 2", null)); //$NON-NLS-1$
+                s4.merge(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "MultiStatus Test 3", null)); //$NON-NLS-1$
                 MessageService.defaultLog(s4);
 //                Activator.getDefault().getLog().log(s4);
             }
         };
         action.setImageDescriptor(ImageDescriptor.getMissingImageDescriptor());
-        action.setToolTipText("Produce test log entries");
+        action.setToolTipText("Produce test log entries"); //$NON-NLS-1$
         return action;
     }
 
@@ -1097,7 +1093,7 @@ public class LogView extends ViewPart implements ILogListener {
                    // Remove the content description in this case
                    // to save vertical space from the view.
                        //return Messages.LogView_WorkspaceLogFile;
-                   return "";
+                   return ""; //$NON-NLS-1$
                }
 
                Map<String, File> sources = LogFilesManager.getLogSources();