Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-09-23 20:53:21 +0000
committerrelves2010-09-23 20:53:21 +0000
commit31eba7ce83c018f4d9d73eea88c93e0a0ff39b99 (patch)
tree738deb10cb6ac71eebb7e3570fd68fd6a4021c1a /org.eclipse.mylyn.oslc.ui
parentfed39ca89c4916ea68b2d1ff53e6864e6568aebf (diff)
downloadorg.eclipse.mylyn.tasks-31eba7ce83c018f4d9d73eea88c93e0a0ff39b99.tar.gz
org.eclipse.mylyn.tasks-31eba7ce83c018f4d9d73eea88c93e0a0ff39b99.tar.xz
org.eclipse.mylyn.tasks-31eba7ce83c018f4d9d73eea88c93e0a0ff39b99.zip
NEW - bug 324257: [oslc] fetching children of null appearing during service discovery
https://bugs.eclipse.org/bugs/show_bug.cgi?id=324257
Diffstat (limited to 'org.eclipse.mylyn.oslc.ui')
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java
index 7e78208b3..fff36ea63 100644
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java
+++ b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java
@@ -102,24 +102,26 @@ public class OslcServiceDiscoveryProvider implements ITreeContentProvider {
public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
try {
- monitor.beginTask("Loading...", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
- ServiceProviderCatalogWrapper wrapper = (ServiceProviderCatalogWrapper) object;
- Object parentElement = wrapper.getServiceObject();
- if (parentElement instanceof OslcServiceProviderCatalog) {
- OslcServiceProviderCatalog remoteFolder = (OslcServiceProviderCatalog) parentElement;
- List<OslcServiceProvider> providers = connector.getAvailableServices(repository,
- remoteFolder.getUrl(), monitor);
- for (OslcServiceProvider oslcServiceProvider : providers) {
- collector.add(new ServiceProviderCatalogWrapper(oslcServiceProvider), monitor);
- }
- } else if (parentElement instanceof OslcServiceProvider) {
- selectedPovider = (OslcServiceProvider) parentElement;
- OslcServiceDescriptor serviceDescriptor = connector.getServiceDescriptor(repository,
- selectedPovider, monitor);
- collector.add(new ServiceProviderCatalogWrapper(serviceDescriptor), monitor);
+ if (!monitor.isCanceled()) {
+ monitor.beginTask("Loading...", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ ServiceProviderCatalogWrapper wrapper = (ServiceProviderCatalogWrapper) object;
+ Object parentElement = wrapper.getServiceObject();
+ if (parentElement instanceof OslcServiceProviderCatalog) {
+ OslcServiceProviderCatalog remoteFolder = (OslcServiceProviderCatalog) parentElement;
+ List<OslcServiceProvider> providers = connector.getAvailableServices(repository,
+ remoteFolder.getUrl(), monitor);
+ for (OslcServiceProvider oslcServiceProvider : providers) {
+ collector.add(new ServiceProviderCatalogWrapper(oslcServiceProvider), monitor);
+ }
+ } else if (parentElement instanceof OslcServiceProvider) {
+ selectedPovider = (OslcServiceProvider) parentElement;
+ OslcServiceDescriptor serviceDescriptor = connector.getServiceDescriptor(repository,
+ selectedPovider, monitor);
+ collector.add(new ServiceProviderCatalogWrapper(serviceDescriptor), monitor);
// for (OslcCreationDialogDescriptor oslcRecordType : serviceDescriptor.getCreationDialogs()) {
// collector.add(new ServiceProviderCatalogWrapper(oslcRecordType), monitor);
// }
+ }
}
} catch (CoreException e) {
StatusHandler.log(new Status(IStatus.ERROR, IOslcCoreConstants.ID_PLUGIN,
@@ -147,7 +149,7 @@ public class OslcServiceDiscoveryProvider implements ITreeContentProvider {
}
public String getLabel(Object o) {
- return null;
+ return element.toString();
}
public Object getParent(Object o) {

Back to the top