use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class AlphabetsManager method loadAlphabetPlugin.
/**
* Loads the alphabets Plug-in
*
* @return An instance of the loaded <i>AbstractAlphabetStore</i>
*/
private void loadAlphabetPlugin() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(OperationsPlugin.PLUGIN_ID, IOperationsConstants.PL_ALPHABETS);
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
if (extensions[i].getNamespaceIdentifier().equals("org.jcryptool.crypto.classic.alphabets")) {
// $NON-NLS-1$
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
if (configElements[j].getName().equals(IOperationsConstants.PL_ALPHABETS)) {
try {
store = (AbstractAlphabetStore) configElements[j].createExecutableExtension(IOperationsConstants.ATT_CLASS);
} catch (CoreException e) {
LogUtil.logError(OperationsPlugin.PLUGIN_ID, "Exception while loading the AlphabetStore", e, // $NON-NLS-1$
true);
}
}
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class NewOperationManager method loadExtensions.
private static void loadExtensions() {
// $NON-NLS-1$
LogUtil.logInfo("loading extensions");
// $NON-NLS-1$
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(FlexiProviderAlgorithmsPlugin.PLUGIN_ID, "newOperation");
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement configElement : configElements) {
try {
// $NON-NLS-1$
INewOperationListener newListener = (INewOperationListener) configElement.createExecutableExtension("listenerClass");
listeners.add(newListener);
} catch (CoreException e) {
// $NON-NLS-1$
LogUtil.logError(FlexiProviderAlgorithmsPlugin.PLUGIN_ID, "CoreException while creating a new INewOperationListener", e, false);
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class ProviderManager2 method loadProviders.
private void loadProviders() {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(OperationsPlugin.PLUGIN_ID, IOperationsConstants.PL_PROVIDERS2);
if (extensionPoint == null) {
LogUtil.logError(OperationsPlugin.PLUGIN_ID, "extension point " + IOperationsConstants.PL_PROVIDERS2 + " not available", new NullPointerException(), // $NON-NLS-1$ //$NON-NLS-2$
true);
return;
}
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
try {
String[] attribs = configElements[j].getAttributeNames();
for (int k = 0; k < attribs.length; k++) {
// $NON-NLS-1$
LogUtil.logInfo("attribName: " + attribs[k]);
}
AbstractProviderController controller = (AbstractProviderController) configElements[j].createExecutableExtension(// $NON-NLS-1$
"providerController");
addProviders(controller.addProviders());
} catch (CoreException e) {
// $NON-NLS-1$
LogUtil.logError(// $NON-NLS-1$
OperationsPlugin.PLUGIN_ID, // $NON-NLS-1$
"CoreException while accessing a provider controller", e, false);
}
}
}
// $NON-NLS-1$
LogUtil.logInfo("activated providers:");
Iterator<String> it = availableProviders.iterator();
while (it.hasNext()) {
LogUtil.logInfo(it.next());
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class ProvidersManager method loadPluginProviders.
/**
* Loads the meta information about providers provided by plug-ins.
*/
private void loadPluginProviders() {
// $NON-NLS-1$
LogUtil.logInfo("Loading Providers provided by a plug-in");
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(OperationsPlugin.PLUGIN_ID, IOperationsConstants.PL_PROVIDERS);
IExtension[] extensions = extensionPoint.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
for (int j = 0; j < configElements.length; j++) {
String name = configElements[j].getAttribute(IOperationsConstants.ATT_PROVIDER_NAME);
String info = configElements[j].getAttribute(IOperationsConstants.ATT_PROVIDER_INFO);
ProviderDescriptor installedProvider = new ProviderDescriptor(extensions[i].getUniqueIdentifier(), name, info);
availableProviders.put(name, installedProvider);
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class CommandFactory method loadExtensions.
public static List<Command> loadExtensions() {
// TODO: load aliases as single, own commands, but mark them as aliases
IExtensionRegistry registry = Platform.getExtensionRegistry();
// $NON-NLS-1$
IExtensionPoint extensionPoint = registry.getExtensionPoint("org.jcryptool.commands.core.commands");
IConfigurationElement[] points = extensionPoint.getConfigurationElements();
List<Command> commands = new LinkedList<Command>();
for (IConfigurationElement point : points) {
if (isExtendedCommand(point)) {
ProxiedExtendedCommand cmdMainObj = new ProxiedExtendedCommand(point, false);
commands.add(cmdMainObj);
// Add "duplicate" command objects to the pool which are marked as aliases
for (String alias : cmdMainObj.getAliases()) {
ProxiedExtendedCommand aliasObj = new ProxiedExtendedCommand(point, true);
aliasObj.setCommandName(alias);
commands.add(aliasObj);
}
} else {
commands.add(new ProxiedCommand(point));
}
}
return commands;
}
Aggregations