Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 310876

Summary: cannot restore overwrite dialog for entity wizard
Product: [WebTools] Dali JPA Tools Reporter: Ram Venkataswamy <ram.venkataswamy>
Component: JPAAssignee: Leslie Davis <les.davis>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: danny.ju, jolene.moffitt, neil.hauge
Version: unspecified   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 321736    
Attachments:
Description Flags
proposed bug fix patch
none
proposed bug fix patch
none
patch with additional recommended changes
none
proposed bug fix patch none

Description Ram Venkataswamy CLA 2010-04-28 14:42:16 EDT
Build Identifier:  M20100211-1343

cannot restore overwrite dialog for entity wizard

Reproducible: Always

Steps to Reproduce:
- Create a JPA project

- Generate JPA entities using "Entities from Tables"

- re-launch "Entities from tables" and finish

an alert appears to warn about overwriting the existing files. 

- check "do not show" on this dialog 

once disabled there is no way to restore this dialog back.

Expecting: It would be useful to provide a UI to control this setting (similar to Preferences | Java - Java Dialog)
Comment 1 Leslie Davis CLA 2011-04-09 21:01:26 EDT
Created attachment 192891 [details]
proposed bug fix patch
Comment 2 Neil Hauge CLA 2011-04-11 17:14:50 EDT
(In reply to comment #1)
> Created attachment 192891 [details]
> proposed bug fix patch

At a glance it would seem there are some changes that are missing in the patch, perhaps most notably the DontShowAgainDialog isn't in there.
Comment 3 Leslie Davis CLA 2011-04-11 18:33:30 EDT
Created attachment 192983 [details]
proposed bug fix patch

Not sure how that happened.
Comment 4 Neil Hauge CLA 2011-04-12 17:19:15 EDT
It looks like we should probably be using IDialogSettings instead of manually storing this dialog preferences, or at the very least we should be using the JptJpaUiPlugin to manage the preference metadata.  But I think we should go with IDialogSettings.

JptJpaUiPlugin is a subclass of AbstractUiPlugin which has a getDialogSettings() method which will return an IDialogSettings which will allow you to store the dialog enablement settings for all of the JPT dialogs based on a unique dialog key.  We could use these settings to determine enablement in the DontShowAgainDialog.  See the usage of this by org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog as an example.  

Our new dialog should probably be inheriting from org.eclipse.jface.dialogs.MessageDialog instead of Dialog which will help standardize our look as we add new dialogs based on the DontShow dialog.  And I think we could rename DontShowAgainDialog to OptionalMessageDialog.  Just sounds a bit better.  This one will be our own internal OptionalMessageDialog.
Comment 5 Leslie Davis CLA 2011-05-24 19:40:11 EDT
Created attachment 196499 [details]
patch with additional recommended changes
Comment 6 Neil Hauge CLA 2011-07-01 16:24:33 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 7 Leslie Davis CLA 2011-07-08 16:07:09 EDT
Created attachment 199360 [details]
proposed bug fix patch

Renamed JptPerferencesPage to JptPreferencesPage.
Comment 8 Neil Hauge CLA 2011-10-14 17:41:05 EDT
Patch from bug 321736 committed to head.
Comment 9 Jolene Moffitt CLA 2011-11-15 10:03:56 EST
Verified in Build S-3.1.0RC1-20111111225339 

Verified you can restore the overwrite dialog for the entity wizard via the Window>Preferences See the link to view test steps for verification.
http://wiki.eclipse.org/Dali_3.1_M3