externalize strings
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
index 2cf4697..fcdc729 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorContextMenuProvider.java
@@ -88,7 +88,7 @@
public DiagramEditorContextMenuProvider(EditPartViewer viewer, ActionRegistry registry, IConfigurationProvider configurationProvider) {
super(viewer);
if (registry == null) {
- throw new IllegalArgumentException("Argument registry must not be null");
+ throw new IllegalArgumentException("Argument registry must not be null"); //$NON-NLS-1$
}
this.actionRegistry = registry;
if (configurationProvider == null) {
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
index 55f52e3..bc7bf56 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditorInput.java
@@ -768,7 +768,7 @@
*/
@Override
public String toString() {
- final String s = super.toString() + " uriName: " + this.uriName + " on TransactionalEditingDomain " //$NON-NLS-1$
+ final String s = super.toString() + " uriName: " + this.uriName + " on TransactionalEditingDomain " //$NON-NLS-1$ $NON-//$NON-NLS-2$
+ String.valueOf(getEditingDomain()) + " (null=OK)"; //$NON-NLS-1$
return s;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/GraphitiUIPlugin.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/GraphitiUIPlugin.java
index 2a7757d..90616d0 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/GraphitiUIPlugin.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/GraphitiUIPlugin.java
@@ -27,7 +27,7 @@
*/
public class GraphitiUIPlugin extends AbstractUIPlugin {
- public static final String PLUGIN_ID = "org.eclipse.graphiti.ui";
+ public static final String PLUGIN_ID = "org.eclipse.graphiti.ui"; //$NON-NLS-1$
private static GraphitiUIPlugin _plugin;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/Messages.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/Messages.java
index dfc2d9a..d9fc6d4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/Messages.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/Messages.java
@@ -45,6 +45,7 @@
public static String GraphicsPaletteRoot_0_xmen;
public static String DiscardChangesDialog_0_xmsg;
public static String DiscardChangesDialog_1_xmsg;
+ public static String ModelClipBoardPasteAction_0_xfld;
public static String PasteAction_0_xfld;
public static String PictogramElementDelegate_0_xmsg;
public static String PrintFigureDialog_0_xfld;
@@ -68,6 +69,7 @@
public static String PrintFigureDialog_32_xfld;
public static String PrintFigureDialog_34_xfld;
public static String PrintFigureDialog_38_xfld;
+ public static String PrintFigureDialog_39_xmsg;
public static String PrintFigureDialog_4_xfld;
public static String PrintFigureDialog_5_xfld;
public static String PrintFigureDialog_6_xfld;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorBehavior.java
index a454283..a345436 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorBehavior.java
@@ -448,7 +448,7 @@
public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
if ((!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) && editingDomain != null) {
final IFile file = GraphitiUiInternal.getEmfService().getFile(resource.getURI(), editingDomain);
- final String fileName = file != null ? file.getFullPath().toString() : "unknown name";
+ final String fileName = file != null ? file.getFullPath().toString() : "unknown name"; //$NON-NLS-1$
final BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, GraphitiUIPlugin.PLUGIN_ID, 0,
"Problems encountered in file " + fileName, new Object[] { exception == null ? (Object) resource : exception }); //$NON-NLS-1$
basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
@@ -668,7 +668,7 @@
if (T.racer().debug()) {
final String editorName = part.getTitle();
T.racer().debug("Delete listener called of editor " //$NON-NLS-1$
- + editorName + " with events " + msg.toString());
+ + editorName + " with events " + msg.toString()); //$NON-NLS-1$
}
final IEditorInput in = part.getEditorInput();
@@ -701,7 +701,7 @@
final IWorkbenchPage page = site.getPage();
if (T.racer().debug()) {
final String editorName = part.getTitle();
- T.racer().debug("Closing editor " + editorName);
+ T.racer().debug("Closing editor " + editorName); //$NON-NLS-1$
}
page.closeEditor(part, false);
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
index 597b4ac..ab260f5 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/editor/DiagramEditorInternal.java
@@ -576,7 +576,7 @@
// can happen if editor is started with invalid URI
if (diagram == null) {
- throw new IllegalStateException("Cannot open diagram '" + diagramEditorInput.getName() //$NON-NLS-2$
+ throw new IllegalStateException("Cannot open diagram '" + diagramEditorInput.getName() //$NON-NLS-1$
+ "'. Might have been deleted. See the error log for details."); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/messages.properties b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/messages.properties
index f0badec..ddcc7f0 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/messages.properties
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/messages.properties
@@ -31,6 +31,7 @@
GraphicsPaletteRoot_0_xmen=Standard tools
DiscardChangesDialog_0_xmsg=File Conflict
DiscardChangesDialog_1_xmsg=There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+ModelClipBoardPasteAction_0_xfld=&Paste Objects
PasteAction_0_xfld=&Paste
PictogramElementDelegate_0_xmsg=Refreshing graphics
PrintFigureDialog_0_xfld=Change &printer...
@@ -54,6 +55,7 @@
PrintFigureDialog_32_xfld=&Top margin
PrintFigureDialog_34_xfld=&Center image
PrintFigureDialog_38_xfld=Unsupported size-mode:
+PrintFigureDialog_39_xmsg=No preview: \n Image too large
PrintFigureDialog_4_xfld=Units
PrintFigureDialog_5_xfld=c&m
PrintFigureDialog_6_xfld=&inches
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/EmfService.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/EmfService.java
index 1b42c29..811adc4 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/EmfService.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/EmfService.java
@@ -227,7 +227,7 @@
do {
if (!parentTx.isReadOnly()) {
throw new IllegalStateException(
- "saveInWorkspaceRunnable() called from within a command (likely to produce deadlock)");
+ "saveInWorkspaceRunnable() called from within a command (likely to produce deadlock)"); //$NON-NLS-1$
}
} while ((parentTx = ((TransactionalEditingDomainImpl) editingDomain).getActiveTransaction().getParent()) != null);
}
@@ -282,9 +282,9 @@
}
private String createMessage(Map<URI, Throwable> failedSaves) {
- final StringBuilder buf = new StringBuilder("The following resources could not be saved:");
+ final StringBuilder buf = new StringBuilder("The following resources could not be saved:"); //$NON-NLS-1$
for (final Entry<URI, Throwable> entry : failedSaves.entrySet()) {
- buf.append("\nURI: ").append(entry.getKey().toString()).append(", cause: \n").append(getExceptionAsString(entry.getValue()));
+ buf.append("\nURI: ").append(entry.getKey().toString()).append(", cause: \n").append(getExceptionAsString(entry.getValue())); //$NON-NLS-1$ //$NON-NLS-2$
}
return buf.toString();
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/ImageService.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/ImageService.java
index 5c46ce3..c8b446e 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/ImageService.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/ImageService.java
@@ -64,7 +64,7 @@
Image image = imageRegistry.get(imageId); // now there is an image
// registered
if (image == null) {
- throw new IllegalStateException("No image could be retrieved for imageId '" + imageId + "'");
+ throw new IllegalStateException("No image could be retrieved for imageId '" + imageId + "'"); //$NON-NLS-1$ //$NON-NLS-2$
}
return image;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/UiService.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/UiService.java
index e897ad8..e0bfea7 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/UiService.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/services/impl/UiService.java
@@ -73,8 +73,8 @@
try {
imageLoader.save(result, format);
} catch (SWTException e) {
- String error = "Depth: " + Integer.toString(image.getImageData().depth) + "\n" + "X: "
- + Integer.toString(image.getImageData().x) + "\n" + "Y: " + Integer.toString(image.getImageData().y);
+ String error = "Depth: " + Integer.toString(image.getImageData().depth) + "\n" + "X: " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + Integer.toString(image.getImageData().x) + "\n" + "Y: " + Integer.toString(image.getImageData().y); //$NON-NLS-1$ //$NON-NLS-2$
throw new IllegalStateException(error, e);
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/ModelClipboard.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/ModelClipboard.java
index 2e2170d..cebf252 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/ModelClipboard.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/ModelClipboard.java
@@ -43,6 +43,7 @@
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.graphiti.ui.internal.Messages;
import org.eclipse.graphiti.ui.internal.T;
import org.eclipse.graphiti.ui.internal.services.GraphitiUiInternal;
import org.eclipse.jface.util.LocalSelectionTransfer;
@@ -96,7 +97,7 @@
*/
public synchronized void setContent(EObject[] objects) throws IllegalStateException {
if (objects == null) {
- throw new IllegalArgumentException("EObject[] objects must not be null");
+ throw new IllegalArgumentException("EObject[] objects must not be null"); //$NON-NLS-1$
}
if (objects.length == 0) {
return;
@@ -120,7 +121,7 @@
*/
public synchronized EObject[] getContentAsEObjects(ResourceSet resourceSet) throws IllegalStateException {
if (resourceSet == null) {
- throw new IllegalArgumentException("ResourceSet resourceSet must not be null");
+ throw new IllegalArgumentException("ResourceSet resourceSet must not be null"); //$NON-NLS-1$
}
final List<String> uriStrings;
if (canUseNative()) {
@@ -244,10 +245,10 @@
@SuppressWarnings("unchecked")
private Collection<EObject> deepCopy(final EObject[] srcObjects) {
if (srcObjects == null) {
- throw new IllegalArgumentException("EObject[] srcObjects must not be null");
+ throw new IllegalArgumentException("EObject[] srcObjects must not be null"); //$NON-NLS-1$
}
if (srcObjects.length == 0) {
- throw new IllegalArgumentException("EObject[] srcObjects.length must not be 0");
+ throw new IllegalArgumentException("EObject[] srcObjects.length must not be 0"); //$NON-NLS-1$
}
final Collection<EObject>[] result = new Collection[1];
// in the case of a UI
@@ -590,7 +591,7 @@
private synchronized boolean canUseNative() {
final boolean result = canUseUI();
if (!result) {
- throw new IllegalStateException("ModelClipboard must be called from UI thread.");
+ throw new IllegalStateException("ModelClipboard must be called from UI thread."); //$NON-NLS-1$
}
return result;
}
@@ -616,7 +617,7 @@
@Override
public String getLabel() {
- return "Paste objects";
+ return Messages.ModelClipBoardPasteAction_0_xfld;
}
@Override
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/UriTransfer.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/UriTransfer.java
index 977e274..04713a2 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/UriTransfer.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/clipboard/UriTransfer.java
@@ -82,7 +82,7 @@
dataOut.write(bytes);
super.javaToNative(out.toByteArray(), transferData);
} catch (final IOException e) {
- T.racer().error("Error when writing transfer data", e);
+ T.racer().error("Error when writing transfer data", e); //$NON-NLS-1$
} finally {
try {
dataOut.close();
@@ -110,7 +110,7 @@
final List<String> uriStrings = fromTransferBytes(uriBytes);
return new UriTransferData(uriStrings);
} catch (final IOException e) {
- T.racer().error("Error when writing transfer data", e);
+ T.racer().error("Error when writing transfer data", e); //$NON-NLS-1$
return null;
} finally {
try {
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/ui/print/PrintFigureDialog.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/ui/print/PrintFigureDialog.java
index 689e947..e9b8946 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/ui/print/PrintFigureDialog.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/ui/print/PrintFigureDialog.java
@@ -236,6 +236,7 @@
}
}
+ @Override
public void paintControl(PaintEvent e) {
Rectangle printRegion = getPrintRegion();
org.eclipse.swt.graphics.Rectangle previewRegion = _preview.getClientArea();
@@ -245,7 +246,7 @@
e.gc.drawImage(_image, 0, 0, _image.getBounds().width, _image.getBounds().height, margins.x, margins.y, size.x, size.y);
e.gc.drawRectangle(margins.x, margins.y, size.x - 1, size.y - 1);
} else {
- e.gc.drawText("No preview: \n Image too large", 1, 1);
+ e.gc.drawText(Messages.PrintFigureDialog_39_xmsg, 1, 1);
}
adjustPrinterValuesUsingPreview(margins.x, margins.y, size.x, size.y, printRegion, previewRegion);
}
@@ -461,6 +462,7 @@
}
}
+ @Override
public void modifyText(ModifyEvent e) {
if (_insideInternalModify) // avoid endless-loops
return;