use of org.eclipse.core.runtime.IConfigurationElement in project linuxtools by eclipse.
the class RemoteProxyManager method getRemoteManager.
/**
* @param schemeId The protocol scheme to be used.
* @return The {@link IRemoteProxyManager} for the given scheme.
* @throws CoreException If a problem getting remote proxy manager for this scheme occurred.
* @since 2.1
*/
protected IRemoteProxyManager getRemoteManager(String schemeId) throws CoreException {
IRemoteProxyManager remoteManager = remoteManagers.get(schemeId);
if (remoteManager == null) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, IRemoteProxyManager.EXTENSION_POINT_ID);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
for (int i = 0; i < infos.length; i++) {
IConfigurationElement configurationElement = infos[i];
if (configurationElement.getName().equals(IRemoteProxyManager.MANAGER_NAME)) {
if (configurationElement.getAttribute(IRemoteProxyManager.SCHEME_ID).equals(schemeId)) {
Object obj = configurationElement.createExecutableExtension(EXT_ATTR_CLASS);
if (obj instanceof IRemoteProxyManager) {
remoteManager = (IRemoteProxyManager) obj;
remoteManagers.put(schemeId, remoteManager);
break;
}
}
}
}
}
return remoteManager;
}
use of org.eclipse.core.runtime.IConfigurationElement in project linuxtools by eclipse.
the class RemoteProxyNatureMapping method getSchemeFromNature.
public String getSchemeFromNature(IProject project) throws CoreException {
IProjectDescription description = project.getDescription();
String[] natures = description.getNatureIds();
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
for (int i = 0; i < infos.length; i++) {
IConfigurationElement configurationElement = infos[i];
if (configurationElement.getName().equals(MANAGER_NAME)) {
for (int j = 0; j < natures.length; j++) {
if (configurationElement.getAttribute(NATURE_ID).equals(natures[j])) {
return configurationElement.getAttribute(SCHEME_ID);
}
}
}
}
return null;
}
use of org.eclipse.core.runtime.IConfigurationElement in project linuxtools by eclipse.
the class FileSystemSelectionArea method getSchemes.
private FileSystemElement[] getSchemes() {
if (fsElements == null) {
fsElements = new LinkedList<>();
// Add all of the ones declared by the registry.
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, EXTENSION_POINT_ID);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
for (int i = 0; i < infos.length; i++) {
IConfigurationElement configurationElement = infos[i];
if (configurationElement.getName().equals(RESOURCE_SELECTOR_PROXY_NAME)) {
IRemoteResourceSelectorProxy remoteSelector = null;
try {
Object obj = configurationElement.createExecutableExtension(EXT_ATTR_CLASS);
if (obj instanceof IRemoteResourceSelectorProxy) {
remoteSelector = (IRemoteResourceSelectorProxy) obj;
}
} catch (CoreException e) {
ProfileLaunchPlugin.log(IStatus.ERROR, ResourceSelectorWidgetMessages.FileSystemSelectionArea_exception_while_creating_runnable_class + configurationElement.getAttribute(EXT_ATTR_CLASS), e);
}
FileSystemElement element = new FileSystemElement(configurationElement.getAttribute(SCHEME_ID), configurationElement.getAttribute(SCHEME_LABEL_ID), Boolean.valueOf(configurationElement.getAttribute(IS_DEFAULT_ID)), remoteSelector);
fsElements.addLast(element);
}
}
}
return fsElements.toArray(new FileSystemElement[fsElements.size()]);
}
use of org.eclipse.core.runtime.IConfigurationElement in project linuxtools by eclipse.
the class ValgrindLaunchPlugin method getToolDelegate.
public IValgrindLaunchDelegate getToolDelegate(String id) throws CoreException {
IValgrindLaunchDelegate delegate = null;
IConfigurationElement config = getToolMap().get(id);
if (config != null) {
Object obj = config.createExecutableExtension(EXT_ATTR_DELEGATE);
if (obj instanceof IValgrindLaunchDelegate) {
delegate = (IValgrindLaunchDelegate) obj;
}
}
if (delegate == null) {
// $NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, Messages.getString("ValgrindLaunchPlugin.Cannot_retrieve_delegate")));
}
return delegate;
}
use of org.eclipse.core.runtime.IConfigurationElement in project linuxtools by eclipse.
the class ValgrindUIPlugin method getToolView.
/**
* Returns the view specialized of a tool.
*
* @param id The valgrind view identifier
* @return IValgrindToolView The valgrind view
* @throws CoreException The view cannot be retrieved
*/
public IValgrindToolView getToolView(String id) throws CoreException {
IValgrindToolView view = null;
IConfigurationElement config = getToolMap().get(id);
if (config != null) {
Object obj = config.createExecutableExtension(EXT_ATTR_CLASS);
if (obj instanceof IValgrindToolView) {
view = (IValgrindToolView) obj;
}
}
if (view == null) {
// $NON-NLS-1$
throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, Messages.getString("ValgrindUIPlugin.Cannot_retrieve_view")));
}
return view;
}
Aggregations