Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2009-05-20 19:24:20 +0000
committerVictor Roldan Betancort2009-05-20 19:24:20 +0000
commit8fa5aebdac03f0ecf8b959397ca291a603dbd9a2 (patch)
treeced49948f50905fc9ed77e561d6553a706272d79 /plugins/org.eclipse.net4j.buddies.chat.ui
parenta4a7bc418b553e0d1092caffd574787b592d4f90 (diff)
downloadcdo-8fa5aebdac03f0ecf8b959397ca291a603dbd9a2.tar.gz
cdo-8fa5aebdac03f0ecf8b959397ca291a603dbd9a2.tar.xz
cdo-8fa5aebdac03f0ecf8b959397ca291a603dbd9a2.zip
[272193] [UI] Externalize Strings (Net4j)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272193
Diffstat (limited to 'plugins/org.eclipse.net4j.buddies.chat.ui')
-rw-r--r--plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java9
-rw-r--r--plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java18
-rw-r--r--plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/Messages.java41
-rw-r--r--plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/messages.properties14
4 files changed, 69 insertions, 13 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java
index 993fb39300..585701c56b 100644
--- a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java
+++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/ChatPane.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.buddies.chat.internal.ui;
import org.eclipse.net4j.buddies.chat.IChat;
import org.eclipse.net4j.buddies.chat.IComment;
+import org.eclipse.net4j.buddies.chat.internal.ui.messages.Messages;
import org.eclipse.net4j.buddies.internal.chat.CommentEvent;
import org.eclipse.net4j.buddies.internal.ui.views.CollaborationsPane;
import org.eclipse.net4j.buddies.internal.ui.views.FacilityPane;
@@ -52,7 +53,7 @@ public class ChatPane extends FacilityPane
CommentEvent e = (CommentEvent)event;
IComment comment = e.getComment();
String text = comment.getText();
- output.append(comment.getSenderID() + ": " + text + StringUtil.NL);
+ output.append(comment.getSenderID() + ": " + text + StringUtil.NL); //$NON-NLS-1$
}
}
@@ -80,7 +81,7 @@ public class ChatPane extends FacilityPane
if ((e.character == SWT.CR || e.character == SWT.LF) && e.stateMask == 0)
{
((IChat)getFacility()).sendComment(input.getText());
- input.setText("");
+ input.setText(""); //$NON-NLS-1$
e.doit = false;
}
}
@@ -97,7 +98,7 @@ public class ChatPane extends FacilityPane
@Override
protected void fillCoolBar(IContributionManager manager)
{
- manager.add(new SafeAction("Vertical Layout", "Vertical Layout", SharedIcons
+ manager.add(new SafeAction(Messages.getString("ChatPane.2"), Messages.getString("ChatPane.3"), SharedIcons //$NON-NLS-1$ //$NON-NLS-2$
.getDescriptor(SharedIcons.ETOOL_VERTICAL))
{
@Override
@@ -107,7 +108,7 @@ public class ChatPane extends FacilityPane
}
});
- manager.add(new SafeAction("Horizontal Layout", "Horizontal Layout", SharedIcons
+ manager.add(new SafeAction(Messages.getString("ChatPane.4"), Messages.getString("ChatPane.5"), SharedIcons //$NON-NLS-1$ //$NON-NLS-2$
.getDescriptor(SharedIcons.ETOOL_HORIZONTAL))
{
@Override
diff --git a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java
index 8e02bcd8ab..e304961f3a 100644
--- a/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java
+++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/SharedIcons.java
@@ -25,21 +25,21 @@ 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$
@SuppressWarnings("unused")
- private static final String VIEW = "view16/";
+ private static final String VIEW = "view16/"; //$NON-NLS-1$
@SuppressWarnings("unused")
- private static final String WIZBAN = "wizban/";
+ private static final String WIZBAN = "wizban/"; //$NON-NLS-1$
- public static final String OBJ_CHAT = OBJ + "chat";
+ public static final String OBJ_CHAT = OBJ + "chat"; //$NON-NLS-1$
- public static final String ETOOL_HORIZONTAL = ETOOL + "horizontal_layout";
+ public static final String ETOOL_HORIZONTAL = ETOOL + "horizontal_layout"; //$NON-NLS-1$
- public static final String ETOOL_VERTICAL = ETOOL + "vertical_layout";
+ public static final String ETOOL_VERTICAL = ETOOL + "vertical_layout"; //$NON-NLS-1$
public static Image getImage(String key)
{
@@ -87,7 +87,7 @@ public class SharedIcons
if (display == null)
{
- throw new IllegalStateException("display == null");
+ throw new IllegalStateException("display == null"); //$NON-NLS-1$
}
return display;
@@ -95,6 +95,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.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/Messages.java b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/Messages.java
new file mode 100644
index 0000000000..0675b1f53a
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/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.buddies.chat.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.buddies.chat.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.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/messages.properties b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/messages.properties
new file mode 100644
index 0000000000..d32c6206a5
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.chat.ui/src/org/eclipse/net4j/buddies/chat/internal/ui/messages/messages.properties
@@ -0,0 +1,14 @@
+# 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
+
+ChatPane.2=Vertical Layout
+ChatPane.3=Vertical Layout
+ChatPane.4=Horizontal Layout
+ChatPane.5=Horizontal Layout

Back to the top