use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class LinuxtoolsPathPropertyPage method fillPaths.
private String[][] fillPaths() {
LinkedList<String[]> list = new LinkedList<>();
for (String[] t : DEFAULT_PATHS) {
list.add(t);
}
IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LaunchCoreConstants.PLUGIN_ID, LINUXTOOLS_PATH_EXT_POINT);
IConfigurationElement[] configs = extPoint.getConfigurationElements();
for (IConfigurationElement config : configs) if (config.getName().equals(LINUXTOOLS_PATH_OPTION)) {
String path = config.getAttribute(LINUXTOOLS_PATH_OPTION_PATH);
String name = config.getAttribute(LINUXTOOLS_PATH_OPTION_NAME);
list.add(new String[] { name, path });
}
return list.toArray(new String[0][0]);
}
use of org.eclipse.core.runtime.IExtensionPoint in project linuxtools by eclipse.
the class ChangeLogDocumentSetupParticipant method setup.
@Override
public void setup(IDocument document) {
IExtensionPoint editorExtensions = null;
IEditorChangeLogContrib editorContrib = null;
// get editor which is stored in preference.
IPreferenceStore store = ChangelogPlugin.getDefault().getPreferenceStore();
String pref_Editor = store.getString(// $NON-NLS-1$
"IChangeLogConstants.DEFAULT_EDITOR");
editorExtensions = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.linuxtools.changelog.core", // $NON-NLS-1$ //$NON-NLS-2$
"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 {
// If editor has a special setup routine, use it.
IConfigurationElement bob = elements[i];
editorContrib = (IEditorChangeLogContrib) bob.createExecutableExtension(// $NON-NLS-1$
"class");
editorContrib.setup(document);
} catch (CoreException e) {
ChangelogPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, ChangelogPlugin.PLUGIN_ID, IStatus.ERROR, e.getMessage(), e));
}
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project knime-core by knime.
the class MissingCellHandlerFactoryManager method registerExtensionPoints.
/**
* Registers all extension point implementations.
* @param extPointId id of the extension point
* @param extPointAttrDf attribute of the factory class within the handler extension point
*/
protected void registerExtensionPoints(final String extPointId, final String extPointAttrDf) {
try {
final IExtensionRegistry registry = Platform.getExtensionRegistry();
final IExtensionPoint point = registry.getExtensionPoint(extPointId);
if (point == null) {
LOGGER.error("Invalid extension point: " + extPointId);
throw new IllegalStateException("ACTIVATION ERROR: " + " --> Invalid extension point: " + extPointId);
}
for (final IConfigurationElement elem : point.getConfigurationElements()) {
final String operator = elem.getAttribute(extPointAttrDf);
final String decl = elem.getDeclaringExtension().getUniqueIdentifier();
if ((operator == null) || operator.isEmpty()) {
LOGGER.error("The extension '" + decl + "' doesn't provide the required attribute '" + extPointAttrDf + "'");
LOGGER.error("Extension " + decl + " ignored.");
continue;
}
try {
final MissingCellHandlerFactory factory = (MissingCellHandlerFactory) elem.createExecutableExtension(extPointAttrDf);
addMissingCellHandlerFactory(factory);
} catch (final Exception t) {
LOGGER.error("Problems during initialization of missing value handler factory (with id '" + operator + "'.)");
if (decl != null) {
LOGGER.error("Extension " + decl + " ignored.", t);
}
}
}
} catch (final Exception e) {
LOGGER.error("Exception while registering MissingCellHandler extensions");
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project vorto by eclipse.
the class ModelParserFactory method getModelParser.
public IModelParser getModelParser() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(IModelParser.EXTENSIONPOINT_ID);
IExtension[] modelParserExtensions = extensionPoint.getExtensions();
if (modelParserExtensions.length == 0) {
throw new RuntimeException("No Vorto Model Parser found!");
} else if (modelParserExtensions.length > 1) {
throw new RuntimeException("More than 1 Vorto Model Parser found. Cannot decide which one to bind. ");
}
try {
return (IModelParser) modelParserExtensions[0].getConfigurationElements()[0].createExecutableExtension("class");
} catch (Exception e) {
throw new RuntimeException("Problem binding Vorto Model Parser", e);
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class OperationsPlugin method retrieveAlgorithmsManager.
/**
* Retrieves the algorithms manager. The extension registry is used to fetch the specific contributor of the
* <i>org.jcryptool.core.operations</i> plug-in.
*
* @return null if there is no specific manager found and an object of AbstractOperationsManager if a manager is
* found
*/
private static AbstractOperationsManager retrieveAlgorithmsManager() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
// $NON-NLS-1$
IExtensionPoint extensionPoint = registry.getExtensionPoint(PLUGIN_ID, "operationsManager");
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
if (// $NON-NLS-1$
"org.jcryptool.core.operations.algorithm.AlgorithmRegistry".equals(extensions[i].getUniqueIdentifier())) {
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
IConfigurationElement element = configElements[j];
if ("manager".equals(element.getName())) {
// $NON-NLS-1$
try {
AbstractOperationsManager manager = (AbstractOperationsManager) element.createExecutableExtension(IOperationsConstants.ATT_CLASS);
return manager;
} catch (CoreException ex) {
LogUtil.logError(PLUGIN_ID, ex);
}
}
}
}
}
return null;
}
Aggregations