~verterok/bzr-eclipse/better-configure-wizard

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.ui/src/org/vcs/bazaar/eclipse/ui/wizards/project/CheckoutFromProjectWizard.java

  • Committer: Guillermo Gonzalez
  • Date: 2010-12-28 15:56:45 UTC
  • Revision ID: guillo.gonzo@gmail.com-20101228155645-p6a1ik3jgan7sbvc
Hook the stock "new project" wizard to the branch/checkout wizard.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
import org.eclipse.core.resources.IProject;
7
7
import org.eclipse.core.resources.IProjectDescription;
8
 
import org.eclipse.core.resources.ResourcesPlugin;
9
8
import org.eclipse.jface.dialogs.MessageDialog;
10
9
import org.eclipse.jface.wizard.WizardDialog;
11
10
import org.eclipse.swt.widgets.Shell;
35
34
        }
36
35
 
37
36
 
38
 
        public boolean performOperation(IProject project) {
39
 
                CheckoutAsProjectOperation checkoutOp = null;
40
 
                if(project == null) {
41
 
                        IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(getNewProjectPage().getProjectName());
42
 
                        description.setLocation(getNewProjectPage().getLocationPath());
43
 
                        checkoutOp = new CheckoutAsProjectOperation(this.getContainer(), getRemoteLocation(), description, getProjectPage().getRevision(), lightweight);
44
 
                } else {
45
 
                        checkoutOp = new CheckoutAsProjectOperation(this.getContainer(), getRemoteLocation(), project, getProjectPage().getRevision(), lightweight);
46
 
                }
 
37
    public boolean performOperation(IProject project, IProjectDescription description) {
47
38
                try {
48
 
                        checkoutOp.run();
 
39
                    CheckoutAsProjectOperation checkoutOp = new CheckoutAsProjectOperation(this.getContainer(), getRemoteLocation(), project, description, getProjectPage().getRevision(), lightweight);
 
40
                    checkoutOp.run();
49
41
                } catch (Exception e) {
50
42
                        MessageDialog.openError(this.getShell(), "Error while executing branch operation", e.getMessage());
51
43
                        EclipseBazaarUI.log(e.getMessage(), e);