[logback-dev] svn commit: r1603 - in logbackPDE/trunk/plugins/ConsolePlugin: . META-INF src/main/java/ch/qos/logback/eclipse src/main/java/ch/qos/logback/eclipse/actions src/main/java/ch/qos/logback/eclipse/dialog src/main/java/ch/qos/logback/eclipse/model src/main/java/ch/qos/logback/eclipse/reciever src/main/java/ch/qos/logback/eclipse/util src/main/java/ch/qos/logback/eclipse/views
noreply.seb at qos.ch
noreply.seb at qos.ch
Sun Nov 18 17:21:34 CET 2007
Author: seb
Date: Sun Nov 18 17:21:33 2007
New Revision: 1603
Added:
logbackPDE/trunk/plugins/ConsolePlugin/plugin.properties
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/Messages.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/messages.properties
Modified:
logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF
logbackPDE/trunk/plugins/ConsolePlugin/build.properties
logbackPDE/trunk/plugins/ConsolePlugin/plugin.xml
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/LogbackPlugin.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/PluginLogger.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackFilterAction.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackPreferencesAction.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/OpenStackTraceAction.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackPreferencesDialog.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SimpleSocketServer.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/util/EditorUtil.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/FilterContentProvider.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LogbackView.java
logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
Log:
I18N for the Console Plugin.
Patch provided by Sebastian Davids, see bugzilla entry #69
Modified: logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/META-INF/MANIFEST.MF Sun Nov 18 17:21:33 2007
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Console Plug-in
+Bundle-Name: %Bundle-Name
Bundle-SymbolicName: ch.qos.logback.eclipse; singleton:=true
Bundle-Version: 1.0.1
Bundle-ClassPath: logbackPlugin.jar,
@@ -9,7 +9,7 @@
lib/logback-classic-0.9.3.jar,
lib/logback-core-0.9.3.jar
Bundle-Activator: ch.qos.logback.eclipse.LogbackPlugin
-Bundle-Vendor: QOS.ch
+Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: logbackPDE/trunk/plugins/ConsolePlugin/build.properties
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/build.properties (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/build.properties Sun Nov 18 17:21:33 2007
@@ -1,6 +1,7 @@
output.. = target/classes/
bin.includes = plugin.xml,\
- README.txt, \
+ plugin.properties,\
+ README.txt, \
META-INF/,\
icons/,\
logbackPlugin.jar,\
Added: logbackPDE/trunk/plugins/ConsolePlugin/plugin.properties
==============================================================================
--- (empty file)
+++ logbackPDE/trunk/plugins/ConsolePlugin/plugin.properties Sun Nov 18 17:21:33 2007
@@ -0,0 +1,20 @@
+# Logback: the reliable, generic, fast and flexible logging framework.
+#
+# Copyright (C) 1999-2007, QOS.ch
+#
+# This library is free software, you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation.
+
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+# Do not translate any values surrounded by {}
+# also see:
+# http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+# http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html#unicode_table
+
+Bundle-Name=LogBack Console Plug-in
+Bundle-Vendor=QOS.ch
+
+viewCategoryName=Logback
+viewName=Logback View
\ No newline at end of file
Modified: logbackPDE/trunk/plugins/ConsolePlugin/plugin.xml
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/plugin.xml (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/plugin.xml Sun Nov 18 17:21:33 2007
@@ -5,11 +5,11 @@
<extension
point="org.eclipse.ui.views">
<category
- name="Logback"
+ name="%viewCategoryName"
id="ch.qos.logback.eclipse">
</category>
<view
- name="Logback View"
+ name="%viewName"
icon="icons/sample.gif"
category="ch.qos.logback.eclipse"
class="ch.qos.logback.eclipse.views.LogbackView"
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/LogbackPlugin.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/LogbackPlugin.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/LogbackPlugin.java Sun Nov 18 17:21:33 2007
@@ -19,7 +19,7 @@
public class LogbackPlugin extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "ch.qos.logback.eclipse";
+ public static final String PLUGIN_ID = "ch.qos.logback.eclipse"; //$NON-NLS-1$
// The shared instance
private static LogbackPlugin plugin;
Added: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/Messages.java
==============================================================================
--- (empty file)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/Messages.java Sun Nov 18 17:21:33 2007
@@ -0,0 +1,142 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2007, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.eclipse;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Message bundle accessor class.
+ * <p>
+ * See <a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/documents/3.1/message_bundles.html">
+ * Message Bundles</a>
+ * <p>
+ *
+ * @author Sebastian Davids
+ * @see org.eclipse.osgi.util.NLS
+ */
+public class Messages extends NLS {
+
+ /** The name of the message bundle used by the plug-in. */
+ public static final String MESSAGE_BUNDLE = "ch.qos.logback.eclipse.messages";//$NON-NLS-1$
+
+ public static String BindException;
+
+ public static String CaughtEOFException;
+
+ public static String CaughtIOException;
+
+ public static String ClearConsoleActionName;
+
+ public static String ClearConsoleActionTooltip;
+
+ public static String ClosingConnection;
+
+ public static String CouldNotCloseConnection;
+
+ public static String CouldNotStartServerError;
+
+ public static String CouldNotStartServerErrorDialogTitle;
+
+ public static String DebugFilterExpression;
+
+ public static String DebugFilterName;
+
+ public static String Delete;
+
+ public static String Down;
+
+ public static String EvaluatorFilterEvalName;
+
+ public static String EvaluatorFilterName;
+
+ public static String EventFilterEvalName;
+
+ public static String EventFilterName;
+
+ public static String ExpressionIncorrectError;
+
+ public static String FilterDialogActionOnFilterMatchLabel;
+
+ public static String FilterDialogActionOnFilterMismatchLabel;
+
+ public static String FilterDialogExpression;
+
+ public static String FilterDialogExpressionFieldDefaultMessage;
+
+ public static String FilterDialogInfoLabel;
+
+ public static String FilterDialogInfoLabel2;
+
+ public static String FilterDialogOnMatch;
+
+ public static String FilterDialogOnMatchFieldDefaultMessage;
+
+ public static String FilterDialogOnMismatch;
+
+ public static String FilterDialogOnMismatchFieldDefaultMessage;
+
+ public static String FilterDialogTitle;
+
+ public static String IncorrectExpressionErrorDialogTitle;
+
+ public static String LogbackFilterActionName;
+
+ public static String LogbackPreferencesActionName;
+
+ public static String LoggingEventLabelContext;
+
+ public static String LogMessageCouldNotUseFont;
+
+ public static String LogMessageListeningOnPort;
+
+ public static String New;
+
+ public static String OpenStacktraceActionName;
+
+ public static String PortOutOfRangeError;
+
+ public static String PortOutOfRangeErrorDialogTitle;
+
+ public static String PreferencesDialogFontNameLabel;
+
+ public static String PreferencesDialogFontSizeLabel;
+
+ public static String PreferencesDialogMaximumNumberOfLogs;
+
+ public static String PreferencesDialogPatternLabel;
+
+ public static String PreferencesDialogPortLabel;
+
+ public static String PreferencesDialogTitle;
+
+ public static String RequiredLogBackVersion;
+
+ public static String Save;
+
+ public static String ScrollLockOffActionName;
+
+ public static String ScrollLockOffActionTooltip;
+
+ public static String ScrollLockOnActionName;
+
+ public static String ScrollLockOnActionTooltip;
+
+ public static String UnexpectedException;
+
+ public static String UnexpectedExceptionWithArg;
+
+ public static String Up;
+
+ public static String VersionError;
+
+ static {
+ NLS.initializeMessages(Messages.MESSAGE_BUNDLE, Messages.class);
+ }
+}
\ No newline at end of file
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/PluginLogger.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/PluginLogger.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/PluginLogger.java Sun Nov 18 17:21:33 2007
@@ -32,7 +32,7 @@
* @param exception, a low-level exception.
*/
public static void logError(Throwable exception) {
- logError("Unexpected Exception", exception);
+ logError(Messages.UnexpectedException, exception);
}
/**
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackFilterAction.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackFilterAction.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackFilterAction.java Sun Nov 18 17:21:33 2007
@@ -14,6 +14,7 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Shell;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.dialog.LogbackFilterDialog;
/**
@@ -22,12 +23,11 @@
* @author Sébastien Pennec
*/
public class LogbackFilterAction extends Action {
- private static String PREF_ACTION_MESSAGE = "Filter...";
private final Shell shell;
public LogbackFilterAction(Viewer viewer) {
- super(PREF_ACTION_MESSAGE);
+ super(Messages.LogbackFilterActionName);
shell = viewer.getControl().getShell();
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackPreferencesAction.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackPreferencesAction.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/LogbackPreferencesAction.java Sun Nov 18 17:21:33 2007
@@ -15,6 +15,7 @@
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Shell;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.dialog.LogbackPreferencesDialog;
import ch.qos.logback.eclipse.model.LoggingEventManager;
import ch.qos.logback.eclipse.views.LogbackView;
@@ -25,13 +26,12 @@
* @author Sébastien Pennec
*/
public class LogbackPreferencesAction extends Action {
- private static String PREF_ACTION_MESSAGE = "Preferences...";
private final Shell shell;
private final LogbackView view;
public LogbackPreferencesAction(Viewer viewer, LogbackView view) {
- super(PREF_ACTION_MESSAGE);
+ super(Messages.LogbackPreferencesActionName);
shell = viewer.getControl().getShell();
this.view = view;
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/OpenStackTraceAction.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/OpenStackTraceAction.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/actions/OpenStackTraceAction.java Sun Nov 18 17:21:33 2007
@@ -22,7 +22,7 @@
public class OpenStackTraceAction extends Action {
- private static final String NEW_LINE = System.getProperty("line.separator");
+ private static final String NEW_LINE = System.getProperty("line.separator"); //$NON-NLS-1$
LogbackView view;
JavaStackTraceConsole console;
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackFilterDialog.java Sun Nov 18 17:21:33 2007
@@ -33,6 +33,7 @@
import ch.qos.logback.classic.boolex.JaninoEventEvaluator;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.FilterReply;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.model.EventFilter;
import ch.qos.logback.eclipse.views.FilterContentProvider;
@@ -41,8 +42,6 @@
*/
public class LogbackFilterDialog extends Dialog {
- private static String ERROR_MESSAGE_EXPRESSION = "The new expression is not correct.";
-
private TableViewer viewer;
private TableColumn codeColumn;
private TableColumn onMatchColumn;
@@ -84,10 +83,10 @@
final Label infoLabel = new Label(container, SWT.NONE);
infoLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
- infoLabel.setText("Enter java code in the expression field.");
+ infoLabel.setText(Messages.FilterDialogInfoLabel);
final Button moveUp = new Button(container, SWT.PUSH);
moveUp.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false, 1, 1));
- moveUp.setText("Up");
+ moveUp.setText(Messages.Up);
moveUp.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -99,10 +98,10 @@
final Label infoLabel2 = new Label(container, SWT.NONE);
infoLabel2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 2, 1));
- infoLabel2.setText("Enter ACCEPT, DENY or NEUTRAL in the other two fields.");
+ infoLabel2.setText(Messages.FilterDialogInfoLabel2);
final Button moveDown = new Button(container, SWT.PUSH);
moveDown.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false, 1, 1));
- moveDown.setText("Down");
+ moveDown.setText(Messages.Down);
moveDown.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -129,7 +128,7 @@
cmp.setLayout(grd);
final Label infoLabel3 = new Label(cmp, SWT.NONE);
infoLabel3.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));
- infoLabel3.setText("Action on filter match");
+ infoLabel3.setText(Messages.FilterDialogActionOnFilterMatchLabel);
matchField = new Text(cmp, SWT.BORDER);
// Rectangle bounds2 = matchField.getBounds();
// bounds2.width = 150;
@@ -137,7 +136,7 @@
final Label infoLabel4 = new Label(cmp, SWT.NONE);
infoLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));
- infoLabel4.setText("Action on filter mismatch");
+ infoLabel4.setText(Messages.FilterDialogActionOnFilterMismatchLabel);
mismatchField = new Text(cmp, SWT.BORDER);
// Rectangle bounds3 = mismatchField.getBounds();
// bounds3.width = 150;
@@ -147,7 +146,7 @@
private void createButtons(Composite container) {
final Button saveButton = new Button(container, SWT.PUSH);
- saveButton.setText("Save");
+ saveButton.setText(Messages.Save);
saveButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -158,7 +157,7 @@
});
final Button newButton = new Button(container, SWT.PUSH);
- newButton.setText("New");
+ newButton.setText(Messages.New);
newButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -170,7 +169,7 @@
});
final Button deleteButton = new Button(container, SWT.PUSH);
- deleteButton.setText("Delete");
+ deleteButton.setText(Messages.Delete);
deleteButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -190,15 +189,15 @@
final Table table = viewer.getTable();
codeColumn = new TableColumn(table, SWT.LEFT);
- codeColumn.setText("Expression");
+ codeColumn.setText(Messages.FilterDialogExpression);
codeColumn.setWidth(200);
onMatchColumn = new TableColumn(table, SWT.LEFT);
- onMatchColumn.setText("On match");
+ onMatchColumn.setText(Messages.FilterDialogOnMatch);
onMatchColumn.setWidth(80);
onMismatchColumn = new TableColumn(table, SWT.LEFT);
- onMismatchColumn.setText("On mismatch");
+ onMismatchColumn.setText(Messages.FilterDialogOnMismatch);
onMismatchColumn.setWidth(80);
table.setHeaderVisible(true);
@@ -240,7 +239,8 @@
eval.stop();
eval.setExpression(oldExp);
eval.start();
- MessageDialog.openInformation(getShell(), "Logback View", ERROR_MESSAGE_EXPRESSION);
+ MessageDialog.openInformation(getShell(), Messages.IncorrectExpressionErrorDialogTitle,
+ Messages.ExpressionIncorrectError);
return;
}
current.start();
@@ -250,19 +250,19 @@
private void emptyEditionUI() {
current = null;
- expressionField.setText("");
+ expressionField.setText("");//$NON-NLS-1$
expressionField.redraw();
- matchField.setText("");
+ matchField.setText("");//$NON-NLS-1$
matchField.redraw();
- mismatchField.setText("");
+ mismatchField.setText("");//$NON-NLS-1$
mismatchField.redraw();
}
private void createNewFilter() {
current = FilterContentProvider.getProvider().createNewFilter();
- expressionField.setText("Enter an expression");
- matchField.setText("Enter an action");
- mismatchField.setText("Enter an action");
+ expressionField.setText(Messages.FilterDialogExpressionFieldDefaultMessage);
+ matchField.setText(Messages.FilterDialogOnMatchFieldDefaultMessage);
+ mismatchField.setText(Messages.FilterDialogOnMismatchFieldDefaultMessage);
}
private void deleteCurrentFilter() {
@@ -275,6 +275,6 @@
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText("Logback View Filtering");
+ newShell.setText(Messages.FilterDialogTitle);
}
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackPreferencesDialog.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackPreferencesDialog.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/dialog/LogbackPreferencesDialog.java Sun Nov 18 17:21:33 2007
@@ -29,6 +29,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.model.LoggingEventManager;
/**
@@ -38,7 +39,6 @@
* @author Sébastien Pennec
*/
public class LogbackPreferencesDialog extends Dialog {
- private static String ERROR_MESSAGE_SERVER = "The server port must be between 0 and 65535.";
private String pattern;
private int serverPort;
@@ -85,7 +85,7 @@
private void createPatternUIParts(Composite container) {
final Label patternLabel = new Label(container, SWT.NONE);
patternLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
- patternLabel.setText("Pattern to setup the PatternLayout:");
+ patternLabel.setText(Messages.PreferencesDialogPatternLabel);
patternField = new Text(container, SWT.BORDER);
Rectangle bounds = patternField.getBounds();
@@ -97,7 +97,7 @@
final Label portLabel = new Label(container, SWT.NONE);
portLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
- portLabel.setText("Listening on port number");
+ portLabel.setText(Messages.PreferencesDialogPortLabel);
portField = new Text(container, SWT.BORDER);
portField.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
@@ -106,7 +106,7 @@
private void createFontUIParts(Composite container) {
final Label fontLabel = new Label(container, SWT.None);
fontLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
- fontLabel.setText("Select the font to use");
+ fontLabel.setText(Messages.PreferencesDialogFontNameLabel);
fontCombo = new Combo(container, SWT.DROP_DOWN | SWT.READ_ONLY);
@@ -122,7 +122,7 @@
final Label sizeLabel = new Label(container, SWT.NONE);
sizeLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
- sizeLabel.setText("Font size");
+ sizeLabel.setText(Messages.PreferencesDialogFontSizeLabel);
fontSizeField = new Text(container, SWT.BORDER);
fontSizeField.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
@@ -131,14 +131,14 @@
private void createListSizeUIParts(Composite container) {
final Label sizeLabel = new Label(container, SWT.None);
sizeLabel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
- sizeLabel.setText("Maximum number of logs to display:");
+ sizeLabel.setText(Messages.PreferencesDialogMaximumNumberOfLogs);
maxSizeField = new Text(container, SWT.BORDER);
maxSizeField.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
}
private void initContent() {
- patternField.setText(pattern != null ? pattern : "");
+ patternField.setText(pattern != null ? pattern : ""); //$NON-NLS-1$
patternField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
pattern = patternField.getText();
@@ -176,7 +176,7 @@
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
- newShell.setText("Logback View options");
+ newShell.setText(Messages.PreferencesDialogTitle);
}
public String getPattern() {
@@ -208,7 +208,7 @@
private boolean checkServerPort() {
if (tmpServerPort != -1 && !portInBounds()) {
- MessageDialog.openInformation(getShell(), "Logback View", ERROR_MESSAGE_SERVER);
+ MessageDialog.openInformation(getShell(), Messages.PortOutOfRangeErrorDialogTitle, Messages.PortOutOfRangeError);
portField.setText(String.valueOf(serverPort));
return false;
} else {
Added: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/messages.properties
==============================================================================
--- (empty file)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/messages.properties Sun Nov 18 17:21:33 2007
@@ -0,0 +1,97 @@
+# Logback: the reliable, generic, fast and flexible logging framework.
+#
+# Copyright (C) 1999-2007, QOS.ch
+#
+# This library is free software, you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation.
+
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+# Do not translate any values surrounded by {}
+# also see:
+# http://java.sun.com/javase/6/docs/api/java/text/MessageFormat.html
+# http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html#unicode_table
+
+# ==============================================================================
+# Common
+# ==============================================================================
+
+RequiredLogBackVersion=0.9.3
+
+ClosingConnection=Closing connection.
+Up=Up
+Down=Down
+Save=Save
+New=New
+Delete=Delete
+
+# ==============================================================================
+# Errors
+# ==============================================================================
+BindException=The port {0} is already in use.
+UnexpectedException=Unexpected Exception
+UnexpectedExceptionWithArg=Unexpected Exception. {0}
+CaughtEOFException=Caught java.io.EOFException closing connection.
+CaughtIOException=Caught java.io.IOException: {0}
+CouldNotCloseConnection=Could not close connection.
+VersionError=There was an error trying to deserialize LoggingEvent. You might want to check the version number of logback. This plugin works with logback version {0}. If you have a different version, please check if the plugin needs to be updated."
+ExpressionIncorrectError=The new expression is not correct.
+PortOutOfRangeError=The server port must be between 0 and 65535.
+CouldNotStartServerError=Unable to start server on port: {0}
+
+# ==============================================================================
+# Actions
+# ==============================================================================
+LogbackFilterActionName=&Filter...
+LogbackPreferencesActionName=&Preferences...
+ClearConsoleActionName=Clear Console
+ClearConsoleActionTooltip=Clear Console
+ScrollLockOnActionName=Turn Auto Scroll On
+ScrollLockOnActionTooltip=Turn Auto Scroll On
+ScrollLockOffActionName=Turn Auto Scroll Off
+ScrollLockOffActionTooltip=Turn Auto Scroll Off
+OpenStacktraceActionName=Open Stacktrace...
+
+# ==============================================================================
+# Views
+# ==============================================================================
+LoggingEventLabelContext=Logback Plug-in Context
+LogMessageListeningOnPort=Now listening on port: {0}
+LogMessageCouldNotUseFont=Desired font could not be used
+
+# ==============================================================================
+# Dialogs
+# ==============================================================================
+FilterDialogTitle=Logback View Filters
+FilterDialogInfoLabel=Enter Java code in the expression field.
+FilterDialogInfoLabel2=Enter ACCEPT, DENY, or NEUTRAL in the other two fields.
+FilterDialogActionOnFilterMatchLabel=Action on filter match:
+FilterDialogActionOnFilterMismatchLabel=Action on filter mismatch:
+FilterDialogExpression=Expression
+FilterDialogOnMatch=On Match
+FilterDialogOnMismatch=On Mismatch
+FilterDialogExpressionFieldDefaultMessage=<Enter an expression here>
+FilterDialogOnMatchFieldDefaultMessage=<Enter an action here>
+FilterDialogOnMismatchFieldDefaultMessage=<Enter an action here>
+IncorrectExpressionErrorDialogTitle=Incorrect Filter Expression
+PreferencesDialogTitle=Logback View Options
+PreferencesDialogPatternLabel=Pattern to setup the PatternLayout:
+PreferencesDialogPortLabel=Listening on port number:
+PreferencesDialogFontNameLabel=Select the font to use:
+PreferencesDialogFontSizeLabel=Font size:
+PreferencesDialogMaximumNumberOfLogs=Maximum number of logs to display:
+PortOutOfRangeErrorDialogTitle=Port Out of Range
+CouldNotStartServerErrorDialogTitle=Could Not Start Server
+
+# ==============================================================================
+# Filters
+# ==============================================================================
+
+EventFilterName=Filter {0}
+EventFilterEvalName=Eval {0}
+EvaluatorFilterName=Evaluator Filter
+EvaluatorFilterEvalName=Evaluator
+
+DebugFilterName=Test Filter
+DebugFilterExpression=level >= INFO
\ No newline at end of file
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/EventFilter.java Sun Nov 18 17:21:33 2007
@@ -13,6 +13,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IMemento;
import ch.qos.logback.classic.boolex.JaninoEventEvaluator;
@@ -21,16 +22,17 @@
import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.FilterReply;
+import ch.qos.logback.eclipse.Messages;
/**
* @author Sébastien Pennec
*/
public class EventFilter {
- private static final String TAG_FILTER = "filter";
- private static final String TAG_EXPRESSION = "expression";
- private static final String TAG_ONMATCH = "onMatch";
- private static final String TAG_ONMISMATCH = "onMismatch";
+ private static final String TAG_FILTER = "filter"; //$NON-NLS-1$
+ private static final String TAG_EXPRESSION = "expression"; //$NON-NLS-1$
+ private static final String TAG_ONMATCH = "onMatch"; //$NON-NLS-1$
+ private static final String TAG_ONMISMATCH = "onMismatch"; //$NON-NLS-1$
private static ContextBase context = new ContextBase();
@@ -99,12 +101,12 @@
IMemento mem = mems[i];
filter = new EvaluatorFilter();
filter.setContext(context);
- filter.setName("filter " + i);
+ filter.setName(NLS.bind(Messages.EventFilterName, i));
filter.setOnMatch(FilterReply.valueOf(mem.getString(TAG_ONMATCH)));
filter.setOnMismatch(FilterReply.valueOf(mem.getString(TAG_ONMISMATCH)));
eval = new JaninoEventEvaluator();
eval.setContext(context);
- eval.setName("Eval " + i);
+ eval.setName(NLS.bind(Messages.EventFilterEvalName, i));
eval.setExpression(mem.getString(TAG_EXPRESSION));
eval.start();
filter.setEvaluator(eval);
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/model/LoggingEventManager.java Sun Nov 18 17:21:33 2007
@@ -25,8 +25,8 @@
*/
public class LoggingEventManager {
- private static final String TAG_MGR = "manager";
- private static final String TAG_MAXSIZE = "maxSize";
+ private static final String TAG_MGR = "manager"; //$NON-NLS-1$
+ private static final String TAG_MAXSIZE = "maxSize"; //$NON-NLS-1$
private static final double REMOVE_RATIO = 0.33;
static LoggingEvent[] NONE = new LoggingEvent[] {};
@@ -81,7 +81,7 @@
private void listSizeCheck() {
synchronized(loggingEventList) {
if (loggingEventList.size() > maxSize) {
- List sub = loggingEventList.subList(0, removeQuantity);
+ List<LoggingEvent> sub = loggingEventList.subList(0, removeQuantity);
sub.clear();
}
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SimpleSocketServer.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SimpleSocketServer.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SimpleSocketServer.java Sun Nov 18 17:21:33 2007
@@ -13,8 +13,10 @@
import java.net.ServerSocket;
import java.net.Socket;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IMemento;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.PluginLogger;
/**
@@ -26,8 +28,8 @@
*/
public class SimpleSocketServer implements Runnable {
- private static final String TAG_SERVER = "lbserver";
- private static final String TAG_PORT = "port";
+ private static final String TAG_SERVER = "lbserver"; //$NON-NLS-1$
+ private static final String TAG_PORT = "port"; //$NON-NLS-1$
private int port = 4321;
private ServerSocket serverSocket;
@@ -68,8 +70,7 @@
}
serverSocket.close();
} catch (java.net.BindException e) {
- String errorMessage = "The port " + port + " is already in use.";
- PluginLogger.logError(errorMessage, e);
+ PluginLogger.logError(NLS.bind(Messages.BindException, port), e);
} catch (Exception e) {
PluginLogger.logError(e);
}
@@ -95,7 +96,7 @@
public static boolean isPortFree(Integer port) {
try {
- Socket s = new Socket("localhost", port);
+ Socket s = new Socket("localhost", port); //$NON-NLS-1$
return !s.isConnected();
} catch (Exception e) {
return true;
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/reciever/SocketNode.java Sun Nov 18 17:21:33 2007
@@ -15,7 +15,10 @@
import java.io.ObjectInputStream;
import java.net.Socket;
+import org.eclipse.osgi.util.NLS;
+
import ch.qos.logback.classic.spi.LoggingEvent;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.PluginLogger;
import ch.qos.logback.eclipse.model.LoggingEventManager;
@@ -62,27 +65,23 @@
} catch (InvalidClassException e) {
printVersionError(e);
} catch (java.io.EOFException e) {
- PluginLogger.logInfo("Caught java.io.EOFException closing connection.");
+ PluginLogger.logInfo(Messages.CaughtEOFException);
} catch (java.net.SocketException e) {
} catch (IOException e) {
- PluginLogger.logInfo("Caught java.io.IOException: " + e);
- PluginLogger.logInfo("Closing connection.");
+ PluginLogger.logInfo(NLS.bind(Messages.CaughtIOException, e));
+ PluginLogger.logInfo(Messages.ClosingConnection);
} catch (Exception e) {
- PluginLogger.logError("Unexpected exception. Closing connection.", e);
+ PluginLogger.logError(NLS.bind(Messages.UnexpectedExceptionWithArg, Messages.ClosingConnection), e);
}
try {
ois.close();
} catch (Exception e) {
- PluginLogger.logError("Could not close connection.", e);
+ PluginLogger.logError(Messages.CouldNotCloseConnection, e);
}
}
private void printVersionError(Exception e) {
- String message = "There was an error trying to deserialize LoggingEvent. " +
- "You might want to check the version number of logback. " +
- "This plugin works with logback version 0.9.3. If you have a different " +
- "version, please check if the plugin needs to be updated.";
- PluginLogger.logError(message, e);
+ PluginLogger.logError(NLS.bind(Messages.VersionError, Messages.RequiredLogBackVersion), e);
}
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/util/EditorUtil.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/util/EditorUtil.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/util/EditorUtil.java Sun Nov 18 17:21:33 2007
@@ -29,6 +29,8 @@
*/
public class EditorUtil {
+ private static final String JAVA_EDITOR_ID = "org.eclipse.jdt.internal.ui.javaeditor.JavaEditor"; //$NON-NLS-1$
+
public static void openInEditor(LoggingEvent event) {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
@@ -46,7 +48,7 @@
type = findType(javaProject, className);
if (type != null) {
String path = type.getPath().toString();
- if (path.startsWith("/" + project.getName())) {
+ if (path.startsWith('/' + project.getName())) {
path = path.substring(project.getName().length() + 1);
}
IFile file = project.getFile(path);
@@ -81,7 +83,7 @@
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
HashMap<String, Object> map = new HashMap<String, Object>();
map.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
- map.put(IDE.EDITOR_ID_ATTR, "org.eclipse.jdt.internal.ui.javaeditor.JavaEditor");
+ map.put(IDE.EDITOR_ID_ATTR, JAVA_EDITOR_ID);
try {
IMarker marker = file.createMarker(IMarker.TEXT);
marker.setAttributes(map);
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/FilterContentProvider.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/FilterContentProvider.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/FilterContentProvider.java Sun Nov 18 17:21:33 2007
@@ -18,6 +18,7 @@
import ch.qos.logback.classic.boolex.JaninoEventEvaluator;
import ch.qos.logback.core.filter.EvaluatorFilter;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.model.EventFilter;
/**
@@ -76,10 +77,10 @@
public EvaluatorFilter createNewFilter() {
EvaluatorFilter current = new EvaluatorFilter();
current.setContext(EventFilter.getContext());
- current.setName("evaluator filter");
+ current.setName(Messages.EvaluatorFilterName);
JaninoEventEvaluator eval = new JaninoEventEvaluator();
eval.setContext(EventFilter.getContext());
- eval.setName("evaluator");
+ eval.setName(Messages.EvaluatorFilterEvalName);
current.setEvaluator(eval);
return current;
}
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LogbackView.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LogbackView.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LogbackView.java Sun Nov 18 17:21:33 2007
@@ -25,6 +25,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.graphics.Font;
@@ -49,6 +50,7 @@
import ch.qos.logback.core.filter.EvaluatorFilter;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.eclipse.LogbackPlugin;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.PluginLogger;
import ch.qos.logback.eclipse.actions.LogbackFilterAction;
import ch.qos.logback.eclipse.actions.LogbackPreferencesAction;
@@ -63,11 +65,11 @@
*/
public class LogbackView extends ViewPart {
- private static final String TAG_DISPLAY = "display";
- private static final String TAG_FONTNAME = "fontName";
- private static final String TAG_FONTSIZE = "fontSize";
+ private static final String TAG_DISPLAY = "display"; //$NON-NLS-1$
+ private static final String TAG_FONTNAME = "fontName"; //$NON-NLS-1$
+ private static final String TAG_FONTSIZE = "fontSize"; //$NON-NLS-1$
- public static final String ID = "ch.qos.logback.eclipse.views.LogbackView";
+ public static final String ID = "ch.qos.logback.eclipse.views.LogbackView"; //$NON-NLS-1$
private TableViewer viewer;
private TableColumn textColumn;
@@ -151,8 +153,8 @@
clearAll();
}
};
- clearConsoleAction.setText("Clear console");
- clearConsoleAction.setToolTipText("Clear the console");
+ clearConsoleAction.setText(Messages.ClearConsoleActionName);
+ clearConsoleAction.setToolTipText(Messages.ClearConsoleActionTooltip);
clearConsoleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
@@ -171,21 +173,21 @@
private void updateText() {
if (provider.getAutoScroll()) {
- this.setText("Turn off auto scroll");
- this.setToolTipText("Turn off auto scroll");
+ this.setText(Messages.ScrollLockOffActionName);
+ this.setToolTipText(Messages.ScrollLockOffActionTooltip);
} else {
- this.setText("Turn on auto scroll");
- this.setToolTipText("Turn on auto scroll");
+ this.setText(Messages.ScrollLockOnActionName);
+ this.setToolTipText(Messages.ScrollLockOnActionTooltip);
}
}
};
- autoScrollAction.setText("Turn off auto scroll");
- autoScrollAction.setToolTipText("Turn off auto scroll");
- URL url = LogbackPlugin.getDefault().getBundle().getEntry("/icons/lock_co.gif");
+ autoScrollAction.setText(Messages.ScrollLockOffActionName);
+ autoScrollAction.setToolTipText(Messages.ScrollLockOffActionTooltip);
+ URL url = LogbackPlugin.getDefault().getBundle().getEntry("/icons/lock_co.gif"); //$NON-NLS-1$
ImageDescriptor imgDesc = ImageDescriptor.createFromURL(url);
autoScrollAction.setImageDescriptor(imgDesc);
- openStackTraceAction = new OpenStackTraceAction(this, "Open stacktrace...");
+ openStackTraceAction = new OpenStackTraceAction(this, Messages.OpenStacktraceActionName);
}
@@ -239,7 +241,7 @@
private void openAndCloseClientToServer() {
try {
- new Socket("localhost", server.getPort());
+ new Socket("localhost", server.getPort()); //$NON-NLS-1$
} catch (Exception e) {
//do nothing
}
@@ -257,10 +259,11 @@
if (SimpleSocketServer.isPortFree(server.getPort())) {
serverThread = new Thread(server);
serverThread.start();
- PluginLogger.logInfo("Now listening on port: " + server.getPort());
+ PluginLogger.logInfo(NLS.bind(Messages.LogMessageListeningOnPort, server.getPort()));
} else {
- String errorMessage = "Unable to start SocketServer on port: " + server.getPort() + ".";
- MessageDialog.openInformation(this.getSite().getShell(), "Logback View", errorMessage);
+ MessageDialog.openInformation(this.getSite().getShell(),
+ Messages.CouldNotStartServerErrorDialogTitle,
+ NLS.bind(Messages.CouldNotStartServerError, server.getPort()));
}
}
@@ -299,7 +302,7 @@
}
private void createContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager m) {
@@ -348,7 +351,7 @@
try {
font = new Font(Display.getDefault(), fontName, fontSize, SWT.NORMAL);
} catch (SWTError error) {
- PluginLogger.logInfo("Desired font could not be used");
+ PluginLogger.logInfo(Messages.LogMessageListeningOnPort);
}
if (font != null) {
viewer.getTable().setFont(font);
@@ -374,9 +377,9 @@
//used for testing only
EvaluatorFilter filter = FilterContentProvider.getProvider().createNewFilter();
JaninoEventEvaluator eval = (JaninoEventEvaluator) filter.getEvaluator();
- eval.setExpression("level >= INFO");
+ eval.setExpression(Messages.DebugFilterExpression);
eval.start();
- filter.setName("test fitler");
+ filter.setName(Messages.DebugFilterName);
filter.setOnMatch(FilterReply.NEUTRAL);
filter.setOnMismatch(FilterReply.DENY);
filter.start();
Modified: logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java
==============================================================================
--- logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java (original)
+++ logbackPDE/trunk/plugins/ConsolePlugin/src/main/java/ch/qos/logback/eclipse/views/LoggingEventLabelProvider.java Sun Nov 18 17:21:33 2007
@@ -26,6 +26,7 @@
import ch.qos.logback.classic.PatternLayout;
import ch.qos.logback.classic.spi.LoggingEvent;
import ch.qos.logback.eclipse.LogbackPlugin;
+import ch.qos.logback.eclipse.Messages;
import ch.qos.logback.eclipse.model.LoggingEventManager;
/**
@@ -37,10 +38,10 @@
class LoggingEventLabelProvider extends LabelProvider implements ITableLabelProvider,
ITableColorProvider {
- private static final String TAG_LABEL = "labelProvider";
- private static final String TAG_PATTERN = "pattern";
+ private static final String TAG_LABEL = "labelProvider"; //$NON-NLS-1$
+ private static final String TAG_PATTERN = "pattern"; //$NON-NLS-1$
- private static String DEFAULT_PATTERN = "%relative %level [%thread] %logger{25} %message %nopex";
+ private static String DEFAULT_PATTERN = "%relative %level [%thread] %logger{25} %message %nopex"; //$NON-NLS-1$
private LoggerContext context;
private PatternLayout patternLayout;
@@ -55,7 +56,7 @@
public LoggingEventLabelProvider() {
context = new LoggerContext();
- context.setName("Logback Plugin Context");
+ context.setName(Messages.LoggingEventLabelContext);
createDefaultPatternLayout();
Display display = Display.getCurrent();
cachedRed = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
@@ -67,7 +68,7 @@
}
private void loadImage() {
- URL url = LogbackPlugin.getDefault().getBundle().getEntry("/icons/call_hierarchy.gif");
+ URL url = LogbackPlugin.getDefault().getBundle().getEntry("/icons/call_hierarchy.gif"); //$NON-NLS-1$
stackTrace = ImageDescriptor.createFromURL(url);
stackImage = stackTrace.createImage();
}
@@ -125,7 +126,7 @@
public String getColumnText(Object element, int columnIndex) {
if (!(element instanceof LoggingEvent)) {
- return "";
+ return ""; //$NON-NLS-1$
}
LoggingEvent event = (LoggingEvent) element;
More information about the logback-dev
mailing list