Author: adietish
Date: 2011-12-06 17:45:42 -0500 (Tue, 06 Dec 2011)
New Revision: 37026
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java
Log:
[JBIDE-10171] added confirmation dialog when user has chosen to use an existing project
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java 2011-12-06
22:34:04 UTC (rev 37025)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizard.java 2011-12-06
22:45:42 UTC (rev 37026)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jgit.api.errors.JGitInternalException;
@@ -71,6 +72,9 @@
if (!model.isNewProject()) {
model.importProject(monitor);
} else {
+ if (!askForConfirmation()) {
+ return Status.CANCEL_STATUS;
+ }
model.addToExistingProject(monitor);
}
return Status.OK_STATUS;
@@ -115,6 +119,20 @@
}
}
+ private boolean askForConfirmation() {
+ final boolean[] confirmed = new boolean[1];
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ confirmed[0] = MessageDialog.openConfirm(getShell(),
+ "Confirm project modification",
+ "This will copy OpenShit configuration files to your project.\n" +
+ "Are you sure that you want to allow this?");
+ }});
+ return confirmed[0];
+ }
+
@Override
public void addPages() {
this.model = new ImportProjectWizardModel();
Show replies by date