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

Bug 88799

Summary: [Preferences] PreferenceDialog performOK() does not restore OK button if save fails
Product: [Eclipse Project] Platform Reporter: icemank
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P5 CC: remy.suen
Version: 3.0.1Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description icemank CLA 2005-03-22 15:17:41 EST
The documentation for IPreferencePage performOK() states that returning false
aborts the container's OK processing.
However, in reality, the PreferenceDialog is closed and preferences are saved
even if a page returns false.
In PreferenceDialog the following snippet is in the try block of the performOK
method:

if (!page.performOk())
return;

However, the finally block contains calls handleSave() and close()- i.e., the
preferences are saved and the dialog closed regardless of whether a particular
page returned false or not.
Comment 1 icemank CLA 2005-11-10 15:33:36 EST
Update: now the performOK() functions as it should.
However, there is still a problem- if performOK() returns false, the OK
processing aborts correctly- however it leave the OK button disabled. The OK
button can be re-enabled only by switching to another preference page and then
back again.
My workaround is to manually re-enable the OK button in my performOK() method
before returning false.
Comment 2 Tod Creasey CLA 2007-04-13 16:10:51 EDT
The question is what to do here.

If the save fails do we remove that page from the list of pages to save? And do we need to keep track of the ones we already called performOK on to make sure we don't do things twice.

There are a few subtleies with this issue which could break people.
Comment 3 Susan McCourt CLA 2009-07-09 19:26:57 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 4 Remy Suen CLA 2010-08-26 09:30:00 EDT
(In reply to comment #1)
> However, there is still a problem- if performOK() returns false, the OK
> processing aborts correctly- however it leave the OK button disabled.

This should've been fixed by the changes for bug 123965.
Comment 5 Eclipse Webmaster CLA 2019-09-06 15:31:57 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 6 Eclipse Genie CLA 2021-12-07 02:42:35 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.