use of org.eclipse.core.runtime.IExtensionRegistry in project tesb-studio-se by Talend.
the class ESBService method addExtensionRepositoryNodes.
private void addExtensionRepositoryNodes(List<ERepositoryObjectType> arraysList) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IConfigurationElement[] configurationElements = registry.getConfigurationElementsFor("org.talend.core.repository.repository_node_provider");
for (IConfigurationElement element : configurationElements) {
String type = element.getAttribute("type");
ERepositoryObjectType repositoryNodeType = ERepositoryObjectType.valueOf(ERepositoryObjectType.class, type);
if (repositoryNodeType != null) {
arraysList.add(repositoryNodeType);
}
}
}
use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class DataSetTableActionGroup method fillContextMenu.
/**
* Fill the context menu with all the correct actions.
* @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
public void fillContextMenu(IMenuManager menu) {
IExtensionRegistry registry = Platform.getExtensionRegistry();
//$NON-NLS-1$ //$NON-NLS-2$
IExtensionPoint point = registry.getExtensionPoint("net.sourceforge.sqlexplorer", "dataSetTableContextAction");
IExtension[] extensions = point.getExtensions();
for (int i = 0; i < extensions.length; i++) {
IExtension e = extensions[i];
IConfigurationElement[] ces = e.getConfigurationElements();
for (int j = 0; j < ces.length; j++) {
try {
//$NON-NLS-1$
String group = ces[j].getAttribute("group");
if (group == null || !group.equalsIgnoreCase("export")) {
//$NON-NLS-1$
// check if the action thinks it is suitable..
AbstractDataSetTableContextAction action = (AbstractDataSetTableContextAction) ces[j].createExecutableExtension(//$NON-NLS-1$
"class");
action.setTable(ptable);
action.setTableCursor(pcursor);
if (action.isAvailable()) {
menu.add(action);
}
}
} catch (Throwable ex) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("DataSetTableActionGroup.logMessage1"), ex);
}
}
}
menu.add(new Separator());
// add export options
//$NON-NLS-1$
MenuManager subMenu = new MenuManager(Messages.getString("DataSetTable.Actions.ExportSubMenu"));
for (int i = 0; i < extensions.length; i++) {
IExtension e = extensions[i];
IConfigurationElement[] ces = e.getConfigurationElements();
for (int j = 0; j < ces.length; j++) {
try {
//$NON-NLS-1$
String group = ces[j].getAttribute("group");
if (group != null && group.equalsIgnoreCase("export")) {
//$NON-NLS-1$
// check if the action thinks it is suitable..
AbstractDataSetTableContextAction action = (AbstractDataSetTableContextAction) ces[j].createExecutableExtension(//$NON-NLS-1$
"class");
action.setTable(ptable);
action.setTableCursor(pcursor);
if (action.isAvailable()) {
subMenu.add(action);
}
}
} catch (Throwable ex) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("DataSetTableActionGroup.logMessage1"), ex);
}
}
}
menu.add(subMenu);
menu.add(new Separator());
menu.add(pcopyTableAction);
}
use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class AfterImportProjectUtil method getAfterImportProjectActions.
public static List<IAfterImportProjectAction> getAfterImportProjectActions() {
try {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IConfigurationElement[] configurationElements = registry.getConfigurationElementsFor(EXTENSION_POINT);
List<IAfterImportProjectAction> models = new ArrayList<IAfterImportProjectAction>();
for (int i = 0; i < configurationElements.length; i++) {
IConfigurationElement element = configurationElements[i];
IAfterImportProjectAction modelcalss = (IAfterImportProjectAction) element.createExecutableExtension(CLASS);
models.add(modelcalss);
}
return models;
} catch (Exception e) {
log.error(e.getMessage(), e);
}
return new ArrayList<IAfterImportProjectAction>();
}
use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class CheckNodeManager method getCheckNodesService.
public static List<ICheckNodesService> getCheckNodesService() {
if (checkNodeServices == null) {
checkNodeServices = new ArrayList<ICheckNodesService>();
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
//$NON-NLS-1$
IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint("org.talend.designer.core.check_nodes");
if (extensionPoint != null) {
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configurationElements = extension.getConfigurationElements();
for (IConfigurationElement configurationElement : configurationElements) {
try {
//$NON-NLS-1$
Object service = configurationElement.createExecutableExtension("class");
if (service instanceof ICheckNodesService) {
checkNodeServices.add((ICheckNodesService) service);
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
}
}
return checkNodeServices;
}
use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class ComponentsProviderManager method loadComponentsProvidersFromExtension.
private void loadComponentsProvidersFromExtension() {
if (providers == null) {
providers = new ArrayList<AbstractComponentsProvider>();
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
//$NON-NLS-1$
IExtensionPoint extensionPoint = extensionRegistry.getExtensionPoint("org.talend.core.components_provider");
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
IConfigurationElement[] configurationElements = extension.getConfigurationElements();
for (IConfigurationElement configurationElement : configurationElements) {
//$NON-NLS-1$
String id = configurationElement.getAttribute("id");
//$NON-NLS-1$
String folderName = configurationElement.getAttribute("folderName");
String contributerName = configurationElement.getContributor().getName();
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (!brandingService.isPoweredOnlyCamel() && id.equals("org.talend.designer.camel.components.localprovider.CamelLocalComponentsProvider")) {
folderName = "camel";
}
try {
AbstractComponentsProvider componentsProvider = (AbstractComponentsProvider) configurationElement.createExecutableExtension(//$NON-NLS-1$
"class");
componentsProvider.setId(id);
componentsProvider.setFolderName(folderName);
componentsProvider.setContributer(contributerName);
providers.add(componentsProvider);
} catch (CoreException e) {
//$NON-NLS-1$
log.error("unable to load component provider" + id, e);
}
}
}
}
}
Aggregations