Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 233666 Details for
Bug 412592
Prepare org.eclipse.emf.ecp.edit and org.eclipse.emf.ecp.edit.swt for I18N
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
I18N for all Java packages in o.e.emf.ecp.edit, o.e.emf.ecp.edit.swt
0001-Bug-412592-Prepare-o.e.emf.ecp.edit-o.e.emf.ecp.edit.patch (text/plain), 86.12 KB, created by
Markus Knauer
on 2013-07-22 08:37:32 EDT
(
hide
)
Description:
I18N for all Java packages in o.e.emf.ecp.edit, o.e.emf.ecp.edit.swt
Filename:
MIME Type:
Creator:
Markus Knauer
Created:
2013-07-22 08:37:32 EDT
Size:
86.12 KB
patch
obsolete
>From 6a360c80958224f88a16bdacdff4b38e5626e20e Mon Sep 17 00:00:00 2001 >From: Markus Knauer <mknauer@eclipsesource.com> >Date: Mon, 22 Jul 2013 13:00:00 +0200 >Subject: [PATCH] Bug 412592 - Prepare o.e.emf.ecp.edit, o.e.emf.ecp.edit.swt > for I18N > >- I18N MANIFEST.MF, plugin.xml, and Java classes with Eclipse standard > RCP mechanisms >- Add message.properties and *Messages classes to all packages >- Adjust NON-NLS markers and remove language TODOs >--- > .../META-INF/MANIFEST.MF | 4 +- > .../OSGI-INF/l10n/bundle.properties | 18 +++++ > .../org.eclipse.emf.ecp.edit.swt/build.properties | 3 +- > bundles/org.eclipse.emf.ecp.edit.swt/plugin.xml | 4 +- > .../emf/ecp/edit/internal/swt/Activator.java | 6 +- > .../edit/internal/swt/actions/ActionMessages.java | 40 +++++++++++ > .../internal/swt/actions/AddAttributeAction.java | 4 +- > .../internal/swt/actions/AddReferenceAction.java | 3 +- > .../swt/actions/DeleteReferenceAction.java | 14 ++-- > .../internal/swt/actions/NewReferenceAction.java | 12 ++-- > .../edit/internal/swt/actions/messages.properties | 23 ++++++ > .../internal/swt/controls/AbstractTextControl.java | 9 ++- > .../swt/controls/AttributeMultiControl.java | 4 +- > .../edit/internal/swt/controls/BooleanControl.java | 7 +- > .../internal/swt/controls/ControlMessages.java | 74 ++++++++++++++++++++ > .../internal/swt/controls/DateTimeControl.java | 9 ++- > .../edit/internal/swt/controls/EEnumControl.java | 7 +- > .../edit/internal/swt/controls/LinkControl.java | 14 ++-- > .../edit/internal/swt/controls/MultiControl.java | 2 +- > .../internal/swt/controls/NumericalControl.java | 36 +++++----- > .../internal/swt/controls/NumericalHelper.java | 30 ++++---- > .../swt/controls/ReferenceMultiControl.java | 4 +- > .../edit/internal/swt/controls/SingleControl.java | 2 +- > .../edit/internal/swt/controls/StringControl.java | 7 +- > .../edit/internal/swt/controls/TableControl.java | 24 +++---- > .../internal/swt/controls/XmlDateControlText.java | 18 ++--- > .../edit/internal/swt/controls/messages.properties | 56 +++++++++++++++ > .../edit/internal/swt/table/DateCellEditor.java | 6 +- > .../edit/internal/swt/table/LinkCellEditor.java | 4 +- > .../edit/internal/swt/table/NumberCellEditor.java | 24 +++---- > .../ecp/edit/internal/swt/table/TableMessages.java | 32 +++++++++ > .../edit/internal/swt/table/XmlDateCellEditor.java | 4 +- > .../edit/internal/swt/table/messages.properties | 16 +++++ > .../edit/internal/swt/util/CellEditorFactory.java | 5 +- > .../ecp/edit/internal/swt/util/DialogOpener.java | 4 +- > .../ecp/edit/internal/swt/util/ECPCellEditor.java | 2 +- > .../emf/ecp/edit/internal/swt/util/SWTControl.java | 10 +-- > .../ecp/edit/internal/swt/util/UtilMessages.java | 33 +++++++++ > .../ecp/edit/internal/swt/util/messages.properties | 15 ++++ > .../org.eclipse.emf.ecp.edit/META-INF/MANIFEST.MF | 4 +- > .../OSGI-INF/l10n/bundle.properties | 17 +++++ > bundles/org.eclipse.emf.ecp.edit/plugin.xml | 2 +- > .../emf/ecp/internal/edit/ControlFactoryImpl.java | 52 +++++++------- > .../emf/ecp/internal/edit/EditMessages.java | 32 +++++++++ > .../emf/ecp/internal/edit/messages.properties | 13 ++++ > 45 files changed, 533 insertions(+), 176 deletions(-) > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/OSGI-INF/l10n/bundle.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/ActionMessages.java > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/messages.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ControlMessages.java > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/messages.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/TableMessages.java > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/messages.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/UtilMessages.java > create mode 100644 bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/messages.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit/OSGI-INF/l10n/bundle.properties > create mode 100644 bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/EditMessages.java > create mode 100644 bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/messages.properties > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.emf.ecp.edit.swt/META-INF/MANIFEST.MF >index 867c436..aa6e8e3 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/META-INF/MANIFEST.MF >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/META-INF/MANIFEST.MF >@@ -1,6 +1,6 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 >-Bundle-Name: Edit SWT >+Bundle-Name: %Bundle-Name > Bundle-SymbolicName: org.eclipse.emf.ecp.edit.swt;singleton:=true > Bundle-Version: 1.0.1.qualifier > Bundle-Activator: org.eclipse.emf.ecp.edit.internal.swt.Activator >@@ -33,4 +33,4 @@ Export-Package: org.eclipse.emf.ecp.edit.internal.swt;version="1.0.0";x-internal > org.eclipse.emf.ecp.edit.internal.swt.controls;version="1.0.0";x-friends:="org.eclipse.emf.ecp.ui.view.swt", > org.eclipse.emf.ecp.edit.internal.swt.table;version="1.0.0";x-internal:=true, > org.eclipse.emf.ecp.edit.internal.swt.util;version="1.0.0";x-friends:="org.eclipse.emf.ecp.ui.view.swt" >-Bundle-Vendor: Eclipse Modeling Project >+Bundle-Vendor: %Bundle-Vendor >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.emf.ecp.edit.swt/OSGI-INF/l10n/bundle.properties >new file mode 100644 >index 0000000..7f3e862 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/OSGI-INF/l10n/bundle.properties >@@ -0,0 +1,18 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+#Properties file for org.eclipse.emf.ecp.edit.swt >+ >+Bundle-Vendor = Eclipse Modeling Project >+Bundle-Name = Edit SWT >+ >+extension-point.cell-editor = ECP SWT Table CellEditor >+extension-point.dialog-wrapper = Dialog Wrapper >\ No newline at end of file >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/build.properties b/bundles/org.eclipse.emf.ecp.edit.swt/build.properties >index e675619..36b13ee 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/build.properties >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/build.properties >@@ -4,4 +4,5 @@ bin.includes = META-INF/,\ > .,\ > plugin.xml,\ > icons/,\ >- schema/ >+ schema/,\ >+ OSGI-INF/ >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/plugin.xml b/bundles/org.eclipse.emf.ecp.edit.swt/plugin.xml >index e4d3547..ac45266 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/plugin.xml >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/plugin.xml >@@ -1,8 +1,8 @@ > <?xml version="1.0" encoding="UTF-8"?> > <?eclipse version="3.4"?> > <plugin> >- <extension-point id="cellEditor" name="ECP SWT Table CellEditor" schema="schema/cellEditor.exsd"/> >- <extension-point id="dialogWrapper" name="Dialog Wrapper" schema="schema/dialogWrapper.exsd"/> >+ <extension-point id="cellEditor" name="%extension-point.cell-editor" schema="schema/cellEditor.exsd"/> >+ <extension-point id="dialogWrapper" name="%extension-point.dialog-wrapper" schema="schema/dialogWrapper.exsd"/> > <extension > point="org.eclipse.emf.ecp.edit.controls"> > <control >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/Activator.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/Activator.java >index 31f79a6..341b70b 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/Activator.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/Activator.java >@@ -108,11 +108,11 @@ public class Activator extends Plugin { > } > > public static Image getImage(URL url) { >- if (!getDefault().imageRegistry.containsKey(url == null ? "NULL" : url.toExternalForm())) { >- getDefault().imageRegistry.put(url == null ? "NULL" : url.toExternalForm(), new ImageDescriptorToImage( >+ if (!getDefault().imageRegistry.containsKey(url == null ? "NULL" : url.toExternalForm())) { //$NON-NLS-1$ >+ getDefault().imageRegistry.put(url == null ? "NULL" : url.toExternalForm(), new ImageDescriptorToImage( //$NON-NLS-1$ > ImageDescriptor.createFromURL(url))); > } >- return getDefault().imageRegistry.get(url == null ? "NULL" : url.toExternalForm()).getImage(); >+ return getDefault().imageRegistry.get(url == null ? "NULL" : url.toExternalForm()).getImage(); //$NON-NLS-1$ > > } > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/ActionMessages.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/ActionMessages.java >new file mode 100644 >index 0000000..b0e6d36 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/ActionMessages.java >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 EclipseSource. >+ * >+ * 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: >+ * EclipseSource - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.emf.ecp.edit.internal.swt.actions; >+ >+import org.eclipse.osgi.util.NLS; >+ >+public class ActionMessages extends NLS { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.edit.internal.swt.actions.messages"; //$NON-NLS-1$ >+ >+ public static String AddAttributeAction_AddEntry; >+ public static String AddReferenceAction_Link; >+ >+ public static String DeleteReferenceAction_Confirmation; >+ public static String DeleteReferenceAction_DeleteModelQuestion; >+ public static String DeleteReferenceAction_DeleteReference; >+ public static String DeleteReferenceAction_Yes; >+ public static String DeleteReferenceAction_No; >+ public static String DeleteReferenceAction_Questionmark; >+ >+ public static String NewReferenceAction_CreateAndLinkNew; >+ >+ private ActionMessages() { >+ } >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class); >+ } >+ >+} >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddAttributeAction.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddAttributeAction.java >index d0b6fa9..5dbddf5 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddAttributeAction.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddAttributeAction.java >@@ -38,8 +38,8 @@ public class AddAttributeAction extends ECPSWTAction { > EStructuralFeature feature) { > super(modelElementContext, itemPropertyDescriptor, feature); > // TODO remove PlatformUI >- setImageDescriptor(Activator.getImageDescriptor("icons/add.png")); >- setToolTipText("Add Entry"); //$NON-NLS-1$ >+ setImageDescriptor(Activator.getImageDescriptor("icons/add.png")); //$NON-NLS-1$ >+ setToolTipText(ActionMessages.AddAttributeAction_AddEntry); > } > > @Override >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddReferenceAction.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddReferenceAction.java >index 7a9832e..7a0dba7 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddReferenceAction.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/AddReferenceAction.java >@@ -77,8 +77,7 @@ public class AddReferenceAction extends ECPSWTAction { > } else if (attribute.endsWith("s")) {//$NON-NLS-1$ > attribute = attribute.substring(0, attribute.length() - 1); > } >- // TODO language dependent >- setToolTipText("Link " + attribute);//$NON-NLS-1$ >+ setToolTipText(ActionMessages.AddReferenceAction_Link + attribute); > } > > /** >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/DeleteReferenceAction.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/DeleteReferenceAction.java >index 6d0567f..5c65d3c 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/DeleteReferenceAction.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/DeleteReferenceAction.java >@@ -48,9 +48,8 @@ public class DeleteReferenceAction extends ECPSWTAction { > super(modelElementContext, itemPropertyDescriptor, feature); > // TODO remove PlatformUI > >- setImageDescriptor(Activator.getImageDescriptor("icons/delete.png")); >- // TODO language >- setToolTipText("Delete Reference"); //$NON-NLS-1$ >+ setImageDescriptor(Activator.getImageDescriptor("icons/delete.png")); //$NON-NLS-1$ >+ setToolTipText(ActionMessages.DeleteReferenceAction_DeleteReference); > } > > @Override >@@ -92,13 +91,14 @@ public class DeleteReferenceAction extends ECPSWTAction { > AdapterFactoryItemDelegator adapterFactoryItemDelegator = new AdapterFactoryItemDelegator(adapterFactory); > // AdapterFactoryLabelProvider adapterFactoryLabelProvider = new AdapterFactoryLabelProvider(adapterFactory); > String modelElementName = adapterFactoryItemDelegator.getText(toBeDeleted); >- // TODO language >- question = "Do you really want to delete the model element " + modelElementName + "?";//$NON-NLS-1$ //$NON-NLS-2$ >+ question = ActionMessages.DeleteReferenceAction_DeleteModelQuestion + modelElementName >+ + ActionMessages.DeleteReferenceAction_Questionmark; > // } else { > // question = "Do you really want to delete these " + toBeDeleted.size() + " model elements?"; > // } >- MessageDialog dialog = new MessageDialog(null, "Confirmation", null, question, MessageDialog.QUESTION,//$NON-NLS-1$ >- new String[] { "Yes", "No" }, 0);//$NON-NLS-1$//$NON-NLS-2$ >+ MessageDialog dialog = new MessageDialog(null, ActionMessages.DeleteReferenceAction_Confirmation, null, >+ question, MessageDialog.QUESTION, new String[] { ActionMessages.DeleteReferenceAction_Yes, >+ ActionMessages.DeleteReferenceAction_No }, 0); > > boolean confirm = false; > if (dialog.open() == Window.OK) { >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/NewReferenceAction.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/NewReferenceAction.java >index 568ef5d..62670f4 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/NewReferenceAction.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/NewReferenceAction.java >@@ -75,7 +75,7 @@ public class NewReferenceAction extends ECPSWTAction { > } else if (attribute.endsWith("s")) {//$NON-NLS-1$ > attribute = attribute.substring(0, attribute.length() - 1); > } >- setToolTipText("Create and link new " + attribute);//$NON-NLS-1$ >+ setToolTipText(ActionMessages.NewReferenceAction_CreateAndLinkNew + attribute); > } > > /** >@@ -106,7 +106,7 @@ public class NewReferenceAction extends ECPSWTAction { > // } > // Image image = labelProvider.getImage(obj); > // >- // ImageDescriptor addOverlay = Activator.getImageDescriptor("icons/add_overlay.png"); >+ // ImageDescriptor addOverlay = Activator.getImageDescriptor("icons/add_overlay.png");//$NON-NLS-1$ > // OverlayImageDescriptor imageDescriptor = new OverlayImageDescriptor(image, addOverlay, > // OverlayImageDescriptor.LOWER_RIGHT); > // setImageDescriptor(imageDescriptor); >@@ -114,12 +114,12 @@ public class NewReferenceAction extends ECPSWTAction { > // String attribute = descriptor.getDisplayName(eReference); > // > // // make singular attribute labels >- // if (attribute.endsWith("ies")) { >- // attribute = attribute.substring(0, attribute.length() - 3) + "y"; >- // } else if (attribute.endsWith("s")) { >+ // if (attribute.endsWith("ies")) {//$NON-NLS-1$ >+ // attribute = attribute.substring(0, attribute.length() - 3) + "y";//$NON-NLS-1$ >+ // } else if (attribute.endsWith("s")) {//$NON-NLS-1$ > // attribute = attribute.substring(0, attribute.length() - 1); > // } >- // setToolTipText("Create and link new " + attribute); >+ // setToolTipText(ActionMessages.NewReferenceAction_CreateAndLinkNew + attribute); > // > // } > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/messages.properties b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/messages.properties >new file mode 100644 >index 0000000..e08c6ed >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/actions/messages.properties >@@ -0,0 +1,23 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+AddAttributeAction_AddEntry=Add Entry >+ >+AddReferenceAction_Link=Link >+ >+DeleteReferenceAction_Confirmation=Confirmation >+DeleteReferenceAction_DeleteModelQuestion=Do you really want to delete the model element >+DeleteReferenceAction_DeleteReference=Delete Reference >+DeleteReferenceAction_Yes=Yes >+DeleteReferenceAction_No=No >+DeleteReferenceAction_Questionmark=? >+ >+NewReferenceAction_CreateAndLinkNew=Create and link new >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java >index 6aadea9..f362b7d 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AbstractTextControl.java >@@ -75,8 +75,7 @@ public abstract class AbstractTextControl extends SingleControl { > private void addControlDecoration(Composite composite) { > controlDecoration = new ControlDecoration(text, SWT.LEFT | SWT.TOP, composite); > controlDecoration.hide(); >- // TODO language >- controlDecoration.setDescriptionText("Invalid input");//$NON-NLS-1$ >+ controlDecoration.setDescriptionText(ControlMessages.AbstractTextControl_InvalidInput); > controlDecoration.setShowHover(true); > FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration( > FieldDecorationRegistry.DEC_ERROR); >@@ -87,7 +86,7 @@ public abstract class AbstractTextControl extends SingleControl { > text = new Text(composite, getTextWidgetStyle()); > text.setLayoutData(getTextWidgetLayoutData()); > if (getStructuralFeature().isUnsettable()) { >- text.setMessage("<unset>"); >+ text.setMessage(ControlMessages.AbstractTextControl_Unset); > } > text.setData(CUSTOM_VARIANT, getTextVariantID()); > customizeText(text); >@@ -241,7 +240,7 @@ public abstract class AbstractTextControl extends SingleControl { > > controlDecoration.hide(); > updateValidationColor(null); >- if ("".equals(value)) { >+ if ("".equals(value)) { //$NON-NLS-1$ > value = null; > } > if (value == null && getStructuralFeature().isUnsettable()) { >@@ -255,7 +254,7 @@ public abstract class AbstractTextControl extends SingleControl { > } catch (IllegalArgumentException e) { > controlDecoration.show(); > updateValidationColor(getText().getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); >- controlDecoration.setDescriptionText("Invalid input " + e.getLocalizedMessage()); >+ controlDecoration.setDescriptionText(ControlMessages.AbstractTextControl_InvalidInputSpace + e.getLocalizedMessage()); > throw e; > } > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AttributeMultiControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AttributeMultiControl.java >index 542204a..d4914ec 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AttributeMultiControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/AttributeMultiControl.java >@@ -62,7 +62,7 @@ public class AttributeMultiControl extends MultiControl { > */ > @Override > protected String getUnsetLabelText() { >- return "Not set. Click to set!"; >+ return ControlMessages.AttributeMultiControl_NotSetClickToSet; > } > > /* >@@ -71,7 +71,7 @@ public class AttributeMultiControl extends MultiControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset"; >+ return ControlMessages.AttributeMultiControl_Unset; > } > > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/BooleanControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/BooleanControl.java >index 8846cd9..fa0ea6b 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/BooleanControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/BooleanControl.java >@@ -52,7 +52,7 @@ public class BooleanControl extends SingleControl { > @Override > protected void fillControlComposite(Composite composite) { > check = new Button(composite, SWT.CHECK); >- check.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_boolean"); >+ check.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_boolean"); //$NON-NLS-1$ > } > > /** >@@ -80,8 +80,7 @@ public class BooleanControl extends SingleControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No boolean set! Click to set boolean."; //$NON-NLS-1$ >+ return ControlMessages.BooleanControl_NoBooleanSetClickToSetBoolean; > } > > /* >@@ -90,7 +89,7 @@ public class BooleanControl extends SingleControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset boolean"; >+ return ControlMessages.BooleanControl_UnsetBoolean; > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ControlMessages.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ControlMessages.java >new file mode 100644 >index 0000000..17b69fa >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ControlMessages.java >@@ -0,0 +1,74 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 EclipseSource. >+ * >+ * 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: >+ * EclipseSource - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.emf.ecp.edit.internal.swt.controls; >+ >+import org.eclipse.osgi.util.NLS; >+ >+public class ControlMessages extends NLS { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.edit.internal.swt.controls.messages"; //$NON-NLS-1$ >+ >+ public static String AbstractTextControl_InvalidInput; >+ public static String AbstractTextControl_InvalidInputSpace; >+ public static String AbstractTextControl_Unset; >+ >+ public static String AttributeMultiControl_NotSetClickToSet; >+ public static String AttributeMultiControl_Unset; >+ >+ public static String BooleanControl_NoBooleanSetClickToSetBoolean; >+ public static String BooleanControl_UnsetBoolean; >+ >+ public static String DateTimeControl_NoDateSetClickToSetDate; >+ public static String DateTimeControl_UnsetDate; >+ >+ public static String EEnumControl_NoValueSetClickToSetValue; >+ public static String EEnumControl_UnsetValue; >+ >+ public static String LinkControl_NoLinkSetClickToSetLink; >+ public static String LinkControl_NotSet; >+ public static String LinkControl_UnsetLink; >+ >+ public static String NumericalControl_FormatNumerical; >+ public static String NumericalControl_FormatNumericalDecimal; >+ public static String NumericalControl_InvalidNumber; >+ public static String NumericalControl_InvalidNumberWillBeUnset; >+ public static String NumericalControl_NoNumberClickToSetNumber; >+ public static String NumericalControl_UnsetNumber; >+ >+ public static String ReferenceMultiControl_NotSetClickToSet; >+ public static String ReferenceMultiControl_Unset; >+ >+ public static String StringControl_NoTextSetClickToSetText; >+ public static String StringControl_UnsetText; >+ >+ public static String TableControl_AddInstanceOf; >+ public static String TableControl_Delete; >+ public static String TableControl_DeleteAreYouSure; >+ public static String TableControl_NotSetClickToSet; >+ public static String TableControl_RemoveSelected; >+ public static String TableControl_Unset; >+ >+ public static String XmlDateControlText_InvalidNumber; >+ public static String XmlDateControlText_NoDateSetClickToSetDate; >+ public static String XmlDateControlText_NumberInvalidValueWillBeUnset; >+ public static String XmlDateControlText_SelectDate; >+ public static String XmlDateControlText_UnsetDate; >+ >+ private ControlMessages() { >+ } >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, ControlMessages.class); >+ } >+ >+} >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/DateTimeControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/DateTimeControl.java >index 90722ba..86d09ec 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/DateTimeControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/DateTimeControl.java >@@ -75,11 +75,11 @@ public class DateTimeControl extends SingleControl { > > dateWidget = new DateTime(composite, SWT.DATE | SWT.BORDER); > dateWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >- dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_dateTime_date"); >+ dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_dateTime_date"); //$NON-NLS-1$ > > timeWidget = new DateTime(composite, SWT.TIME | SWT.SHORT | SWT.BORDER); > timeWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); >- timeWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_dateTime_time"); >+ timeWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_dateTime_time"); //$NON-NLS-1$ > } > > /** >@@ -105,8 +105,7 @@ public class DateTimeControl extends SingleControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No date set! Click to set date."; //$NON-NLS-1$ >+ return ControlMessages.DateTimeControl_NoDateSetClickToSetDate; > } > > /* >@@ -115,7 +114,7 @@ public class DateTimeControl extends SingleControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset Date"; >+ return ControlMessages.DateTimeControl_UnsetDate; > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/EEnumControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/EEnumControl.java >index c07fee2..01b3989 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/EEnumControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/EEnumControl.java >@@ -67,7 +67,7 @@ public class EEnumControl extends SingleControl { > > }); > combo.setInput(getStructuralFeature().getEType().getInstanceClass().getEnumConstants()); >- combo.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_enum"); >+ combo.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_enum"); //$NON-NLS-1$ > } > > /** >@@ -89,8 +89,7 @@ public class EEnumControl extends SingleControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No value set! Click to set value."; //$NON-NLS-1$ >+ return ControlMessages.EEnumControl_NoValueSetClickToSetValue; > } > > /* >@@ -99,7 +98,7 @@ public class EEnumControl extends SingleControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset value"; >+ return ControlMessages.EEnumControl_UnsetValue; > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/LinkControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/LinkControl.java >index c23dfd0..56b6752 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/LinkControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/LinkControl.java >@@ -112,8 +112,7 @@ public class LinkControl extends SingleControl { > mainComposite.setLayout(stackLayout); > > unsetLabel = new Label(mainComposite, SWT.NONE); >- // TODO language >- unsetLabel.setText("(Not Set)");//$NON-NLS-1$ >+ unsetLabel.setText(ControlMessages.LinkControl_NotSet); > unsetLabel.setBackground(composite.getBackground()); > unsetLabel.setForeground(composite.getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); > unsetLabel.setAlignment(SWT.CENTER); >@@ -161,7 +160,7 @@ public class LinkControl extends SingleControl { > imageHyperlink.setBackground(linkComposite.getBackground()); > > hyperlink = new Link(linkComposite, SWT.NONE); >- hyperlink.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_reference"); >+ hyperlink.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_reference"); //$NON-NLS-1$ > hyperlink.setBackground(linkComposite.getBackground()); > hyperlink.addSelectionListener(new SelectionAdapter() { > >@@ -219,7 +218,7 @@ public class LinkControl extends SingleControl { > @Override > public Object convert(Object value) { > updateChangeListener((EObject) value); >- return "<a>" + getLinkText(value) + "</a>"; >+ return "<a>" + getLinkText(value) + "</a>"; //$NON-NLS-1$ //$NON-NLS-2$ > } > }); > IObservableValue tooltipValue = SWTObservables.observeTooltipText(hyperlink); >@@ -259,7 +258,7 @@ public class LinkControl extends SingleControl { > > protected Object getLinkText(Object value) { > String linkName = adapterFactoryItemDelegator.getText(value); >- return linkName == null ? "" : linkName; >+ return linkName == null ? "" : linkName; //$NON-NLS-1$ > } > > private void updateChangeListener(final EObject value) { >@@ -321,8 +320,7 @@ public class LinkControl extends SingleControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No link set! Click to set link."; //$NON-NLS-1$ >+ return ControlMessages.LinkControl_NoLinkSetClickToSetLink; > } > > /* >@@ -331,7 +329,7 @@ public class LinkControl extends SingleControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset Link"; >+ return ControlMessages.LinkControl_UnsetLink; > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java >index cd2cb23..e6f3532 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/MultiControl.java >@@ -350,7 +350,7 @@ public abstract class MultiControl extends SWTControl { > */ > private void createDeleteButton(Composite composite) { > Button delB = new Button(composite, SWT.PUSH); >- delB.setImage(Activator.getImage("icons/delete.png")); >+ delB.setImage(Activator.getImage("icons/delete.png")); //$NON-NLS-1$ > delB.addSelectionListener(new SelectionAdapter() { > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalControl.java >index 7d75338..bd99fe6 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalControl.java >@@ -68,7 +68,7 @@ public class NumericalControl extends AbstractTextControl { > */ > @Override > protected String getTextVariantID() { >- return "org_eclipse_emf_ecp_control_numerical"; >+ return "org_eclipse_emf_ecp_control_numerical"; //$NON-NLS-1$ > } > > /* >@@ -77,8 +77,7 @@ public class NumericalControl extends AbstractTextControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No number set! Click to set number."; //$NON-NLS-1$ >+ return ControlMessages.NumericalControl_NoNumberClickToSetNumber; > } > > /* >@@ -87,7 +86,7 @@ public class NumericalControl extends AbstractTextControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset number"; >+ return ControlMessages.NumericalControl_UnsetNumber; > } > > @Override >@@ -138,12 +137,12 @@ public class NumericalControl extends AbstractTextControl { > private String getFormatText() { > > if (NumericalHelper.isInteger(getInstanceClass())) { >- return "The format is '#'."; >+ return ControlMessages.NumericalControl_FormatNumerical; > } else if (NumericalHelper.isDouble(getInstanceClass())) { >- return "The format is '#.#'."; >+ return ControlMessages.NumericalControl_FormatNumericalDecimal; > } > >- return ""; >+ return ""; //$NON-NLS-1$ > } > > // TODO: Remarks EM: >@@ -187,16 +186,16 @@ public class NumericalControl extends AbstractTextControl { > if (NumericalHelper.isInteger(getInstanceClass())) { > boolean maxValue = false; > Class<?> instanceClass = getInstanceClass(); >- String formatedValue = ""; >+ String formatedValue = ""; //$NON-NLS-1$ > try { > if (Integer.class.isAssignableFrom(instanceClass) >- || Integer.class.getField("TYPE").get(null).equals(instanceClass)) { >+ || Integer.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > if (Integer.MAX_VALUE == number.intValue()) { > maxValue = true; > formatedValue = format.format(Integer.MAX_VALUE); > } > } else if (Long.class.isAssignableFrom(instanceClass) >- || Long.class.getField("TYPE").get(null).equals(instanceClass)) { >+ || Long.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > if (Long.MAX_VALUE == number.longValue()) { > maxValue = true; > formatedValue = format.format(Long.MAX_VALUE); >@@ -218,13 +217,13 @@ public class NumericalControl extends AbstractTextControl { > } > } > } >- String formatedNumber = ""; >+ String formatedNumber = ""; //$NON-NLS-1$ > if (number != null) { > formatedNumber = format.format(number); > } >- // if (number.toString().contains("E") >- // || ((String) value).matches("0*" + formatedNumber + "\\" >- // + format.getDecimalFormatSymbols().getDecimalSeparator() + "?0*")) { >+ // if (number.toString().contains("E") //$NON-NLS-1$ >+ // || ((String) value).matches("0*" + formatedNumber + "\\" //$NON-NLS-1$ //$NON-NLS-2$ >+ // + format.getDecimalFormatSymbols().getDecimalSeparator() + "?0*")) { //$NON-NLS-1$ > // > // } > // return revertToOldValue(value); >@@ -240,14 +239,15 @@ public class NumericalControl extends AbstractTextControl { > > private Object revertToOldValue(final Object value) { > >- if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { >+ if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { //$NON-NLS-1$ > return null; > } > > Object result = getModelValue().getValue(); > >- MessageDialog messageDialog = new MessageDialog(getText().getShell(), "Invalid Number", null, >- "The Number you have entered is invalid. The value will be unset.", MessageDialog.ERROR, >+ MessageDialog messageDialog = new MessageDialog(getText().getShell(), >+ ControlMessages.NumericalControl_InvalidNumber, null, >+ ControlMessages.NumericalControl_InvalidNumberWillBeUnset, MessageDialog.ERROR, > new String[] { JFaceResources.getString(IDialogLabelKeys.OK_LABEL_KEY) }, 0); > > new ECPDialogExecutor(messageDialog) { >@@ -258,7 +258,7 @@ public class NumericalControl extends AbstractTextControl { > }.execute(); > > if (result == null) { >- getText().setText(""); >+ getText().setText(""); //$NON-NLS-1$ > } else { > getText().setText(format.format(result)); > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalHelper.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalHelper.java >index 0e20dff..08521e6 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalHelper.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/NumericalHelper.java >@@ -32,10 +32,10 @@ public class NumericalHelper { > format.setGroupingUsed(false); > > // EAnnotation annotation = getStructuralFeature().getEType().getEAnnotation( >- // "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"); >- // String stringTotalDigits = annotation.getDetails().get("totalDigits"); >+ // "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"); //$NON-NLS-1$ >+ // String stringTotalDigits = annotation.getDetails().get("totalDigits"); //$NON-NLS-1$ > // if (stringTotalDigits != null) { >- // String stringFractionDigits = annotation.getDetails().get("fractionDigits"); >+ // String stringFractionDigits = annotation.getDetails().get("fractionDigits"); //$NON-NLS-1$ > // int fractionalDigits = 0; > // if (stringFractionDigits != null) { > // fractionalDigits = Integer.valueOf(stringFractionDigits); >@@ -57,10 +57,10 @@ public class NumericalHelper { > public static Number getDefaultValue(Class<?> instanceClass) { > if (instanceClass.isPrimitive()) { > try { >- if (Double.class.getField("TYPE").get(null).equals(instanceClass) >- || Float.class.getField("TYPE").get(null).equals(instanceClass) >- || Integer.class.getField("TYPE").get(null).equals(instanceClass) >- || Long.class.getField("TYPE").get(null).equals(instanceClass)) { >+ if (Double.class.getField("TYPE").get(null).equals(instanceClass) //$NON-NLS-1$ >+ || Float.class.getField("TYPE").get(null).equals(instanceClass) //$NON-NLS-1$ >+ || Integer.class.getField("TYPE").get(null).equals(instanceClass) //$NON-NLS-1$ >+ || Long.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > return 0; > } > } catch (IllegalArgumentException ex) { >@@ -91,8 +91,8 @@ public class NumericalHelper { > public static boolean isDouble(Class<?> instanceClass) { > if (instanceClass.isPrimitive()) { > try { >- return Double.class.getField("TYPE").get(null).equals(instanceClass) >- || Float.class.getField("TYPE").get(null).equals(instanceClass); >+ return Double.class.getField("TYPE").get(null).equals(instanceClass) //$NON-NLS-1$ >+ || Float.class.getField("TYPE").get(null).equals(instanceClass); //$NON-NLS-1$ > } catch (IllegalArgumentException ex) { > Activator.logException(ex); > } catch (SecurityException ex) { >@@ -116,8 +116,8 @@ public class NumericalHelper { > public static boolean isInteger(Class<?> instanceClass) { > if (instanceClass.isPrimitive()) { > try { >- return Integer.class.getField("TYPE").get(null).equals(instanceClass) >- || Long.class.getField("TYPE").get(null).equals(instanceClass); >+ return Integer.class.getField("TYPE").get(null).equals(instanceClass) //$NON-NLS-1$ >+ || Long.class.getField("TYPE").get(null).equals(instanceClass); //$NON-NLS-1$ > } catch (IllegalArgumentException ex) { > Activator.logException(ex); > } catch (SecurityException ex) { >@@ -145,13 +145,13 @@ public class NumericalHelper { > public static Object numberToInstanceClass(Number number, Class<?> instanceClass) { > if (instanceClass.isPrimitive()) { > try { >- if (Double.class.getField("TYPE").get(null).equals(instanceClass)) { >+ if (Double.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > return number.doubleValue(); >- } else if (Integer.class.getField("TYPE").get(null).equals(instanceClass)) { >+ } else if (Integer.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > return number.intValue(); >- } else if (Long.class.getField("TYPE").get(null).equals(instanceClass)) { >+ } else if (Long.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > return number.longValue(); >- } else if (Float.class.getField("TYPE").get(null).equals(instanceClass)) { >+ } else if (Float.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > return number.floatValue(); > } > } catch (IllegalArgumentException ex) { >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ReferenceMultiControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ReferenceMultiControl.java >index d52644d..e61851d 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ReferenceMultiControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/ReferenceMultiControl.java >@@ -64,7 +64,7 @@ public class ReferenceMultiControl extends MultiControl { > */ > @Override > protected String getUnsetLabelText() { >- return "Not set. Click to set!"; >+ return ControlMessages.ReferenceMultiControl_NotSetClickToSet; > } > > /* >@@ -73,6 +73,6 @@ public class ReferenceMultiControl extends MultiControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset"; >+ return ControlMessages.ReferenceMultiControl_Unset; > } > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java >index 35b4309..c49ec3d 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/SingleControl.java >@@ -85,7 +85,7 @@ public abstract class SingleControl extends SWTControl { > return; > } > validationLabel.setImage(null); >- validationLabel.setToolTipText(""); >+ validationLabel.setToolTipText(""); //$NON-NLS-1$ > updateValidationColor(null); > } > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/StringControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/StringControl.java >index 86b5ed4..f645476 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/StringControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/StringControl.java >@@ -72,7 +72,7 @@ public class StringControl extends AbstractTextControl { > */ > @Override > protected String getTextVariantID() { >- return "org_eclipse_emf_ecp_control_string"; >+ return "org_eclipse_emf_ecp_control_string"; //$NON-NLS-1$ > } > > /* >@@ -81,8 +81,7 @@ public class StringControl extends AbstractTextControl { > */ > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No text set! Click to set text."; //$NON-NLS-1$ >+ return ControlMessages.StringControl_NoTextSetClickToSetText; > } > > /* >@@ -91,7 +90,7 @@ public class StringControl extends AbstractTextControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset text"; >+ return ControlMessages.StringControl_UnsetText; > } > > @Override >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/TableControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/TableControl.java >index 6aa54c5..0f1a345 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/TableControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/TableControl.java >@@ -208,7 +208,7 @@ public class TableControl extends SWTControl { > tableViewer = new TableViewer(composite, SWT.MULTI | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); > // GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).hint(SWT.DEFAULT, SWT.DEFAULT) > // .applyTo(tableViewer.getTable()); >- tableViewer.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_table"); >+ tableViewer.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_table"); //$NON-NLS-1$ > tableViewer.getTable().setHeaderVisible(true); > tableViewer.getTable().setLinesVisible(true); > >@@ -260,9 +260,9 @@ public class TableControl extends SWTControl { > final TableViewerColumn column = new TableViewerColumn(tableViewer, cellEditor.getStyle()); > > if (ECPCellEditor.class.isInstance(cellEditor)) { >- column.getColumn().setData("width", ((ECPCellEditor) cellEditor).getColumnWidthWeight()); >+ column.getColumn().setData("width", ((ECPCellEditor) cellEditor).getColumnWidthWeight()); //$NON-NLS-1$ > } else { >- column.getColumn().setData("width", 100); >+ column.getColumn().setData("width", 100); //$NON-NLS-1$ > } > > // determine the attribute that should be observed >@@ -281,12 +281,12 @@ public class TableControl extends SWTControl { > if (ECPCellEditor.class.isInstance(cellEditor)) { > ECPCellEditor ecpCellEditor = (ECPCellEditor) cellEditor; > String text = ecpCellEditor.getFormatedString(value); >- cell.setText(text == null ? "" : text); >+ cell.setText(text == null ? "" : text); //$NON-NLS-1$ > > } else { > > cell.setText(value == null ? "" : value.toString()); //$NON-NLS-1$ >- cell.getControl().setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_string"); >+ cell.getControl().setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_string"); //$NON-NLS-1$ > } > > // if (featureErrorMap.containsKey(element) >@@ -469,7 +469,7 @@ public class TableControl extends SWTControl { > TableColumnLayout layout = new TableColumnLayout(); > composite.setLayout(layout); > for (int i = 0; i < tableViewer.getTable().getColumns().length; i++) { >- Integer storedValue = (Integer) tableViewer.getTable().getColumns()[i].getData("width"); >+ Integer storedValue = (Integer) tableViewer.getTable().getColumns()[i].getData("width"); //$NON-NLS-1$ > layout.setColumnData(tableViewer.getTable().getColumns()[i], new ColumnWeightData(storedValue == null ? 50 > : storedValue)); > } >@@ -501,7 +501,7 @@ public class TableControl extends SWTControl { > removeButton = new Button(buttonComposite, SWT.None); > Image image = Activator.getImage("icons/delete.png"); //$NON-NLS-1$ > removeButton.setImage(image); >- removeButton.setToolTipText("Remove the selected " + clazz.getInstanceClass().getSimpleName()); >+ removeButton.setToolTipText(ControlMessages.TableControl_RemoveSelected + clazz.getInstanceClass().getSimpleName()); > removeButton.addSelectionListener(new SelectionAdapter() { > /* > * (non-Javadoc) >@@ -522,8 +522,8 @@ public class TableControl extends SWTControl { > deletionList.add((EObject) iterator.next()); > } > >- MessageDialog dialog = new MessageDialog(tableViewer.getTable().getShell(), "Delete?", null, >- "Are you sure you want to delete the selected Elements?", MessageDialog.CONFIRM, new String[] { >+ MessageDialog dialog = new MessageDialog(tableViewer.getTable().getShell(), ControlMessages.TableControl_Delete, null, >+ ControlMessages.TableControl_DeleteAreYouSure, MessageDialog.CONFIRM, new String[] { > JFaceResources.getString(IDialogLabelKeys.YES_LABEL_KEY), > JFaceResources.getString(IDialogLabelKeys.NO_LABEL_KEY) }, 0); > >@@ -565,7 +565,7 @@ public class TableControl extends SWTControl { > addButton = new Button(buttonComposite, SWT.None); > Image image = Activator.getImage("icons/add.png"); //$NON-NLS-1$ > addButton.setImage(image); >- addButton.setToolTipText("Add an instance of " + clazz.getInstanceClass().getSimpleName()); >+ addButton.setToolTipText(ControlMessages.TableControl_AddInstanceOf + clazz.getInstanceClass().getSimpleName()); > addButton.addSelectionListener(new SelectionAdapter() { > /* > * (non-Javadoc) >@@ -721,7 +721,7 @@ public class TableControl extends SWTControl { > */ > @Override > protected String getUnsetLabelText() { >- return "Not set. Click to set!"; >+ return ControlMessages.TableControl_NotSetClickToSet; > } > > /* >@@ -730,7 +730,7 @@ public class TableControl extends SWTControl { > */ > @Override > protected String getUnsetButtonTooltip() { >- return "Unset"; >+ return ControlMessages.TableControl_Unset; > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/XmlDateControlText.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/XmlDateControlText.java >index 508494c..6d22336 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/XmlDateControlText.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/XmlDateControlText.java >@@ -72,18 +72,17 @@ public class XmlDateControlText extends AbstractTextControl { > > @Override > protected String getTextVariantID() { >- return "org_eclipse_emf_ecp_control_xmldate"; >+ return "org_eclipse_emf_ecp_control_xmldate"; //$NON-NLS-1$ > } > > @Override > protected String getUnsetLabelText() { >- // TODO language >- return "No date set! Click to set date."; //$NON-NLS-1$ >+ return ControlMessages.XmlDateControlText_NoDateSetClickToSetDate; > } > > @Override > protected String getUnsetButtonTooltip() { >- return "Unset date"; >+ return ControlMessages.XmlDateControlText_UnsetDate; > } > > @Override >@@ -97,7 +96,7 @@ public class XmlDateControlText extends AbstractTextControl { > super.fillControlComposite(composite); > ((GridLayout) composite.getLayout()).numColumns = 2; > final Button button = new Button(composite, SWT.PUSH); >- button.setText("Datum wählen"); >+ button.setText(ControlMessages.XmlDateControlText_SelectDate); > button.addSelectionListener(new SelectionAdapter() { > > @Override >@@ -221,14 +220,15 @@ public class XmlDateControlText extends AbstractTextControl { > > private Object revertToOldValue(final Object value) { > >- if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { >+ if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { //$NON-NLS-1$ > return null; > } > > Object result = getModelValue().getValue(); > >- MessageDialog messageDialog = new MessageDialog(getText().getShell(), "Invalid Number", null, >- "The Number you have entered is invalid. The value will be unset.", MessageDialog.ERROR, >+ MessageDialog messageDialog = new MessageDialog(getText().getShell(), >+ ControlMessages.XmlDateControlText_InvalidNumber, null, >+ ControlMessages.XmlDateControlText_NumberInvalidValueWillBeUnset, MessageDialog.ERROR, > new String[] { JFaceResources.getString(IDialogLabelKeys.OK_LABEL_KEY) }, 0); > > new ECPDialogExecutor(messageDialog) { >@@ -239,7 +239,7 @@ public class XmlDateControlText extends AbstractTextControl { > }.execute(); > > if (result == null) { >- getText().setText(""); >+ getText().setText(""); //$NON-NLS-1$ > } else { > XMLGregorianCalendar gregorianCalendar = (XMLGregorianCalendar) result; > Date date = gregorianCalendar.toGregorianCalendar().getTime(); >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/messages.properties b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/messages.properties >new file mode 100644 >index 0000000..af488a9 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/controls/messages.properties >@@ -0,0 +1,56 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+AbstractTextControl_InvalidInput=Invalid input >+AbstractTextControl_InvalidInputSpace=Invalid input >+AbstractTextControl_Unset=<unset> >+ >+AttributeMultiControl_NotSetClickToSet=Not set. Click to set\! >+AttributeMultiControl_Unset=Unset >+ >+BooleanControl_NoBooleanSetClickToSetBoolean=No boolean set\! Click to set boolean. >+BooleanControl_UnsetBoolean=Unset boolean >+ >+DateTimeControl_NoDateSetClickToSetDate=No date set\! Click to set date. >+DateTimeControl_UnsetDate=Unset Date >+ >+EEnumControl_NoValueSetClickToSetValue=No value set\! Click to set value. >+EEnumControl_UnsetValue=Unset value >+ >+LinkControl_NoLinkSetClickToSetLink=No link set\! Click to set link. >+LinkControl_NotSet=(Not Set) >+LinkControl_UnsetLink=Unset Link >+ >+NumericalControl_FormatNumerical=The format is '\#'. >+NumericalControl_FormatNumericalDecimal=The format is '\#.\#'. >+NumericalControl_InvalidNumber=Invalid Number >+NumericalControl_InvalidNumberWillBeUnset=The Number you have entered is invalid. The value will be unset. >+NumericalControl_NoNumberClickToSetNumber=No number set\! Click to set number. >+NumericalControl_UnsetNumber=Unset number >+ >+ReferenceMultiControl_NotSetClickToSet=Not set. Click to set\! >+ReferenceMultiControl_Unset=Unset >+ >+StringControl_NoTextSetClickToSetText=No text set\! Click to set text. >+StringControl_UnsetText=Unset text >+ >+TableControl_AddInstanceOf=Add an instance of >+TableControl_Delete=Delete? >+TableControl_DeleteAreYouSure=Are you sure you want to delete the selected Elements? >+TableControl_NotSetClickToSet=Not set. Click to set\! >+TableControl_RemoveSelected=Remove the selected >+TableControl_Unset=Unset >+ >+XmlDateControlText_InvalidNumber=Invalid Number >+XmlDateControlText_NoDateSetClickToSetDate=No date set\! Click to set date. >+XmlDateControlText_NumberInvalidValueWillBeUnset=The Number you have entered is invalid. The value will be unset. >+XmlDateControlText_SelectDate=Select Date >+XmlDateControlText_UnsetDate=Unset date >\ No newline at end of file >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/DateCellEditor.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/DateCellEditor.java >index 24b94d5..0b22b8f 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/DateCellEditor.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/DateCellEditor.java >@@ -93,9 +93,9 @@ public class DateCellEditor extends CellEditor implements ECPCellEditor { > protected Control createControl(Composite parent) { > // Composite composite = new Composite(parent, SWT.NONE); > dateWidget = new DateTime(parent, SWT.DATE); >- dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_date"); >+ dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_date"); //$NON-NLS-1$ > // timeWidget = new DateTime(composite, SWT.TIME); >- // timeWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_swt_cellEditor_time"); >+ // timeWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_swt_cellEditor_time"); //$NON-NLS-1$ > > dateWidget.addKeyListener(new KeyAdapter() { > // hook key pressed - see PR 14201 >@@ -205,7 +205,7 @@ public class DateCellEditor extends CellEditor implements ECPCellEditor { > public String getFormatedString(Object value) { > Date cal = (Date) value; > if (value == null) { >- return ""; >+ return ""; //$NON-NLS-1$ > } > return dateFormat.format(cal); > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/LinkCellEditor.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/LinkCellEditor.java >index 0aa258f..be478cb 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/LinkCellEditor.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/LinkCellEditor.java >@@ -94,7 +94,7 @@ public class LinkCellEditor extends CellEditor implements ECPCellEditor { > > adapterFactoryItemDelegator = new AdapterFactoryItemDelegator(composedAdapterFactory); > link = new Link(parent, SWT.NONE); >- link.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_reference"); >+ link.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_reference"); //$NON-NLS-1$ > link.addSelectionListener(new SelectionAdapter() { > > @Override >@@ -134,7 +134,7 @@ public class LinkCellEditor extends CellEditor implements ECPCellEditor { > @Override > protected void doSetValue(Object value) { > String linkName = adapterFactoryItemDelegator.getText(value); >- link.setText("<a>" + linkName + "</a>"); >+ link.setText("<a>" + linkName + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$ > } > > /* >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/NumberCellEditor.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/NumberCellEditor.java >index d19e610..783b2bf 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/NumberCellEditor.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/NumberCellEditor.java >@@ -56,7 +56,7 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > public void instantiate(IItemPropertyDescriptor descriptor, ECPControlContext ecpControlContext) { > this.descriptor = descriptor; > this.ecpControlContext = ecpControlContext; >- getControl().setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_numberical"); >+ getControl().setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_numberical"); //$NON-NLS-1$ > // do nothing > } > >@@ -66,8 +66,8 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > */ > public String getFormatedString(Object value) { > if (value == null) { >- setErrorMessage("Value is null"); >- return ""; >+ setErrorMessage(TableMessages.NumberCellEditor_ValueIsNull); >+ return ""; //$NON-NLS-1$ > } > > DecimalFormat format = NumericalHelper.setupFormat(ecpControlContext.getLocale(), getInstanceClass()); >@@ -112,16 +112,16 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > if (NumericalHelper.isInteger(getInstanceClass())) { > boolean maxValue = false; > Class<?> instanceClass = getInstanceClass(); >- String formatedValue = ""; >+ String formatedValue = ""; //$NON-NLS-1$ > try { > if (Integer.class.isAssignableFrom(instanceClass) >- || Integer.class.getField("TYPE").get(null).equals(instanceClass)) { >+ || Integer.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > if (Integer.MAX_VALUE == number.intValue()) { > maxValue = true; > formatedValue = format.format(Integer.MAX_VALUE); > } > } else if (Long.class.isAssignableFrom(instanceClass) >- || Long.class.getField("TYPE").get(null).equals(instanceClass)) { >+ || Long.class.getField("TYPE").get(null).equals(instanceClass)) { //$NON-NLS-1$ > if (Long.MAX_VALUE == number.longValue()) { > maxValue = true; > formatedValue = format.format(Long.MAX_VALUE); >@@ -143,7 +143,7 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > } > } > } >- String formatedNumber = ""; >+ String formatedNumber = ""; //$NON-NLS-1$ > if (number != null) { > formatedNumber = format.format(number); > } >@@ -165,15 +165,15 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > > private Object revertToOldValue(final Object value) { > >- if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { >+ if (getStructuralFeature().getDefaultValue() == null && (value == null || value.equals(""))) { //$NON-NLS-1$ > return null; > } > > // Object result = getModelValue().getValue(); > Object result = null; > >- MessageDialog messageDialog = new MessageDialog(getText().getShell(), "Invalid Number", null, >- "The Number you have entered is invalid. The value will be unset.", MessageDialog.ERROR, >+ MessageDialog messageDialog = new MessageDialog(getText().getShell(), TableMessages.NumberCellEditor_InvalidNumber, null, >+ TableMessages.NumberCellEditor_NumberYouEnteredIsInvalid, MessageDialog.ERROR, > new String[] { JFaceResources.getString(IDialogLabelKeys.OK_LABEL_KEY) }, 0); > > new ECPDialogExecutor(messageDialog) { >@@ -184,7 +184,7 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > }.execute(); > > if (result == null) { >- getText().setText(""); >+ getText().setText(""); //$NON-NLS-1$ > } else { > DecimalFormat format = format = NumericalHelper.setupFormat(ecpControlContext.getLocale(), > getInstanceClass()); >@@ -209,7 +209,7 @@ public class NumberCellEditor extends TextCellEditor implements ECPCellEditor { > @Override > public Object convert(Object value) { > if (value == null) { >- return ""; >+ return ""; //$NON-NLS-1$ > } > final DecimalFormat format = NumericalHelper.setupFormat(ecpControlContext.getLocale(), > getInstanceClass()); >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/TableMessages.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/TableMessages.java >new file mode 100644 >index 0000000..9c00e43 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/TableMessages.java >@@ -0,0 +1,32 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 EclipseSource. >+ * >+ * 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: >+ * EclipseSource - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.emf.ecp.edit.internal.swt.table; >+ >+import org.eclipse.osgi.util.NLS; >+ >+public class TableMessages extends NLS { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.edit.internal.swt.table.messages"; //$NON-NLS-1$ >+ >+ public static String NumberCellEditor_InvalidNumber; >+ public static String NumberCellEditor_NumberYouEnteredIsInvalid; >+ public static String NumberCellEditor_ValueIsNull; >+ >+ private TableMessages() { >+ } >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, TableMessages.class); >+ } >+ >+} >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/XmlDateCellEditor.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/XmlDateCellEditor.java >index 92f12ee..ab31156 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/XmlDateCellEditor.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/XmlDateCellEditor.java >@@ -93,7 +93,7 @@ public class XmlDateCellEditor extends CellEditor implements ECPCellEditor { > @Override > protected Control createControl(Composite parent) { > dateWidget = new DateTime(parent, SWT.DATE | SWT.DROP_DOWN); >- dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_xmlDate"); >+ dateWidget.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_edit_cellEditor_xmlDate"); //$NON-NLS-1$ > dateWidget.addKeyListener(new KeyAdapter() { > // hook key pressed - see PR 14201 > @Override >@@ -198,7 +198,7 @@ public class XmlDateCellEditor extends CellEditor implements ECPCellEditor { > public String getFormatedString(Object value) { > XMLGregorianCalendar cal = (XMLGregorianCalendar) value; > if (value == null) { >- return ""; >+ return ""; //$NON-NLS-1$ > } > return dateFormat.format(cal.toGregorianCalendar().getTime()); > } >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/messages.properties b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/messages.properties >new file mode 100644 >index 0000000..96b5266 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/table/messages.properties >@@ -0,0 +1,16 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+NumberCellEditor_InvalidNumber=Invalid Number >+ >+NumberCellEditor_NumberYouEnteredIsInvalid=The Number you have entered is invalid. The value will be unset. >+ >+NumberCellEditor_ValueIsNull=Value is null >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/CellEditorFactory.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/CellEditorFactory.java >index d5db138..0a6835f 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/CellEditorFactory.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/CellEditorFactory.java >@@ -69,9 +69,8 @@ public final class CellEditorFactory { > private static <T> Class<T> loadClass(String bundleName, String clazz) throws ClassNotFoundException { > Bundle bundle = Platform.getBundle(bundleName); > if (bundle == null) { >- // TODO externalize strings >- throw new ClassNotFoundException(clazz + " cannot be loaded because bundle " + bundleName //$NON-NLS-1$ >- + " cannot be resolved"); //$NON-NLS-1$ >+ throw new ClassNotFoundException(clazz + UtilMessages.CellEditorFactory_CannotBeLoadedBecauseBundle + bundleName >+ + UtilMessages.CellEditorFactory_CannotBeResolved); > } > return (Class<T>) bundle.loadClass(clazz); > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/DialogOpener.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/DialogOpener.java >index 13d1649..c503164 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/DialogOpener.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/DialogOpener.java >@@ -28,10 +28,10 @@ public class DialogOpener { > public static void openDialog(Dialog dialog, ECPDialogExecutor callBack) { > DialogWrapper wrapper = null; > IConfigurationElement[] controls = Platform.getExtensionRegistry().getConfigurationElementsFor( >- "org.eclipse.emf.ecp.edit.swt.dialogWrapper"); >+ "org.eclipse.emf.ecp.edit.swt.dialogWrapper"); //$NON-NLS-1$ > for (IConfigurationElement e : controls) { > try { >- wrapper = (DialogWrapper) e.createExecutableExtension("class"); >+ wrapper = (DialogWrapper) e.createExecutableExtension("class"); //$NON-NLS-1$ > break; > } catch (CoreException e1) { > Activator.logException(e1); >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/ECPCellEditor.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/ECPCellEditor.java >index fd5960f..e5894e2 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/ECPCellEditor.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/ECPCellEditor.java >@@ -28,7 +28,7 @@ public interface ECPCellEditor { > /** > * RAP theming variable. > */ >- String CUSTOM_VARIANT = "org.eclipse.rap.rwt.customVariant"; >+ String CUSTOM_VARIANT = "org.eclipse.rap.rwt.customVariant"; //$NON-NLS-1$ > > IValueProperty getValueProperty(); > >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/SWTControl.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/SWTControl.java >index 4d96ac2..94ddf12 100644 >--- a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/SWTControl.java >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/SWTControl.java >@@ -51,7 +51,7 @@ public abstract class SWTControl extends ECPAbstractControl { > /** > * RAP theming variable to set. > */ >- protected static final String CUSTOM_VARIANT = "org.eclipse.rap.rwt.customVariant"; >+ protected static final String CUSTOM_VARIANT = "org.eclipse.rap.rwt.customVariant";//$NON-NLS-1$ > > protected static final String VALIDATION_ERROR_ICON = "icons/validation_error.png";//$NON-NLS-1$ > >@@ -123,13 +123,13 @@ public abstract class SWTControl extends ECPAbstractControl { > if (getModelElementContext().isRunningAsWebApplication() && getHelpText() != null > && getHelpText().length() != 0) { > Label l = new Label(composite, SWT.PUSH); >- l.setImage(Activator.getImage("icons/help.png")); >- l.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_help"); >+ l.setImage(Activator.getImage("icons/help.png")); //$NON-NLS-1$ >+ l.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_help"); //$NON-NLS-1$ > l.setBackground(parent.getBackground()); > l.addMouseListener(new MouseListener() { > > public void mouseUp(MouseEvent e) { >- MessageDialog dialog = new MessageDialog(parent.getShell(), "Help", null, getHelpText(), >+ MessageDialog dialog = new MessageDialog(parent.getShell(), UtilMessages.SWTControl_Help, null, getHelpText(), > MessageDialog.INFORMATION, new String[] { JFaceResources > .getString(IDialogLabelKeys.OK_LABEL_KEY) }, 0); > new ECPDialogExecutor(dialog) { >@@ -255,7 +255,7 @@ public abstract class SWTControl extends ECPAbstractControl { > showUnsetLabel(); > } > }); >- unsetButton.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_unset"); >+ unsetButton.setData(CUSTOM_VARIANT, "org_eclipse_emf_ecp_control_unset"); //$NON-NLS-1$ > } > > if (!getStructuralFeature().isUnsettable() >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/UtilMessages.java b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/UtilMessages.java >new file mode 100644 >index 0000000..62d3549 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/UtilMessages.java >@@ -0,0 +1,33 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 EclipseSource. >+ * >+ * 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: >+ * EclipseSource - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.emf.ecp.edit.internal.swt.util; >+ >+import org.eclipse.osgi.util.NLS; >+ >+public class UtilMessages extends NLS { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.edit.internal.swt.util.messages"; //$NON-NLS-1$ >+ >+ public static String CellEditorFactory_CannotBeLoadedBecauseBundle; >+ public static String CellEditorFactory_CannotBeResolved; >+ >+ public static String SWTControl_Help; >+ >+ private UtilMessages() { >+ } >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, UtilMessages.class); >+ } >+ >+} >diff --git a/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/messages.properties b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/messages.properties >new file mode 100644 >index 0000000..e069a5a >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit.swt/src/org/eclipse/emf/ecp/edit/internal/swt/util/messages.properties >@@ -0,0 +1,15 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+CellEditorFactory_CannotBeLoadedBecauseBundle=\ cannot be loaded because bundle >+CellEditorFactory_CannotBeResolved=\ cannot be resolved >+ >+SWTControl_Help=Help >diff --git a/bundles/org.eclipse.emf.ecp.edit/META-INF/MANIFEST.MF b/bundles/org.eclipse.emf.ecp.edit/META-INF/MANIFEST.MF >index d0ba25b..bc49c0a 100644 >--- a/bundles/org.eclipse.emf.ecp.edit/META-INF/MANIFEST.MF >+++ b/bundles/org.eclipse.emf.ecp.edit/META-INF/MANIFEST.MF >@@ -1,6 +1,6 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 >-Bundle-Name: ECP Edit >+Bundle-Name: %Bundle-Name > Bundle-SymbolicName: org.eclipse.emf.ecp.edit;singleton:=true > Bundle-Version: 1.0.1.qualifier > Bundle-Activator: org.eclipse.emf.ecp.internal.edit.Activator >@@ -15,4 +15,4 @@ Export-Package: org.eclipse.emf.ecp.edit;version="1.0.0", > org.eclipse.emf.ecp.edit.util;version="1.0.0", > org.eclipse.emf.ecp.internal.edit;version="1.0.0";x-internal:=true > Service-Component: OSGI-INF/ecpControlFactory.xml >-Bundle-Vendor: Eclipse Modeling Project >+Bundle-Vendor: %Bundle-Vendor >diff --git a/bundles/org.eclipse.emf.ecp.edit/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.emf.ecp.edit/OSGI-INF/l10n/bundle.properties >new file mode 100644 >index 0000000..8bd8840 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit/OSGI-INF/l10n/bundle.properties >@@ -0,0 +1,17 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+#Properties file for org.eclipse.emf.ecp.edit >+ >+Bundle-Vendor = Eclipse Modeling Project >+Bundle-Name = ECP Edit >+ >+extension-point.controls = ECP Controls >diff --git a/bundles/org.eclipse.emf.ecp.edit/plugin.xml b/bundles/org.eclipse.emf.ecp.edit/plugin.xml >index a15ff07..3e9baa2 100644 >--- a/bundles/org.eclipse.emf.ecp.edit/plugin.xml >+++ b/bundles/org.eclipse.emf.ecp.edit/plugin.xml >@@ -1,7 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> > <?eclipse version="3.4"?> > <plugin> >-<extension-point id="controls" name="ECP Controls" schema="schema/controls.exsd"/> >+<extension-point id="controls" name="%extension-point.controls" schema="schema/controls.exsd"/> > <extension > point="org.eclipse.equinox.preferences.preferences"> > </extension> >diff --git a/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/ControlFactoryImpl.java b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/ControlFactoryImpl.java >index f523580..e4901f1 100644 >--- a/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/ControlFactoryImpl.java >+++ b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/ControlFactoryImpl.java >@@ -1,11 +1,11 @@ > /******************************************************************************* > * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH 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: > * Eugen Neufeld - initial API and implementation > ******************************************************************************/ >@@ -32,31 +32,31 @@ import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; > import org.osgi.framework.Bundle; > > /** >- * The ControlFactoryImpl is a Singelton which reads the org.eclipse.emf.ecp.editor.widgets ExtensionPoint and provides a >- * method ({@link #createControl(T, IItemPropertyDescriptor, ECPControlContext)}) for creating a suitable >+ * The ControlFactoryImpl is a Singleton which reads the org.eclipse.emf.ecp.editor.widgets ExtensionPoint and provides >+ * a method ({@link #createControl(T, IItemPropertyDescriptor, ECPControlContext)}) for creating a suitable > * control for with the known widgets. >- * >+ * > * @author Eugen Neufeld >- * >+ * > */ > public final class ControlFactoryImpl implements ECPControlFactory{ > > private static final String CONTROL_EXTENSION = "org.eclipse.emf.ecp.edit.controls"; //$NON-NLS-1$ >- >+ > private static final String CLASS_ATTRIBUTE = "class";//$NON-NLS-1$ > private static final String CONTROL_ID = "id";//$NON-NLS-1$ > private static final String LABEL_ATTRIBUTE = "showLabel";//$NON-NLS-1$ >- >+ > private static final String TEST_DYNAMIC = "dynamicTest";//$NON-NLS-1$ > private static final String CONTROL_TESTER = "testClass";//$NON-NLS-1$ >- >+ > private static final String TEST_STATIC = "staticTest";//$NON-NLS-1$ > private static final String TESTER_PRIORITY = "priority";//$NON-NLS-1$ > private static final String TESTER_CLASSTYPE = "supportedClassType";//$NON-NLS-1$ > private static final String TESTER_EOBJECT = "supportedEObject";//$NON-NLS-1$ > private static final String TESTER_FEATURE = "supportedFeature";//$NON-NLS-1$ > private static final String TESTER_SINGLEVALUE = "singleValue";//$NON-NLS-1$ >- >+ > private Set<ECPControlDescription> controlDescriptors = new HashSet<ECPControlDescription>(); > > /** >@@ -77,7 +77,7 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > String clazz = e.getAttribute(CLASS_ATTRIBUTE); > Class<? extends ECPAbstractControl> resolvedClass = loadClass(e.getContributor().getName(), clazz); > boolean showLabel = Boolean.parseBoolean(e.getAttribute(LABEL_ATTRIBUTE)); >- >+ > // ECPApplicableTester tester=null; > Set<ECPApplicableTester> tester=new HashSet<ECPApplicableTester>(); > for(IConfigurationElement testerExtension: e.getChildren()){ >@@ -87,19 +87,19 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > else if(TEST_STATIC.equals(testerExtension.getName())){ > boolean singleValue = Boolean.parseBoolean(testerExtension.getAttribute(TESTER_SINGLEVALUE)); > int priority = Integer.parseInt(testerExtension.getAttribute(TESTER_PRIORITY)); >- >+ > String type = testerExtension.getAttribute(TESTER_CLASSTYPE); > Class<?> supportedClassType = loadClass(testerExtension.getContributor().getName(), type); > //Class.forName(type); >- >+ > String eObject = testerExtension.getAttribute(TESTER_EOBJECT); > if (eObject == null) { > eObject = "org.eclipse.emf.ecore.EObject";//$NON-NLS-1$ > } > Class<? extends EObject> supportedEObject = loadClass(testerExtension.getContributor().getName(), eObject); >- >+ > String supportedFeature = testerExtension.getAttribute(TESTER_FEATURE); >- >+ > tester.add(new ECPStaticApplicableTester(singleValue, priority, supportedClassType, supportedEObject, supportedFeature)); > } > } >@@ -117,9 +117,8 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > private static <T> Class<T> loadClass(String bundleName, String clazz) throws ClassNotFoundException { > Bundle bundle = Platform.getBundle(bundleName); > if (bundle == null) { >- //TODO externalize strings >- throw new ClassNotFoundException(clazz + " cannot be loaded because bundle " + bundleName //$NON-NLS-1$ >- + " cannot be resolved"); //$NON-NLS-1$ >+ throw new ClassNotFoundException(clazz + EditMessages.ControlFactoryImpl_CannotBeLoadedBecauseBundle + bundleName >+ + EditMessages.ControlFactoryImpl_CannotBeResolved); > } > return (Class<T>) bundle.loadClass(clazz); > >@@ -137,15 +136,15 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > } > T control = getControlInstance(controlDescription,itemPropertyDescriptor,context); > >- > return control; > } >+ > /** > * {@inheritDoc} > */ > public <T extends ECPControl> T createControl(IItemPropertyDescriptor itemPropertyDescriptor, > ECPControlContext context, String controlId) { >- >+ > ECPControlDescription controlDescription = null; > for(ECPControlDescription desc:controlDescriptors){ > if(desc.getId().equals(controlId)){ >@@ -158,7 +157,7 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > } > T control = getControlInstance(controlDescription,itemPropertyDescriptor,context); > >- >+ > return control; > } > >@@ -198,20 +197,20 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > int highestPriority = -1; > ECPControlDescription bestCandidate = null; > for (ECPControlDescription description : controlDescriptors) { >- >+ > if(!controlClass.isAssignableFrom(description.getControlClass())){ > continue; > } > int currentPriority=-1; >- >+ > for(ECPApplicableTester tester:description.getTester()){ > int testerPriority=tester.isApplicable(itemPropertyDescriptor, modelElement); > if(testerPriority>currentPriority){ > currentPriority=testerPriority; > } >- >+ > } >- >+ > if(currentPriority>highestPriority){ > highestPriority=currentPriority; > bestCandidate=description; >@@ -220,7 +219,4 @@ public final class ControlFactoryImpl implements ECPControlFactory{ > return bestCandidate; > } > >- >- >- > } >diff --git a/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/EditMessages.java b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/EditMessages.java >new file mode 100644 >index 0000000..4d70071 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/EditMessages.java >@@ -0,0 +1,32 @@ >+/******************************************************************************* >+ * Copyright (c) 2013 EclipseSource. >+ * >+ * 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: >+ * EclipseSource - initial API and implementation >+ * >+ *******************************************************************************/ >+package org.eclipse.emf.ecp.internal.edit; >+ >+import org.eclipse.osgi.util.NLS; >+ >+public class EditMessages extends NLS { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.internal.edit.messages"; //$NON-NLS-1$ >+ >+ public static String ControlFactoryImpl_CannotBeLoadedBecauseBundle; >+ public static String ControlFactoryImpl_CannotBeResolved; >+ >+ private EditMessages() { >+ } >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(BUNDLE_NAME, EditMessages.class); >+ } >+ >+} >diff --git a/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/messages.properties b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/messages.properties >new file mode 100644 >index 0000000..e539584 >--- /dev/null >+++ b/bundles/org.eclipse.emf.ecp.edit/src/org/eclipse/emf/ecp/internal/edit/messages.properties >@@ -0,0 +1,13 @@ >+############################################################################### >+# Copyright (c) 2013 EclipseSource. >+# 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: >+# EclipseSource - initial API and implementation >+################################################################################ >+ >+ControlFactoryImpl_CannotBeLoadedBecauseBundle=\ cannot be loaded because bundle >+ControlFactoryImpl_CannotBeResolved=\ cannot be resolved >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
eneufeld
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 412592
:
233278
| 233666