Author: adietish
Date: 2011-11-18 11:39:41 -0500 (Fri, 18 Nov 2011)
New Revision: 36445
Modified:
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/EmbedCartridgeWizardPage.java
Log:
[JBIDE-9927] now removing phpmyadmin if you remove mysql cartridge
Modified:
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 2011-11-18
16:29:15 UTC (rev 36444)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizard.java 2011-11-18
16:39:41 UTC (rev 36445)
@@ -42,7 +42,7 @@
final ArrayBlockingQueue<Boolean> queue = new
ArrayBlockingQueue<Boolean>(1);
try {
WizardUtils.runInWizard(
- new Job(NLS.bind("Embedding cartridges to application
\"{0}\"...",
+ new Job(NLS.bind("Adding/Removing embedded cartridges for application
{0}...",
wizardModel.getApplication().getName())) {
@Override
@@ -53,7 +53,7 @@
} catch (OpenShiftException e) {
queue.offer(false);
return new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- NLS.bind("Could not embed cartridges to application
\"{0}\"",
+ NLS.bind("Could not embed cartridges to application {0}",
wizardModel.getApplication().getName()), e);
}
return Status.OK_STATUS;
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-18
16:29:15 UTC (rev 36444)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/EmbedCartridgeWizardPage.java 2011-11-18
16:39:41 UTC (rev 36445)
@@ -140,7 +140,11 @@
addCartridge(cartridge);
}
} else {
- model.getSelectedEmbeddableCartridges().remove(cartridge);
+ if (IEmbeddableCartridge.MYSQL_51.equals(cartridge)) {
+ removeMySQLCartridge(cartridge);
+ } else {
+ removeCartridge(cartridge);
+ }
}
}
};
@@ -188,11 +192,11 @@
private void addPhpMyAdminCartridge(IEmbeddableCartridge cartridge) {
if (!viewer.getChecked(IEmbeddableCartridge.MYSQL_51)) {
- if (MessageDialog.openQuestion(getShell(), "Enable MySQL cartridge",
- "To embed PhpMyAdmin, you'd also have to embed MySql. ")) {
- viewer.setChecked(IEmbeddableCartridge.MYSQL_51, true);
+ if (MessageDialog.openQuestion(getShell(), "Embed mysql cartridge",
+ "To embed phpmyadmin, you'd also have to embed mysql.")) {
model.getSelectedEmbeddableCartridges().add(IEmbeddableCartridge.MYSQL_51);
model.getSelectedEmbeddableCartridges().add(cartridge);
+ viewer.setChecked(IEmbeddableCartridge.MYSQL_51, true);
} else {
viewer.setChecked(cartridge, false);
}
@@ -205,6 +209,25 @@
model.getSelectedEmbeddableCartridges().add(cartridge);
}
+ private void removeMySQLCartridge(IEmbeddableCartridge cartridge) {
+ 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.")) {
+ model.getSelectedEmbeddableCartridges().remove(IEmbeddableCartridge.PHPMYADMIN_34);
+ model.getSelectedEmbeddableCartridges().remove(cartridge);
+ viewer.setChecked(IEmbeddableCartridge.PHPMYADMIN_34, false);
+ } else {
+ viewer.setChecked(cartridge, true);
+ }
+ } else {
+ model.getSelectedEmbeddableCartridges().add(cartridge);
+ }
+ }
+
+ private void removeCartridge(IEmbeddableCartridge cartridge) {
+ model.getSelectedEmbeddableCartridges().remove(cartridge);
+ }
+
private SelectionListener onCheckAll() {
return new SelectionAdapter() {