本文整理汇总了Java中org.eclipse.team.core.RepositoryProvider.getProvider方法的典型用法代码示例。如果您正苦于以下问题:Java RepositoryProvider.getProvider方法的具体用法?Java RepositoryProvider.getProvider怎么用?Java RepositoryProvider.getProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.team.core.RepositoryProvider
的用法示例。
在下文中一共展示了RepositoryProvider.getProvider方法的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;
}
示例2: 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;
}
示例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;
}
示例4: 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();
}
示例5: 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();
}
}
}
示例6: 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;
}
示例7: 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();
}
}
}
示例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();
}
示例9: 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;
}
示例10: 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;
}
示例11: getProviderMapping
import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
protected Hashtable getProviderMapping(IResource[] resources) {
Hashtable result = new Hashtable();
for (int i = 0; i < resources.length; i++) {
RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject());
List list = (List)result.get(provider);
if (list == null) {
list = new ArrayList();
result.put(provider, list);
}
list.add(resources[i]);
}
return result;
}
示例12: roots
import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
public IResource[] roots() {
List<IProject> result = new ArrayList<IProject>();
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
if(project.isAccessible()) {
RepositoryProvider provider = RepositoryProvider.getProvider(project, SVNProviderPlugin.PROVIDER_ID);
if(provider != null) {
result.add(project);
}
}
}
return (IProject[]) result.toArray(new IProject[result.size()]);
}
示例13: isEnabled
import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
protected boolean isEnabled() throws TeamException {
// invoke the inherited method so that overlaps are maintained
IResource[] resources = super.getSelectedResources();
// disable if no resources are selected
if(resources.length==0) return false;
// validate enabled for each resource in the selection
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
// no SVN actions are enabled if the selection contains a linked resource
if (SVNWorkspaceRoot.isLinkedResource(resource)) return false;
// only enable for resources in a project shared with SVN
if(RepositoryProvider.getProvider(resource.getProject(), SVNProviderPlugin.getTypeId()) == null) {
return false;
}
// ensure that resource management state matches what the action requires
ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resource);
if (!isEnabledForSVNResource(svnResource)) {
return false;
}
}
return true;
}
示例14: 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);
Iterator iter = projectSyncInfos.keySet().iterator();
final IProject project = (IProject) iter.next();
SVNTeamProvider provider = (SVNTeamProvider)RepositoryProvider.getProvider(project, SVNUIPlugin.PROVIDER_ID);
monitor.beginTask(null, projectSyncInfos.size() * 100);
run(provider, syncSet, Policy.subMonitorFor(monitor,100));
monitor.done();
}
示例15: asReference
import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
/**
* Answer a string representing the specified project
*
* @param project
* the project (not <code>null</code>)
* @return the project reference (not <code>null</code>)
*/
private String asReference(IProject project) {
StringBuffer buffer = new StringBuffer();
buffer.append("0.9.3,"); //$NON-NLS-1$
SVNTeamProvider provider = (SVNTeamProvider) RepositoryProvider
.getProvider(project);
SVNWorkspaceRoot root = provider.getSVNWorkspaceRoot();
buffer.append(root.getLocalRoot().getUrl().toString());
buffer.append(",");
buffer.append(project.getName());
return buffer.toString();
}