[jbosstools-commits] JBoss Tools SVN: r39384 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Mar 8 15:39:21 EST 2012


Author: adietish
Date: 2012-03-08 15:39:20 -0500 (Thu, 08 Mar 2012)
New Revision: 39384

Modified:
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
[JBIDE-11214] removed unncesseary accessors #setSelectedApplication, #setSelectedProject and replaced #setInitialUser by skipCredentialsPage parameter in the wizard constructor. this flag reflects what the initial user is all about. 

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java	2012-03-08 18:58:35 UTC (rev 39383)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java	2012-03-08 20:39:20 UTC (rev 39384)
@@ -358,9 +358,8 @@
 		if (showImportLink ) {
 			importLink.addSelectionListener(new SelectionListener() {
 				public void widgetSelected(SelectionEvent e) {
-					OpenShiftExpressApplicationWizard wizard = new ImportOpenShiftExpressApplicationWizard();
-					wizard.setInitialUser(fuser);
-					wizard.setSelectedApplication(fapplication);
+					OpenShiftExpressApplicationWizard wizard = 
+							new ImportOpenShiftExpressApplicationWizard(fuser, null, fapplication, true);
 					WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
 					int oldServerCount = ServerCore.getServers().length;
 					dialog.create();

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java	2012-03-08 18:58:35 UTC (rev 39383)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportOpenShiftExpressApplicationWizard.java	2012-03-08 20:39:20 UTC (rev 39384)
@@ -21,13 +21,17 @@
 		super(true, "Import OpenShift Express Application");
 	}
 
+	public ImportOpenShiftExpressApplicationWizard(UserDelegate user, IProject project, IApplication application) {
+		this(user, project, application, false);
+	}
+
 	/**
 	 * Constructor
 	 * @param user
 	 * @param project
 	 * @param application
 	 */
-	public ImportOpenShiftExpressApplicationWizard(UserDelegate user, IProject project, IApplication application) {
-		super(user, project, application, true, "Import OpenShift Express Application");
+	public ImportOpenShiftExpressApplicationWizard(UserDelegate user, IProject project, IApplication application, boolean skipCredentialsPage) {
+		super(user, project, application, true, skipCredentialsPage, "Import OpenShift Express Application");
 	}
 }

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java	2012-03-08 18:58:35 UTC (rev 39383)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java	2012-03-08 20:39:20 UTC (rev 39384)
@@ -27,7 +27,6 @@
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.jgit.api.errors.JGitInternalException;
 import org.eclipse.jgit.errors.TransportException;
@@ -45,7 +44,6 @@
 
 import com.openshift.express.client.IApplication;
 import com.openshift.express.client.IEmbeddableCartridge;
-import com.openshift.express.client.IUser;
 import com.openshift.express.client.OpenShiftEndpointException;
 import com.openshift.express.client.OpenShiftException;
 
@@ -55,17 +53,22 @@
  */
 public abstract class OpenShiftExpressApplicationWizard extends Wizard implements IImportWizard, INewWizard {
 
-	private UserDelegate initialUser;
-
+	private boolean skipCredentialsPage;
+	
 	private OpenShiftExpressApplicationWizardModel wizardModel;
 
 	public OpenShiftExpressApplicationWizard(boolean useExistingApplication, String wizardTitle) {
 		this(null, null, null, useExistingApplication, wizardTitle);
 	}
 	public OpenShiftExpressApplicationWizard(UserDelegate user, IProject project, IApplication application, boolean useExistingApplication, String wizardTitle) {
+		this(user, project, application, useExistingApplication, false, wizardTitle);
+	}
+
+	public OpenShiftExpressApplicationWizard(UserDelegate user, IProject project, IApplication application, boolean useExistingApplication, boolean skipCredentialsPage, String wizardTitle) {
 		setWizardModel(new OpenShiftExpressApplicationWizardModel(user, project, application, useExistingApplication));
 		setWindowTitle(wizardTitle);
 		setNeedsProgressMonitor(true);
+		this.skipCredentialsPage = skipCredentialsPage;
 	}
 
 	void setWizardModel(OpenShiftExpressApplicationWizardModel wizardModel) {
@@ -111,14 +114,6 @@
 		return confirmed[0];
 	}
 
-	public void setSelectedApplication(IApplication application) {
-		getWizardModel().setApplication(application);
-	}
-
-	public void setSelectedProject(IProject project) {
-		getWizardModel().setProject(project);
-	}
-
 	@Override
 	public void init(IWorkbench workbench, IStructuredSelection selection) {
 		Object o = selection.getFirstElement();
@@ -133,25 +128,15 @@
 
 	@Override
 	public void addPages() {
-		if( getWizardModel().getUser() == null)
-			getWizardModel().setUser(initialUser);
-		addPage(new CredentialsWizardPage(this, getWizardModel()));
+		if (!skipCredentialsPage) {
+			addPage(new CredentialsWizardPage(this, getWizardModel()));
+		}
 		addPage(new ApplicationConfigurationWizardPage(this, getWizardModel()));
 		addPage(new ProjectAndServerAdapterSettingsWizardPage(this, getWizardModel()));
 		addPage(new GitCloningSettingsWizardPage(this, getWizardModel()));
 	}
 
 	@Override
-	public IWizardPage getStartingPage() {
-		IWizardPage[] pages = getPages();
-		return initialUser == null ? pages[0] : pages[1];
-	}
-
-	public void setInitialUser(UserDelegate user) {
-		this.initialUser = user;
-	}
-
-	@Override
 	public boolean performFinish() {
 		boolean success = getWizardModel().isUseExistingApplication();
 		if (!success) {



More information about the jbosstools-commits mailing list