Search in sources :

Example 1 with IDockerConnectionSettingsProvider

use of org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsProvider in project linuxtools by eclipse.

the class DefaultDockerConnectionSettingsFinder method getKnownConnectionSettings.

@Override
public List<IDockerConnectionSettings> getKnownConnectionSettings() {
    List<IDockerConnectionSettings> result = new ArrayList<>();
    IConfigurationElement[] configs = getConfigurationElements();
    for (IConfigurationElement config : configs) {
        try {
            // $NON-NLS-1$
            Object obj = config.createExecutableExtension("provider");
            if (obj instanceof IDockerConnectionSettingsProvider) {
                List<IDockerConnectionSettings> settings = ((IDockerConnectionSettingsProvider) obj).getConnectionSettings();
                if (settings != null && !settings.isEmpty()) {
                    result.addAll(settings);
                }
            }
        } catch (CoreException e) {
        // continue, perhaps another configuration will succeed
        }
    }
    return result;
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) IDockerConnectionSettings(org.eclipse.linuxtools.docker.core.IDockerConnectionSettings) ArrayList(java.util.ArrayList) IDockerConnectionSettingsProvider(org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsProvider) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement)

Aggregations

ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IDockerConnectionSettings (org.eclipse.linuxtools.docker.core.IDockerConnectionSettings)1 IDockerConnectionSettingsProvider (org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsProvider)1