Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2009-05-20 18:12:47 +0000
committerVictor Roldan Betancort2009-05-20 18:12:47 +0000
commite87578beb3393762ec4175a6ec8eb1a1aab9ee17 (patch)
tree4f55f0df32833b47483bd835b8e82958418a884b /plugins/org.eclipse.net4j.debug/src
parent0a979565f2cce67cf15709444f0a93e189a5194b (diff)
downloadcdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.tar.gz
cdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.tar.xz
cdo-e87578beb3393762ec4175a6ec8eb1a1aab9ee17.zip
[272193] [UI] Externalize Strings (Net4j)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272193
Diffstat (limited to 'plugins/org.eclipse.net4j.debug/src')
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/Messages.java40
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/messages.properties12
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java19
3 files changed, 62 insertions, 9 deletions
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/Messages.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/Messages.java
new file mode 100644
index 0000000000..010441e154
--- /dev/null
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/Messages.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.internal.debug.messages;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Eike Stepper
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME = "org.eclipse.net4j.internal.debug.messages.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/messages.properties b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/messages.properties
new file mode 100644
index 0000000000..1e56ba7e21
--- /dev/null
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/messages/messages.properties
@@ -0,0 +1,12 @@
+RemoteTraceView.0=ID
+RemoteTraceView.1=Time Stamp
+RemoteTraceView.10=Clear
+RemoteTraceView.11=Double-click detected on
+RemoteTraceView.12=Remote Traces
+RemoteTraceView.2=Agent ID
+RemoteTraceView.3=Bundle ID
+RemoteTraceView.4=Tracer Name
+RemoteTraceView.5=Context
+RemoteTraceView.6=Message
+RemoteTraceView.7=Throwable
+RemoteTraceView.9=Clear
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
index 3359f86ac6..fcb0839bcc 100644
--- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java
@@ -11,6 +11,7 @@
package org.eclipse.net4j.internal.debug.views;
import org.eclipse.net4j.internal.debug.RemoteTraceManager;
+import org.eclipse.net4j.internal.debug.messages.Messages;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.om.trace.RemoteTraceServer.Event;
@@ -91,8 +92,8 @@ public class RemoteTraceView extends ViewPart
protected void createColmuns(TableViewer viewer)
{
- final String[] columnNames = { "ID", "Time Stamp", "Agent ID", "Bundle ID", "Tracer Name", "Context", "Message",
- "Throwable" };
+ final String[] columnNames = { Messages.getString("RemoteTraceView.0"), Messages.getString("RemoteTraceView.1"), Messages.getString("RemoteTraceView.2"), Messages.getString("RemoteTraceView.3"), Messages.getString("RemoteTraceView.4"), Messages.getString("RemoteTraceView.5"), Messages.getString("RemoteTraceView.6"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+ Messages.getString("RemoteTraceView.7") }; //$NON-NLS-1$
final int[] columnWidths = { 60, 170, 80, 160, 120, 120, 400, 200 };
TableColumn[] columns = new TableColumn[columnNames.length];
for (int i = 0; i < columns.length; i++)
@@ -120,7 +121,7 @@ public class RemoteTraceView extends ViewPart
private void hookContextMenu()
{
- MenuManager menuMgr = new MenuManager("#PopupMenu");
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener()
{
@@ -171,8 +172,8 @@ public class RemoteTraceView extends ViewPart
}
};
- clearAction.setText("Clear");
- clearAction.setToolTipText("Clear");
+ clearAction.setText(Messages.getString("RemoteTraceView.9")); //$NON-NLS-1$
+ clearAction.setToolTipText(Messages.getString("RemoteTraceView.10")); //$NON-NLS-1$
clearAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
ISharedImages.IMG_TOOL_DELETE));
@@ -183,7 +184,7 @@ public class RemoteTraceView extends ViewPart
{
ISelection selection = viewer.getSelection();
Object obj = ((IStructuredSelection)selection).getFirstElement();
- showMessage("Double-click detected on " + obj.toString());
+ showMessage(Messages.getString("RemoteTraceView.11") + obj.toString()); //$NON-NLS-1$
}
};
}
@@ -201,7 +202,7 @@ public class RemoteTraceView extends ViewPart
private void showMessage(String message)
{
- MessageDialog.openInformation(viewer.getControl().getShell(), "Remote Traces", message);
+ MessageDialog.openInformation(viewer.getControl().getShell(), Messages.getString("RemoteTraceView.12"), message); //$NON-NLS-1$
}
/**
@@ -276,7 +277,7 @@ public class RemoteTraceView extends ViewPart
return id;
}
- return id + " (" + className + ")";
+ return id + " (" + className + ")"; //$NON-NLS-1$ //$NON-NLS-2$
case 7:
return getFirstLine(text);
@@ -326,7 +327,7 @@ public class RemoteTraceView extends ViewPart
str = str.substring(0, nl);
}
- return str.replaceAll("\r", "");
+ return str.replaceAll("\r", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
}

Back to the top