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


Java RepositoryProvider类代码示例

本文整理汇总了Java中org.eclipse.team.core.RepositoryProvider的典型用法代码示例。如果您正苦于以下问题:Java RepositoryProvider类的具体用法?Java RepositoryProvider怎么用?Java RepositoryProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RepositoryProvider类属于org.eclipse.team.core包,在下文中一共展示了RepositoryProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
/**
 * Opens an Eclipse project.
 *
 * @param localPath
 *        the local path
 * @param importOptions
 *        the import options
 */
public IProject open(final String localPath, final ImportOptions importOptions) throws CoreException {
    final IProject project = createProject(localPath, importOptions);

    if (!project.isOpen()) {
        project.open(null);
    }

    /* Register with project manager. */
    TFSEclipseClientPlugin.getDefault().getProjectManager().addProject(project, importOptions.getTFSRepository());

    if (RepositoryProvider.getProvider(project, TFSRepositoryProvider.PROVIDER_ID) == null) {
        RepositoryProvider.map(project, TFSRepositoryProvider.PROVIDER_ID);
    }

    return project;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:25,代码来源:ImportOpenProjectStrategy.java

示例2: refreshProject

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
private void refreshProject(IProject project, IProgressMonitor monitor)
		throws SVNException {
    if (monitor != null)
    {
    	monitor.beginTask("", 100); //$NON-NLS-1$
    	monitor.subTask(Policy.bind("SVNProvider.Creating_project_1", project.getName()));
    }
	try {
		// Register the project with Team
		RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
		RepositoryProvider.getProvider(project, SVNProviderPlugin.getTypeId());
	} catch (TeamException e) {
		throw new SVNException("Cannot map the project with svn provider",e);
	} finally {
		if (monitor != null)
		{
			monitor.subTask(" ");
			monitor.done();
		}
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:22,代码来源:CheckoutCommand.java

示例3: getRepositoryFor

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
/**
   * Gets the repository which the local filesystem <code>location</code> belongs to.
   */
  public static ISVNRepositoryLocation getRepositoryFor(IPath location) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = root.getProjects();
for (IProject project : projects) {
	if (project.getLocation().isPrefixOf(location) && SVNWorkspaceRoot.isManagedBySubclipse(project)) {
		try {
			SVNTeamProvider teamProvider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNProviderPlugin.getTypeId());
			return teamProvider.getSVNWorkspaceRoot().getRepository();
		} catch (SVNException e) {
			// an exception is thrown when resource	is not managed
			SVNProviderPlugin.log(e);
			return null;
		}
	}
}
return null;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:SVNWorkspaceRoot.java

示例4: isSupervised

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public boolean isSupervised(IResource resource) throws TeamException {
try {
	if (resource.isTeamPrivateMember() || SVNWorkspaceRoot.isLinkedResource(resource)) return false;
	RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject(), SVNProviderPlugin.getTypeId());
	if (provider == null) return false;
	// TODO: what happens for resources that don't exist?
	// TODO: is it proper to use ignored here?
	ISVNLocalResource svnThing = SVNWorkspaceRoot.getSVNResourceFor(resource);
	if (svnThing.isIgnored()) {
		// An ignored resource could have an incoming addition (conflict)
		return (remoteSyncStateStore.getBytes(resource) != null) || 
				((remoteSyncStateStore.members(resource) != null) && (remoteSyncStateStore.members(resource).length > 0));
	}
	return true;
} catch (TeamException e) {
	// If there is no resource in coe this measn there is no local and no remote
	// so the resource is not supervised.
	if (e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND) {
		return false;
	}
	throw e;
}
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:24,代码来源:SVNWorkspaceSubscriber.java

示例5: importExistingProject

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
/**
 * Imports a existing SVN Project to the workbench
 * 
 * @param monitor
 *            project monitor
 * @return true if loaded, else false
 * @throws TeamException
 */

boolean importExistingProject(IProgressMonitor monitor)
        throws TeamException {
    if (directory == null) {
        return false;
    }
    try {
        monitor.beginTask("Importing", 3 * 1000);

        createExistingProject(new SubProgressMonitor(monitor, 1000));

        monitor.subTask("Refreshing " + project.getName());
        RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
        monitor.worked(1000);
        SVNWorkspaceRoot.setSharing(project, new SubProgressMonitor(
                monitor, 1000));

        return true;
    } catch (CoreException ce) {
        throw new SVNException("Failed to import External SVN Project"
                + ce, ce);
    } finally {
        monitor.done();
    }
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:34,代码来源:SVNProjectSetCapability.java

示例6: refreshProject

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
private void refreshProject(IProject project, IProgressMonitor monitor)
		throws SVNException {
    if (monitor != null)
    {
    	monitor.beginTask("", 100); //$NON-NLS-1$
    }
	try {
		// Register the project with Team
		RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
		RepositoryProvider.getProvider(project, SVNProviderPlugin.getTypeId());
		project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
	} catch (Exception e) {
		throw new SVNException("Cannot map the project with svn provider",e);
	} finally {
		if (monitor != null)
		{
			monitor.done();
		}
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:CheckoutAsProjectOperation.java

示例7: getCommitProviderMapping

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
private Map<ProjectAndRepository, List<IResource>> getCommitProviderMapping(IResource[] resources) {
	ProjectAndRepository mapKey = null;
	Map<ProjectAndRepository, List<IResource>> result = new HashMap<ProjectAndRepository, List<IResource>>();
	for (IResource resource : resources) {
		if (mapKey == null || !svnClient.canCommitAcrossWC()) {
			SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider.getProvider(resource.getProject(), SVNProviderPlugin.getTypeId());
			mapKey = new ProjectAndRepository(provider, getRootURL(SVNWorkspaceRoot.getSVNResourceFor(resource)));
		}
		List<IResource> list = result.get(mapKey);
		if (list == null) {
			list = new ArrayList<IResource>();
			result.put(mapKey, list);
		}
		list.add(resource);
	}
	return result;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:CommitOperation.java

示例8: run

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
	// First, ask the user if they want to include conflicts
	SyncInfoSet syncSet = getSyncInfoSet();
	if (!promptForConflictHandling(getShell(), syncSet)) return;
	// Divide the sync info by project
	final Map projectSyncInfos = getProjectSyncInfoSetMap(syncSet);
	monitor.beginTask(null, projectSyncInfos.size() * 100);
	for (Iterator iter = projectSyncInfos.keySet().iterator(); iter.hasNext(); ) {
		final IProject project = (IProject) iter.next();

		// Pass the scheduling rule to the synchronizer so that sync change events
		// and cache commits to disk are batched
		SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNUIPlugin.PROVIDER_ID);
		if (provider != null) {
			run(provider, (SyncInfoSet)projectSyncInfos.get(project), Policy.subMonitorFor(monitor,100));
		}
	}
	monitor.done();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:SVNSynchronizeOperation.java

示例9: run

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
	// First, ask the user if they want to include conflicts
	SyncInfoSet syncSet = getSyncInfoSet();
	if (!promptForConflictHandling(getShell(), syncSet)) return;
	// Divide the sync info by project
	final Map projectSyncInfos = getProjectSyncInfoSetMap(syncSet);
	monitor.beginTask(null, projectSyncInfos.size() * 100);
	for (Iterator iter = projectSyncInfos.keySet().iterator(); iter.hasNext(); ) {
		final IProject project = (IProject) iter.next();

		// Pass the scheduling rule to the synchronizer so that sync change events
		// and cache commits to disk are batched
		SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNUIPlugin.PROVIDER_ID);
		if (provider != null) {
			run(provider, (SyncInfoSet)projectSyncInfos.get(project), Policy.subMonitorFor(monitor,100));
			break;
		}
	}
	monitor.done();
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:IgnoreSynchronizeOperation.java

示例10: isValidInput

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public boolean isValidInput(Object object) {
  if(object instanceof IResource) {
    RepositoryProvider provider = RepositoryProvider.getProvider(((IResource) object).getProject());
    return provider instanceof SVNTeamProvider;
  } else if(object instanceof ISVNRemoteResource) {
    return true;
  }

  // TODO
  // } else if(object instanceof CVSFileRevision) {
  // return true;
  // } else if(object instanceof CVSLocalFileRevision) {
  // return true;

  return false;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:17,代码来源:SVNHistoryPage.java

示例11: GpsCvsRepositoryHandler

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public GpsCvsRepositoryHandler(IProject project, GpsProject parent) throws Exception {
	this.parent = parent;
	CVSTeamProvider provider = (CVSTeamProvider) RepositoryProvider.getProvider(project);
	
	CVSWorkspaceRoot root = provider.getCVSWorkspaceRoot();
	CVSRepositoryLocation location = CVSRepositoryLocation.fromString(root.getRemoteLocation().getLocation(false));
	location.setUserMuteable(true);
	address = location.getLocation(false);
	
	ICVSFolder folder = root.getLocalRoot();
	FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
	
	this.location = syncInfo.getRepository() /*module*/;

	/* CVS import handler does not allow us to import the project under different name */
	parent.setName( folder.getName() /* project name */ );
	
	CVSTag tag = syncInfo.getTag();
	if (tag != null) {
		if (tag.getType() != CVSTag.DATE) {
			this.tag = tag.getName();
		}
	}
	
}
 
开发者ID:Genuitec,项目名称:gerrit-tools,代码行数:26,代码来源:GpsCvsRepositoryHandler.java

示例12: isValid

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
@Override
public boolean isValid(ILaunchConfiguration configuration) {
    final String projectName;
    try {

        projectName = configuration.getAttribute(CODENVY_PROJECT_NAME_ATTRIBUTE_NAME, "");

    } catch (CoreException e) {
        throw new RuntimeException(e);
    }

    if (!isEmpty(projectName)) {

        final IProject project = workspaceRoot.getProject(projectName);
        final boolean isCodenvyProject =
                                         project.exists()
                                             && RepositoryProvider.getProvider(project, CodenvyProvider.PROVIDER_ID) != null;
        setErrorMessage(isCodenvyProject ? null : "Project specified is not a valid Codenvy project");

        return isCodenvyProject;
    }

    setErrorMessage("Project not specified");
    return false;
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:26,代码来源:RunMainConfigurationTab.java

示例13: resolveProjectShareDataForProjects

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public ProjectShareData resolveProjectShareDataForProjects(List<IProject> projects) {
	ProjectShareData data = new ProjectShareData();
	
	for (IProject project: projects){
		RepositoryProvider provider = RepositoryProvider.getProvider(project);
		if (provider == null) {
			continue;
		}
		data.register(provider, project);
	}
	return data;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:13,代码来源:ProjectShareSupport.java

示例14: reconnectToTeamProviders

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
/**
 * Will try to reconnect team provicers - but only for projects not being
 * shared already!
 * @param monitor 
 * 
 * @param data
 * @param projectsList
 */
public void reconnectToTeamProviders(IProgressMonitor monitor, ProjectShareData data, List<IProject> projectsList) {
	if (data == null) {
		return;
	}
	if (projectsList == null || projectsList.isEmpty()) {
		return;
	}

	for (IProject project : projectsList) {
		if (RepositoryProvider.isShared(project)) {
			/* already shared - so ignore! */
			continue;
		}
		String projectName = project.getName();

		IPath path = project.getFullPath();
		String providerId = data.getProviderId(path);
		if (providerId == null) {
			continue;
		}
		try {
			RepositoryProvider.map(project, providerId);
			progressMessage(monitor, "Reconnected team provider for project: "+projectName);
		} catch (TeamException e) {
			IDEUtil.logError("Was not able to reconnect team provider on project:"+projectName, e);
		}
	}
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:37,代码来源:ProjectShareSupport.java

示例15: register

import org.eclipse.team.core.RepositoryProvider; //导入依赖的package包/类
public void register(RepositoryProvider provider, IProject project) {
	if (provider == null) {
		return;
	}
	if (project==null){
		return;
	}
	IPath fullPath = project.getFullPath();
	if (fullPath == null) {
		return;
	}
	map.put(fullPath, provider.getID());

}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:15,代码来源:ProjectShareSupport.java


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