use of org.eclipse.core.runtime.IExtensionPoint 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.IExtensionPoint in project translationstudio8 by heartsome.
the class SelfHelpDisplay method createHelpDisplay.
private static void createHelpDisplay() {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(HELP_DISPLAY_EXTENSION_ID);
if (point != null) {
IExtension[] extensions = point.getExtensions();
if (extensions.length != 0) {
// We need to pick up the non-default configuration
IConfigurationElement[] elements = extensions[0].getConfigurationElements();
if (elements.length == 0)
return;
IConfigurationElement displayElement = elements[0];
// Instantiate the help display
try {
helpDisplay = (AbstractHelpDisplay) (displayElement.createExecutableExtension(HELP_DISPLAY_CLASS_ATTRIBUTE));
} catch (CoreException e) {
HelpBasePlugin.logStatus(e.getStatus());
}
}
}
}
use of org.eclipse.core.runtime.IExtensionPoint 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.IExtensionPoint 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.IExtensionPoint in project tdi-studio-se by Talend.
the class AbstractMultiPageTalendEditor method createPage2.
// create jobscript editor
protected void createPage2() {
if (!GlobalServiceRegister.getDefault().isServiceRegistered(ICreateXtextProcessService.class)) {
return;
}
String scriptValue = "";
try {
IProject currentProject = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
String jobScriptVersion = "";
if (getEditorInput() != null && getEditorInput() instanceof RepositoryEditorInput) {
Item item = ((RepositoryEditorInput) getEditorInput()).getItem();
if (item != null) {
Property property = item.getProperty();
if (property != null) {
jobScriptVersion = "_" + property.getVersion();
}
}
}
IFile file = currentProject.getFolder("temp").getFile(getEditorInput().getName() + jobScriptVersion + "_job" + ".jobscript");
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(scriptValue.getBytes());
if (file.exists()) {
file.delete(true, null);
file.create(byteArrayInputStream, true, null);
file.setContents(byteArrayInputStream, 0, null);
} else {
file.create(byteArrayInputStream, true, null);
}
String pointId = "org.talend.metalanguage.jobscript.JobScriptForMultipage";
// the way to get the xtextEditor programmly
IEditorInput editorInput = new FileEditorInput(file);
IExtensionPoint ep = RegistryFactory.getRegistry().getExtensionPoint("org.eclipse.ui.editors");
IExtension[] extensions = ep.getExtensions();
IExtension ex;
IConfigurationElement confElem = null;
for (IExtension extension : extensions) {
ex = extension;
if (ex.getContributor().getName().equals("org.talend.metalanguage.jobscript.ui")) {
for (IConfigurationElement c : ex.getConfigurationElements()) {
if (c.getName().equals("editor") && c.getAttribute("id").equals(pointId)) {
confElem = c;
break;
}
}
}
}
if (confElem != null) {
jobletEditor = (AbstractDecoratedTextEditor) confElem.createExecutableExtension("class");
if (jobletEditor != null) {
int index = addPage(jobletEditor, editorInput);
setPageText(index, "Jobscript");
}
}
} catch (PartInitException e) {
ExceptionHandler.process(e);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
Aggregations