use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class TalendPaletteSearchIndex method getTalendDocPlugins.
protected PluginVersionInfo getTalendDocPlugins() {
Set<String> totalIds = new HashSet<String>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry.getExtensionPoint(TocFileProvider.EXTENSION_POINT_ID_TOC);
IExtension[] extensions = extensionPoint.getExtensions();
for (IExtension extension : extensions) {
try {
totalIds.add(extension.getNamespaceIdentifier());
} catch (InvalidRegistryObjectException e) {
// ignore this extension and move on
}
}
Collection<String> additionalPluginIds = BaseHelpSystem.getLocalSearchManager().getPluginsWithSearchParticipants();
totalIds.addAll(additionalPluginIds);
Iterator<String> idIter = totalIds.iterator();
while (idIter.hasNext()) {
String id = idIter.next();
if (!id.startsWith("org.talend.")) {
idIter.remove();
}
}
return new PluginVersionInfo(INDEXED_CONTRIBUTION_INFO_FILE, totalIds, indexDir, !exists());
}
use of org.eclipse.core.runtime.IExtensionRegistry in project tdi-studio-se by Talend.
the class SchemaNode method addExtensionNodes.
/**
* Add Extension nodes.
*/
//$NON-NLS-1$
@SuppressWarnings("unchecked")
private void addExtensionNodes() {
String databaseProductName = getSession().getRoot().getDatabaseProductName().toLowerCase().trim();
IExtensionRegistry registry = Platform.getExtensionRegistry();
//$NON-NLS-1$ //$NON-NLS-2$
IExtensionPoint point = registry.getExtensionPoint("net.sourceforge.sqlexplorer", "node");
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 {
// include only nodes that are attachted to the schema
// node..
//$NON-NLS-1$
String parent = ces[j].getAttribute("parent-node");
if (parent.indexOf("schema") == -1) {
//$NON-NLS-1$
continue;
}
boolean isValidProduct = false;
//$NON-NLS-1$ //$NON-NLS-2$
String[] validProducts = ces[j].getAttribute("database-product-name").split(",");
// include only nodes valid for this database
for (int k = 0; k < validProducts.length; k++) {
String product = validProducts[k].toLowerCase().trim();
if (product.length() == 0) {
continue;
}
if (product.equals("*")) {
//$NON-NLS-1$
isValidProduct = true;
break;
}
//$NON-NLS-1$
String regex = TextUtil.replaceChar(product, '*', ".*");
if (databaseProductName.matches(regex)) {
isValidProduct = true;
break;
}
}
if (!isValidProduct) {
continue;
}
//$NON-NLS-1$
String imagePath = ces[j].getAttribute("icon");
//$NON-NLS-1$
String id = ces[j].getAttribute("id");
//$NON-NLS-1$
String type = ces[j].getAttribute("table-type").trim();
//$NON-NLS-1$
AbstractNode childNode = (AbstractNode) ces[j].createExecutableExtension("class");
childNode.setParent(this);
childNode.setSession(psessionNode);
childNode.setType(type);
String fragmentId = id.substring(0, id.indexOf('.', END_INDEX));
if (imagePath != null && imagePath.trim().length() != 0) {
childNode.setImage(ImageUtil.getFragmentImage(fragmentId, imagePath));
}
pchildNames.add(childNode.getLabelText());
if (!isExcludedByFilter(childNode.getLabelText())) {
addChildNode(childNode);
}
} catch (Throwable ex) {
//$NON-NLS-1$
SqlBuilderPlugin.log(Messages.getString("SchemaNode.logMessage1"), ex);
}
}
}
}
use of org.eclipse.core.runtime.IExtensionRegistry in project cubrid-manager by CUBRID.
the class QueryEditorToolBar method loadDbNavigatorMenu.
/**
*
* Load the database selection pop-up menu from extension points
*
*/
private void loadDbNavigatorMenu() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extension = registry.getExtensionPoint(CommonUIPlugin.PLUGIN_ID + "." + QUERY_POPUP_MENUS_EXTENSION_POINT);
if (extension == null) {
dbMenu = null;
} else {
IConfigurationElement[] configElements = extension.getConfigurationElements();
for (IConfigurationElement ce : configElements) {
try {
dbMenu = (DatabaseNavigatorMenu) ce.createExecutableExtension("class");
} catch (CoreException e) {
dbMenu = null;
}
}
}
if (dbMenu == null) {
dbMenu = new DatabaseNavigatorMenu();
}
}
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);
}
}
}
}
}
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;
}
Aggregations