Author: adietish
Date: 2012-05-10 13:46:45 -0400 (Thu, 10 May 2012)
New Revision: 40920
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbeddedCartridgeWizardStrategy.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
Log:
[JBIDE-10852] implementing conflicting cases when embedding cartridges
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-10
17:31:56 UTC (rev 40919)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-05-10
17:46:45 UTC (rev 40920)
@@ -13,7 +13,6 @@
import java.lang.reflect.InvocationTargetException;
import java.net.SocketTimeoutException;
import java.util.Collection;
-import java.util.Set;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateListStrategy;
@@ -39,9 +38,6 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ControlDecoration;
@@ -76,7 +72,6 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.common.ui.WizardUtils;
@@ -116,6 +111,7 @@
private Group newAppEmbeddableCartridgesGroup;
private Button checkAllButton;
private Button uncheckAllButton;
+ private EmbeddedCartridgeWizardStrategy embeddedCartridgeWizardStrategy;
public ApplicationConfigurationWizardPage(IWizard wizard,
OpenShiftExpressApplicationWizardModel wizardModel) {
super("Setup OpenShift Application",
@@ -140,6 +136,8 @@
GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL,
SWT.FILL).applyTo(container);
createApplicationSelectionGroup(container, dbc);
createApplicationConfigurationGroup(container, dbc);
+
+ this.embeddedCartridgeWizardStrategy = new EmbeddedCartridgeWizardStrategy(viewer,
this, pageModel);
}
private Composite createApplicationSelectionGroup(Composite container,
DataBindingContext dbc) {
@@ -233,8 +231,8 @@
};
try {
WizardUtils.runInWizard(j, getContainer(), dbc);
- } catch(InvocationTargetException ite) {
- } catch(InterruptedException ie) {
+ } catch (InvocationTargetException ite) {
+ } catch (InterruptedException ie) {
}
}
}
@@ -462,19 +460,9 @@
try {
IEmbeddableCartridge cartridge = (IEmbeddableCartridge) event.getElement();
if (event.getChecked()) {
- if (IEmbeddableCartridge.PHPMYADMIN_34.equals(cartridge)) {
- addPhpMyAdminCartridge(cartridge);
- } else if (IEmbeddableCartridge.JENKINS_14.equals(cartridge)) {
- addJenkinsCartridge(cartridge);
- } else {
- addCartridge(cartridge);
- }
+ embeddedCartridgeWizardStrategy.addCartridge(cartridge);
} else {
- if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
- removeMySQLCartridge(cartridge);
- } else {
- removeCartridge(cartridge);
- }
+ embeddedCartridgeWizardStrategy.removeCartridge(cartridge);
}
} catch (OpenShiftException e) {
OpenShiftUIActivator.log("Could not process embeddable cartridges", e);
@@ -485,99 +473,20 @@
};
}
- private void addJenkinsCartridge(final IEmbeddableCartridge cartridge) throws
OpenShiftException,
- SocketTimeoutException {
- if (pageModel.hasApplicationOfType(ICartridge.JENKINS_14)) {
- pageModel.getSelectedEmbeddableCartridges().add(cartridge);
- } else {
- final JenkinsApplicationDialog dialog = new JenkinsApplicationDialog(getShell());
- if (dialog.open() == Dialog.OK) {
- createJenkinsApplication(cartridge, dialog.getValue());
- } else {
- viewer.setChecked(cartridge, false);
- }
- }
- }
- private void createJenkinsApplication(final IEmbeddableCartridge cartridge, final String
name) {
- try {
- WizardUtils.runInWizard(new Job(NLS.bind("Creating jenkins application
\"{0}\"...", name)) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- IApplication jenkinsApplication = pageModel.createJenkinsApplication(name,
monitor);
- pageModel.getSelectedEmbeddableCartridges().add(cartridge);
- openLogDialog(jenkinsApplication);
- return Status.OK_STATUS;
- } catch (Exception e) {
- getShell().getDisplay().syncExec(new Runnable() {
- @Override
- public void run() {
- viewer.setChecked(cartridge, false);
- }
- });
- return OpenShiftUIActivator.createErrorStatus("Could not load embeddable
cartridges", e);
- }
- }
-
- }, getContainer());
- } catch (Exception e) {
- // ignore
- }
- }
-
- private void addPhpMyAdminCartridge(IEmbeddableCartridge cartridge) throws
OpenShiftException {
- if (!viewer.getChecked(IEmbeddableCartridge.MYSQL_51)) {
- if (MessageDialog.openQuestion(getShell(), "Embed mysql cartridge",
- "To embed phpmyadmin, you'd also have to embed mysql.")) {
- pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
- pageModel.selectEmbeddedCartridges(cartridge);
- viewer.setChecked(IEmbeddableCartridge.MYSQL_51, true);
- } else {
- viewer.setChecked(cartridge, false);
- }
- } else {
- pageModel.getSelectedEmbeddableCartridges().add(cartridge);
- }
- }
-
- private void addCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException {
- pageModel.getSelectedEmbeddableCartridges().add(cartridge);
- }
-
- private void removeMySQLCartridge(IEmbeddableCartridge cartridge) throws
OpenShiftException {
- Set<IEmbeddableCartridge> checkedCartridges =
pageModel.getSelectedEmbeddableCartridges();
- if (viewer.getChecked(IEmbeddableCartridge.PHPMYADMIN_34)) {
- if (MessageDialog.openQuestion(getShell(), "Remove phpmyadmin cartridge",
- "If you remove the mysql cartridge, you'd also have to remove
phpmyadmin.")) {
- checkedCartridges.remove(IEmbeddableCartridge.PHPMYADMIN_34);
- checkedCartridges.remove(cartridge);
- viewer.setChecked(IEmbeddableCartridge.PHPMYADMIN_34, false);
- } else {
- viewer.setChecked(cartridge, true);
- }
- } else {
- checkedCartridges.remove(cartridge);
- }
- }
-
- private void removeCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException
{
- pageModel.getSelectedEmbeddableCartridges().remove(cartridge);
- }
-
private SelectionListener onCheckAll() {
return new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- viewer.setAllChecked(true);
- try {
- addJenkinsCartridge(IEmbeddableCartridge.JENKINS_14);
- } catch (OpenShiftException ex) {
- OpenShiftUIActivator.log("Could not select jenkins cartridge", ex);
- } catch (SocketTimeoutException ex) {
- OpenShiftUIActivator.log("Could not select jenkins cartridge", ex);
- }
+// viewer.setAllChecked(true);
+// try {
+// addJenkinsCartridge(IEmbeddableCartridge.JENKINS_14);
+// } catch (OpenShiftException ex) {
+// OpenShiftUIActivator.log("Could not select jenkins cartridge", ex);
+// } catch (SocketTimeoutException ex) {
+// OpenShiftUIActivator.log("Could not select jenkins cartridge", ex);
+// }
}
};
@@ -694,43 +603,6 @@
}
}
- private static class JenkinsApplicationDialog extends InputDialog {
-
- public JenkinsApplicationDialog(Shell shell) {
- super(
- shell,
- "New Jenkins application",
- "To embed Jenkins into your application, you first have to create a separate
Jenkins application. "
- + "Please provide a name for this new Jenkins application (lower-case letters
and digits only):"
- , null, new JenkinsNameValidator());
- }
-
- private static class JenkinsNameValidator implements IInputValidator {
-
- @Override
- public String isValid(String input) {
- if (StringUtils.isEmpty(input)) {
- return "You have to provide a name for the jenkins application";
- }
-
- if (!StringUtils.isAlphaNumeric(input)) {
- return "The name may only contain lower-case letters and digits.";
- }
- return null;
- }
- }
- }
-
- private void openLogDialog(final IApplication application) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- new CreationLogDialog(getShell(), application).open();
- }
- });
- }
-
/**
* Viewer element comparer based on #equals(). The default implementation in
* CheckboxTableViewer compares elements based on instance identity.
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-10
17:31:56 UTC (rev 40919)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-05-10
17:46:45 UTC (rev 40920)
@@ -382,10 +382,14 @@
return wizardModel.getSelectedEmbeddableCartridges();
}
- public void selectEmbeddedCartridges(IEmbeddableCartridge cartridge) {
-
+ public void selectEmbeddedCartridges(IEmbeddableCartridge cartridge) throws
OpenShiftException {
+ getSelectedEmbeddableCartridges().add(cartridge);
}
+ public void unselectEmbeddedCartridges(IEmbeddableCartridge cartridge) throws
OpenShiftException {
+ getSelectedEmbeddableCartridges().remove(cartridge);
+ }
+
public void setSelectedEmbeddableCartridges(Set<IEmbeddableCartridge>
selectedEmbeddableCartridges) {
firePropertyChange(PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES,
wizardModel.getSelectedEmbeddableCartridges(),
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbeddedCartridgeWizardStrategy.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbeddedCartridgeWizardStrategy.java
(rev 0)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbeddedCartridgeWizardStrategy.java 2012-05-10
17:46:45 UTC (rev 40920)
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * 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.net.SocketTimeoutException;
+
+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.Dialog;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
+
+import com.openshift.client.IApplication;
+import com.openshift.client.ICartridge;
+import com.openshift.client.IEmbeddableCartridge;
+import com.openshift.client.OpenShiftException;
+
+/**
+ * A UI strategy that is able to add and remove embedded cartridges while
+ * fullfilling requirements and resolving conflicts (ex. mutual exclusivity
+ * etc.)
+ *
+ * @author Andre Dietisheim
+ */
+public class EmbeddedCartridgeWizardStrategy {
+
+ private CheckboxTableViewer viewer;
+ private ApplicationConfigurationWizardPageModel pageModel;
+ private IWizardPage wizardPage;
+
+ public EmbeddedCartridgeWizardStrategy(CheckboxTableViewer viewer, IWizardPage
wizardPage,
+ ApplicationConfigurationWizardPageModel pageModel) {
+ this.viewer = viewer;
+ this.wizardPage = wizardPage;
+ this.pageModel = pageModel;
+ }
+
+ public void addCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException,
SocketTimeoutException {
+ if (IEmbeddableCartridge.PHPMYADMIN_34.equals(cartridge)) {
+ addPhpMyAdmin();
+ } else if (IEmbeddableCartridge.JENKINS_14.equals(cartridge)) {
+ addJenkins(cartridge);
+ } else if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
+ addMySql();
+ } else if (IEmbeddableCartridge.POSTGRESQL_84.equals(cartridge)) {
+ addPostgreSql();
+ } else if (IEmbeddableCartridge.ROCKMONGO_11.equals(cartridge)) {
+ addRockMongo();
+ } else if (IEmbeddableCartridge._10GEN_MMS_AGENT_01.equals(cartridge)) {
+ add10gen();
+ } else {
+ pageModel.selectEmbeddedCartridges(cartridge);
+ }
+ }
+
+ public void removeCartridge(IEmbeddableCartridge cartridge) throws OpenShiftException {
+ if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
+ removeMySQL();
+ } else if (IEmbeddableCartridge.MONGODB_20.equals(cartridge)) {
+ removeMongoDb();
+ } else {
+ pageModel.unselectEmbeddedCartridges(cartridge);
+ }
+ }
+
+ private void addJenkins(final IEmbeddableCartridge cartridge) throws
OpenShiftException,
+ SocketTimeoutException {
+ if (pageModel.hasApplicationOfType(ICartridge.JENKINS_14)) {
+ pageModel.getSelectedEmbeddableCartridges().add(cartridge);
+ } else {
+ final JenkinsApplicationDialog dialog = new JenkinsApplicationDialog(getShell());
+ if (dialog.open() == Dialog.OK) {
+ createJenkinsApplication(cartridge, dialog.getValue());
+ } else {
+ viewer.setChecked(cartridge, false);
+ }
+ }
+ }
+
+ private void createJenkinsApplication(final IEmbeddableCartridge cartridge, final String
name) {
+ try {
+ WizardUtils.runInWizard(new Job(NLS.bind("Creating jenkins application
\"{0}\"...", name)) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ IApplication jenkinsApplication = pageModel.createJenkinsApplication(name,
monitor);
+ pageModel.getSelectedEmbeddableCartridges().add(cartridge);
+ openLogDialog(jenkinsApplication);
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ getShell().getDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ viewer.setChecked(cartridge, false);
+ }
+ });
+ return OpenShiftUIActivator.createErrorStatus("Could not load embeddable
cartridges", e);
+ }
+ }
+
+ }, getContainer());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private void addPhpMyAdmin() throws OpenShiftException {
+ if (!viewer.getChecked(IEmbeddableCartridge.MYSQL_51)) {
+ if (MessageDialog.openQuestion(getShell(), "Embed phpMyAdmin Cartridge",
+ "To embed phpMyAdmin, you'd also have to embed MySQL. \n\nAlso embed
MySQL?")) {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, true);
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, false);
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ viewer.setChecked(IEmbeddableCartridge.PHPMYADMIN_34, false);
+ }
+ } else {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
+ }
+ }
+
+ private void addMySql()
+ throws OpenShiftException, SocketTimeoutException {
+ if (viewer.getChecked(IEmbeddableCartridge.POSTGRESQL_84)) {
+ if (MessageDialog
+ .openQuestion(getShell(), "Remove PostgreSQL Cartridge",
+ "MySQL and PostgreSQL are mutually exclusive. To embed MySQL, you have to
remove PostgreSQL. \n\nRemove PostgreSQL?")) {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
+ viewer.setChecked(IEmbeddableCartridge.POSTGRESQL_84, false);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, false);
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ }
+ } else {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ }
+ }
+
+ private void addPostgreSql()
+ throws OpenShiftException, SocketTimeoutException {
+ if (viewer.getChecked(IEmbeddableCartridge.MYSQL_51)) {
+ if (MessageDialog
+ .openQuestion(getShell(), "Remove MySQL Cartridge",
+ "MySQL and PostgreSQL are mutually exclusive. To embed PostgreSQL, you have
to remove MySQL. \n\nRemove MySQL?")) {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, false);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.POSTGRESQL_84, false);
+ }
+ } else {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.POSTGRESQL_84);
+ }
+ }
+
+ private void removeMySQL() throws OpenShiftException {
+ if (viewer.getChecked(IEmbeddableCartridge.PHPMYADMIN_34)) {
+ if (MessageDialog.openQuestion(getShell(), "Remove phpmyadmin cartridge",
+ "If you remove the mysql cartridge, you'd also have to remove
phpmyadmin.")) {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
+ viewer.setChecked(IEmbeddableCartridge.PHPMYADMIN_34, false);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, true);
+ }
+ } else {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ }
+ }
+
+ private void addRockMongo() throws OpenShiftException {
+ if (!viewer.getChecked(IEmbeddableCartridge.MONGODB_20)) {
+ if (MessageDialog.openQuestion(getShell(), "Embed MongoDB Cartridge",
+ "To embed RockMongo, you'd also have to embed MongoDB. \n\nAlso embed
MongoDB?")) {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
+ viewer.setChecked(IEmbeddableCartridge.MONGODB_20, true);
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.ROCKMONGO_11);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MONGODB_20, false);
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
+ viewer.setChecked(IEmbeddableCartridge.ROCKMONGO_11, false);
+ }
+ } else {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
+ }
+ }
+
+ private void removeMongoDb() throws OpenShiftException {
+ if (viewer.getChecked(IEmbeddableCartridge.ROCKMONGO_11)) {
+ if (MessageDialog.openQuestion(getShell(), "Remove MongoDB cartridge",
+ "If you remove the MongoDB cartridge, you'd also have to remove
RockMongo.")) {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.ROCKMONGO_11);
+ viewer.setChecked(IEmbeddableCartridge.ROCKMONGO_11, false);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MONGODB_20, true);
+ }
+ } else {
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
+ }
+ }
+
+ private void add10gen() throws OpenShiftException {
+ if (!viewer.getChecked(IEmbeddableCartridge.MONGODB_20)) {
+ if (MessageDialog.openQuestion(getShell(), "Embed 10gen Cartridge",
+ "To embed 10gen cartridge, you'd also have to embed MongoDB. \n\nAlso embed
MongoDB?")) {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.MONGODB_20);
+ viewer.setChecked(IEmbeddableCartridge.MONGODB_20, true);
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge._10GEN_MMS_AGENT_01);
+ } else {
+ viewer.setChecked(IEmbeddableCartridge.MONGODB_20, false);
+ pageModel.unselectEmbeddedCartridges(IEmbeddableCartridge.MYSQL_51);
+ viewer.setChecked(IEmbeddableCartridge._10GEN_MMS_AGENT_01, false);
+ }
+ } else {
+ pageModel.selectEmbeddedCartridges(IEmbeddableCartridge.PHPMYADMIN_34);
+ }
+ }
+
+
+ private Shell getShell() {
+ return viewer.getControl().getShell();
+ }
+
+ private IWizardContainer getContainer() {
+ return wizardPage.getWizard().getContainer();
+ }
+
+ private void openLogDialog(final IApplication application) {
+ getShell().getDisplay().syncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ new CreationLogDialog(getShell(), application).open();
+ }
+ });
+ }
+
+ private static class JenkinsApplicationDialog extends InputDialog {
+
+ public JenkinsApplicationDialog(Shell shell) {
+ super(
+ shell,
+ "New Jenkins application",
+ "To embed Jenkins into your application, you first have to create a separate
Jenkins application. "
+ + "Please provide a name for this new Jenkins application (lower-case letters
and digits only):"
+ , null, new JenkinsNameValidator());
+ }
+
+ private static class JenkinsNameValidator implements IInputValidator {
+
+ @Override
+ public String isValid(String input) {
+ if (StringUtils.isEmpty(input)) {
+ return "You have to provide a name for the jenkins application";
+ }
+
+ if (!StringUtils.isAlphaNumeric(input)) {
+ return "The name may only contain lower-case letters and digits.";
+ }
+ return null;
+ }
+ }
+ }
+}
Property changes on:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbeddedCartridgeWizardStrategy.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain