Bug 75036 - [Forms] improve doc of FormEditor#addPage(IFormPage page)
Summary: [Forms] improve doc of FormEditor#addPage(IFormPage page)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Dejan Glozic CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2004-09-25 13:04 EDT by Sebastian Davids CLA
Modified: 2005-05-06 14:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Davids CLA 2004-09-25 13:04:45 EDT
While reading bug 53657 ...

I found it weird that isDirty e.g. is not propaged if you use addPage(IFormPage).

Only by looking at the implementation and finding out that it uses
MPE#addPage(Control) internally, then reading the MPE doc to isDirty:

    /**
     * The <code>MultiPageEditorPart</code> implementation of this
<code>IEditorPart</code>
     * method returns whether the contents of any of this multi-page editor's
     * nested editors have changed since the last save. Pages created with
<code>addPage(Control)</code>
     * are ignored.

one comes up with this conclusion.

The doc of all addPage methods should be improved to clearly state whether a
listener is attached or not.
Comment 1 Dejan Glozic CLA 2005-05-02 18:20:22 EDT
In a typical implementation (e.g. all of the PDE editors), source page(s) host 
the entire file, while form pages show various aspects of the reconciler 
model. Threfore, pages themselves are not dirty - the model itself is dirty. 
For source pages, there is 1->1 mapping between reconciling model and the 
page, which is not the case for form pages.

If you check PDEFormEditor class, you will notice that it also checks 
inputContextManager, which hosts one reconciling model for each source page. 
So if you make a change in one of the form pages that will make one of the 
models dirty, the editor will be dirty.
Comment 2 Dejan Glozic CLA 2005-05-06 13:59:55 EDT
The more I think of it, the more I am convinced that 'isDirty' on FormEditor 
should be overriden to also check IFormPage.isDirty.
Comment 3 Dejan Glozic CLA 2005-05-06 14:08:50 EDT
Fixed by overriding isDirty() and checking all the pages that implement 
IFormPage, delegating to super if none are dirty.