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

Bug 101619

Summary: [formatter] Formatter profiles store even though I clicked 'Cancel'
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Martin Aeschlimann <martinae>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer, hudsonr
Version: 3.1   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dani Megert CLA 2005-06-24 08:23:23 EDT
I20050624-0010

1. open the formatter preference page
2. switch from existing profile p1 to another, lets say p2
3. click 'Cancel'

Expected: my formatter profile is still p1 but it is now p2.
Comment 1 Dirk Baeumer CLA 2005-07-11 06:14:38 EDT
Martin, can you please investigate in a fix for 3.1.1.
Comment 2 Martin Aeschlimann CLA 2005-07-12 12:52:50 EDT
By design all changes to profiles (add/remove/edits) are directly applied in the
profile store.
The only setting in the preference store is the profile selection; it in fact
could be reverted on cancel. Problem with that is that it then might point to a
non-existing profile or a profile that is completly different than before.
So we always directly apply the profile selection on every change. Cancel has no
meaning.

I would leave the current behaviour also for 3.2. 'Cancel' is not so important
here as it takes just one click to specify the previous profile. I see the
problem, but I don't see an easy solution.

Reopen if you don't agree.
Comment 3 Dani Megert CLA 2005-07-13 04:20:47 EDT
The behavior can really be surprising and it contradicts to other preferences
UIs, e.g. look at the code template preferences: you can edit a template, press
OK on the edit dialog, then press Cancel on the preference page ==> changes are
not applied to the template.

Yes, I can revert it once I've realized that 'Cancel' did not work but I might
already have formatted several files and even committed them.

It is not a 3.1.1 candidate for me (unless the fix would be trivial, however for
3.2 this should be improved.

For me an acceptable fix would be:
- do not immediately store when I switch templates (disable OK if it has been
  deleted, and display 'deleted'. Maybe the removal can even be postponed
  until 'OK' is pressed?)
- make it clear to the user that editing a profile leaves the preferences
  sandbox and all changes are immediately saved
Comment 4 Dani Megert CLA 2005-07-13 04:21:17 EDT
.
Comment 5 Martin Aeschlimann CLA 2005-07-26 09:28:45 EDT
not for 3.1.1
Comment 6 Martin Aeschlimann CLA 2005-09-29 04:10:28 EDT
*** Bug 110990 has been marked as a duplicate of this bug. ***
Comment 7 Martin Aeschlimann CLA 2005-10-06 11:41:21 EDT
fixed > 20051006
Comment 8 Benno Baumgartner CLA 2005-11-01 10:10:01 EST
Verified using I20051031-2000
Comment 9 Dirk Baeumer CLA 2005-11-01 10:15:49 EST
Marking as verified.