Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceDescriptor.java7
-rw-r--r--org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceProvider.java6
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java34
3 files changed, 29 insertions, 18 deletions
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceDescriptor.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceDescriptor.java
index decbcf6b8..e03c5462e 100644
--- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceDescriptor.java
+++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceDescriptor.java
@@ -27,7 +27,7 @@ import org.eclipse.mylyn.internal.oslc.core.cm.Messages;
*/
public class OslcServiceDescriptor implements Serializable {
- private static final long serialVersionUID = -5981264972265788764L;
+ private static final long serialVersionUID = -3981264972265788764L;
private final Set<OslcCreationDialogDescriptor> creationDialogs;
@@ -210,4 +210,9 @@ public class OslcServiceDescriptor implements Serializable {
return true;
}
+ @Override
+ public String toString() {
+ return title;
+ }
+
}
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceProvider.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceProvider.java
index cebe10146..78969b2ed 100644
--- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceProvider.java
+++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/OslcServiceProvider.java
@@ -13,7 +13,6 @@ package org.eclipse.mylyn.internal.oslc.core;
/**
* @see http://open-services.net/bin/view/Main/OslcServiceProviderCatalogV1
- *
* @author Robert Elves
*/
public class OslcServiceProvider {
@@ -35,4 +34,9 @@ public class OslcServiceProvider {
return url;
}
+ @Override
+ public String toString() {
+ return name;
+ }
+
}
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