Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 017dde194ef7bb40788097494f7a6054e92ace66 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;

/**
 * IProjectSetSerializer manages the serializing and deserializing
 * of references to projects.  Given a project, it can produce a
 * UTF-8 encoded String which can be stored in a file.
 * Given this String, it can create in the workspace an IProject.
 * 
 * @since 2.0
 * 
 * @deprecated 
 *       Use {@link org.eclipse.team.core.RepositoryProviderType#getProjectSetCapability()}
 *       to obtain an instance of {@link org.eclipse.team.core.ProjectSetCapability} instead.
 */

public interface IProjectSetSerializer {
	
	/**
	 * For every IProject in providerProjects, return an opaque
	 * UTF-8 encoded String to act as a reference to that project.
	 * The format of the String is specific to the provider.
	 * The format of the String must be such that
	 * IProjectSetSerializer.addToWorskpace() will be able to
	 * consume it and recreate a corresponding project.
	 * @see IProjectSetSerializer#addToWorkspace(String[] referenceStrings, String filename, Object context, IProgressMonitor monitor)
	 * 
	 * @param providerProjects  an array of projects that the serializer should create
	 *   text references for
	 * @param context  a UI context object. This object will either be a 
	 *                 com.ibm.swt.widgets.Shell or it will be null.
	 * @param monitor  a progress monitor
	 * @return String[] an array of serialized reference strings uniquely identifying the projects
	 * @throws TeamException
	 */
	public String[] asReference(IProject[] providerProjects, Object context, IProgressMonitor monitor) throws TeamException;
	
	/**
	 * For every String in referenceStrings, create in the workspace a
	 * corresponding IProject.  Return an Array of the resulting IProjects.
	 * Result is unspecified in the case where an IProject of that name
	 * already exists. In the case of failure, a TeamException must be thrown.
	 * The opaque strings in referenceStrings are guaranteed to have been previously
	 * produced by IProjectSetSerializer.asReference().
	 * @see IProjectSetSerializer#asReference(IProject[] providerProjects, Object context, IProgressMonitor monitor)
	 * 
	 * @param referenceStrings  an array of reference strings uniquely identifying the projects
	 * @param filename  the name of the file that the references were read from. This is included
	 *   in case the provider needs to deduce relative paths
	 * @param context  a UI context object. This object will either be a 
	 *                 com.ibm.swt.widgets.Shell or it will be null.
	 * @param monitor  a progress monitor
	 * @return IProject[]  an array of projects that were created
	 * @throws TeamException
	 */
	public IProject[] addToWorkspace(String[] referenceStrings, String filename, Object context, IProgressMonitor monitor) throws TeamException;
}

Back to the top