当前位置: 首页>>代码示例>>Java>>正文


Java ProjectSetSerializationContext类代码示例

本文整理汇总了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;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:22,代码来源:TFSRepositoryProviderType.java

示例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);
}
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:30,代码来源:SVNProjectSetCapability.java

示例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()]);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:34,代码来源:SVNProjectSetCapability.java

示例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()]);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:31,代码来源:SVNProjectSetCapability.java

示例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;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:SVNProjectSetCapability.java

示例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;
        }
    }

}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:54,代码来源:SVNProjectSetCapability.java


注:本文中的org.eclipse.team.core.ProjectSetSerializationContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。