mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
minor refactoring
This commit is contained in:
parent
fef68e3d8a
commit
455dfb6541
2 changed files with 5 additions and 4 deletions
|
@ -37,6 +37,7 @@ import org.w3c.dom.Element;
|
||||||
* Test cases testing LanguageSettingsProvider functionality
|
* Test cases testing LanguageSettingsProvider functionality
|
||||||
*/
|
*/
|
||||||
public class LanguageSettingsPersistenceProjectTests extends TestCase {
|
public class LanguageSettingsPersistenceProjectTests extends TestCase {
|
||||||
|
private static final String LANGUAGE_SETTINGS_PROJECT_XML = ".settings/language.settings.xml";
|
||||||
// Should match id of extension point defined in plugin.xml
|
// Should match id of extension point defined in plugin.xml
|
||||||
private static final String EXTENSION_PROVIDER_ID = "org.eclipse.cdt.core.tests.language.settings.base.provider.subclass";
|
private static final String EXTENSION_PROVIDER_ID = "org.eclipse.cdt.core.tests.language.settings.base.provider.subclass";
|
||||||
private static final String EXTENSION_PROVIDER_NAME = "Test Plugin Base Provider Subclass";
|
private static final String EXTENSION_PROVIDER_NAME = "Test Plugin Base Provider Subclass";
|
||||||
|
@ -744,7 +745,7 @@ public class LanguageSettingsPersistenceProjectTests extends TestCase {
|
||||||
|
|
||||||
// write to project description
|
// write to project description
|
||||||
coreModel.setProjectDescription(project, writableProjDescription);
|
coreModel.setProjectDescription(project, writableProjDescription);
|
||||||
IFile xmlStorageFile = project.getFile(".settings/language.settings.xml");
|
IFile xmlStorageFile = project.getFile(LANGUAGE_SETTINGS_PROJECT_XML);
|
||||||
assertTrue(xmlStorageFile.exists());
|
assertTrue(xmlStorageFile.exists());
|
||||||
xmlStorageFileLocation = xmlStorageFile.getLocation().toOSString();
|
xmlStorageFileLocation = xmlStorageFile.getLocation().toOSString();
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,14 +157,14 @@ public class LanguageSettingsProvidersSerializer {
|
||||||
* @param store - name of the store
|
* @param store - name of the store
|
||||||
* @return location of the store in the plug-in state area
|
* @return location of the store in the plug-in state area
|
||||||
*/
|
*/
|
||||||
private static URI getStoreLocation(String store) {
|
private static URI getStoreLocationInWorkspaceArea(String store) {
|
||||||
IPath location = CCorePlugin.getDefault().getStateLocation().append(store);
|
IPath location = CCorePlugin.getDefault().getStateLocation().append(store);
|
||||||
URI uri = URIUtil.toURI(location);
|
URI uri = URIUtil.toURI(location);
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void serializeLanguageSettingsWorkspace() throws CoreException {
|
public static void serializeLanguageSettingsWorkspace() throws CoreException {
|
||||||
URI uriLocation = getStoreLocation(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
|
URI uriLocation = getStoreLocationInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
|
||||||
List<LanguageSettingsSerializable> serializableExtensionProviders = new ArrayList<LanguageSettingsSerializable>();
|
List<LanguageSettingsSerializable> serializableExtensionProviders = new ArrayList<LanguageSettingsSerializable>();
|
||||||
for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) {
|
for (ILanguageSettingsProvider provider : rawGlobalWorkspaceProviders.values()) {
|
||||||
if (provider instanceof LanguageSettingsSerializable) {
|
if (provider instanceof LanguageSettingsSerializable) {
|
||||||
|
@ -206,7 +206,7 @@ public class LanguageSettingsProvidersSerializer {
|
||||||
public static void loadLanguageSettingsWorkspace() throws CoreException {
|
public static void loadLanguageSettingsWorkspace() throws CoreException {
|
||||||
List <ILanguageSettingsProvider> providers = null;
|
List <ILanguageSettingsProvider> providers = null;
|
||||||
|
|
||||||
URI uriLocation = getStoreLocation(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
|
URI uriLocation = getStoreLocationInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);
|
||||||
|
|
||||||
Document doc = null;
|
Document doc = null;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Reference in a new issue