本文整理汇总了Java中org.eclipse.team.core.ProjectSetSerializationContext类的典型用法代码示例。如果您正苦于以下问题:Java ProjectSetSerializationContext类的具体用法?Java ProjectSetSerializationContext怎么用?Java ProjectSetSerializationContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectSetSerializationContext类属于org.eclipse.team.core包,在下文中一共展示了ProjectSetSerializationContext类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asReference
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
@Override
public String[] asReference(
final IProject[] providerProjects,
final ProjectSetSerializationContext context,
final IProgressMonitor monitor) throws TeamException {
final String[] references = new String[providerProjects.length];
for (int i = 0; i < providerProjects.length; i++) {
final IProject project = providerProjects[i];
/* MULTIPLE REPOSITORIES TODO */
final Workspace repositoryWorkspace =
TFSEclipseClientPlugin.getDefault().getRepositoryManager().getDefaultRepository().getWorkspace();
final String serverPath = repositoryWorkspace.getMappedServerPath(project.getLocation().toOSString());
final String serverUrl = repositoryWorkspace.getClient().getConnection().getBaseURI().toString();
references[i] = serverUrl + SEPARATOR + serverPath;
}
return references;
}
示例2: addToWorkspace
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
/**
* Override superclass implementation to load the referenced projects into
* the workspace.
*
* @see org.eclipse.team.core.ProjectSetSerializer#addToWorkspace(java.lang.String[],
* org.eclipse.team.core.ProjectSetSerializationContext,
* org.eclipse.core.runtime.IProgressMonitor)
*/
public IProject[] addToWorkspace(String[] referenceStrings,
ProjectSetSerializationContext context, IProgressMonitor monitor)
throws TeamException {
monitor = Policy.monitorFor(monitor);
Policy.checkCanceled(monitor);
// Confirm the projects to be loaded
Map<IProject, LoadInfo> infoMap = new HashMap<IProject, SVNProjectSetCapability.LoadInfo>(referenceStrings.length);
IProject[] projects = asProjects(context, referenceStrings, infoMap);
projects = confirmOverwrite(context, projects);
if (projects == null) {
return new IProject[0];
}
// Load the projects
try {
return checkout(projects, infoMap, monitor);
} catch (MalformedURLException e) {
throw SVNException.wrapException(e);
}
}
示例3: asProjects
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
/**
* Translate the reference strings into projects to be loaded and build a
* mapping of project to project load information.
*
* @param context
* the context of where the references came from
* @param referenceStrings
* project references
* @param infoMap
* a mapping of project to project load information
* @return the projects to be loaded
*/
private IProject[] asProjects(ProjectSetSerializationContext context,
String[] referenceStrings, Map<IProject, LoadInfo> infoMap) throws SVNException {
Collection<IProject> result = new ArrayList<IProject>();
for (String referenceString : referenceStrings) {
StringTokenizer tokenizer = new StringTokenizer(referenceString, ","); //$NON-NLS-1$
try {
String version = tokenizer.nextToken();
// If this is a newer version, then ignore it
if (!version.equals("0.9.3")) { //$NON-NLS-1$
continue;
}
LoadInfo info = new LoadInfo(context, tokenizer);
IProject proj = info.getProject();
result.add(proj);
infoMap.put(proj, info);
} catch (NoSuchElementException e) {
throw new IllegalArgumentException("malformed project reference: " + referenceString, e); //$NON-NLS-1$
}
}
return (IProject[]) result.toArray(new IProject[result.size()]);
}
示例4: asProjects
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
/**
* Translate the reference strings into projects to be loaded and build a
* mapping of project to project load information.
*
* @param context
* the context of where the references came from
* @param referenceStrings
* project references
* @param infoMap
* a mapping of project to project load information
* @return the projects to be loaded
*/
private IProject[] asProjects(ProjectSetSerializationContext context,
String[] referenceStrings, Map<IProject, LoadInfo> infoMap) throws SVNException {
Collection<IProject> result = new ArrayList<IProject>();
for (String referenceString : referenceStrings) {
StringTokenizer tokenizer = new StringTokenizer(
referenceString, ","); //$NON-NLS-1$
String version = tokenizer.nextToken();
// If this is a newer version, then ignore it
if (!version.equals("0.9.3")) { //$NON-NLS-1$
continue;
}
LoadInfo info = new LoadInfo(context, tokenizer);
IProject proj = info.getProject();
result.add(proj);
infoMap.put(proj, info);
}
return (IProject[]) result.toArray(new IProject[result.size()]);
}
示例5: asReference
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
/**
* Override superclass implementation to return an array of project
* references.
*
* @see ProjectSetSerializer#asReference(IProject[],
* ProjectSetSerializationContext, IProgressMonitor)
*/
public String[] asReference(IProject[] projects,
ProjectSetSerializationContext context, IProgressMonitor monitor)
throws TeamException {
String[] result = new String[projects.length];
for (int i = 0; i < projects.length; i++) {
result[i] = asReference(projects[i]);
}
return result;
}
示例6: LoadInfo
import org.eclipse.team.core.ProjectSetSerializationContext; //导入依赖的package包/类
/**
* Construct a new instance wrappering the specified project reference
*
* @param context
* the context of where the reference came from
* @param projRef
* the project reference
*/
LoadInfo(ProjectSetSerializationContext context,
StringTokenizer tokenizer) throws SVNException {
repo = tokenizer.nextToken();
String projectName = tokenizer.nextToken();
project = ResourcesPlugin.getWorkspace().getRoot().getProject(
projectName);
if (repo.indexOf("://") != -1) { //$NON-NLS-1$
// Create connection to repository root.
repositoryLocation = SVNRepositoryLocation.fromString(repo, false, true);
fromFileSystem = false;
directory = null;
} else {
// Assume this is an already checked
// out project, from the filesystem
repositoryLocation = null;
fromFileSystem = true;
// Is it relative? If so, expand it
// from the psf file location
if (!new Path(repo).isAbsolute()) {
String baseDir;
if (context.getFilename() != null) {
baseDir = new File(context.getFilename()).getParent();
} else {
// Use the workspace root directory as
// basedir, this shouldn't happen
baseDir = project.getWorkspace().getRoot()
.getLocation().toOSString();
}
try {
directory = new File(baseDir + File.separatorChar
+ repo).getCanonicalPath();
} catch (IOException ioe) {
throw new SVNException(
"Path expansion/canonicalization failed", ioe);
}
} else {
directory = repo;
}
}
}