KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > IProjectSetSerializer


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.core;
12
13 import org.eclipse.core.resources.IProject;
14 import org.eclipse.core.runtime.IProgressMonitor;
15
16 /**
17  * IProjectSetSerializer manages the serializing and deserializing
18  * of references to projects. Given a project, it can produce a
19  * UTF-8 encoded String which can be stored in a file.
20  * Given this String, it can create in the workspace an IProject.
21  *
22  * @since 2.0
23  *
24  * @deprecated
25  * Use {@link org.eclipse.team.core.RepositoryProviderType#getProjectSetCapability()}
26  * to obtain an instance of {@link org.eclipse.team.core.ProjectSetCapability} instead.
27  */

28
29 public interface IProjectSetSerializer {
30     
31     /**
32      * For every IProject in providerProjects, return an opaque
33      * UTF-8 encoded String to act as a reference to that project.
34      * The format of the String is specific to the provider.
35      * The format of the String must be such that
36      * IProjectSetSerializer.addToWorskpace() will be able to
37      * consume it and recreate a corresponding project.
38      * @see IProjectSetSerializer#addToWorkspace(String[] referenceStrings, String filename, Object context, IProgressMonitor monitor)
39      *
40      * @param providerProjects an array of projects that the serializer should create
41      * text references for
42      * @param context a UI context object. This object will either be a
43      * com.ibm.swt.widgets.Shell or it will be null.
44      * @param monitor a progress monitor
45      * @return String[] an array of serialized reference strings uniquely identifying the projects
46      * @throws TeamException
47      */

48     public String JavaDoc[] asReference(IProject[] providerProjects, Object JavaDoc context, IProgressMonitor monitor) throws TeamException;
49     
50     /**
51      * For every String in referenceStrings, create in the workspace a
52      * corresponding IProject. Return an Array of the resulting IProjects.
53      * Result is unspecified in the case where an IProject of that name
54      * already exists. In the case of failure, a TeamException must be thrown.
55      * The opaque strings in referenceStrings are guaranteed to have been previously
56      * produced by IProjectSetSerializer.asReference().
57      * @see IProjectSetSerializer#asReference(IProject[] providerProjects, Object context, IProgressMonitor monitor)
58      *
59      * @param referenceStrings an array of reference strings uniquely identifying the projects
60      * @param filename the name of the file that the references were read from. This is included
61      * in case the provider needs to deduce relative paths
62      * @param context a UI context object. This object will either be a
63      * com.ibm.swt.widgets.Shell or it will be null.
64      * @param monitor a progress monitor
65      * @return IProject[] an array of projects that were created
66      * @throws TeamException
67      */

68     public IProject[] addToWorkspace(String JavaDoc[] referenceStrings, String JavaDoc filename, Object JavaDoc context, IProgressMonitor monitor) throws TeamException;
69 }
70
Popular Tags