Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2009-05-07 12:29:40 +0000
committerVictor Roldan Betancort2009-05-07 12:29:40 +0000
commit9c01d0c668a0f33f4869d857f46e6034928ae24a (patch)
tree2a840c734c870f2435b76b4f601d55ac3322ecab /plugins/org.eclipse.net4j.ui/src
parentb65d6bd3ecf777b527a28195ebdf01d2123e08d0 (diff)
downloadcdo-9c01d0c668a0f33f4869d857f46e6034928ae24a.tar.gz
cdo-9c01d0c668a0f33f4869d857f46e6034928ae24a.tar.xz
cdo-9c01d0c668a0f33f4869d857f46e6034928ae24a.zip
[272193] [UI] Externalize Strings (Net4j)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272193
Diffstat (limited to 'plugins/org.eclipse.net4j.ui/src')
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java30
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/Messages.java41
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/messages.properties16
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/AcceptorsView.java9
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java3
5 files changed, 79 insertions, 20 deletions
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java
index bde74fdecb..f1f47ea130 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/SharedIcons.java
@@ -25,31 +25,31 @@ public class SharedIcons
{
private static final ImageRegistry REGISTRY = new ImageRegistry(getDisplay());
- private static final String ETOOL = "etool16/";
+ private static final String ETOOL = "etool16/"; //$NON-NLS-1$
- private static final String OBJ = "obj16/";
+ private static final String OBJ = "obj16/"; //$NON-NLS-1$
- public static final String OBJ_ACCEPTOR = OBJ + "acceptor";
+ public static final String OBJ_ACCEPTOR = OBJ + "acceptor"; //$NON-NLS-1$
- public static final String OBJ_ADAPTER = OBJ + "adapter";
+ public static final String OBJ_ADAPTER = OBJ + "adapter"; //$NON-NLS-1$
- public static final String OBJ_CHANNEL = OBJ + "channel";
+ public static final String OBJ_CHANNEL = OBJ + "channel"; //$NON-NLS-1$
- public static final String OBJ_CONNECTOR = OBJ + "connector";
+ public static final String OBJ_CONNECTOR = OBJ + "connector"; //$NON-NLS-1$
- public static final String OBJ_FACTORY = OBJ + "factory";
+ public static final String OBJ_FACTORY = OBJ + "factory"; //$NON-NLS-1$
- public static final String OBJ_FOLDER = OBJ + "folder";
+ public static final String OBJ_FOLDER = OBJ + "folder"; //$NON-NLS-1$
- public static final String ETOOL_ADD_ACCEPTOR = ETOOL + "add_acceptor";
+ public static final String ETOOL_ADD_ACCEPTOR = ETOOL + "add_acceptor"; //$NON-NLS-1$
- public static final String ETOOL_ADD_CONNECTOR = ETOOL + "add_connector";
+ public static final String ETOOL_ADD_CONNECTOR = ETOOL + "add_connector"; //$NON-NLS-1$
- public static final String ETOOL_ADD = ETOOL + "add";
+ public static final String ETOOL_ADD = ETOOL + "add"; //$NON-NLS-1$
- public static final String ETOOL_DELETE = ETOOL + "delete";
+ public static final String ETOOL_DELETE = ETOOL + "delete"; //$NON-NLS-1$
- public static final String ETOOL_REFRESH = ETOOL + "refresh";
+ public static final String ETOOL_REFRESH = ETOOL + "refresh"; //$NON-NLS-1$
public static Image getImage(String key)
{
@@ -97,7 +97,7 @@ public class SharedIcons
if (display == null)
{
- throw new IllegalStateException("display == null");
+ throw new IllegalStateException("display == null"); //$NON-NLS-1$
}
return display;
@@ -105,6 +105,6 @@ public class SharedIcons
private static String mangleKey(String key)
{
- return "icons/full/" + key + ".gif";
+ return "icons/full/" + key + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/Messages.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/Messages.java
new file mode 100644
index 0000000000..8ab8cc25c8
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/Messages.java
@@ -0,0 +1,41 @@
+/**
+ * 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:
+ * Victor Roldan Betancort - initial API and implementation
+ * Eike Stepper - maintenance
+ */
+package org.eclipse.net4j.internal.ui.messages;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @author Victor Roldan Betancort
+ */
+public class Messages
+{
+ private static final String BUNDLE_NAME = "org.eclipse.net4j.internal.ui.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.ui/src/org/eclipse/net4j/internal/ui/messages/messages.properties b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/messages.properties
new file mode 100644
index 0000000000..18d37ffb71
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/messages/messages.properties
@@ -0,0 +1,16 @@
+# 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:
+# Victor Roldan Betancort - initial API and implementation
+# Eike Stepper - maintenance
+
+AcceptorsView_0=Add Acceptor 2036
+AcceptorsView_1=Add an acceptor for port 2036
+AcceptorsView_4=Add Acceptor 2037
+AcceptorsView_5=Add an acceptor for port 2037
+Net4jItemProvider.0=Remove
+Net4jItemProvider.1=Remove
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/AcceptorsView.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/AcceptorsView.java
index f81e250c9c..5a8c597ed0 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/AcceptorsView.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/AcceptorsView.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.internal.ui.views;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.acceptor.IAcceptor;
+import org.eclipse.net4j.internal.ui.messages.Messages;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.container.IPluginContainer;
@@ -28,23 +29,23 @@ import org.eclipse.jface.action.IToolBarManager;
*/
public class AcceptorsView extends ContainerView
{
- private Action addAcceptorAction2036 = new SafeAction("Add Acceptor 2036", "Add an acceptor for port 2036",
+ private Action addAcceptorAction2036 = new SafeAction(Messages.getString("AcceptorsView_0"), Messages.getString("AcceptorsView_1"), //$NON-NLS-1$ //$NON-NLS-2$
getAddImageDescriptor())
{
@Override
protected void safeRun() throws Exception
{
- Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036");
+ Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2036"); //$NON-NLS-1$ //$NON-NLS-2$
}
};
- private Action addAcceptorAction2037 = new SafeAction("Add Acceptor 2037", "Add an acceptor for port 2037",
+ private Action addAcceptorAction2037 = new SafeAction(Messages.getString("AcceptorsView_4"), Messages.getString("AcceptorsView_5"), //$NON-NLS-1$ //$NON-NLS-2$
getAddImageDescriptor())
{
@Override
protected void safeRun() throws Exception
{
- Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2037");
+ Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", "0.0.0.0:2037"); //$NON-NLS-1$ //$NON-NLS-2$
}
};
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
index 745ee005ad..d1c02e9d8c 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/views/Net4jItemProvider.java
@@ -14,6 +14,7 @@ import org.eclipse.net4j.acceptor.IAcceptor;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.internal.ui.SharedIcons;
+import org.eclipse.net4j.internal.ui.messages.Messages;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.ui.actions.LongRunningAction;
@@ -83,7 +84,7 @@ public class Net4jItemProvider extends ContainerItemProvider<IContainer<Object>>
public RemoveAction(Object object)
{
- super("Remove", "Remove", ContainerView.getDeleteImageDescriptor());
+ super(Messages.getString("Net4jItemProvider.0"), Messages.getString("Net4jItemProvider.1"), ContainerView.getDeleteImageDescriptor()); //$NON-NLS-1$ //$NON-NLS-2$
this.object = object;
}

Back to the top