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:
parent
540bcb2558
commit
6c57d8f72e
5 changed files with 15 additions and 15 deletions
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.make.internal.ui.scannerconfig;
|
|||
import java.net.URL;
|
||||
|
||||
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 {
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class ScannerDiscoveryConsole extends CBuildConsole {
|
|||
*/
|
||||
@Override
|
||||
public void init(String consoleId, String name, URL defaultIconUrl) {
|
||||
URL iconUrl = LanguageSettingsProviderAssociation.getImageUrl(consoleId);
|
||||
URL iconUrl = LanguageSettingsProviderAssociationManager.getImageUrl(consoleId);
|
||||
if (iconUrl==null) {
|
||||
iconUrl = defaultIconUrl;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.net.URL;
|
|||
|
||||
import org.eclipse.cdt.core.ConsoleOutputStream;
|
||||
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.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
|
@ -91,7 +91,7 @@ public class ScannerDiscoveryGlobalConsole implements ICConsole {
|
|||
}
|
||||
|
||||
if (console==null) {
|
||||
URL iconUrl = LanguageSettingsProviderAssociation.getImageUrl(consoleId);
|
||||
URL iconUrl = LanguageSettingsProviderAssociationManager.getImageUrl(consoleId);
|
||||
if (iconUrl==null) {
|
||||
iconUrl = defaultIconUrl;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.eclipse.cdt.ui.CDTSharedImages;
|
|||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
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$
|
||||
|
||||
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>();
|
||||
|
||||
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) {
|
||||
IExtension[] extensions = extension.getExtensions();
|
||||
for (IExtension ext : extensions) {
|
||||
|
@ -85,12 +85,12 @@ public class LanguageSettingsProviderAssociation {
|
|||
return url;
|
||||
}
|
||||
} catch (MalformedURLException exception) {}
|
||||
|
||||
|
||||
loadedIcons.add(url);
|
||||
if (url!=null) {
|
||||
CDTSharedImages.register(url);
|
||||
}
|
||||
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class LanguageSettingsProviderAssociation {
|
|||
}
|
||||
if (fRegirestedIds.contains(providerId)) {
|
||||
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) {
|
||||
IExtension[] extensions = extension.getExtensions();
|
||||
for (IExtension ext : extensions) {
|
||||
|
@ -141,7 +141,7 @@ public class LanguageSettingsProviderAssociation {
|
|||
}
|
||||
if (fRegisteredClasses.contains(providerClassName)) {
|
||||
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) {
|
||||
IExtension[] extensions = extension.getExtensions();
|
||||
for (IExtension ext : extensions) {
|
||||
|
@ -178,12 +178,12 @@ public class LanguageSettingsProviderAssociation {
|
|||
*/
|
||||
public static URL getImage(Class<? extends ILanguageSettingsProvider> clazz) {
|
||||
URL url = null;
|
||||
|
||||
|
||||
outer: for (Class<?> cl=clazz;cl!=null;cl=cl.getSuperclass()) {
|
||||
url = getImageURL(cl);
|
||||
if (url!=null)
|
||||
break;
|
||||
|
||||
|
||||
// this does not check for superinterfaces, feel free to implement as needed
|
||||
for (Class<?> in : cl.getInterfaces()) {
|
||||
url = getImageURL(in);
|
|
@ -558,7 +558,7 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
|||
if (provider!=null) {
|
||||
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
|
||||
if (rawProvider!=null) {
|
||||
optionsPage = LanguageSettingsProviderAssociation.createOptionsPage(rawProvider);
|
||||
optionsPage = LanguageSettingsProviderAssociationManager.createOptionsPage(rawProvider);
|
||||
}
|
||||
|
||||
if (optionsPage instanceof AbstractLanguageSettingProviderOptionPage) {
|
||||
|
|
|
@ -38,12 +38,12 @@ class LanguageSettingsProvidersLabelProvider extends LabelProvider {
|
|||
String imageKey = null;
|
||||
// try id-association
|
||||
String id = provider.getId();
|
||||
URL url = LanguageSettingsProviderAssociation.getImageUrl(id);
|
||||
URL url = LanguageSettingsProviderAssociationManager.getImageUrl(id);
|
||||
// try class-association
|
||||
if (url==null) {
|
||||
ILanguageSettingsProvider rawProvider = LanguageSettingsManager.getRawProvider(provider);
|
||||
if (rawProvider!=null) {
|
||||
url = LanguageSettingsProviderAssociation.getImage(rawProvider.getClass());
|
||||
url = LanguageSettingsProviderAssociationManager.getImage(rawProvider.getClass());
|
||||
}
|
||||
}
|
||||
if (url!=null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue