Skip to main content
summaryrefslogtreecommitdiffstats
blob: fb6e01a4f1ff044e6911071f93d4f8c066860fb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*******************************************************************************
 * Copyright (c) 2012 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.commons.repositories.ui.auth;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationCredentials;
import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationRequest;
import org.eclipse.mylyn.commons.repositories.core.auth.AuthenticationType;
import org.eclipse.swt.widgets.Shell;

/**
 * @author Steffen Pingel
 */
public abstract class AbstractCredentialsProviderUi<T extends AuthenticationCredentials> {

	/**
	 * Opens the credentials UI. Invoked from the UI thread.
	 * 
	 * @param parentShell
	 *            the parent shell
	 * @param request
	 *            the authentication request
	 * @return {@link IStatus#OK} on success; {@link IStatus#CANCEL} on cancellation; an error status otherwise
	 */
	public abstract IStatus open(Shell parentShell, AuthenticationRequest<AuthenticationType<T>> request);

	/**
	 * Returns the provided credentials.
	 */
	public abstract T getCredentials();

}

Back to the top