X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.message.ui%2Fsrc%2Forg%2Fsimantics%2Fmessage%2Fui%2FLogView.java;h=a9d685be387c9e358ecc861f3a0fe5d095c9a13c;hb=47269fe0acb894f346810417d950a1ab59cdc0ea;hp=ab0940960c2ba6a26073838c7ed22975d0d94984;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.message.ui/src/org/simantics/message/ui/LogView.java b/bundles/org.simantics.message.ui/src/org/simantics/message/ui/LogView.java index ab0940960..a9d685be3 100644 --- a/bundles/org.simantics.message.ui/src/org/simantics/message/ui/LogView.java +++ b/bundles/org.simantics.message.ui/src/org/simantics/message/ui/LogView.java @@ -1,14 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.message.ui; import java.io.BufferedReader; @@ -149,7 +149,7 @@ import com.ibm.icu.text.SimpleDateFormat; * @author Tuukka Lehtonen * @see org.eclipse.ui.internal.views.LogView */ -@SuppressWarnings("deprecation") +@SuppressWarnings("deprecation") public class LogView extends ViewPart implements ILogListener { public static final int DEFAULT_EXPAND_LEVEL = 1; @@ -209,7 +209,7 @@ public class LogView extends ViewPart implements ILogListener { private boolean fFirstEvent = true; private TreeColumn fColumn1; - @SuppressWarnings("unused") + @SuppressWarnings("unused") private TreeColumn fColumn2; private TreeColumn fColumn3; @@ -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("

Select a message to show its description here.

"); + fMessageDescription.setText("

Select a message to show its description here.

"); //$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("
Select a message to show its description here.
"); + fMessageDescription.setText("
Select a message to show its description here.
"); //$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 { @@ -594,13 +590,13 @@ public class LogView extends ViewPart implements ILogListener { return action; } - @SuppressWarnings("unused") + @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
continuing...

still...
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
continuing...

still...
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; } @@ -803,8 +799,8 @@ public class LogView extends ViewPart implements ILogListener { }); fFilteredTree.setInitialText(Messages.LogView_show_filter_initialText); fTree = fFilteredTree.getViewer().getTree(); - fTree.setLinesVisible(true); createColumns(fTree); + fTree.setLinesVisible(true); fFilteredTree.getViewer().setAutoExpandLevel(fMemento.getInteger(P_EXPAND_LEVEL).intValue()); fFilteredTree.getViewer().setContentProvider(new LogViewContentProvider(this)); fFilteredTree.getViewer().setLabelProvider(fLabelProvider = new LogViewLabelProvider(this)); @@ -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 sources = LogFilesManager.getLogSources();