diff options
author | jonas | 2014-09-18 09:11:38 +0000 |
---|---|---|
committer | jonas | 2014-09-18 09:11:38 +0000 |
commit | a8194a3ee734a620c738158352debe0f8f8a45d5 (patch) | |
tree | 178af235cbc9e82a5d5e4657c68e2acad2d76c72 | |
parent | 9faed05343e0d9e34e768c5eb6a8dfe0f8a81b58 (diff) | |
download | org.eclipse.e4.tools-a8194a3ee734a620c738158352debe0f8f8a45d5.tar.gz org.eclipse.e4.tools-a8194a3ee734a620c738158352debe0f8f8a45d5.tar.xz org.eclipse.e4.tools-a8194a3ee734a620c738158352debe0f8f8a45d5.zip |
Bug 444340 - Externalize Strings - Refactored Plugin ID to a constant
9 files changed, 35 insertions, 26 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/ContributionURIValidator.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/ContributionURIValidator.java index ae3d97b1..000a715d 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/ContributionURIValidator.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/ContributionURIValidator.java @@ -13,26 +13,25 @@ package org.eclipse.e4.tools.emf.ui.common; import org.eclipse.core.databinding.validation.IValidator; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.emf.common.util.URI; public class ContributionURIValidator implements IValidator { - private static final String PLUGIN_ID = "org.eclipse.e4.tools.emf.ui"; - @Override public IStatus validate(Object value) { if (value == null) { - return new Status(IStatus.ERROR, PLUGIN_ID, "The URI must not be empty!"); + return new Status(IStatus.ERROR, Plugin.ID, "The URI must not be empty!"); } else if (!value.toString().startsWith("bundleclass:")) { - return new Status(IStatus.ERROR, PLUGIN_ID, "The URI has to start with 'platform:/plugin'"); + return new Status(IStatus.ERROR, Plugin.ID, "The URI has to start with 'platform:/plugin'"); } else { try { URI uri = URI.createURI(value.toString()); if (uri.authority() == null || uri.authority().length() == 0 || uri.segmentCount() != 1) { - return new Status(IStatus.ERROR, PLUGIN_ID, "The uri has to have the format 'bundleclass://$$bundleId$$/$$className$$'"); + return new Status(IStatus.ERROR, Plugin.ID, "The uri has to have the format 'bundleclass://$$bundleId$$/$$className$$'"); } } catch (Exception e) { - return new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage()); + return new Status(IStatus.ERROR, Plugin.ID, e.getMessage()); } } diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Plugin.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Plugin.java new file mode 100644 index 00000000..42a2ee64 --- /dev/null +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/Plugin.java @@ -0,0 +1,6 @@ +package org.eclipse.e4.tools.emf.ui.internal; + +public interface Plugin { + + public static final String ID = "org.eclipse.e4.tools.emf.ui"; //$NON-NLS-1$ +} diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/PreferenceInitializer.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/PreferenceInitializer.java index e3d81434..958f7753 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/PreferenceInitializer.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/PreferenceInitializer.java @@ -16,7 +16,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { @Override public void initializeDefaultPreferences() { - IEclipsePreferences pref = InstanceScope.INSTANCE.getNode("org.eclipse.e4.tools.emf.ui"); //$NON-NLS-1$ + IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(Plugin.ID); //$NON-NLS-1$ if (pref.get("notRenderedColor", null) == null) { //$NON-NLS-1$ String val = StringConverter.asString(new RGB(200, 200, 200)); diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java index 1734293c..3e955a4e 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/ModelEditor.java @@ -63,6 +63,7 @@ import org.eclipse.e4.tools.emf.ui.common.Util; import org.eclipse.e4.tools.emf.ui.common.component.AbstractComponentEditor; import org.eclipse.e4.tools.emf.ui.internal.Messages; import org.eclipse.e4.tools.emf.ui.internal.PatternFilter; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider; import org.eclipse.e4.tools.emf.ui.internal.common.component.AddonsEditor; import org.eclipse.e4.tools.emf.ui.internal.common.component.ApplicationEditor; @@ -291,15 +292,15 @@ public class ModelEditor implements IGotoObject { private IClipboardService clipboardService; @Inject - @Preference(nodePath = "org.eclipse.e4.tools.emf.ui", value = "autoCreateElementId") + @Preference(nodePath = Plugin.ID, value = "autoCreateElementId") private boolean autoCreateElementId; @Inject - @Preference(nodePath = "org.eclipse.e4.tools.emf.ui", value = "showXMIId") + @Preference(nodePath = Plugin.ID, value = "showXMIId") private boolean showXMIId; @Inject - @Preference(nodePath = "org.eclipse.e4.tools.emf.ui") + @Preference(nodePath = Plugin.ID) IEclipsePreferences preferences; @Inject diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/KeyBindingEditor.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/KeyBindingEditor.java index 8eb61b52..f94341bb 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/KeyBindingEditor.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/KeyBindingEditor.java @@ -26,6 +26,7 @@ import org.eclipse.e4.tools.emf.ui.common.CommandToStringConverter; import org.eclipse.e4.tools.emf.ui.common.IModelResource; import org.eclipse.e4.tools.emf.ui.common.Util; import org.eclipse.e4.tools.emf.ui.common.component.AbstractComponentEditor; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider; import org.eclipse.e4.tools.emf.ui.internal.common.ComponentLabelProvider; import org.eclipse.e4.tools.emf.ui.internal.common.component.ControlFactory.TextPasteHandler; @@ -359,22 +360,22 @@ public class KeyBindingEditor extends AbstractComponentEditor { try { KeySequence keySequence = KeySequence.getInstance(value.toString()); if (!keySequence.isComplete()) { - return new Status(statusCode, "org.eclipse.e4.tools.emf.ui", Messages.KeyBindingEditor_SequenceNotComplete); //$NON-NLS-1$ + return new Status(statusCode, Plugin.ID, Messages.KeyBindingEditor_SequenceNotComplete); //$NON-NLS-1$ } if (keySequence.isEmpty()) { - return new Status(statusCode, "org.eclipse.e4.tools.emf.ui", Messages.KeyBindingEditor_SequenceEmpty); //$NON-NLS-1$ + return new Status(statusCode, Plugin.ID, Messages.KeyBindingEditor_SequenceEmpty); //$NON-NLS-1$ } if (!value.toString().toUpperCase().equals(value.toString())) { - return new Status(IStatus.ERROR, "org.eclipse.e4.tools.emf.ui", Messages.KeyBindingEditor_SequenceLowercase); //$NON-NLS-1$ + return new Status(IStatus.ERROR, Plugin.ID, Messages.KeyBindingEditor_SequenceLowercase); //$NON-NLS-1$ } return Status.OK_STATUS; } catch (Exception e) { - return new Status(statusCode, "org.eclipse.e4.tools.emf.ui", e.getMessage(), e); //$NON-NLS-1$ + return new Status(statusCode, Plugin.ID, e.getMessage(), e); //$NON-NLS-1$ } } - return new Status(statusCode, "org.eclipse.e4.tools.emf.ui", Messages.KeyBindingEditor_SequenceEmpty); //$NON-NLS-1$ + return new Status(statusCode, Plugin.ID, Messages.KeyBindingEditor_SequenceEmpty); //$NON-NLS-1$ } } diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java index 01db113d..37f9dc2e 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/dialogs/SaveDialogBoundsSettingsDialog.java @@ -12,6 +12,7 @@ package org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs; import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.jface.dialogs.DialogSettings; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.dialogs.TitleAreaDialog; @@ -21,16 +22,14 @@ import org.osgi.service.prefs.Preferences; public abstract class SaveDialogBoundsSettingsDialog extends TitleAreaDialog { - private static final String ORG_ECLIPSE_E4_TOOLS_EMF_UI = "org.eclipse.e4.tools.emf.ui"; //$NON-NLS-1$ - private static final String DIALOG_ORIGIN_X = "DIALOG_X_ORIGIN"; //$NON-NLS-1$ private static final String DIALOG_ORIGIN_Y = "DIALOG_Y_ORIGIN"; //$NON-NLS-1$ private static final String DIALOG_WIDTH = "DIALOG_WIDTH"; //$NON-NLS-1$ private static final String DIALOG_HEIGHT = "DIALOG_HEIGHT"; //$NON-NLS-1$ - private IDialogSettings dialogSettings = new DialogSettings(ORG_ECLIPSE_E4_TOOLS_EMF_UI); + private IDialogSettings dialogSettings = new DialogSettings(Plugin.ID); - private Preferences preferences = InstanceScope.INSTANCE.getNode(ORG_ECLIPSE_E4_TOOLS_EMF_UI); + private Preferences preferences = InstanceScope.INSTANCE.getNode(Plugin.ID); public SaveDialogBoundsSettingsDialog(Shell parentShell) { super(parentShell); diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/ListTab.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/ListTab.java index c779244b..f88d04f1 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/ListTab.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/tabs/ListTab.java @@ -41,6 +41,7 @@ import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.tools.emf.ui.common.IModelResource; import org.eclipse.e4.tools.emf.ui.internal.Messages; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider; import org.eclipse.e4.tools.emf.ui.internal.common.ModelEditor; import org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs.BundleImageCache; @@ -173,7 +174,7 @@ public class ListTab implements IViewEObjects { // save custom column and filter settings public void saveSettings() { - IEclipsePreferences pref = InstanceScope.INSTANCE.getNode("org.eclipse.e4.tools.emf.ui"); //$NON-NLS-1$ + IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(Plugin.ID); //$NON-NLS-1$ try { Document doc = DocUtil.createDocument("list-tab"); //$NON-NLS-1$ Element cols = DocUtil.createChild(doc.getDocumentElement(), "columns"); //$NON-NLS-1$ @@ -236,7 +237,7 @@ public class ListTab implements IViewEObjects { // load custom column and filter settings private void loadSettings() { - IEclipsePreferences pref = InstanceScope.INSTANCE.getNode("org.eclipse.e4.tools.emf.ui"); //$NON-NLS-1$ + IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(Plugin.ID); //$NON-NLS-1$ boolean restoreColumns = pref.getBoolean("list-tab-remember-columns", false); //$NON-NLS-1$ boolean restoreFilters = pref.getBoolean("list-tab-remember-filters", false); //$NON-NLS-1$ @@ -352,7 +353,7 @@ public class ListTab implements IViewEObjects { } }); try { - imgMarkedItem = imageCache.create("org.eclipse.e4.tools.emf.ui", "/icons/full/obj16/mark_occurrences.png"); //$NON-NLS-1$//$NON-NLS-2$ + imgMarkedItem = imageCache.create(Plugin.ID, "/icons/full/obj16/mark_occurrences.png"); //$NON-NLS-1$//$NON-NLS-2$ } catch (Exception e2) { e2.printStackTrace(); } @@ -741,7 +742,7 @@ public class ListTab implements IViewEObjects { Control ret = super.createContents(parent); setMessage(Messages.ListTab_selectAnAttribute); try { - setTitleImage(imageCache.create("org.eclipse.e4.tools.emf.ui", "/icons/full/wizban/attribute_wiz.gif")); //$NON-NLS-1$ //$NON-NLS-2$ + setTitleImage(imageCache.create(Plugin.ID, "/icons/full/wizban/attribute_wiz.gif")); //$NON-NLS-1$ //$NON-NLS-2$ } catch (Exception e) { e.printStackTrace(); } diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedActionPage.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedActionPage.java index ba15ca37..3075c5f0 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedActionPage.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedActionPage.java @@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.tools.emf.ui.common.IClassContributionProvider.ContributionData; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider; import org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs.BundleImageCache; import org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs.ContributionDataFile; @@ -77,7 +78,7 @@ public class NonReferencedActionPage extends WizardPage implements IWizardPage { imageCache = context.get(BundleImageCache.class); - setImageDescriptor(ImageDescriptor.createFromImage(imageCache.create("org.eclipse.e4.tools.emf.ui", "/icons/full/wizban/newefix_wizban.png"))); //$NON-NLS-1$ //$NON-NLS-2$ + setImageDescriptor(ImageDescriptor.createFromImage(imageCache.create(Plugin.ID, "/icons/full/wizban/newefix_wizban.png"))); //$NON-NLS-1$ //$NON-NLS-2$ if (bundle == null && installLocation != null) { this.bundle = FilteredContributionDialog.getBundle(installLocation); diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedResourceDialog.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedResourceDialog.java index 56b157cc..7c8cf61d 100644 --- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedResourceDialog.java +++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/resourcelocator/dialogs/NonReferencedResourceDialog.java @@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.tools.emf.ui.common.IClassContributionProvider.ContributionData; +import org.eclipse.e4.tools.emf.ui.internal.Plugin; import org.eclipse.e4.tools.emf.ui.internal.ResourceProvider; import org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs.BundleImageCache; import org.eclipse.e4.tools.emf.ui.internal.common.component.dialogs.ContributionDataFile; @@ -413,7 +414,7 @@ public class NonReferencedResourceDialog extends TitleAreaDialog { setTitle(Messages.NonReferencedResourceDialog_resourceReferenceWarning); getShell().setText(Messages.NonReferencedResourceDialog_resourceReferenceWarning); try { - setTitleImage(imageCache.create("org.eclipse.e4.tools.emf.ui", "/icons/full/wizban/newefix_wizban.png")); //$NON-NLS-1$ //$NON-NLS-2$ + setTitleImage(imageCache.create(Plugin.ID, "/icons/full/wizban/newefix_wizban.png")); //$NON-NLS-1$ //$NON-NLS-2$ } catch (Exception e) { e.printStackTrace(); } @@ -431,7 +432,7 @@ public class NonReferencedResourceDialog extends TitleAreaDialog { protected Control createContents(Composite parent) { Control ret = super.createContents(parent); setMessage(Messages.NonReferencedResourceDialog_selectTheFolderResourceCopy); - setTitleImage(imageCache.create("org.eclipse.e4.tools.emf.ui", "/icons/full/wizban/add_to_dir_wiz.png")); //$NON-NLS-1$ //$NON-NLS-2$ + setTitleImage(imageCache.create(Plugin.ID, "/icons/full/wizban/add_to_dir_wiz.png")); //$NON-NLS-1$ //$NON-NLS-2$ return ret; } |