Configuring a project

Typically, the first step in building a team UI is implementing a wizard page that allows users to configure a project for your plug-in's team support.  This is where your team provider's id will be added to the project's properties.  You participate in project configuration by contributing to the org.eclipse.team.ui.configurationWizards extension point.  This wizard is shown when the user chooses Team->Share Project...

We'll look at this in the context of the CVS client implementation.  Here is the CVS UI markup for its configuration wizard:

<extension
      point="org.eclipse.team.ui.configurationWizards">
   <wizard
        name="%SharingWizard.name"
        icon="icons/full/wizards/newconnect_wiz.gif"
        class="org.eclipse.team.internal.ccvs.ui.wizards.SharingWizard"
        id="org.eclipse.team.ccvs.ui.SharingWizard">
   </wizard>
</extension>

As usual, plug-ins supply a class that implements the extension and a unique id to identify their extension.  The name and icon are shown in the first page of the project configuration wizard if there are multiple providers to choose from.

Once the user has selected a provider, the next page shows the specific configuration information for your provider.  (If your provider is the only team provider plug-in installed, then the wizard skips directly to your page.)  Your wizard must implement IConfigurationWizard, which initializes the wizard for a specified workbench and project.  The rest of the implementation depends on the design of your wizard.  You must gather up any information needed to associate the project with your team support.  

When the wizard is completed, you must map your team provider to the project using RepositoryProvider.map(IProject, String).  Mapping handles the assignment of the correct project persistent property to your project.

The CVS client does this work in its provider's setSharing method, which is called when its wizard is finished:

public void setSharing(IProject project, FolderSyncInfo info, IProgressMonitor monitor) throws TeamException {
	
	// Ensure provided info matches that of the project
	...		
	// Ensure that the provided location is managed
	...		
	// Register the project with Team
	RepositoryProvider.map(project, CVSProviderPlugin.getTypeId());
}

 

Copyright IBM Corporation and others 2000, 2003.