use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class ChangeLogPreferencesPage method populateEditorList.
private void populateEditorList(IPreferenceStore store) {
IExtensionPoint editorExtensions = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.linuxtools.changelog.core", // $NON-NLS-1$ //$NON-NLS-2$
"editorContribution");
if (editorExtensions != null) {
IConfigurationElement[] elements = editorExtensions.getConfigurationElements();
for (IConfigurationElement element : elements) {
if (element.getName().equals("editor")) {
// $NON-NLS-1$
// $NON-NLS-1$
String fname = element.getAttribute("name");
editorList.add(fname);
if (fname.equals(store.getString("IChangeLogConstants.DEFAULT_EDITOR"))) {
// $NON-NLS-1$
editorList.setSelection(editorList.getItemCount() - 1);
}
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class GprofLaunchTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest");
ProjectScope ps = new ProjectScope(proj.getProject());
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, ProviderProfileConstants.PLUGIN_ID);
scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
scoped.setValue(ProviderProfileConstants.PREFS_KEY + GPROF_CATEGORY, GPROF_PROVIDER_ID);
scoped.setValue(ProviderProfileConstants.USE_PROJECT_SETTINGS + GPROF_CATEGORY, true);
scoped.save();
IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LAUNCH_SHORT_EXTPT);
IConfigurationElement[] configs = extPoint.getConfigurationElements();
for (IConfigurationElement cfg : configs) {
if (cfg.getAttribute("id").equals(ID)) {
// $NON-NLS-1$
try {
// $NON-NLS-1$
shortcut = (ProviderLaunchShortcut) cfg.createExecutableExtension("class");
// $NON-NLS-1$
launchConfigTypeId = cfg.getChildren("class")[0].getChildren("parameter")[1].getAttribute("value");
} catch (Exception e) {
fail(e.getMessage());
}
}
}
config = createConfiguration(proj.getProject());
// (otherwise test hangs on 'enable GGprof support' dialogue. )
enableGprofSupport();
// ---- Continue with launch.
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
}
use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class GprofShortcutTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest2");
ProjectScope ps = new ProjectScope(proj.getProject());
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, ProviderProfileConstants.PLUGIN_ID);
scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
scoped.setValue(ProviderProfileConstants.PREFS_KEY + GPROF_CATEGORY, GPROF_PROVIDER_ID);
scoped.setValue(ProviderProfileConstants.USE_PROJECT_SETTINGS + GPROF_CATEGORY, true);
scoped.save();
IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LAUNCH_SHORT_EXTPT);
IConfigurationElement[] configs = extPoint.getConfigurationElements();
for (IConfigurationElement cfg : configs) {
if (cfg.getAttribute("id").equals(ID)) {
// $NON-NLS-1$
try {
// $NON-NLS-1$
shortcut = (ProviderLaunchShortcut) cfg.createExecutableExtension("class");
// $NON-NLS-1$
launchConfigTypeId = cfg.getChildren("class")[0].getChildren("parameter")[1].getAttribute("value");
} catch (Exception e) {
fail(e.getMessage());
}
}
}
config = createConfiguration(proj.getProject());
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
}
use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class ChangeLogEditor method getConfig.
/**
* Gets appropriate style editor from user pref.
*
* @return configuration for the Changelog editor
*/
private SourceViewerConfiguration getConfig() {
IExtensionPoint editorExtensions = null;
IEditorChangeLogContrib editorContrib = null;
// get editor which is stored in preference.
IPreferenceStore store = ChangelogPlugin.getDefault().getPreferenceStore();
// $NON-NLS-1$
String pref_Editor = store.getString("IChangeLogConstants.DEFAULT_EDITOR");
editorExtensions = // $NON-NLS-1$
Platform.getExtensionRegistry().getExtensionPoint(// $NON-NLS-1$
"org.eclipse.linuxtools.changelog.core", // $NON-NLS-1$
"editorContribution");
if (editorExtensions != null) {
IConfigurationElement[] elements = editorExtensions.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
if (// $NON-NLS-1$
elements[i].getName().equals("editor") && (elements[i].getAttribute("name").equals(pref_Editor))) {
try {
IConfigurationElement bob = elements[i];
// $NON-NLS-1$
editorContrib = (IEditorChangeLogContrib) bob.createExecutableExtension("class");
return (SourceViewerConfiguration) editorContrib;
} catch (CoreException e) {
ChangelogPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, ChangelogPlugin.PLUGIN_ID, IStatus.ERROR, e.getMessage(), e));
}
}
}
}
return null;
}
use of org.eclipse.core.runtime.IExtensionPoint 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;
}
Aggregations