use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class ShowEditorsPulldownMenuAction method run.
/**
* Rhe implementation of the on click action.
*/
public void run(IAction action) {
// connects to the extension point
// $NON-NLS-1$
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.jcryptool.core.editorButton");
IExtension extension = point.getExtensions()[0];
IConfigurationElement element = extension.getConfigurationElements()[0];
final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
IEvaluationContext evaluationContext = handlerService.createContextSnapshot(true);
ExecutionEvent event = new ExecutionEvent(null, Collections.EMPTY_MAP, null, evaluationContext);
try {
// runs the defined action
// $NON-NLS-1$
IHandler handler = (IHandler) element.createExecutableExtension("OnClickClass");
handler.execute(event);
} catch (CoreException ex) {
LogUtil.logError(CorePlugin.PLUGIN_ID, ex);
} catch (ExecutionException ex) {
LogUtil.logError(CorePlugin.PLUGIN_ID, ex);
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class ViewProviderPaletteViewer method createTree.
/**
* Creates a tree from the extension point structure.
*
* @param needles the search string to filter the elements
*/
private void createTree(String[] needles) {
invisibleRoot = new PaletteRoot();
TreeMap<String, PaletteEntry> sortList = new TreeMap<String, PaletteEntry>();
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(extensionPointId);
// $NON-NLS-1$
String label = "";
if (extensionPoint.getLabel().equals("analysis")) {
// $NON-NLS-1$
label = AlgorithmView.MENU_TEXT_ANALYSIS;
} else if (extensionPoint.getLabel().equals("games")) {
// $NON-NLS-1$
label = AlgorithmView.MENU_TEXT_GAMES;
} else if (extensionPoint.getLabel().equals("visuals")) {
// $NON-NLS-1$
label = AlgorithmView.MENU_TEXT_VISUALS;
}
PaletteDrawer category = new PaletteDrawer(label);
category.setSmallIcon(ViewsPlugin.getImageDescriptor(TreeView.ICON_FOLDER));
category.setLargeIcon(ViewsPlugin.getImageDescriptor(TreeView.ICON_FOLDER));
invisibleRoot.add(category);
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (IConfigurationElement element : elements) {
// $NON-NLS-1$
String name = element.getAttribute("name");
// filter
boolean show = true;
for (String needle : needles) {
if (// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
!needle.equals("") && !name.toLowerCase().matches(".*" + needle.toLowerCase() + ".*"))
show = false;
}
if (show) {
SelectionToolEntry paletteEntry = new SelectionToolEntry(element.getAttribute("name"), // $NON-NLS-1$ //$NON-NLS-2$
"");
paletteEntry.setSmallIcon(ViewsPlugin.getImageDescriptor(TreeView.ICON_ITEM_JCT));
paletteEntry.setLargeIcon(ViewsPlugin.getImageDescriptor(TreeView.ICON_ITEM_JCT));
paletteEntry.setUserModificationPermission(PaletteEntry.PERMISSION_NO_MODIFICATION);
// $NON-NLS-1$
paletteEntry.setType("");
sortList.put(paletteEntry.getLabel(), paletteEntry);
}
}
// attach items to the category
for (PaletteEntry entry : sortList.values()) {
category.add(entry);
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project core by jcryptool.
the class CheckOperationManager method loadExtensions.
private static void loadExtensions() {
// $NON-NLS-1$
LogUtil.logInfo("loading extensions");
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(FlexiProviderOperationsPlugin.PLUGIN_ID, // $NON-NLS-1$
"checkFlexiProviderOperation");
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement configElement : configElements) {
try {
ICheckOperationListener newListener = (ICheckOperationListener) configElement.createExecutableExtension(// $NON-NLS-1$
"listenerClass");
listeners.add(newListener);
} catch (CoreException e) {
LogUtil.logError(FlexiProviderOperationsPlugin.PLUGIN_ID, "CoreException while creating a new ICheckOperationListener", e, // $NON-NLS-1$
false);
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project tmdm-studio-se by Talend.
the class RepositoryViewObjectResourceChangeManager method initListenerDefine.
private void initListenerDefine() {
listeners = new ArrayList<AbstractRepositoryResourceChangeListener>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
//
IExtensionPoint extensionPoint = registry.getExtensionPoint(RepositoryPlugin.PLUGIN_ID, EXTENSION_POINT_TEMPLATE);
if (extensionPoint != null && extensionPoint.isValid()) {
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension s : extensions) {
IConfigurationElement[] elements = s.getConfigurationElements();
for (IConfigurationElement element : elements) {
if (element.getAttribute(PROP_CLASS) != null) {
try {
AbstractRepositoryResourceChangeListener configuration = (AbstractRepositoryResourceChangeListener) element.createExecutableExtension(PROP_CLASS);
listeners.add(configuration);
} catch (CoreException e) {
log.error(e.getMessage(), e);
}
}
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint in project tmdm-studio-se by Talend.
the class RepositoryNodeConfigurationManager method initTemplateDefine.
private static void initTemplateDefine() {
if (!inited) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
//
IExtensionPoint extensionPoint = registry.getExtensionPoint(RepositoryPlugin.PLUGIN_ID, EXTENSION_POINT_TEMPLATE);
if (extensionPoint != null && extensionPoint.isValid()) {
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension s : extensions) {
IConfigurationElement[] elements = s.getConfigurationElements();
for (IConfigurationElement element : elements) {
if (element.getAttribute(PROP_CLASS) != null) {
try {
IRepositoryNodeConfiguration configuration = (IRepositoryNodeConfiguration) element.createExecutableExtension(PROP_CLASS);
configurations.add(configuration);
} catch (CoreException e) {
log.error(e.getMessage(), e);
}
}
}
}
// Bean2EObjUtil.getInstance().dumpMap();
}
inited = true;
}
}
Aggregations