Author: xcoulon
Date: 2012-01-26 06:12:20 -0500 (Thu, 26 Jan 2012)
New Revision: 38199
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreateNewApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
Log:
OPEN - issue JBIDE-10528: Improve OpenShift UI
https://issues.jboss.org/browse/JBIDE-10528
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -0,0 +1,158 @@
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jgit.api.errors.JGitInternalException;
+import org.eclipse.jgit.errors.TransportException;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.ui.DelegatingProgressMonitor;
+import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
+
+import com.openshift.express.client.OpenShiftException;
+
+public abstract class AbstractOpenShiftApplicationWizard<T extends
AbstractOpenShiftApplicationWizardModel> extends Wizard {
+
+ private T wizardModel;
+
+ public AbstractOpenShiftApplicationWizard() {
+ super();
+ }
+
+ void setWizardModel(T wizardModel) {
+ this.wizardModel = wizardModel;
+ }
+
+ T getWizardModel() {
+ return wizardModel;
+ }
+
+ protected boolean isTransportException(InvocationTargetException e) {
+ return e.getTargetException() instanceof JGitInternalException
+ && e.getTargetException().getCause() instanceof TransportException;
+ }
+
+ protected TransportException getTransportException(InvocationTargetException e) {
+ if (isTransportException(e)) {
+ return (TransportException) ((JGitInternalException)
e.getTargetException()).getCause();
+ }
+ return null;
+ }
+
+ protected void openError(final String title, final String message) {
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ MessageDialog.openError(getShell(), title, message);
+ }
+ });
+ }
+
+ protected boolean askForConfirmation(final String message, final String applicationName)
{
+ final boolean[] confirmed = new boolean[1];
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ confirmed[0] = MessageDialog.openConfirm(
+ getShell(),
+ NLS.bind("Import OpenShift Application ", applicationName),
+ message);
+ }
+ });
+ return confirmed[0];
+ }
+
+ /**
+ * A workspace job that will create a new project or enable the selected
+ * project to be used with OpenShift.
+ */
+ class ImportJob extends WorkspaceJob {
+
+ private DelegatingProgressMonitor delegatingMonitor;
+
+ public ImportJob(DelegatingProgressMonitor delegatingMonitor) {
+ super("Importing project to workspace...");
+ this.delegatingMonitor = delegatingMonitor;
+ }
+
+ @Override
+ public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
+ try {
+ delegatingMonitor.add(monitor);
+
+ if (wizardModel.isNewProject()) {
+ wizardModel.importProject(delegatingMonitor);
+ } else if (!wizardModel.isGitSharedProject()) {
+ if (!askForConfirmation(
+ NLS.bind("OpenShift application {0} will be enabled on project {1} by "
+
+ "copying OpenShift configuration and enabling Git for the project.\n "
+
+ "This cannot be undone. Do you wish to continue ?",
+ wizardModel.getApplicationName(), wizardModel.getProjectName()),
+ wizardModel.getApplicationName())) {
+ return Status.CANCEL_STATUS;
+ }
+ wizardModel.configureUnsharedProject(delegatingMonitor);
+ } else {
+ if (!askForConfirmation(
+ NLS.bind("OpenShift application {0} will be enabled on project {1} by copying
OpenShift " +
+ "configuration and adding the OpenShift git repo as remote.\n " +
+ "This cannot be undone. Do you wish to continue ?",
+ wizardModel.getApplicationName(), wizardModel.getProjectName()),
+ wizardModel.getApplicationName())) {
+ return Status.CANCEL_STATUS;
+ }
+ wizardModel.configureGitSharedProject(delegatingMonitor);
+ }
+
+ return Status.OK_STATUS;
+ } catch (final WontOverwriteException e) {
+ openError("Project already present", e.getMessage());
+ return Status.CANCEL_STATUS;
+ } catch (final ImportFailedException e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "Could not import maven project {0}.", e,
+ wizardModel.getProjectName());
+ } catch (IOException e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "Could not copy openshift configuration files to project {0}", e,
+ wizardModel.getProjectName());
+ } catch (OpenShiftException e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "Could not import project to the workspace.", e);
+ } catch (URISyntaxException e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "The url of the remote git repository is not valid", e);
+ } catch (InvocationTargetException e) {
+ if (isTransportException(e)) {
+ TransportException te = getTransportException(e);
+ return OpenShiftUIActivator
+ .createErrorStatus(
+ "Could not clone the repository. Authentication failed.\n"
+ + " Please make sure that you added your private key to the ssh
preferences.",
+ te);
+ } else {
+ return OpenShiftUIActivator.createErrorStatus(
+ "An exception occurred while creating local git repository.", e);
+ }
+ } catch (Exception e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ "Could not import project to the workspace.", e);
+ } finally {
+ delegatingMonitor.done();
+ }
+ }
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenShiftApplicationWizard.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionWizardPage.java 2012-01-26
11:08:58 UTC (rev 38198)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationSelectionWizardPage.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -39,7 +39,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreateNewApplicationWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreateNewApplicationWizard.java 2012-01-26
11:08:58 UTC (rev 38198)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreateNewApplicationWizard.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -10,35 +10,24 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URISyntaxException;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
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;
-import org.eclipse.jgit.errors.TransportException;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.tools.common.ui.DelegatingProgressMonitor;
import org.jboss.tools.common.ui.JobUtils;
import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IEmbeddableCartridge;
@@ -48,34 +37,30 @@
* @author Andr� Dietisheim
* @author Xavier Coulon
*/
-public class CreateNewApplicationWizard extends Wizard implements INewWizard {
+public class CreateNewApplicationWizard extends
AbstractOpenShiftApplicationWizard<CreateNewApplicationWizardModel> implements
INewWizard {
- private CreateNewApplicationWizardModel wizardModel;
-
public CreateNewApplicationWizard() {
- this.wizardModel = new CreateNewApplicationWizardModel();
+ setWizardModel(new CreateNewApplicationWizardModel());
setNeedsProgressMonitor(true);
}
@Override
public void addPages() {
- this.wizardModel = new CreateNewApplicationWizardModel();
- addPage(new CredentialsWizardPage(this, wizardModel));
- addPage(new ApplicationConfigurationWizardPage(this, wizardModel));
- addPage(new ProjectAndServerAdapterSettingsWizardPage(this, wizardModel));
- addPage(new GitCloningSettingsWizardPage(this, wizardModel));
+ addPage(new CredentialsWizardPage(this, getWizardModel()));
+ addPage(new ApplicationConfigurationWizardPage(this, getWizardModel()));
+ addPage(new ProjectAndServerAdapterSettingsWizardPage(this, getWizardModel()));
+ addPage(new GitCloningSettingsWizardPage(this, getWizardModel()));
}
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
// TODO Auto-generated method stub
-
}
@Override
public boolean performFinish() {
boolean successfull = true;
- if (wizardModel.getApplication() == null) {
+ if (getWizardModel().getApplication() == null) {
successfull = processApplicationCreation();
}
@@ -104,11 +89,11 @@
final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
try {
WizardUtils.runInWizard(
- new Job(NLS.bind("Creating application \"{0}\"...",
wizardModel.getApplicationName())) {
+ new Job(NLS.bind("Creating application \"{0}\"...",
getWizardModel().getApplicationName())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- wizardModel.createApplication(monitor);
+ getWizardModel().createApplication(monitor);
queue.offer(true);
return Status.OK_STATUS;
} catch (Exception e) {
@@ -128,16 +113,16 @@
final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
try {
WizardUtils.runInWizard(
- new Job(NLS.bind("Adding selected embedded cartridges for application
{0}...", wizardModel
+ new Job(NLS.bind("Adding selected embedded cartridges for application
{0}...", getWizardModel()
.getApplication().getName())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- List<IEmbeddableCartridge> selectedCartridges = wizardModel
+ List<IEmbeddableCartridge> selectedCartridges = getWizardModel()
.getSelectedEmbeddableCartridges();
- final IApplication application = wizardModel.getApplication();
+ final IApplication application = getWizardModel().getApplication();
if (selectedCartridges != null && !selectedCartridges.isEmpty()) {
application.addEmbbedCartridges(selectedCartridges);
}
@@ -145,7 +130,7 @@
} catch (OpenShiftException e) {
queue.offer(false);
return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID, NLS.bind(
- "Could not embed cartridges to application {0}",
wizardModel.getApplication()
+ "Could not embed cartridges to application {0}",
getWizardModel().getApplication()
.getName()), e);
}
return Status.OK_STATUS;
@@ -157,122 +142,4 @@
}
}
- private boolean isTransportException(InvocationTargetException e) {
- return e.getTargetException() instanceof JGitInternalException
- && e.getTargetException().getCause() instanceof TransportException;
- }
-
- private TransportException getTransportException(InvocationTargetException e) {
- if (isTransportException(e)) {
- return (TransportException) ((JGitInternalException)
e.getTargetException()).getCause();
- }
- return null;
- }
-
- private void openError(final String title, final String message) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(getShell(), title, message);
- }
- });
- }
-
- private boolean askForConfirmation(final String message, final String applicationName)
{
- final boolean[] confirmed = new boolean[1];
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- confirmed[0] = MessageDialog.openConfirm(
- getShell(),
- NLS.bind("Import OpenShift Application ", applicationName),
- message);
- }
- });
- return confirmed[0];
- }
-
- /**
- * A workspace job that will create a new project or enable the selected
- * project to be used with OpenShift.
- */
- private class ImportJob extends WorkspaceJob {
-
- private DelegatingProgressMonitor delegatingMonitor;
-
- public ImportJob(DelegatingProgressMonitor delegatingMonitor) {
- super("Importing project to workspace...");
- this.delegatingMonitor = delegatingMonitor;
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try {
- delegatingMonitor.add(monitor);
-
- if (wizardModel.isNewProject()) {
- wizardModel.importProject(delegatingMonitor);
- } else if (!wizardModel.isGitSharedProject()) {
- if (!askForConfirmation(
- NLS.bind("OpenShift application {0} will be enabled on project {1} by "
+
- "copying OpenShift configuration and enabling Git for the project.\n "
+
- "This cannot be undone. Do you wish to continue ?",
- wizardModel.getApplicationName(), wizardModel.getProjectName()),
- wizardModel.getApplicationName())) {
- return Status.CANCEL_STATUS;
- }
- wizardModel.configureUnsharedProject(delegatingMonitor);
- } else {
- if (!askForConfirmation(
- NLS.bind("OpenShift application {0} will be enabled on project {1} by copying
OpenShift " +
- "configuration and adding the OpenShift git repo as remote.\n " +
- "This cannot be undone. Do you wish to continue ?",
- wizardModel.getApplicationName(), wizardModel.getProjectName()),
- wizardModel.getApplicationName())) {
- return Status.CANCEL_STATUS;
- }
- wizardModel.configureGitSharedProject(delegatingMonitor);
- }
-
- return Status.OK_STATUS;
- } catch (final WontOverwriteException e) {
- openError("Project already present", e.getMessage());
- return Status.CANCEL_STATUS;
- } catch (final ImportFailedException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import maven project {0}.", e,
- wizardModel.getProjectName());
- } catch (IOException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not copy openshift configuration files to project {0}", e,
- wizardModel.getProjectName());
- } catch (OpenShiftException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import project to the workspace.", e);
- } catch (URISyntaxException e) {
- return OpenShiftUIActivator.createErrorStatus(
- "The url of the remote git repository is not valid", e);
- } catch (InvocationTargetException e) {
- if (isTransportException(e)) {
- TransportException te = getTransportException(e);
- return OpenShiftUIActivator
- .createErrorStatus(
- "Could not clone the repository. Authentication failed.\n"
- + " Please make sure that you added your private key to the ssh
preferences.",
- te);
- } else {
- return OpenShiftUIActivator.createErrorStatus(
- "An exception occurred while creating local git repository.", e);
- }
- } catch (Exception e) {
- return OpenShiftUIActivator.createErrorStatus(
- "Could not import project to the workspace.", e);
- } finally {
- delegatingMonitor.done();
- }
- }
- }
-
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-01-26
11:08:58 UTC (rev 38198)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -51,7 +51,7 @@
private Button useDefaultRepoPathButton;
private Text remoteNameText;
- public GitCloningSettingsWizardPage(CreateNewApplicationWizard wizard,
AbstractOpenShiftApplicationWizardModel model) {
+ public GitCloningSettingsWizardPage(AbstractOpenShiftApplicationWizard<?> wizard,
AbstractOpenShiftApplicationWizardModel model) {
super(
"Import an existing OpenShift application",
"Configure the cloning settings by specifying the clone destination if you
create a new project, and the git remote name if you're using an existing
project.",
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java 2012-01-26
11:08:58 UTC (rev 38198)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportExistingApplicationWizard.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -22,12 +22,8 @@
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;
import org.eclipse.jgit.errors.TransportException;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
import org.jboss.tools.common.ui.DelegatingProgressMonitor;
@@ -43,11 +39,10 @@
* @author Andr� Dietisheim
* @author Xavier Coulon
*/
-public class ImportExistingApplicationWizard extends Wizard implements IImportWizard {
+public class ImportExistingApplicationWizard extends
AbstractOpenShiftApplicationWizard<ImportExistingApplicationWizardModel> implements
IImportWizard {
- private ImportExistingApplicationWizardModel model;
-
public ImportExistingApplicationWizard() {
+ super();
}
@Override
@@ -73,45 +68,15 @@
}
}
- private boolean askForConfirmation(final String applicationName, final String
projectName) {
- final boolean[] confirmed = new boolean[1];
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- confirmed[0] = MessageDialog.openConfirm(getShell(),
- NLS.bind("Import OpenShift Application ", applicationName),
- NLS.bind(
- "OpenShift application {0} will be enabled on project {1} by copying
OpenShift " +
- "configuration and enable Git for the project.\n " +
- "This cannot be undone. Do you wish to continue ?", applicationName,
- projectName));
- }
- });
- return confirmed[0];
- }
-
@Override
public void addPages() {
- this.model = new ImportExistingApplicationWizardModel();
- addPage(new CredentialsWizardPage(this, model));
- addPage(new ApplicationSelectionWizardPage(this, model));
- addPage(new ProjectAndServerAdapterSettingsWizardPage(this, model));
- addPage(new GitCloningSettingsWizardPage(this, model));
+ setWizardModel(new ImportExistingApplicationWizardModel());
+ addPage(new CredentialsWizardPage(this, getWizardModel()));
+ addPage(new ApplicationSelectionWizardPage(this, getWizardModel()));
+ addPage(new ProjectAndServerAdapterSettingsWizardPage(this, getWizardModel()));
+ addPage(new GitCloningSettingsWizardPage(this, getWizardModel()));
}
- private boolean isTransportException(InvocationTargetException e) {
- return e.getTargetException() instanceof JGitInternalException
- && e.getTargetException().getCause() instanceof TransportException;
- }
-
- private TransportException getTransportException(InvocationTargetException e) {
- if (isTransportException(e)) {
- return (TransportException) ((JGitInternalException)
e.getTargetException()).getCause();
- }
- return null;
- }
-
/**
* A workspace job that will create a new project or enable the selected
* project to be used with OpenShift.
@@ -130,13 +95,13 @@
try {
delegatingMonitor.add(monitor);
- if (model.isNewProject()) {
- model.importProject(delegatingMonitor);
+ if (getWizardModel().isNewProject()) {
+ getWizardModel().importProject(delegatingMonitor);
} else {
- if (!askForConfirmation(model.getApplicationName(), model.getProjectName())) {
+ if (!askForConfirmation(getWizardModel().getApplicationName(),
getWizardModel().getProjectName())) {
return Status.CANCEL_STATUS;
}
- model.configureUnsharedProject(delegatingMonitor);
+ getWizardModel().configureUnsharedProject(delegatingMonitor);
}
return Status.OK_STATUS;
@@ -146,11 +111,11 @@
} catch (final ImportFailedException e) {
return OpenShiftUIActivator.createErrorStatus(
"Could not import maven project {0}.", e,
- model.getProjectName());
+ getWizardModel().getProjectName());
} catch (IOException e) {
return OpenShiftUIActivator.createErrorStatus(
"Could not copy openshift configuration files to project {0}", e,
- model.getProjectName());
+ getWizardModel().getProjectName());
} catch (OpenShiftException e) {
return OpenShiftUIActivator.createErrorStatus(
"Could not import project to the workspace.", e);
@@ -178,14 +143,4 @@
}
}
- private void openError(final String title, final String message) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(getShell(), title, message);
- }
- });
- }
-
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-01-26
11:08:58 UTC (rev 38198)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ProjectAndServerAdapterSettingsWizardPage.java 2012-01-26
11:12:20 UTC (rev 38199)
@@ -15,8 +15,6 @@
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.list.WritableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.validation.MultiValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
@@ -44,8 +42,6 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.WorkingSetGroup;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
import org.jboss.tools.common.ui.databinding.InvertingBooleanConverter;
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
@@ -154,7 +150,7 @@
final IObservableValue existingProjectValidityObservable = BeanProperties.value(
ProjectAndServerAdapterSettingsWizardPageModel.PROPERTY_EXISTING_PROJECT_VALIDITY).observe(pageModel);
final UseExistingOpenProjectValidator existingProjectValidator = new
UseExistingOpenProjectValidator(
- existingProjectValidityObservable, existingProjectNameTextObservable);
+ existingProjectValidityObservable);
dbc.addValidationStatusProvider(existingProjectValidator);
ControlDecorationSupport.create(existingProjectValidator, SWT.LEFT | SWT.TOP);
@@ -218,10 +214,6 @@
return serverAdapterGroup;
}
- private IServerType getServerTypeToCreate() {
- return
ServerCore.findServerType("org.jboss.tools.openshift.express.openshift.server.type");
- }
-
private WorkingSetGroup createWorkingSetGroup(Composite container, DataBindingContext
dbc) {
return new WorkingSetGroup(container, null, new String[] {
"org.eclipse.ui.resourceWorkingSetPage", //$NON-NLS-1$
"org.eclipse.jdt.ui.JavaWorkingSetPage" /* JavaWorkingSetUpdater.ID */});
@@ -266,12 +258,8 @@
private final IObservableValue existingProjectValidityObservable;
- private final IObservableValue existingProjectNameTextObservable;
-
- public UseExistingOpenProjectValidator(IObservableValue
existingProjectValidityObservable,
- IObservableValue existingProjectNameTextObservable) {
+ public UseExistingOpenProjectValidator(IObservableValue
existingProjectValidityObservable) {
this.existingProjectValidityObservable = existingProjectValidityObservable;
- this.existingProjectNameTextObservable = existingProjectNameTextObservable;
}
@Override
@@ -285,17 +273,6 @@
return ValidationStatus.ok();
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.databinding.validation.MultiValidator#getTargets()
- */
- @Override
- public IObservableList getTargets() {
- WritableList targets = new WritableList();
- // targets.add(existingProjectNameTextObservable);
- return targets;
- }
-
}
/*