use of org.eclipse.core.runtime.IExtensionPoint in project webtools.sourceediting by eclipse.
the class RegistryReader method readRegistry.
/**
* Start the registry reading process using the supplied plugin ID and
* extension point.
*/
protected void readRegistry(IExtensionRegistry registry, String pluginId, String extensionPoint) {
IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
if (point != null) {
IExtension[] extensions = point.getExtensions();
extensions = orderExtensions(extensions);
for (int i = 0; i < extensions.length; i++) readExtension(extensions[i]);
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project eclipse-integration-commons by spring-projects.
the class DashboardMainPage method createNewProjectsSection.
private void createNewProjectsSection(Composite parent) {
Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
section.setText("Create");
GridDataFactory.fillDefaults().grab(false, false).applyTo(section);
section.setLayout(new GridLayout());
final Composite headerComposite = toolkit.createComposite(section, SWT.NONE);
RowLayout rowLayout = new RowLayout();
rowLayout.marginTop = 0;
rowLayout.marginBottom = 0;
headerComposite.setLayout(rowLayout);
headerComposite.setBackground(null);
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
toolBarManager.createControl(headerComposite);
section.setTextClient(headerComposite);
toolBarManager.add(new NewWizardAction(getSite().getWorkbenchWindow()));
toolBarManager.update(true);
Composite container = toolkit.createComposite(section);
container.setLayout(new GridLayout(2, false));
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_ID_NEW_WIZARD);
IExtension[] extensions = extensionPoint.getExtensions();
IConfigurationElement[] foundElements = new IConfigurationElement[6];
String[] ids = new String[] { JAVA_WIZARD_ID, SPRING_WIZARD_ID, ROO_WIZARD_ID, GROOVY_WIZARD_ID, GRAILS_WIZARD_ID };
for (IExtension extension : extensions) {
IConfigurationElement[] elements = extension.getConfigurationElements();
for (IConfigurationElement element : elements) {
String id = element.getAttribute("id");
for (int i = 0; i < ids.length; i++) {
if (ids[i].equals(id) && element.getAttribute(ELEMENT_CLASS) != null && element.getAttribute(ELEMENT_NAME) != null && element.getAttribute(ELEMENT_ICON) != null) {
foundElements[i] = element;
}
}
}
}
for (IConfigurationElement element : foundElements) {
createNewProjectFromExtension(container, element);
}
section.setClient(container);
}
use of org.eclipse.core.runtime.IExtensionPoint in project webtools.sourceediting by eclipse.
the class JsTranslationAdapter method getJsTranslation.
/**
* Returns the IJsTranslation for this adapter.
*
* @return a IJsTranslation
*/
public IJsTranslation getJsTranslation(boolean listenForChanges) {
/*
* If no translation exists or switching from not listening to
* listening
*/
if (fJSTranslation == null || (!this.listenForChanges && listenForChanges)) {
if (fJSTranslation != null)
fJSTranslation.release();
if (fTranslationAsFactory == null) {
/* load the translation factory from the extension point */
try {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint("org.eclipse.wst.jsdt.web.core.javascriptPreProcessor");
IConfigurationElement[] points = extensionPoint.getConfigurationElements();
int highestPriorityValue = -1;
int highestPriorityIndex = -1;
for (int i = 0; i < points.length; i++) {
String priority = points[i].getAttribute(PRIORITY_ATTRIB);
int value = Integer.parseInt(priority);
if (value > highestPriorityValue) {
highestPriorityIndex = i;
highestPriorityValue = value;
}
}
fTranslationAsFactory = (IJsTranslation) points[highestPriorityIndex].createExecutableExtension("class");
} catch (Exception e) {
Logger.logException(e);
}
}
if (fTranslationAsFactory != null) {
fJSTranslation = fTranslationAsFactory.getInstance(fHtmlDocument, getJavaProject(), listenForChanges);
} else {
fJSTranslation = new JsTranslation(fHtmlDocument, getJavaProject(), listenForChanges);
}
this.listenForChanges = listenForChanges;
}
shouldListenForChanges(listenForChanges);
return fJSTranslation;
}
use of org.eclipse.core.runtime.IExtensionPoint in project eclipse-integration-commons by spring-projects.
the class StartupExtensionPointReader method runStartupExtensions.
public static void runStartupExtensions() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_ID_STARTUP);
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] elements = extension.getConfigurationElements();
for (IConfigurationElement element : elements) {
if (element.getName().compareTo(ELEMENT_STARTUP) == 0) {
runStartupExtension(element);
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project webtools.sourceediting by eclipse.
the class FileTaskScannerRegistryReader method readRegistry.
private void readRegistry() {
fScannerInfos = new HashMap();
// Just remember the elements, so plugins don't have to be activated,
// unless extension attributes match those of interest
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(SCANNER_EXTENSION_POINT_ID);
if (point != null) {
fScannerElements = point.getConfigurationElements();
}
}
Aggregations