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


Java RepositoryProvider.map方法代码示例

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


在下文中一共展示了RepositoryProvider.map方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: 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

示例5: 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

示例6: doRun

import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
@Override
protected IStatus doRun(final IProgressMonitor progressMonitor) throws Exception {
    TFSEclipseClientPlugin.getDefault().getProjectManager().addProject(project, repository);
    RepositoryProvider.map(project, TFSRepositoryProvider.PROVIDER_ID);

    return Status.OK_STATUS;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:8,代码来源:ConnectProjectCommand.java

示例7: setSharing

import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
/**
 * Set the sharing for a project to enable it to be used with the SVNTeamProvider.
    * This is used when a project has .svn directory but is not shared in Eclipse.
 * An exception is thrown if project does not have a remote directory counterpart
 */
public static void setSharing(IProject project, IProgressMonitor monitor) throws TeamException {

	// Ensure provided info matches that of the project
	LocalResourceStatus status = peekResourceStatusFor(project);

       // this folder needs to be managed but also to have a remote counter-part
       // because we need to know its url
       // we will change this exception !
       if (!status.hasRemote())
           throw new SVNException(new SVNStatus(IStatus.ERROR, Policy.bind("SVNProvider.infoMismatch", project.getName())));//$NON-NLS-1$

       String repositoryURL = null;
       ISVNClientAdapter client = SVNProviderPlugin.getPlugin().getSVNClient();
       try {
           SVNProviderPlugin.disableConsoleLogging();
		ISVNInfo info = client.getInfoFromWorkingCopy(project.getLocation().toFile());
		if (info.getRepository() != null)
			repositoryURL = info.getRepository().toString();
	} catch (SVNClientException e) {
	} finally {
        SVNProviderPlugin.enableConsoleLogging();
           SVNProviderPlugin.getPlugin().getSVNClientManager().returnSVNClient(client);
	}
	if (repositoryURL == null)
		repositoryURL = status.getUrlString();

	// Ensure that the provided location is managed
	SVNProviderPlugin.getPlugin().getRepositories().getRepository(repositoryURL, false);

	// Register the project with Team
	RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:38,代码来源:SVNWorkspaceRoot.java

示例8: run

import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
@Override
protected IStatus run(final IProgressMonitor monitor) {
    /*
     * Get the current TFS Repository (may be null)
     */
    final TFSRepository repository =
        TFSEclipseClientPlugin.getDefault().getRepositoryManager().getDefaultRepository();

    final ProjectRepositoryManager projectManager = TFSEclipseClientPlugin.getDefault().getProjectManager();

    try {
        boolean projectOnline = false;

        if (repository != null
            && repository.getWorkspace().getMappedServerPath(project.getLocation().toOSString()) != null) {
            /*
             * This is in the current (online) repository, simply hook it up
             * as such.
             */
            RepositoryProvider.map(project, TFSRepositoryProvider.PROVIDER_ID);
            projectManager.addProject(project, repository);
            projectOnline = true;
        } else {
            /*
             * If there are no other projects configured as TFS projects,
             * then connect this one to the server. Otherwise, defer
             * connection.
             */
            final boolean connectProject = (projectManager.getProjects().length == 0);

            /* Otherwise, configure ourselves as the repository provider. */
            RepositoryProvider.map(project, TFSRepositoryProvider.PROVIDER_ID);

            if (connectProject) {
                projectManager.addAndConnectProject(project);
                projectOnline = true;
            } else {
                projectManager.addOfflineProject(project);
            }
        }

        if (projectOnline
            && repository != null
            && repository.getWorkspace().getLocation() == WorkspaceLocation.LOCAL) {
            UICommandExecutorFactory.newUICommandExecutor(ShellUtils.getWorkbenchShell()).execute(
                new ScanLocalWorkspaceCommand(repository, Arrays.asList(new String[] {
                    project.getLocation().toOSString()
            })));
        }
    } catch (final TeamException e) {
        return new Status(IStatus.ERROR, TFSEclipseClientPlugin.PLUGIN_ID, e.getLocalizedMessage(), e);
    }

    return Status.OK_STATUS;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:56,代码来源:TFSProjectCreationJob.java

示例9: run

import org.eclipse.team.core.RepositoryProvider; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask(null, IProgressMonitor.UNKNOWN);
SVNProviderPlugin plugin = SVNProviderPlugin.getPlugin();
SVNClientManager svnClientManager = plugin.getSVNClientManager();
ISVNClientAdapter client = null;
try{
	
	if (plugin == null || plugin.getSimpleDialogsHelper() == null){
		if (++reschedCount > MAX_RETRIES){
			String errorString = "Subclipse core and/or ui didn't come up in " + MAX_RETRIES + " retries, failing.";  //$NON-NLS-1$
			System.err.println(errorString); // Let it be visible to the user
			throw new SVNException(errorString);
		}
		schedule(1000);
		return Status.OK_STATUS;
	}
	
	if (!plugin.getSimpleDialogsHelper().promptYesNo(
			"Auto-add "+project.getName()+" to source control", //$NON-NLS-1$
			  "The new project \""+ project.getName() +"\" was created in a subversion " + //$NON-NLS-1$
			  "controlled directory.\n\n" + //$NON-NLS-1$
			  "Would you like to automatically add it to source control?", true)) { //$NON-NLS-1$

		return Status.OK_STATUS;
	}
			
	client = svnClientManager.getSVNClient();

	File file = project.getLocation().toFile();
	client.addDirectory(file, false);

	RepositoryProvider.map(project, SVNProviderPlugin.getTypeId());
	plugin.getStatusCacheManager().refreshStatus(project,
			true);
	
}catch(Exception e){
             SVNProviderPlugin.log(IStatus.ERROR, "Could not auto-add project " + project.getName(), e); //$NON-NLS-1$
	return Status.CANCEL_STATUS;
}finally{
	monitor.done();
	svnClientManager.returnSVNClient(client);
}
return Status.OK_STATUS;
     }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:45,代码来源:SVNTeamProviderType.java


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