use of org.tigris.subversion.subclipse.ui.wizards.SVNRepositoryProviderWizardPage in project subclipse by subclipse.
the class SharingWizard method addPages.
/**
* add pages
*/
public void addPages() {
ImageDescriptor sharingImage = SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_WIZBAN_SHARE);
if (project.getLocation() == null) {
CannotSharePage cannotSharePage = new CannotSharePage("cannotSharePage", Policy.bind("SharingWizard.importTitle"), sharingImage, // $NON-NLS-1$ //$NON-NLS-2$
project);
addPage(cannotSharePage);
} else if (doesSVNDirectoryExist()) {
// if .svn directory exists, we add the autoconnect page
autoconnectPage = new ConfigurationWizardAutoconnectPage("autoconnectPage", Policy.bind("SharingWizard.autoConnectTitle"), sharingImage, // $NON-NLS-1$ //$NON-NLS-2$
projectStatus);
autoconnectPage.setProject(project);
autoconnectPage.setDescription(// $NON-NLS-1$
Policy.bind("SharingWizard.autoConnectTitleDescription"));
addPage(autoconnectPage);
} else {
try {
ISVNLocalFolder localFolder = SVNWorkspaceRoot.getSVNFolderFor(project);
if (localFolder instanceof LocalFolder) {
IFolder[] svnFolders = ((LocalFolder) localFolder).getSVNFolders(null, false);
if (svnFolders.length > 0) {
warningPage = new SvnFoldersExistWarningPage("warningPage", Policy.bind("SharingWizard.importTitle"), sharingImage, // $NON-NLS-1$ //$NON-NLS-2$
svnFolders);
// $NON-NLS-1$
warningPage.setDescription(Policy.bind("SharingWizard.svnFolderExists"));
addPage(warningPage);
// Remember to update getNextPage.
}
}
} catch (SVNException e) {
SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.PERFORM_SYNC_EXEC);
}
// otherwise we add :
// - the repository selection page
// - any contributed repository source pages
// - the create location page
// - the module selection page
// - the finish page
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
locations = SVNUIPlugin.getPlugin().getRepositoryManager().getKnownRepositoryLocations(monitor);
}
};
try {
new ProgressMonitorDialog(getShell()).run(true, false, runnable);
} catch (Exception e) {
SVNUIPlugin.openError(getShell(), null, null, e, SVNUIPlugin.LOG_TEAM_EXCEPTIONS);
}
locationPage = new RepositorySelectionPage("importPage", Policy.bind("SharingWizard.importTitle"), // $NON-NLS-1$ //$NON-NLS-2$
sharingImage);
locationPage.setDescription(// $NON-NLS-1$
Policy.bind("SharingWizard.importTitleDescription"));
addPage(locationPage);
ISVNRepositorySourceProvider[] repositorySourceProviders = null;
try {
repositorySourceProviders = SVNUIPlugin.getRepositorySourceProviders();
} catch (Exception e) {
}
if (repositorySourceProviders != null && repositorySourceProviders.length > 0) {
repositorySourceProviderPage = new ConfigurationWizardRepositorySourceProviderPage("source", Policy.bind("NewLocationWizard.heading"), SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_WIZBAN_NEW_LOCATION), // $NON-NLS-1$ //$NON-NLS-2$
repositorySourceProviders);
repositorySourceProviderPage.setDescription(// $NON-NLS-1$
Policy.bind("NewLocationWizard.0"));
addPage(repositorySourceProviderPage);
for (ISVNRepositorySourceProvider repositorySourceProvider : repositorySourceProviders) {
SVNRepositoryProviderWizardPage wizardPage = repositorySourceProvider.getWizardPage();
addPage(wizardPage);
wizardPageMap.put(repositorySourceProvider, wizardPage);
}
}
createLocationPage = new ConfigurationWizardMainPage("createLocationPage", Policy.bind("SharingWizard.enterInformation"), // $NON-NLS-1$ //$NON-NLS-2$
sharingImage);
createLocationPage.setDescription(// $NON-NLS-1$
Policy.bind("SharingWizard.enterInformationDescription"));
addPage(createLocationPage);
createLocationPage.setDialogSettings(getDialogSettings());
ISVNRepositoryLocationProvider repositoryLocationProvider = new ISVNRepositoryLocationProvider() {
public ISVNRepositoryLocation getLocation() throws TeamException {
return SharingWizard.this.getLocation();
}
public IProject getProject() {
return SharingWizard.this.getProject();
}
};
directoryPage = new DirectorySelectionPage("modulePage", Policy.bind("SharingWizard.enterModuleName"), sharingImage, // $NON-NLS-1$ //$NON-NLS-2$
repositoryLocationProvider);
directoryPage.setDescription(// $NON-NLS-1$
Policy.bind("SharingWizard.enterModuleNameDescription"));
addPage(directoryPage);
finishPage = new SharingWizardFinishPage("finishPage", Policy.bind("SharingWizard.readyToFinish"), sharingImage, // $NON-NLS-1$ //$NON-NLS-2$
repositoryLocationProvider);
finishPage.setDescription(// $NON-NLS-1$
Policy.bind("SharingWizard.readyToFinishDescription"));
addPage(finishPage);
}
}
use of org.tigris.subversion.subclipse.ui.wizards.SVNRepositoryProviderWizardPage in project subclipse by subclipse.
the class SharingWizard method getLocation.
/**
* Return an ISVNRepositoryLocation
*/
protected ISVNRepositoryLocation getLocation() throws TeamException {
// If there is an autoconnect page then it has the location
if (autoconnectPage != null) {
return autoconnectPage.getLocation();
}
// If the import page has a location, use it.
if (locationPage != null) {
ISVNRepositoryLocation location = locationPage.getLocation();
if (location != null)
return location;
}
// Otherwise, get the location from the create location page
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
createLocationPage.finish(new NullProgressMonitor());
}
});
final Properties properties = createLocationPage.getProperties();
if (repositorySourceProviderPage != null) {
ISVNRepositorySourceProvider selectedRepositorySourceProvider = repositorySourceProviderPage.getSelectedRepositorySourceProvider();
if (selectedRepositorySourceProvider != null) {
final SVNRepositoryProviderWizardPage wizardPage = wizardPageMap.get(selectedRepositorySourceProvider);
if (wizardPage != null) {
getShell().getDisplay().syncExec(new Runnable() {
public void run() {
// $NON-NLS-1$
properties.setProperty("url", wizardPage.getSelectedUrl());
}
});
}
}
}
ISVNRepositoryLocation location = SVNProviderPlugin.getPlugin().getRepositories().createRepository(properties);
return location;
}
Aggregations