Author: adietish
Date: 2011-11-17 08:03:18 -0500 (Thu, 17 Nov 2011)
New Revision: 36403
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizard.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardModel.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java
Log:
[JBIDE-9927] added "embed" button and wizard to applications page
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.ICartridge;
+import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim
+ */
+public class ApplicationWizardModel extends ObservableUIPojo {
+
+ public static final String PROPERTY_APPLICATION = "application";
+
+ private IUser user;
+ private IApplication application;
+ private String name;
+ private ICartridge cartridge;
+
+ public ApplicationWizardModel(IUser user) {
+ this.user = user;
+ }
+
+ public IUser getUser() {
+ return user;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String setName(String name) {
+ return this.name = name;
+ }
+
+ public void setCartridge(ICartridge cartridge) {
+ this.cartridge = cartridge;
+ }
+
+ public void createApplication() throws OpenShiftException {
+ createApplication(name, cartridge);
+ }
+
+
+ public void setApplication(IApplication application) {
+ firePropertyChange(PROPERTY_APPLICATION, this.application, this.application =
application);
+ }
+
+ public IApplication getApplication() {
+ return application;
+ }
+
+ public void createApplication(String name, ICartridge cartridge) throws
OpenShiftException {
+ IApplication application = getUser().createApplication(name, cartridge);
+ setApplication(application);
+ }
+
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.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/ApplicationWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -90,7 +90,7 @@
domainGroup.setText("Domain");
GridDataFactory.fillDefaults()
.grab(true, false).align(SWT.FILL, SWT.TOP).span(3, 1).applyTo(domainGroup);
- GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(3).applyTo(domainGroup);
+ GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(4).applyTo(domainGroup);
Label namespaceLabel = new Label(domainGroup, SWT.NONE);
namespaceLabel.setText("&Domain name");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
@@ -123,11 +123,11 @@
applicationGroup.setText("Available Applications");
GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).hint(400,
260).span(3, 1)
.applyTo(applicationGroup);
- GridLayoutFactory.fillDefaults().numColumns(3).margins(6,
6).applyTo(applicationGroup);
+ GridLayoutFactory.fillDefaults().numColumns(4).margins(6,
6).applyTo(applicationGroup);
Composite tableContainer = new Composite(applicationGroup, SWT.NONE);
this.viewer = createTable(tableContainer);
- GridDataFactory.fillDefaults().span(3, 1).align(SWT.FILL, SWT.FILL).grab(true,
true).applyTo(tableContainer);
+ GridDataFactory.fillDefaults().span(4, 1).align(SWT.FILL, SWT.FILL).grab(true,
true).applyTo(tableContainer);
viewer.addDoubleClickListener(onApplicationDoubleClick());
Binding selectedApplicationBinding = dbc.bindValue(
ViewerProperties.singleSelection().observe(viewer),
@@ -140,7 +140,8 @@
return ValidationStatus.ok();
}
else {
- return ValidationStatus.info("Please select an application to start with, or
create a new one");
+ return ValidationStatus
+ .info("Please select an application to start with, or create a new
one");
}
}
}),
@@ -157,6 +158,12 @@
DataBindingUtils.bindEnablementToValidationStatus(deleteButton, IStatus.OK, dbc,
selectedApplicationBinding);
deleteButton.addSelectionListener(onDelete(dbc));
+ Button embedButton = new Button(applicationGroup, SWT.PUSH);
+ embedButton.setText("E&mbed");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80,
SWT.DEFAULT).applyTo(embedButton);
+ DataBindingUtils.bindEnablementToValidationStatus(embedButton, IStatus.OK, dbc,
selectedApplicationBinding);
+ embedButton.addSelectionListener(onEmbed(dbc));
+
Button detailsButton = new Button(applicationGroup, SWT.PUSH);
detailsButton.setText("De&tails");
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).grab(true, false).hint(80,
SWT.DEFAULT)
@@ -305,7 +312,7 @@
@Override
public void widgetSelected(SelectionEvent e) {
Shell shell = getContainer().getShell();
- NewApplicationDialog applicationDialog = new NewApplicationDialog(model.getUser());
+ NewApplicationWizard applicationDialog = new NewApplicationWizard(model.getUser());
if (WizardUtils.openWizardDialog(applicationDialog, shell) == Dialog.OK) {
viewer.refresh();
model.setSelectedApplication(applicationDialog.getApplication());
@@ -314,6 +321,16 @@
};
}
+ private SelectionAdapter onEmbed(final DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ WizardUtils.openWizardDialog(new EmbedCartridgeWizard(model.getUser()), getShell());
+ }
+ };
+ }
+
private SelectionAdapter onDetails(DataBindingContext dbc) {
return new SelectionAdapter() {
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+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.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenShiftException;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+
+/**
+ * @author André Dietisheim
+ */
+public class EmbedCartridgeWizard extends Wizard {
+
+ private ApplicationWizardModel wizardModel;
+
+ public EmbedCartridgeWizard(IUser user) {
+ this.wizardModel = new ApplicationWizardModel(user);
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
+ try {
+ WizardUtils.runInWizard(new Job(NLS.bind("Creating application
\"{0}\"...", wizardModel.getName())) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ wizardModel.createApplication();
+ queue.offer(true);
+ } catch (OpenShiftException e) {
+ queue.offer(false);
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ NLS.bind("Could not create application \"{0}\"",
wizardModel.getName()), e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ return queue.poll(10, TimeUnit.SECONDS);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new EmbedCartridgeWizardPage(wizardModel, this));
+ }
+
+ public IApplication getApplication() {
+ return wizardModel.getApplication();
+ }
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.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/EmbedCartridgeWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -49,7 +49,7 @@
private EmbedCartridgeWizardPageModel model;
private CheckboxTableViewer viewer;
- public EmbedCartridgeWizardPage(NewApplicationWizardModel wizardModel, IWizard wizard)
{
+ public EmbedCartridgeWizardPage(ApplicationWizardModel wizardModel, IWizard wizard) {
super("Embed Cartridges", "Please select the cartridges to embed into
your application",
"EmbedCartridgePage", wizard);
this.model = new EmbedCartridgeWizardPageModel(wizardModel);
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPageModel.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -30,12 +30,12 @@
public static final String PROPERTY_EMBEDDABLE_CARTRIDGES =
"embeddableCartridges";
public static final String PROPERTY_SELECTED_CARTRIDGE = "selectedCartridge";
- private NewApplicationWizardModel wizardModel;
+ private ApplicationWizardModel wizardModel;
private List<IEmbeddableCartridge> embeddableCartridges = new
ArrayList<IEmbeddableCartridge>();
private List<IEmbeddableCartridge> selectedEmbeddableCartridges = new
ArrayList<IEmbeddableCartridge>();
- public EmbedCartridgeWizardPageModel(NewApplicationWizardModel wizardModel) {
+ public EmbedCartridgeWizardPageModel(ApplicationWizardModel wizardModel) {
this.wizardModel = wizardModel;
}
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-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.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.client.IApplication;
-import org.jboss.tools.openshift.express.client.IUser;
-import org.jboss.tools.openshift.express.client.OpenShiftException;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-
-/**
- * @author André Dietisheim
- */
-public class NewApplicationDialog extends Wizard {
-
- private NewApplicationWizardModel newApplicationWizardModel;
-
- public NewApplicationDialog(IUser user) {
- this.newApplicationWizardModel = new NewApplicationWizardModel(user);
- setNeedsProgressMonitor(true);
- }
-
- @Override
- public boolean performFinish() {
- final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
- try {
- WizardUtils.runInWizard(new Job("Creating application...") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- newApplicationWizardModel.createApplication();
- queue.offer(true);
- } catch (OpenShiftException e) {
- queue.offer(false);
- return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- NLS.bind("Could not create application \"{0}\"",
newApplicationWizardModel.getName()), e);
- }
- return Status.OK_STATUS;
- }
- }, getContainer());
- return queue.poll(10, TimeUnit.SECONDS);
- } catch (Exception e) {
- return false;
- }
- }
-
- @Override
- public void addPages() {
- addPage(new NewApplicationWizardPage(newApplicationWizardModel, this));
- addPage(new EmbedCartridgeWizardPage(newApplicationWizardModel, this));
- }
-
- public IApplication getApplication() {
- return newApplicationWizardModel.getApplication();
- }
-}
Copied:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizard.java
(from rev 36402,
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationDialog.java)
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizard.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizard.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.wizard;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+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.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.client.IApplication;
+import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenShiftException;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewApplicationWizard extends Wizard {
+
+ private ApplicationWizardModel wizardModel;
+
+ public NewApplicationWizard(IUser user) {
+ this.wizardModel = new ApplicationWizardModel(user);
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
+ try {
+ WizardUtils.runInWizard(new Job(NLS.bind("Creating application
\"{0}\"...", wizardModel.getName())) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ wizardModel.createApplication();
+ queue.offer(true);
+ } catch (OpenShiftException e) {
+ queue.offer(false);
+ return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ NLS.bind("Could not create application \"{0}\"",
wizardModel.getName()), e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ return queue.poll(10, TimeUnit.SECONDS);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new NewApplicationWizardPage(wizardModel, this));
+ addPage(new EmbedCartridgeWizardPage(wizardModel, this));
+ }
+
+ public IApplication getApplication() {
+ return wizardModel.getApplication();
+ }
+}
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardModel.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardModel.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.wizard;
-
-import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
-import org.jboss.tools.openshift.express.client.IApplication;
-import org.jboss.tools.openshift.express.client.ICartridge;
-import org.jboss.tools.openshift.express.client.IUser;
-import org.jboss.tools.openshift.express.client.OpenShiftException;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-
-/**
- * @author André Dietisheim
- */
-public class NewApplicationWizardModel extends ObservableUIPojo {
-
- private IUser user;
-
- private String name;
- private ICartridge cartridge;
-
- private IApplication application;
-
- public NewApplicationWizardModel(IUser user) {
- this.user = user;
- }
-
- public IUser getUser() {
- return user;
- }
-
- public String getName() {
- return name;
- }
-
- public String setName(String name) {
- return this.name = name;
- }
-
- public ICartridge getCartridge() {
- return cartridge;
- }
-
- public void setCartridge(ICartridge cartridge) {
- this.cartridge = cartridge;
- }
-
- public void setApplication(IApplication application) {
- this.application = application;
- }
-
- public void createApplication() throws OpenShiftException {
- IApplication application = user.createApplication(name, cartridge);
- setApplication(application);
- }
-
- public IApplication getApplication() {
- return application;
- }
-
- public boolean hasApplication(String name) {
- try {
- return user.getApplicationByName(name) != null;
- } catch (OpenShiftException e) {
- OpenShiftUIActivator.log(
- OpenShiftUIActivator.createErrorStatus("Could not get application by
name", e));
- return false;
- }
- }
-}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -46,9 +46,9 @@
public class NewApplicationWizardPage extends AbstractOpenShiftWizardPage {
private NewApplicationWizardPageModel model;
- private NewApplicationWizardModel wizardModel;
+ private ApplicationWizardModel wizardModel;
- public NewApplicationWizardPage(NewApplicationWizardModel wizardModel, IWizard wizard)
{
+ public NewApplicationWizardPage(ApplicationWizardModel wizardModel, IWizard wizard) {
super("Create new OpenShift Express application", "Create new OpenShift
Express application",
"Create new OpenShift Express application", wizard);
this.wizardModel = wizardModel;
@@ -154,9 +154,8 @@
@Override
protected void onPageWillGetDeactivated(Direction progress, final PageChangingEvent
event, DataBindingContext dbc) {
- final String name = wizardModel.getName();
try {
- WizardUtils.runInWizard(new Job(NLS.bind("Creating application
\"{0}\"...", name)) {
+ WizardUtils.runInWizard(new Job(NLS.bind("Creating application
\"{0}\"...", wizardModel.getName())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
@@ -164,7 +163,7 @@
wizardModel.createApplication();
} catch (OpenShiftException e) {
event.doit = false;
- return OpenShiftUIActivator.createErrorStatus("Could not create application
\"{0}\"", e, name);
+ return OpenShiftUIActivator.createErrorStatus("Could not create application
\"{0}\"", e, wizardModel.getName());
}
return Status.OK_STATUS;
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java 2011-11-17
12:05:44 UTC (rev 36402)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPageModel.java 2011-11-17
13:03:18 UTC (rev 36403)
@@ -29,13 +29,13 @@
public static final String PROPERTY_CARTRIDGES = "cartridges";
public static final String PROPERTY_SELECTED_CARTRIDGE = "selectedCartridge";
- private NewApplicationWizardModel wizardModel;
+ private ApplicationWizardModel wizardModel;
private List<ICartridge> cartridges = new ArrayList<ICartridge>();
private ICartridge selectedCartridge;
private StringPreferenceValue selectedCartridgePreference;
- public NewApplicationWizardPageModel(NewApplicationWizardModel wizardModel) {
+ public NewApplicationWizardPageModel(ApplicationWizardModel wizardModel) {
this.wizardModel = wizardModel;
this.selectedCartridgePreference = new StringPreferenceValue(
"org.jboss.tools.openshift.express.internal.ui.wizard.NewApplicationWizard.selectedCartridge",