From fd6bc8ef1ab891020256d2c2eb03bb1a5dc6f715 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Thu, 19 Apr 2007 17:51:23 +0000 Subject: [PATCH] Externalization fixes --- .../eclipse/cdt/make/core/MakeCorePlugin.java | 2 +- .../scannerconfig/ScannerConfigBuilder.java | 2 +- .../internal/core/MakeMessages.properties | 1 + .../MakeConfigurationDataProvider.java | 2 +- .../MakeConfigurationDataProvider.properties | 12 ++++ ...MakeConfigurationDataProviderMessages.java | 32 +++++++++ .../ScannerConfigInfoFactory2.java | 2 +- .../dataprovider/BuildEntryStorage.java | 2 +- .../CDefaultConfigurationDataProvider.java | 2 +- .../settings/model/util/CDataSerializer.java | 68 +++++++++---------- .../settings/model/util/PatternNameMap.java | 2 +- .../UserAndDiscoveredEntryDataSerializer.java | 6 +- .../model/util/UtilMessages.properties | 14 ++++ .../model/CExternalSettingsManager.java | 8 +-- .../settings/model/CRefSettingsHolder.java | 4 +- .../CfgExportSettingContainerFactory.java | 10 +-- .../model/ExtensionContainerFactory.java | 12 ++-- .../model/SettingsModelMessages.properties | 4 ++ .../core/CConfigBasedDescriptorManager.java | 12 ++-- .../core/CCorePluginResources.properties | 6 ++ .../internal/core/CExtensionDescriptor.java | 4 +- .../core/CdtVarPathEntryVariableManager.java | 2 +- 22 files changed, 139 insertions(+), 70 deletions(-) create mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProvider.properties create mode 100644 build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProviderMessages.java diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java index edf52284492..d4c437f1352 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java @@ -67,7 +67,7 @@ public class MakeCorePlugin extends Plugin { public static final String MAKEFILE_STYLE = PLUGIN_ID + "editor_makefile_style"; //$NON-NLS-1$ public static final String MAKEFILE_DIRS = PLUGIN_ID + "editor_makefile_dirs"; //$NON-NLS-1$ - public static final String CFG_DATA_PROVIDER_ID = PLUGIN_ID + ".configurationDataProvider"; + public static final String CFG_DATA_PROVIDER_ID = PLUGIN_ID + ".configurationDataProvider"; //$NON-NLS-1$ private MakeTargetManager fTargetManager; private DiscoveredPathManager fDiscoveryPathManager; //The shared instance. diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java index b2b72c33f5c..89461572b7d 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java @@ -92,7 +92,7 @@ public class ScannerConfigBuilder extends ACBuilder { ICConfigurationDescription[] cfgs = des.getConfigurations(); IScannerConfigBuilderInfo2Set container = ScannerConfigProfileManager.createScannerConfigBuildInfo2Set(project); - monitor.beginTask("building per-configuratin info", cfgs.length + 1); + monitor.beginTask(MakeMessages.getString("ScannerConfigBuilder.0"), cfgs.length + 1); //$NON-NLS-1$ boolean wasbuilt = false; for(int i = 0; i < cfgs.length; i++){ ICConfigurationDescription cfg = cfgs[i]; diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeMessages.properties b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeMessages.properties index 252ff1e958b..390336ec519 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeMessages.properties +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeMessages.properties @@ -26,6 +26,7 @@ MakeTargetManager.error_writing_file=Error writing target file ProjectTargets.error_reading_project_targets=Error reading project targets. ScannerConfigBuilder.Invoking_Builder=Invoking scanner config builder on project +ScannerConfigBuilder.0=building per-configuratin info ScannerConfigNature.Missing_Project=Missing or closed project ScannerConfigInfoFactory.Missing_Builder=Missing Builder: diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/MakeConfigurationDataProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/MakeConfigurationDataProvider.java index 0a16f0039d8..90160d83d73 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/MakeConfigurationDataProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/dataprovider/MakeConfigurationDataProvider.java @@ -24,7 +24,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; public class MakeConfigurationDataProvider extends CDefaultConfigurationDataProvider { - private static final String STORAGE_ID = "makeConfigDataProvider"; + private static final String STORAGE_ID = "makeConfigDataProvider"; //$NON-NLS-1$ protected CDataFacroty getDataFactory() { return MakeCDataFacroty.getDefault(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProvider.properties b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProvider.properties new file mode 100644 index 00000000000..a6bba317cf7 --- /dev/null +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProvider.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2007 Intel Corporation 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: +# Intel Corporation - Initial API and implementation +############################################################################### + +ScannerConfigInfoFactory2.0=can not remove the default info diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProviderMessages.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProviderMessages.java new file mode 100644 index 00000000000..2feefd825a3 --- /dev/null +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/MakeConfigurationDataProviderMessages.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2007 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.make.internal.core.scannerconfig2; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class MakeConfigurationDataProviderMessages { + private static final String BUNDLE_NAME = "org.eclipse.cdt.make.internal.core.scannerconfig2.MakeConfigurationDataProvider"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle + .getBundle(BUNDLE_NAME); + + private MakeConfigurationDataProviderMessages() { + } + + public static String getString(String key) { + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } +} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java index 626afdb0e54..6a39de1ab04 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigInfoFactory2.java @@ -323,7 +323,7 @@ public class ScannerConfigInfoFactory2 { private void checkRemoveInfo(InfoContext context) throws CoreException{ if(context.isDefaultContext()) - throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.PLUGIN_ID, "can not remove the default info")); + throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.PLUGIN_ID, MakeConfigurationDataProviderMessages.getString("ScannerConfigInfoFactory2.0"))); //$NON-NLS-1$ } public boolean isDirty(){ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java index 626b9f0b793..d0be0c3926e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/dataprovider/BuildEntryStorage.java @@ -275,7 +275,7 @@ public class BuildEntryStorage extends AbstractEntryStorage { nv[1] = value.substring(index + 1); } else { nv[0] = value; - nv[1] = ""; + nv[1] = ""; //$NON-NLS-1$ } return nv; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationDataProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationDataProvider.java index 215b6e08d98..ed64f76f234 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationDataProvider.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/extension/impl/CDefaultConfigurationDataProvider.java @@ -88,6 +88,6 @@ public class CDefaultConfigurationDataProvider extends } protected CConfigurationData createPreferenceConfig(CDataFacroty factory){ - return CDataUtil.createEmptyData(null, "preference", factory, true); + return CDataUtil.createEmptyData(null, "preference", factory, true); //$NON-NLS-1$ } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataSerializer.java index 1831011e3c9..e2522e2b8e4 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataSerializer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataSerializer.java @@ -35,27 +35,27 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; public class CDataSerializer { - protected static final String NAME = "name"; - protected static final String ID = "id"; - protected static final String DESCRIPTION = "description"; - protected static final String SOURCE_ENTRIES = "sourceEntries"; - protected static final String PATH = "path"; - protected static final String LANGUAGE_ID = "languageId"; - protected static final String CONTENT_TYPE_IDS = "contentTypeIds"; - protected static final String EXTENSIONS = "extensions"; - protected static final String DELIMITER = ";"; - protected static final String FOLDER_DATA = "folderData"; - protected static final String FILE_DATA = "fileData"; - protected static final String BUILD_DATA = "buildData"; - protected static final String TARGET_PLATFORM_DATA = "targetPlatformData"; - protected static final String LANGUAGE_DATA = "languageData"; + protected static final String NAME = "name"; //$NON-NLS-1$ + protected static final String ID = "id"; //$NON-NLS-1$ + protected static final String DESCRIPTION = "description"; //$NON-NLS-1$ + protected static final String SOURCE_ENTRIES = "sourceEntries"; //$NON-NLS-1$ + protected static final String PATH = "path"; //$NON-NLS-1$ + protected static final String LANGUAGE_ID = "languageId"; //$NON-NLS-1$ + protected static final String CONTENT_TYPE_IDS = "contentTypeIds"; //$NON-NLS-1$ + protected static final String EXTENSIONS = "extensions"; //$NON-NLS-1$ + protected static final String DELIMITER = ";"; //$NON-NLS-1$ + protected static final String FOLDER_DATA = "folderData"; //$NON-NLS-1$ + protected static final String FILE_DATA = "fileData"; //$NON-NLS-1$ + protected static final String BUILD_DATA = "buildData"; //$NON-NLS-1$ + protected static final String TARGET_PLATFORM_DATA = "targetPlatformData"; //$NON-NLS-1$ + protected static final String LANGUAGE_DATA = "languageData"; //$NON-NLS-1$ // protected static final String EXCLUDED = "excluded"; - protected static final String OUTPUT_ENTRIES = "outputEntries"; - protected static final String ERROR_PARSERS = "errorParsers"; - protected static final String BINARY_PARSERS = "binaryParsers"; - protected static final String CWD = "cwd"; - protected static final String SETTING_ENTRIES = "settingEntries"; - protected static final String SUPPORTED_ENTRY_KINDS = "supportedEntryKinds"; + protected static final String OUTPUT_ENTRIES = "outputEntries"; //$NON-NLS-1$ + protected static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$ + protected static final String BINARY_PARSERS = "binaryParsers"; //$NON-NLS-1$ + protected static final String CWD = "cwd"; //$NON-NLS-1$ + protected static final String SETTING_ENTRIES = "settingEntries"; //$NON-NLS-1$ + protected static final String SUPPORTED_ENTRY_KINDS = "supportedEntryKinds"; //$NON-NLS-1$ private static CDataSerializer fInstance; @@ -68,12 +68,12 @@ public class CDataSerializer { public CConfigurationData loadConfigurationData(CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for configuration")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.20"))); //$NON-NLS-1$ String name = el.getAttribute(NAME); CConfigurationData data = factory.createConfigurationdata(id, name, null, false); if(data == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create configuration")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.21"))); //$NON-NLS-1$ String tmp = el.getAttribute(DESCRIPTION); if(tmp != null) @@ -123,7 +123,7 @@ public class CDataSerializer { public CFolderData loadFolderData(CConfigurationData data, CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for folder data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.22"))); //$NON-NLS-1$ String tmp = el.getAttribute(PATH); IPath path = null; @@ -131,11 +131,11 @@ public class CDataSerializer { path = new Path(tmp); } if(path == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no path attribute for folder data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.23"))); //$NON-NLS-1$ CFolderData foData = factory.createFolderData(data, null, id, false, path); if(foData == null){ - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create folder data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.24"))); //$NON-NLS-1$ } // tmp = el.getAttribute(EXCLUDED); @@ -162,7 +162,7 @@ public class CDataSerializer { public CFileData loadFileData(CConfigurationData data, CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for file data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.25"))); //$NON-NLS-1$ String tmp = el.getAttribute(PATH); IPath path = null; @@ -170,11 +170,11 @@ public class CDataSerializer { path = new Path(tmp); } if(path == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no path attribute for file data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.26"))); //$NON-NLS-1$ CFileData fiData = factory.createFileData(data, null, null, id, false, path); if(fiData == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create file data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.27"))); //$NON-NLS-1$ // tmp = el.getAttribute(EXCLUDED); // if(tmp != null){ @@ -201,13 +201,13 @@ public class CDataSerializer { public CBuildData loadBuildData(CConfigurationData data, CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for build data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.28"))); //$NON-NLS-1$ String name = el.getAttribute(NAME); CBuildData bData = factory.createBuildData(data, null, id, name, false); if(bData == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create build data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.29"))); //$NON-NLS-1$ String tmp = el.getAttribute(ERROR_PARSERS); if(tmp != null){ @@ -243,13 +243,13 @@ public class CDataSerializer { public CTargetPlatformData loadTargetPlatformData(CConfigurationData data, CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for target platform data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.30"))); //$NON-NLS-1$ String name = el.getAttribute(NAME); CTargetPlatformData tpData = factory.createTargetPlatformData(data, null, id, name, false); if(tpData == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create target platform data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.31"))); //$NON-NLS-1$ String tmp = el.getAttribute(BINARY_PARSERS); if(tmp != null){ @@ -263,7 +263,7 @@ public class CDataSerializer { public CLanguageData loadLanguageData(CConfigurationData data, CResourceData rcData, CDataFacroty factory, ICStorageElement el) throws CoreException { String id = el.getAttribute(ID); if(id == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "no id attribute for language data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.32"))); //$NON-NLS-1$ String name = el.getAttribute(NAME); String langId = el.getAttribute(LANGUAGE_ID); @@ -291,7 +291,7 @@ public class CDataSerializer { } CLanguageData lData = factory.createLanguageData(data, rcData, id, name, langId, supportedKinds, ids, cTypes); if(lData == null) - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, "failed to create language data")); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, UtilMessages.getString("CDataSerializer.33"))); //$NON-NLS-1$ ICStorageElement[] children = el.getChildren(); String childName; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java index f2aebc5e1cb..c4fbaa65f70 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java @@ -23,7 +23,7 @@ import org.eclipse.cdt.core.model.CoreModelUtil; public class PatternNameMap { private static final char[] SPEC_CHARS = new char[]{'*', '?'}; - static final String DOUBLE_STAR_PATTERN = "**"; + static final String DOUBLE_STAR_PATTERN = "**"; //$NON-NLS-1$ private Map fChildrenMap; private Map fPatternMap; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java index 046549bb72a..1d5248b68f2 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UserAndDiscoveredEntryDataSerializer.java @@ -20,9 +20,9 @@ import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.extension.CLanguageData; public class UserAndDiscoveredEntryDataSerializer extends CDataSerializer { - protected static final String DISABLED_DISCOVERED_ENTRIES = "disabledDiscoveredEntries"; - protected static final String KIND = "kind"; - protected static final String VALUE = "value"; + protected static final String DISABLED_DISCOVERED_ENTRIES = "disabledDiscoveredEntries"; //$NON-NLS-1$ + protected static final String KIND = "kind"; //$NON-NLS-1$ + protected static final String VALUE = "value"; //$NON-NLS-1$ private static UserAndDiscoveredEntryDataSerializer fInstance; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UtilMessages.properties b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UtilMessages.properties index 634e409eb00..f271aca7aef 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UtilMessages.properties +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/UtilMessages.properties @@ -12,3 +12,17 @@ KindBasedStore.0=illegal kind KindBasedStore.1=illegal kind PathEntryTranslator.0=illegal kind PathEntryTranslator.1=illegal kind +CDataSerializer.20=no id attribute for configuration +CDataSerializer.21=failed to create configuration +CDataSerializer.22=no id attribute for folder data +CDataSerializer.23=no path attribute for folder data +CDataSerializer.24=failed to create folder data +CDataSerializer.25=no id attribute for file data +CDataSerializer.26=no path attribute for file data +CDataSerializer.27=failed to create file data +CDataSerializer.28=no id attribute for build data +CDataSerializer.29=failed to create build data +CDataSerializer.30=no id attribute for target platform data +CDataSerializer.31=failed to create target platform data +CDataSerializer.32=no id attribute for language data +CDataSerializer.33=failed to create language data diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java index 2e102fa0562..2acfe09dc60 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java @@ -40,8 +40,8 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP private static final int OP_ADDED = 2; private static final int OP_REMOVED = 3; - private static final QualifiedName EXTERNAL_SETTING_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "externalSettings"); - private static final String EXTERNAL_SETTING_STORAGE_ID = CCorePlugin.PLUGIN_ID + ".externalSettings"; + private static final QualifiedName EXTERNAL_SETTING_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "externalSettings"); //$NON-NLS-1$ + private static final String EXTERNAL_SETTING_STORAGE_ID = CCorePlugin.PLUGIN_ID + ".externalSettings"; //$NON-NLS-1$ private Map fFactoryMap = new HashMap(); private static CExternalSettingsManager fInstance; @@ -129,7 +129,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP } public String toString() { - return fFactoryId.toString() + " : " + fContainerId.toString(); + return fFactoryId.toString() + " : " + fContainerId.toString(); //$NON-NLS-1$ } } private static class ContainerDescriptor { @@ -626,7 +626,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP private CSettingsRefInfo getRefInfo(ICConfigurationDescription cfg, boolean write){ if(write && cfg.isReadOnly()) - throw new IllegalArgumentException("writable ref info is requested for the read only config"); + throw new IllegalArgumentException(SettingsModelMessages.getString("CExternalSettingsManager.3")); //$NON-NLS-1$ RefInfoContainer cr = (RefInfoContainer)cfg.getSessionProperty(EXTERNAL_SETTING_PROPERTY); CSettingsRefInfo ri; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CRefSettingsHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CRefSettingsHolder.java index f0d39cbde90..89ffe656885 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CRefSettingsHolder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CRefSettingsHolder.java @@ -14,8 +14,8 @@ import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.internal.core.settings.model.CExternalSettingsManager.CContainerRef; public class CRefSettingsHolder extends CExternalSettingsHolder { - private static final String ATTR_FACTORY_ID = "factoryId"; - private static final String ATTR_CONTAINER_ID = "containerId"; + private static final String ATTR_FACTORY_ID = "factoryId"; //$NON-NLS-1$ + private static final String ATTR_CONTAINER_ID = "containerId"; //$NON-NLS-1$ private CContainerRef fContainerRef; private boolean fIsReconsiled; diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java index 027314f0abe..95b35fc1f83 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java @@ -33,7 +33,7 @@ import org.eclipse.core.runtime.ListenerList; public class CfgExportSettingContainerFactory extends CExternalSettingContainerFactory implements ICProjectDescriptionListener { - static final String FACTORY_ID = CCorePlugin.PLUGIN_ID + ".cfg.export.settings.sipplier"; + static final String FACTORY_ID = CCorePlugin.PLUGIN_ID + ".cfg.export.settings.sipplier"; //$NON-NLS-1$ private static final char DELIMITER = ';'; private ListenerList fListenerList; @@ -165,11 +165,11 @@ public class CfgExportSettingContainerFactory extends cfgId = id.substring(index + 1); } else { projName = id; - cfgId = ""; + cfgId = ""; //$NON-NLS-1$ } if((projName = projName.trim()).length() == 0) - throw ExceptionFactory.createCoreException("invalid id: project name not specified"); + throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CfgExportSettingContainerFactory.2")); //$NON-NLS-1$ return new String[]{projName, cfgId}; } @@ -225,14 +225,14 @@ public class CfgExportSettingContainerFactory extends for(int i = 0; i < cfgs.length; i++){ cfgIds.add(cfgs[i].getId()); } - cfgIds.add(""); + cfgIds.add(""); //$NON-NLS-1$ } case ICDescriptionDelta.CHANGED: ICDescriptionDelta[] children = delta.getChildren(); collectCfgIds(children, cfgIds); if((delta.getChangeFlags() & ICDescriptionDelta.ACTIVE_CFG) != 0) - cfgIds.add(""); + cfgIds.add(""); //$NON-NLS-1$ } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java index faa83ba34cf..924d6abf4b9 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ExtensionContainerFactory.java @@ -30,8 +30,8 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.Platform; public class ExtensionContainerFactory extends CExternalSettingContainerFactory { - static final String FACTORY_ID = CCorePlugin.PLUGIN_ID + ".extension.container.factory"; - private static final String EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".externalSettingsProvider"; + static final String FACTORY_ID = CCorePlugin.PLUGIN_ID + ".extension.container.factory"; //$NON-NLS-1$ + private static final String EXTENSION_ID = CCorePlugin.PLUGIN_ID + ".externalSettingsProvider"; //$NON-NLS-1$ private static ExtensionContainerFactory fInstance; private Map fDescriptorMap; @@ -59,8 +59,8 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactory } private static class CExtensionSettingProviderDescriptor { - private static final String PROVIDER = "provider"; - private static final String CLASS = "class"; + private static final String PROVIDER = "provider"; //$NON-NLS-1$ + private static final String CLASS = "class"; //$NON-NLS-1$ private IExtension fExtension; private IConfigurationElement fProviderElement; @@ -107,9 +107,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactory if(obj instanceof CExternalSettingProvider){ return (CExternalSettingProvider)obj; } else - throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("invalid setting provider class specified")); + throw ExceptionFactory.createCoreException(SettingsModelMessages.getString(SettingsModelMessages.getString("ExtensionContainerFactory.4"))); //$NON-NLS-1$ } - throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("provider element not specified")); + throw ExceptionFactory.createCoreException(SettingsModelMessages.getString(SettingsModelMessages.getString("ExtensionContainerFactory.5"))); //$NON-NLS-1$ } private IConfigurationElement getProviderElement(){ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties index da5f671ea78..69bcaf1f6e8 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsModelMessages.properties @@ -36,3 +36,7 @@ CFolderDescription.1=expected proxy of type ICLanguageSetting, but was CFolderDescription.2=data was not created CFolderDescription.3=expected proxy of type ICLanguageSetting, but was SetCProjectDescriptionOperation.0=CDT Project settings serialization +CExternalSettingsManager.3=writable ref info is requested for the read only config +CfgExportSettingContainerFactory.2=invalid id: project name not specified +ExtensionContainerFactory.4=invalid setting provider class specified +ExtensionContainerFactory.5=provider element not specified diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java index f0d56bea377..933b7c1a9aa 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java @@ -154,7 +154,7 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager { public void convert(IProject project, String id) throws CoreException { CConfigBasedDescriptor dr = findDescriptor(project, false); if(dr == null){ - throw ExceptionFactory.createCoreException("the project is not a CDT project"); + throw ExceptionFactory.createCoreException(CCorePlugin.getResourceString("CConfigBasedDescriptorManager.0")); //$NON-NLS-1$ } @@ -218,17 +218,17 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager { throws CoreException { CConfigBasedDescriptor dr = getOperatingDescriptor(project); if(dr != null){ - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "description based descriptor operation can not be nested", null)); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, CCorePlugin.getResourceString("CConfigBasedDescriptorManager.1"), null)); //$NON-NLS-1$ } if(des.isReadOnly()){ - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "can not perform descriptor operation based on the read only description", null)); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, CCorePlugin.getResourceString("CConfigBasedDescriptorManager.2"), null)); //$NON-NLS-1$ } dr = loadDescriptor((CProjectDescription)des); if (dr == null) { - throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, "Failed to create descriptor", null)); + throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, CCorePlugin.getResourceString("CConfigBasedDescriptorManager.3"), null)); //$NON-NLS-1$ } setOperatingDescriptor(project, dr); @@ -312,11 +312,11 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager { if(cfgDes != null){ if(cfgDes.isReadOnly()) - throw ExceptionFactory.createCoreException("error: read-only configuration can not be used for CDescriptor"); + throw ExceptionFactory.createCoreException(CCorePlugin.getResourceString("CConfigBasedDescriptorManager.4")); //$NON-NLS-1$ dr = new CConfigBasedDescriptor(cfgDes); } else { - throw ExceptionFactory.createCoreException("the project does not contain valid configurations"); + throw ExceptionFactory.createCoreException(CCorePlugin.getResourceString("CConfigBasedDescriptorManager.5")); //$NON-NLS-1$ } } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties index b25b4f80c91..7f773c65389 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties @@ -78,3 +78,9 @@ pdom.indexer.name=C/C++ Indexer pdom.indexer.task=Indexing PDOMIndexerJob.updateMonitorJob=Update Monitor CCoreInternals.savePreferencesJob=Save preferences +CConfigBasedDescriptorManager.0=the project is not a CDT project +CConfigBasedDescriptorManager.1=description based descriptor operation can not be nested +CConfigBasedDescriptorManager.2=can not perform descriptor operation based on the read only description +CConfigBasedDescriptorManager.3=Failed to create descriptor +CConfigBasedDescriptorManager.4=error: read-only configuration can not be used for CDescriptor +CConfigBasedDescriptorManager.5=the project does not contain valid configurations diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java index b1522dd40d2..0c025aa12c4 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java @@ -15,8 +15,8 @@ import org.eclipse.core.runtime.IConfigurationElement; public class CExtensionDescriptor implements ICExtensionDescriptor { private IConfigurationElement fElement; - protected static final String ATTRIBUTE_ID = "id"; - protected static final String ATTRIBUTE_NAME = "name"; + protected static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$ + protected static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$ public CExtensionDescriptor(IConfigurationElement el){ fElement = el; diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java index 16662e1375b..547bfe950ad 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java @@ -52,7 +52,7 @@ public class CdtVarPathEntryVariableManager implements private class VarSubstitutor extends SupplierBasedCdtVariableSubstitutor { public VarSubstitutor() { - super(new VarContextInfo(), "", " "); + super(new VarContextInfo(), "", " "); //$NON-NLS-1$ //$NON-NLS-2$ } }