*/
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) {
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;
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) {
// 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 {
@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);
// 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;
}
// 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();