Bug 316345 - Applies the changes in PDE for the e4 tools copy
of the WizardPage
PDE changed the PluginContentPage implementation in
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=fe8c42cffd5d1778fef3dcaba4719fab500c188e
this commit does the same for the e4 tools
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/PluginContentPage.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/PluginContentPage.java
index 6a1d0e9..451f670 100644
--- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/PluginContentPage.java
+++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/project/PluginContentPage.java
@@ -267,7 +267,17 @@
public void setVisible(boolean visible) {
if (visible) {
fMainPage.updateData();
+
+ boolean wasGenActivatorEnabled = fGenerateActivator.isEnabled();
fGenerateActivator.setEnabled(!fData.isSimple());
+ // if fGenerateActivator is disabled, set selection to false
+ if (!fGenerateActivator.isEnabled()) {
+ fGenerateActivator.setSelection(false);
+ }
+ // if the fGenerateActivator was disabled and is now enabled, then set the selection to true
+ else if (!wasGenActivatorEnabled) {
+ fGenerateActivator.setSelection(true);
+ }
fClassLabel.setEnabled(!fData.isSimple() && fGenerateActivator.getSelection());
fClassText.setEnabled(!fData.isSimple() && fGenerateActivator.getSelection());
boolean wasUIPluginEnabled = fUIPlugin.isEnabled();
@@ -341,7 +351,9 @@
* @param settings
*/
public void saveSettings(IDialogSettings settings) {
- settings.put(S_GENERATE_ACTIVATOR, !fGenerateActivator.getSelection());
+ if (fGenerateActivator.isEnabled()) {
+ settings.put(S_GENERATE_ACTIVATOR, !fGenerateActivator.getSelection());
+ }
if (fUIPlugin.isEnabled()) {
settings.put(S_UI_PLUGIN, !fUIPlugin.getSelection());
}