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


Java RepositoryProvider.getProvider方法代码示例

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

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

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

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

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

示例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;
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:26,代码来源:RunMainConfigurationTab.java

示例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;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:13,代码来源:ProjectShareSupport.java

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

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

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

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

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


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