Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdumoulin2013-06-05 19:47:23 +0000
committercdumoulin2013-06-05 19:47:23 +0000
commit3359d6e1494537b45189ed6b45ed3b387f1accb7 (patch)
treeac23b8a3119b9c409083b4c07190568e9ba14716 /plugins
parenta57d1e51cc7147afb4cd9f6c7ad1ff6481eebe77 (diff)
downloadorg.eclipse.papyrus-3359d6e1494537b45189ed6b45ed3b387f1accb7.tar.gz
org.eclipse.papyrus-3359d6e1494537b45189ed6b45ed3b387f1accb7.tar.xz
org.eclipse.papyrus-3359d6e1494537b45189ed6b45ed3b387f1accb7.zip
RESOLVED - bug 404142: [sasheditor] Rename diagram command from sash tab
https://bugs.eclipse.org/bugs/show_bug.cgi?id=404142 i18n - externalize Strings
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/RenameDiagramHandler.java16
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/Messages.java21
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/messages.properties3
3 files changed, 30 insertions, 10 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/RenameDiagramHandler.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/RenameDiagramHandler.java
index a58f0628318..a3d9b9f4ff6 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/RenameDiagramHandler.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/RenameDiagramHandler.java
@@ -24,6 +24,7 @@ import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocument
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.commands.messages.Messages;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForIEvaluationContext;
import org.eclipse.swt.widgets.Display;
@@ -40,11 +41,6 @@ import org.eclipse.ui.IEditorPart;
*/
public class RenameDiagramHandler extends AbstractHandler {
- public static String RenameDiagramHandler_NewName = "New name:";
-
- public static String RenameDiagramHandler_RenameAnExistingDiagram = "Rename an existing diagram";
-
-
/**
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
* @param event
@@ -82,7 +78,7 @@ public class RenameDiagramHandler extends AbstractHandler {
// Open the dialog to ask the new name
String currentName = notationDiagramHelper.getName();
String newName = null;
- InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), RenameDiagramHandler_RenameAnExistingDiagram, RenameDiagramHandler_NewName, currentName, null);
+ InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), Messages.RenameDiagramHandler_RenameAnExistingDiagram, Messages.RenameDiagramHandler_NewName, currentName, null);
if(dialog.open() == Window.OK) {
newName = dialog.getValue();
if(newName == null || newName.length() <= 0) {
@@ -117,14 +113,14 @@ public class RenameDiagramHandler extends AbstractHandler {
* @return The command name to show.
*/
public String getCommandName() {
- return "Rename Diagram";
+ return Messages.RenameDiagramHandler_RenameDiagram;
}
protected IEvaluationContext getIEvaluationContext(ExecutionEvent event) throws NotFoundException {
try {
return (IEvaluationContext)event.getApplicationContext();
} catch (ClassCastException e) {
- throw new NotFoundException("IEvaluationContext can't be found.");
+ throw new NotFoundException("IEvaluationContext can't be found."); //$NON-NLS-1$
}
}
@@ -157,13 +153,13 @@ public class RenameDiagramHandler extends AbstractHandler {
IEditorPart editor = ServiceUtilsForIEvaluationContext.getInstance().getNestedActiveIEditorPart(context);
if( ! (editor instanceof DiagramDocumentEditor) ) {
- throw new NotFoundException("Selected editor do not contains Diagram");
+ throw new NotFoundException("Selected editor do not contains Diagram"); //$NON-NLS-1$
}
DiagramDocumentEditor diagramEditor = (DiagramDocumentEditor)editor;
Diagram diagram = diagramEditor.getDiagram();
if(diagram == null) {
- throw new NotFoundException("Selected editor do not contains Diagram");
+ throw new NotFoundException("Selected editor do not contains Diagram"); //$NON-NLS-1$
}
// Return a new instance of the Helper
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/Messages.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/Messages.java
new file mode 100644
index 00000000000..796da9dda4a
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/Messages.java
@@ -0,0 +1,21 @@
+package org.eclipse.papyrus.commands.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.commands.messages.messages"; //$NON-NLS-1$
+
+ public static String RenameDiagramHandler_NewName;
+
+ public static String RenameDiagramHandler_RenameAnExistingDiagram;
+
+ public static String RenameDiagramHandler_RenameDiagram;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/messages.properties b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/messages.properties
new file mode 100644
index 00000000000..c962f35540a
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands/src/org/eclipse/papyrus/commands/messages/messages.properties
@@ -0,0 +1,3 @@
+RenameDiagramHandler_NewName=New name:
+RenameDiagramHandler_RenameAnExistingDiagram=Rename an existing diagram
+RenameDiagramHandler_RenameDiagram=Rename Diagram

Back to the top