Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-06-07 20:10:31 +0000
committerRoland Grunberg2013-06-11 17:55:59 +0000
commit6d5945d987cdbd06b887b1cd35c64b629a6e979e (patch)
treeaf259a6d0bb67ecf521bfdc92845d1b19f135f8e
parent1b5b4726aa48b6cfd4094636ca896b6018a5ed5e (diff)
downloadorg.eclipse.linuxtools-6d5945d987cdbd06b887b1cd35c64b629a6e979e.tar.gz
org.eclipse.linuxtools-6d5945d987cdbd06b887b1cd35c64b629a6e979e.tar.xz
org.eclipse.linuxtools-6d5945d987cdbd06b887b1cd35c64b629a6e979e.zip
Dataviewers: Externalize strings and add missing NLS tags.
Change-Id: I4d84ef69fc8c9f41790f9b694369c8052f6a05e5 Reviewed-on: https://git.eclipse.org/r/13660 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/STAnnotatedSourceEditorActivator.java2
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/AbstractOpenSourceFileAction.java16
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/Messages.java29
-rw-r--r--profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/messages.properties16
4 files changed, 53 insertions, 10 deletions
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/STAnnotatedSourceEditorActivator.java b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/STAnnotatedSourceEditorActivator.java
index abd3faa06e..7626548052 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/STAnnotatedSourceEditorActivator.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/STAnnotatedSourceEditorActivator.java
@@ -41,7 +41,7 @@ public class STAnnotatedSourceEditorActivator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
- EditorsUI.getPreferenceStore().setValue("STRuler", true);
+ EditorsUI.getPreferenceStore().setValue("STRuler", true); //$NON-NLS-1$
}
/*
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/AbstractOpenSourceFileAction.java b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/AbstractOpenSourceFileAction.java
index 8a43ad4445..8421da9c06 100644
--- a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/AbstractOpenSourceFileAction.java
+++ b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/AbstractOpenSourceFileAction.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
import org.eclipse.linuxtools.dataviewers.annotatedsourceeditor.STAnnotatedSourceEditorActivator;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
@@ -26,11 +27,11 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.FileStoreEditorInput;
public abstract class AbstractOpenSourceFileAction extends Action {
- public static final String EDITOR_ID = "org.eclipse.linuxtools.dataviewers.annotatedsourceeditor.editor";
+ public static final String EDITOR_ID = "org.eclipse.linuxtools.dataviewers.annotatedsourceeditor.editor"; //$NON-NLS-1$
private long ts;
public AbstractOpenSourceFileAction(String filepath, long ts) {
- super.setText("Open =>" + filepath);
+ super.setText(NLS.bind(Messages.OpenSourceFileAction_open_src_action_text, filepath));
this.ts = ts;
}
@@ -49,10 +50,7 @@ public abstract class AbstractOpenSourceFileAction extends Action {
MessageBox msg = new MessageBox(window.getShell(), SWT.ICON_WARNING | SWT.APPLICATION_MODAL
| SWT.YES | SWT.NO);
msg.setText(fileStore.toString());
- msg.setMessage("The file "
- + fileStore
- + " is newer than the analysis result, \n"
- + " if you continue opening it the visualization could result inconsistent. \n Do you want to continue?");
+ msg.setMessage(NLS.bind(Messages.OpenSourceFileAction_warning_inconsistency, fileStore));
}
try {
@@ -64,11 +62,11 @@ public abstract class AbstractOpenSourceFileAction extends Action {
}
} catch (Exception e) {
Status s = new Status(IStatus.ERROR, STAnnotatedSourceEditorActivator.PLUGIN_ID,
- IStatus.ERROR, "Error when opening annotated source view", e);
+ IStatus.ERROR, Messages.OpenSourceFileAction_view_error, e);
STAnnotatedSourceEditorActivator.getDefault().getLog().log(s);
}
} else {
- showMessage("The selected file does not exist: " + fileStore, window.getShell());
+ showMessage(NLS.bind(Messages.OpenSourceFileAction_file_dne,fileStore), window.getShell());
}
}
@@ -76,7 +74,7 @@ public abstract class AbstractOpenSourceFileAction extends Action {
private void showMessage(String message, Shell shell) {
MessageBox msgBox = new MessageBox(shell, SWT.ICON_ERROR);
- msgBox.setText("Error");
+ msgBox.setText(Messages.OpenSourceFileAction_Error);
msgBox.setMessage(message);
msgBox.open();
}
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/Messages.java b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/Messages.java
new file mode 100644
index 0000000000..21ace63f08
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/Messages.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Red Hat, Inc.
+ * 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:
+ * Red Hat initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.dataviewers.annotatedsourceeditor.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.dataviewers.annotatedsourceeditor.actions.messages"; //$NON-NLS-1$
+ public static String OpenSourceFileAction_view_error;
+ public static String OpenSourceFileAction_Error;
+ public static String OpenSourceFileAction_file_dne;
+ public static String OpenSourceFileAction_warning_inconsistency;
+ public static String OpenSourceFileAction_open_src_action_text;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/messages.properties b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/messages.properties
new file mode 100644
index 0000000000..14a0fb89cf
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.dataviewers.annotatedsourceeditor/src/org/eclipse/linuxtools/dataviewers/annotatedsourceeditor/actions/messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2013 Red Hat, Inc.
+# 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:
+# Red Hat - initial API and implementation
+###############################################################################
+OpenSourceFileAction_view_error=Error when opening annotated source view
+OpenSourceFileAction_Error=Error
+OpenSourceFileAction_file_dne=The selected file does not exist: {0}
+OpenSourceFileAction_warning_inconsistency=The file {0} is newer than the analysis result, \n \
+ if you continue opening it the visualization could result inconsistent. \n Do you want to continue?
+OpenSourceFileAction_open_src_action_text=Open => {0} \ No newline at end of file

Back to the top