Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316345 - New Plug-in wizard resets the "Generate an activator..." flag
Summary: New Plug-in wizard resets the "Generate an activator..." flag
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P5 normal with 2 votes (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 278702 355374 378746 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-09 14:03 EDT by Lars Vogel CLA
Modified: 2012-10-30 13:09 EDT (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-06-09 14:03:10 EDT
The PDE new Plug-in Wizard does not remember the selection of an activator if you switch between the wizard pages. 

To test, de-select the flag "Generate an activator..." and go one step back for forth and return then to the second page. The flag is set again.
Comment 1 Curtis Windatt CLA 2011-08-22 11:46:20 EDT
*** Bug 355374 has been marked as a duplicate of this bug. ***
Comment 2 Curtis Windatt CLA 2012-05-07 16:52:59 EDT
*** Bug 378746 has been marked as a duplicate of this bug. ***
Comment 3 Curtis Windatt CLA 2012-05-07 16:53:41 EDT
*** Bug 278702 has been marked as a duplicate of this bug. ***
Comment 4 Lars Vogel CLA 2012-05-07 16:57:45 EDT
Looks like every two years I open the same bug... ;-)

Sorry for this.
Comment 5 Lars Vogel CLA 2012-09-18 17:37:22 EDT
The following change should IMHO fix this bug:

PluginContentPage

if (visible) {
 			fMainPage.updateData();
-			fGenerateActivator.setSelection(!fData.isSimple());
 			fGenerateActivator.setEnabled(!fData.isSimple());
 			fClassLabel.setEnabled(!fData.isSimple() && fGenerateActivator.getSelection());
 			fClassText.setEnabled(!fData.isSimple() && fGenerateActivator.getSelection());

@Curtis: Care for a patch?
Comment 6 Curtis Windatt CLA 2012-09-19 16:40:48 EDT
Your solution ends up setting generator information in the wizard data object which is incorrect.  Also I don't think the behaviour of whether the activator should be on or not is quite right.

So, with bug 297143 closed, and creating an activator remaining the default, I have a better fix for this.  I'll apply it after M2 week.
Comment 7 Lars Vogel CLA 2012-09-20 00:58:45 EDT
Great to hear that Curtis. But I don't think I modified settings. I just removed this line:

fGenerateActivator.setSelection(!fData.isSimple());

and IMHO fGenerateActivator is the UI field. The corresponding method was called whenever the page was displayed hence set the selection again.

But if you have a better or different solution that is even better. Looking forward to it.
Comment 8 Curtis Windatt CLA 2012-09-24 12:32:19 EDT
The data object gathered its settings from the UI elements.  Your change to leave the selection even if the element was enabled would change what is stored.  I'm not saying that the page uses good design :)

Fixed in master:

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=fe8c42cffd5d1778fef3dcaba4719fab500c188e

The activator setting now follows the same basic logic as the 'contribute to UI' checkbox.  Turns on by default if you check the 'create a java project' option on the first page.  Turns off if the field is disabled.  Uses dialog settings otherwise.
Comment 9 Curtis Windatt CLA 2012-10-30 13:09:04 EDT
Verified in I20121030-0800