Search in sources :

Example 1 with ILaunchShortcut2

use of org.eclipse.debug.ui.ILaunchShortcut2 in project linuxtools by eclipse.

the class CApplicationLaunchShortcut method getProxy.

private ILaunchShortcut2 getProxy() {
    if (proxy == null) {
        // Get a proxy to CDT's CApplicationLaunchShortcut class which is internal
        // This plug-in has a dependency on org.eclipe.cdt.debug.ui so this extension is expected to be found.
        IExtensionPoint extPoint = // $NON-NLS-1$
        Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.debug.ui.launchShortcuts");
        IConfigurationElement[] configs = extPoint.getConfigurationElements();
        for (IConfigurationElement config : configs) {
            Object obj = null;
            if (config.getName().equals("shortcut")) {
                // $NON-NLS-1$
                // $NON-NLS-1$
                String id = config.getAttribute("id");
                if (id.equals(CDT_LAUNCH_SHORTCUT_ID)) {
                    try {
                        // $NON-NLS-1$
                        obj = config.createExecutableExtension("class");
                    } catch (CoreException e) {
                        ProfileLaunchPlugin.log(e);
                    }
                    if (obj instanceof ILaunchShortcut2) {
                        proxy = (ILaunchShortcut2) obj;
                        break;
                    }
                }
            }
            if (proxy != null)
                break;
        }
    }
    return proxy;
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) CoreException(org.eclipse.core.runtime.CoreException) ILaunchShortcut2(org.eclipse.debug.ui.ILaunchShortcut2) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 ILaunchShortcut2 (org.eclipse.debug.ui.ILaunchShortcut2)1