1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Renamed LanguageSettingsProviderAssociation ->

LanguageSettingsProviderAssociationManager
This commit is contained in:
Andrew Gvozdev 2011-12-06 17:52:18 -05:00
parent 540bcb2558
commit 6c57d8f72e
5 changed files with 15 additions and 15 deletions

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.make.internal.ui.scannerconfig;
import java.net.URL; import java.net.URL;
import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole; import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole;
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProviderAssociation; import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProviderAssociationManager;
public class ScannerDiscoveryConsole extends CBuildConsole { public class ScannerDiscoveryConsole extends CBuildConsole {
@ -27,7 +27,7 @@ public class ScannerDiscoveryConsole extends CBuildConsole {
*/ */
@Override @Override
public void init(String consoleId, String name, URL defaultIconUrl) { public void init(String consoleId, String name, URL defaultIconUrl) {
URL iconUrl = LanguageSettingsProviderAssociation.getImageUrl(consoleId); URL iconUrl = LanguageSettingsProviderAssociationManager.getImageUrl(consoleId);
if (iconUrl==null) { if (iconUrl==null) {
iconUrl = defaultIconUrl; iconUrl = defaultIconUrl;
} }

View file

@ -16,7 +16,7 @@ import java.net.URL;
import org.eclipse.cdt.core.ConsoleOutputStream; import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.internal.core.ICConsole; import org.eclipse.cdt.internal.core.ICConsole;
import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProviderAssociation; import org.eclipse.cdt.internal.ui.language.settings.providers.LanguageSettingsProviderAssociationManager;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Assert;
@ -91,7 +91,7 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
} }
if (console==null) { if (console==null) {
URL iconUrl = LanguageSettingsProviderAssociation.getImageUrl(consoleId); URL iconUrl = LanguageSettingsProviderAssociationManager.getImageUrl(consoleId);
if (iconUrl==null) { if (iconUrl==null) {
iconUrl = defaultIconUrl; iconUrl = defaultIconUrl;
} }

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.dialogs.ICOptionPage; import org.eclipse.cdt.ui.dialogs.ICOptionPage;
public class LanguageSettingsProviderAssociation { public class LanguageSettingsProviderAssociationManager {
public static final String LANGUAGE_SETTINGS_PROVIDER_UI = "LanguageSettingsProviderAssociation"; //$NON-NLS-1$ public static final String LANGUAGE_SETTINGS_PROVIDER_UI = "LanguageSettingsProviderAssociation"; //$NON-NLS-1$
private static final String ELEM_ID_ASSOCIATION = "id-association"; //$NON-NLS-1$ private static final String ELEM_ID_ASSOCIATION = "id-association"; //$NON-NLS-1$
@ -47,7 +47,7 @@ public class LanguageSettingsProviderAssociation {
if (fRegisteredClasses==null) fRegisteredClasses = new ArrayList<String>(); if (fRegisteredClasses==null) fRegisteredClasses = new ArrayList<String>();
IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LanguageSettingsProviderAssociation.LANGUAGE_SETTINGS_PROVIDER_UI); IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LANGUAGE_SETTINGS_PROVIDER_UI);
if (extension != null) { if (extension != null) {
IExtension[] extensions = extension.getExtensions(); IExtension[] extensions = extension.getExtensions();
for (IExtension ext : extensions) { for (IExtension ext : extensions) {
@ -85,12 +85,12 @@ public class LanguageSettingsProviderAssociation {
return url; return url;
} }
} catch (MalformedURLException exception) {} } catch (MalformedURLException exception) {}
loadedIcons.add(url); loadedIcons.add(url);
if (url!=null) { if (url!=null) {
CDTSharedImages.register(url); CDTSharedImages.register(url);
} }
return url; return url;
} }
@ -107,7 +107,7 @@ public class LanguageSettingsProviderAssociation {
} }
if (fRegirestedIds.contains(providerId)) { if (fRegirestedIds.contains(providerId)) {
IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LanguageSettingsProviderAssociation.LANGUAGE_SETTINGS_PROVIDER_UI); IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LANGUAGE_SETTINGS_PROVIDER_UI);
if (extension != null) { if (extension != null) {
IExtension[] extensions = extension.getExtensions(); IExtension[] extensions = extension.getExtensions();
for (IExtension ext : extensions) { for (IExtension ext : extensions) {
@ -141,7 +141,7 @@ public class LanguageSettingsProviderAssociation {
} }
if (fRegisteredClasses.contains(providerClassName)) { if (fRegisteredClasses.contains(providerClassName)) {
IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LanguageSettingsProviderAssociation.LANGUAGE_SETTINGS_PROVIDER_UI); IExtensionPoint extension = registry.getExtensionPoint(CUIPlugin.PLUGIN_ID, LANGUAGE_SETTINGS_PROVIDER_UI);
if (extension != null) { if (extension != null) {
IExtension[] extensions = extension.getExtensions(); IExtension[] extensions = extension.getExtensions();
for (IExtension ext : extensions) { for (IExtension ext : extensions) {
@ -178,12 +178,12 @@ public class LanguageSettingsProviderAssociation {
*/ */
public static URL getImage(Class<? extends ILanguageSettingsProvider> clazz) { public static URL getImage(Class<? extends ILanguageSettingsProvider> clazz) {
URL url = null; URL url = null;
outer: for (Class<?> cl=clazz;cl!=null;cl=cl.getSuperclass()) { outer: for (Class<?> cl=clazz;cl!=null;cl=cl.getSuperclass()) {
url = getImageURL(cl); url = getImageURL(cl);
if (url!=null) if (url!=null)
break; break;
// this does not check for superinterfaces, feel free to implement as needed // this does not check for superinterfaces, feel free to implement as needed
for (Class<?> in : cl.getInterfaces()) { for (Class<?> in : cl.getInterfaces()) {
url = getImageURL(in); url = getImageURL(in);

View file

@ -558,7 +558,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
if (provider!=null) { if (provider!=null) {
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider); ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
if (rawProvider!=null) { if (rawProvider!=null) {
optionsPage = LanguageSettingsProviderAssociation.createOptionsPage(rawProvider); optionsPage = LanguageSettingsProviderAssociationManager.createOptionsPage(rawProvider);
} }
if (optionsPage instanceof AbstractLanguageSettingProviderOptionPage) { if (optionsPage instanceof AbstractLanguageSettingProviderOptionPage) {

View file

@ -38,12 +38,12 @@ class LanguageSettingsProvidersLabelProvider extends LabelProvider {
String imageKey = null; String imageKey = null;
// try id-association // try id-association
String id = provider.getId(); String id = provider.getId();
URL url = LanguageSettingsProviderAssociation.getImageUrl(id); URL url = LanguageSettingsProviderAssociationManager.getImageUrl(id);
// try class-association // try class-association
if (url==null) { if (url==null) {
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider); ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
if (rawProvider!=null) { if (rawProvider!=null) {
url = LanguageSettingsProviderAssociation.getImage(rawProvider.getClass()); url = LanguageSettingsProviderAssociationManager.getImage(rawProvider.getClass());
} }
} }
if (url!=null) { if (url!=null) {