Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2013-12-18 18:08:15 +0000
committerSteffen Pingel2013-12-18 18:08:15 +0000
commita1d4132660b53b59fdf074cc7f8b04acaf705080 (patch)
tree65730834934e822a2830872a7c355b9ca7642f59 /org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal
parentb7eef8e0c8da174009283d5a2c7e2c518c21e9fd (diff)
downloadorg.eclipse.mylyn.tasks-a1d4132660b53b59fdf074cc7f8b04acaf705080.tar.gz
org.eclipse.mylyn.tasks-a1d4132660b53b59fdf074cc7f8b04acaf705080.tar.xz
org.eclipse.mylyn.tasks-a1d4132660b53b59fdf074cc7f8b04acaf705080.zip
421071: remove OSLC connector from Mylyn
Change-Id: I4ef36e5f4b7ee7fb1b5e6cdccce4d1fe9969f0b2 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=421071
Diffstat (limited to 'org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal')
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/Messages.java31
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcRepositorySettingsPage.java195
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java170
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizard.java64
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardDialog.java27
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardPage.java108
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java55
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/messages.properties14
8 files changed, 0 insertions, 664 deletions
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/Messages.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/Messages.java
deleted file mode 100644
index 6948af01b..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/Messages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2010 Tasktop Technologies.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Tasktop EULA
- * which accompanies this distribution, and is available at
- * http://tasktop.com/legal
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.oslc.ui.messages"; //$NON-NLS-1$
-
- public static String OslcRepositorySettingsPage_Enter_Base_Url_Above;
-
- public static String OslcServiceDiscoveryWizardPage_Browse_Available_Services_Below;
-
- public static String OslcServiceDiscoveryWizardPage_Serivce_Discovery;
-
- public static String OslcServiceLabelProvider_Loading;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcRepositorySettingsPage.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcRepositorySettingsPage.java
deleted file mode 100644
index 639482b6f..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcRepositorySettingsPage.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.window.Window;
-import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.oslc.core.IOslcConnector;
-import org.eclipse.mylyn.internal.oslc.core.IOslcCoreConstants;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProvider;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @author Robert Elves
- */
-public abstract class OslcRepositorySettingsPage extends AbstractRepositorySettingsPage {
-
- private OslcServiceDescriptor descriptor;
-
- protected Text baseText;
-
- public OslcRepositorySettingsPage(String name, String desc, TaskRepository taskRepository) {
- super(name, desc, taskRepository);
- setNeedsAnonymousLogin(false);
- setNeedsEncoding(false);
- setNeedsTimeZone(false);
- setNeedsHttpAuth(false);
- }
-
- public OslcServiceDescriptor getProvider() {
- return descriptor;
- }
-
- public void setServiceDescriptor(OslcServiceDescriptor descriptor) {
- this.descriptor = descriptor;
- }
-
- protected String getBaseUrl() {
- return baseText.getText();
- }
-
- @Override
- protected void createSettingControls(Composite parent) {
-
- Label baseUrlLabel = new Label(parent, SWT.NONE);
- baseUrlLabel.setText("Base URL:"); //$NON-NLS-1$
- baseText = new Text(parent, SWT.BORDER);
- if (repository != null) {
- String base = repository.getProperty(IOslcCoreConstants.OSLC_BASEURL);
- if (base != null) {
- baseText.setText(base);
- }
- }
- baseText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- serverUrlCombo.setText(baseText.getText());
- if (getWizard() != null) {
- getWizard().getContainer().updateButtons();
- }
- }
- });
-
- GridDataFactory.fillDefaults().hint(300, SWT.DEFAULT).span(2, 1).grab(true, false).applyTo(baseText);
-
- super.createSettingControls(parent);
- if (serverUrlCombo.getText().length() == 0) {
- serverUrlCombo.setText(Messages.OslcRepositorySettingsPage_Enter_Base_Url_Above);
- }
- serverUrlCombo.setEnabled(false);
- }
-
- @Override
- public abstract String getConnectorKind();
-
- @Override
- protected Validator getValidator(TaskRepository repository) {
- return new OslcValidator(createTaskRepository(), baseText.getText());
- }
-
- @Override
- public void applyTo(TaskRepository repository) {
- repository.setProperty(IOslcCoreConstants.OSLC_BASEURL, baseText.getText());
- super.applyTo(repository);
- };
-
- @Override
- protected void applyValidatorResult(Validator validator) {
- OslcValidator cqValidator = (OslcValidator) validator;
-
- if (!cqValidator.getProviders().isEmpty()) {
- if (repository == null) {
- repository = createTaskRepository();
- }
- OslcServiceDiscoveryWizard oslcWizard = new OslcServiceDiscoveryWizard(((IOslcConnector) connector),
- cqValidator.getRepository(), cqValidator.getProviders());
- OslcServiceDiscoveryWizardDialog dialog = new OslcServiceDiscoveryWizardDialog(getShell(), oslcWizard);
- dialog.setBlockOnOpen(true);
- dialog.create();
- int result = dialog.open();
-
- if (result == Window.OK && oslcWizard.getSelectedServiceDescriptor() != null) {
- setUrl(oslcWizard.getSelectedServiceDescriptor().getAboutUrl());
- setServiceDescriptor(oslcWizard.getSelectedServiceDescriptor());
- } else {
- cqValidator.setStatus(Status.CANCEL_STATUS);
- }
- }
-
- super.applyValidatorResult(validator);
- }
-
- private class OslcValidator extends Validator {
-
- final TaskRepository repository;
-
- private List<OslcServiceProvider> providers = new ArrayList<OslcServiceProvider>();
-
- private final String baseUrl;
-
- public TaskRepository getRepository() {
- return this.repository;
- }
-
- public OslcValidator(TaskRepository repository, String baseUrl) {
- this.repository = repository;
- this.baseUrl = baseUrl;
- }
-
- private String getBaseUrl() {
- return baseUrl;
- }
-
- @Override
- public void run(IProgressMonitor monitor) throws CoreException {
- try {
- new URL(getBaseUrl());
-
- // TODO: if only one ServiceProviderCatalog/ServiceProvider found, use it
-
- List<OslcServiceProvider> serviceProviders = ((IOslcConnector) connector).getAvailableServices(
- repository, getBaseUrl(), monitor);
- setProviders(serviceProviders);
- } catch (MalformedURLException ex) {
- throw new CoreException(new Status(IStatus.ERROR, IOslcCoreConstants.ID_PLUGIN, IStatus.OK,
- INVALID_REPOSITORY_URL, null));
- } catch (CoreException e) {
- StatusHandler.log(new Status(IStatus.ERROR, IOslcCoreConstants.ID_PLUGIN,
- "Error occurred during service discovery", e)); //$NON-NLS-1$
- throw e;
- }
-
- }
-
- private void setProviders(List<OslcServiceProvider> providers) {
- this.providers = providers;
- }
-
- public List<OslcServiceProvider> getProviders() {
- return providers;
- }
-
- }
-
- @Override
- protected void createAdditionalControls(Composite parent) {
- // ignore
- }
-
-}
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
deleted file mode 100644
index 4abc86862..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryProvider.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.mylyn.commons.core.StatusHandler;
-import org.eclipse.mylyn.internal.oslc.core.IOslcConnector;
-import org.eclipse.mylyn.internal.oslc.core.IOslcCoreConstants;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProvider;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProviderCatalog;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.ui.progress.DeferredTreeContentManager;
-import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
-import org.eclipse.ui.progress.IElementCollector;
-
-/**
- * @author Robert Elves
- */
-public class OslcServiceDiscoveryProvider implements ITreeContentProvider {
-
- private final IOslcConnector connector;
-
- private final TaskRepository repository;
-
- private OslcServiceProvider selectedPovider;
-
- private DeferredTreeContentManager manager;
-
- OslcServiceDiscoveryProvider(IOslcConnector connector, TaskRepository repository, String base) {
- this.connector = connector;
- this.repository = repository;
- }
-
- public Object[] getChildren(Object parentElement) {
- return manager.getChildren(parentElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public OslcServiceProvider getOSLServiceProvider() {
- return selectedPovider;
- }
-
- public boolean hasChildren(Object element) {
- return manager.mayHaveChildren(element);
- }
-
- @SuppressWarnings("unchecked")
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List<?>) {
- List<OslcServiceProvider> rootProviders = (List<OslcServiceProvider>) inputElement;
- Object[] result = new Object[rootProviders.size()];
- for (int x = 0; x < rootProviders.size(); x++) {
- result[x] = new ServiceProviderCatalogWrapper(rootProviders.get(x));
- }
- return result;
- } else {
- Object[] result = { inputElement };
- return result;
- }
- }
-
- public void dispose() {
- // ignore
- }
-
- @SuppressWarnings("deprecation")
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (viewer instanceof AbstractTreeViewer) {
- manager = new DeferredTreeContentManager(null, (AbstractTreeViewer) viewer);
- }
- }
-
- protected class ServiceProviderCatalogWrapper implements IDeferredWorkbenchAdapter {
- private final Object element;
-
- public ServiceProviderCatalogWrapper(Object catalog) {
- this.element = catalog;
- }
-
- public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
- try {
- 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,
- "Error occurred during service discovery", e)); //$NON-NLS-1$
- } finally {
- monitor.done();
- }
-
- }
-
- public ISchedulingRule getRule(Object object) {
- return null;
- }
-
- public boolean isContainer() {
- return (element instanceof OslcServiceProviderCatalog || element instanceof OslcServiceProvider);
- }
-
- public Object[] getChildren(Object o) {
- return null;
- }
-
- public ImageDescriptor getImageDescriptor(Object object) {
- return null;
- }
-
- public String getLabel(Object o) {
- if (element instanceof OslcServiceProvider) {
- return ((OslcServiceProvider) element).getName();
- } else if (element instanceof OslcServiceDescriptor) {
- return ((OslcServiceDescriptor) element).getDescription();
- }
- return ""; //$NON-NLS-1$
- }
-
- public Object getParent(Object o) {
- return null;
- }
-
- public Object getServiceObject() {
- return element;
- }
-
- }
-
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizard.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizard.java
deleted file mode 100644
index 49c396c86..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizard.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import java.util.List;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.mylyn.internal.oslc.core.IOslcConnector;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProvider;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-
-/**
- * @author Robert Elves
- */
-public class OslcServiceDiscoveryWizard extends Wizard {
-
- private final IOslcConnector connector;
-
- private final TaskRepository repository;
-
- private OslcServiceDiscoveryWizardPage page;
-
- private final List<OslcServiceProvider> providers;
-
- public OslcServiceDiscoveryWizard(IOslcConnector connector, TaskRepository repository,
- List<OslcServiceProvider> providers) {
- setNeedsProgressMonitor(true);
- this.connector = connector;
- this.repository = repository;
- this.providers = providers;
- }
-
- @Override
- public boolean performFinish() {
- return true;
- }
-
- @Override
- public void addPages() {
- page = new OslcServiceDiscoveryWizardPage(connector, repository);
- page.setRootProviders(providers);
- addPage(page);
- }
-
- @Override
- public boolean canFinish() {
- return (page.getSelectedServiceProvider() != null);
- }
-
- public OslcServiceDescriptor getSelectedServiceDescriptor() {
- return page.getSelectedServiceProvider();
- }
-
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardDialog.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardDialog.java
deleted file mode 100644
index 645abd9be..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardDialog.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * @author Robert Elves
- */
-public class OslcServiceDiscoveryWizardDialog extends WizardDialog {
-
- public OslcServiceDiscoveryWizardDialog(Shell parentShell, IWizard newWizard) {
- super(parentShell, newWizard);
- }
-
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardPage.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardPage.java
deleted file mode 100644
index 713aed688..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceDiscoveryWizardPage.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import java.util.List;
-
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.mylyn.internal.oslc.core.IOslcConnector;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProvider;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProviderCatalog;
-import org.eclipse.mylyn.internal.oslc.ui.OslcServiceDiscoveryProvider.ServiceProviderCatalogWrapper;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUiImages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author Robert Elves
- */
-public class OslcServiceDiscoveryWizardPage extends WizardPage {
-
- private static final String TITLE_SERVICE_DISCOVERY = Messages.OslcServiceDiscoveryWizardPage_Serivce_Discovery;
-
- private TreeViewer v;
-
- private OslcServiceDescriptor selectedServiceDescriptor;
-
- private final TaskRepository repository;
-
- private final OslcServiceDiscoveryProvider provider;
-
- private List<OslcServiceProvider> rootProviders;
-
- protected OslcServiceDiscoveryWizardPage(IOslcConnector connector, TaskRepository repository) {
- super(TITLE_SERVICE_DISCOVERY, TITLE_SERVICE_DISCOVERY, TasksUiImages.BANNER_REPOSITORY);
- this.repository = repository;
- this.provider = new OslcServiceDiscoveryProvider(connector, repository, null);
- setMessage(Messages.OslcServiceDiscoveryWizardPage_Browse_Available_Services_Below);
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(1, true));
- GridDataFactory.fillDefaults().grab(true, true).applyTo(composite);
-
- v = new TreeViewer(composite, SWT.VIRTUAL | SWT.BORDER);
- v.setUseHashlookup(true);
- GridDataFactory.fillDefaults().grab(true, true).applyTo(v.getTree());
-
- v.setLabelProvider(new OslcServiceLabelProvider());
- v.setContentProvider(provider);
- v.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- TreeSelection selection = (TreeSelection) v.getSelection();
- Object o = selection.getFirstElement();
- if (o instanceof ServiceProviderCatalogWrapper) {
- Object provObj = ((ServiceProviderCatalogWrapper) o).getServiceObject();
- if (provObj instanceof OslcServiceProviderCatalog) {
- setSelectedServiceDescriptor(null);
- } else if (provObj instanceof OslcServiceProvider) {
- setSelectedServiceDescriptor(null);
- } else if (provObj instanceof OslcServiceDescriptor) {
- setSelectedServiceDescriptor((OslcServiceDescriptor) provObj);
- }
- } else {
- // TODO: disable OK button
- }
- }
- });
- if (rootProviders != null && !rootProviders.isEmpty()) {
- v.setInput(rootProviders);
- } else {
- v.setInput(new OslcServiceProviderCatalog(repository.getRepositoryLabel(), repository.getUrl()));
- }
- setControl(composite);
- }
-
- private void setSelectedServiceDescriptor(OslcServiceDescriptor selectedServiceDescriptor) {
- this.selectedServiceDescriptor = selectedServiceDescriptor;
- setPageComplete(selectedServiceDescriptor != null);
- }
-
- public OslcServiceDescriptor getSelectedServiceProvider() {
- return selectedServiceDescriptor;
- }
-
- public void setRootProviders(List<OslcServiceProvider> providers) {
- this.rootProviders = providers;
- }
-
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java
deleted file mode 100644
index a18edd166..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Tasktop Technologies and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tasktop Technologies - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.oslc.ui;
-
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.mylyn.commons.ui.CommonImages;
-import org.eclipse.mylyn.internal.oslc.core.OslcCreationDialogDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceDescriptor;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProvider;
-import org.eclipse.mylyn.internal.oslc.core.OslcServiceProviderCatalog;
-import org.eclipse.mylyn.internal.oslc.ui.OslcServiceDiscoveryProvider.ServiceProviderCatalogWrapper;
-import org.eclipse.mylyn.tasks.ui.TasksUiImages;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Robert Elves
- */
-public class OslcServiceLabelProvider extends LabelProvider {
-
- @Override
- public String getText(Object element) {
- if (element instanceof OslcServiceProvider) {
- return ((OslcServiceProvider) element).getName();
- } else if (element instanceof OslcCreationDialogDescriptor) {
- return ((OslcCreationDialogDescriptor) element).getTitle();
- } else if (element instanceof OslcServiceDescriptor) {
- return ((OslcServiceDescriptor) element).getDescription();
- } else if (element instanceof ServiceProviderCatalogWrapper) {
- return this.getText(((ServiceProviderCatalogWrapper) element).getServiceObject());
- } else {
- return Messages.OslcServiceLabelProvider_Loading;
- }
- }
-
- @Override
- public Image getImage(Object element) {
- if (element instanceof OslcServiceProviderCatalog) {
- return CommonImages.getImage(TasksUiImages.REPOSITORIES_VIEW);
- } else if (element instanceof OslcServiceProvider) {
- return CommonImages.getImage(TasksUiImages.REPOSITORY);
- } else if (element instanceof ServiceProviderCatalogWrapper) {
- return this.getImage(((ServiceProviderCatalogWrapper) element).getServiceObject());
- }
- return null;
- }
-}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/messages.properties b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/messages.properties
deleted file mode 100644
index a4ff95641..000000000
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/messages.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2009 Tasktop Technologies and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Tasktop Technologies - initial API and implementation
-###############################################################################
-OslcRepositorySettingsPage_Enter_Base_Url_Above=Enter base url above and press Validate Settings
-OslcServiceDiscoveryWizardPage_Browse_Available_Services_Below=Browse the available services below.
-OslcServiceDiscoveryWizardPage_Serivce_Discovery=Service Discovery
-OslcServiceLabelProvider_Loading=Loading... \ No newline at end of file

Back to the top