Bug 2696 - [Preferences] Preference page lost when preference dialog closed (1GI730L)
Summary: [Preferences] Preference page lost when preference dialog closed (1GI730L)
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows NT
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:41 EDT by Randy Giffen CLA
Modified: 2004-10-22 16:10 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Giffen CLA 2001-10-10 22:41:42 EDT
From Eclipse Corner

>> I'm adding a PreferenceNode dynamically.  Going to "Window" ->
>> "Preferences", it displays its page fine.  Closing the "Preferences" now
>> will dispose its preference page (the dialog is disposed,
>> PreferenceNode.disposeResources() is called).  Trying "Window" ->
>> "Preferences" again will fail - my PreferenceNode is still there (as I
>> want it to be), but its PreferencePage is gone (BAD)...
>>
>> When can I recreate the node's page??  Or, alternatively, avoid the
>> disposing of its resources until I remove the node?  I'm using R0.9.

> I should mention that I use the PreferenceNode(String id, IPreferencePage
> preferencePage) constructor - therefore PreferenceNode.label is always null
> (so displaying the treeItem when the page is gone fails, as getTextLabel()
> returns null), and createPage() is no good, as there is no
> PreferenceNode.classname.

> The PreferenceNode(String id, String label, ImageDescriptor image, String
> className) constructor doesn't work - in createPage(), page =
> (IPreferencePage)createObject(classname) fails (although it works fine when
> I do it in my code, when extending PreferenceNode!?).  Also, I prefer to use
> the former constructor, i.e., have the PreferencePage instantiated by me
> (with a custom constructor)...

NOTES:
	RG (8/9/01 10:14:03 AM)
	We could consider keeping the pages but allowing them to dispose their widgets.
	Or we could make the preference node class abstract and force subclasses to implement
	a page creation method.
Comment 1 DJ Houghton CLA 2001-10-29 19:10:23 EST
PRODUCT VERSION:
128

Comment 2 Randy Giffen CLA 2002-01-22 15:08:47 EST
Needs investigation to see if this can be done in a non-breaking way.
Comment 3 Kevin Haaland CLA 2002-02-01 12:12:01 EST
It is important not to break existing code
Comment 4 Randy Giffen CLA 2002-02-01 12:28:01 EST
Suggest defer until after 2.0
This API is an enhancement to JFace but we do not expect/want workbench plugins 
to do this.
Comment 5 Randy Giffen CLA 2002-05-27 21:43:20 EDT
JFace issue, not workbench. Defer
Comment 6 Randy Giffen CLA 2002-08-08 15:09:57 EDT
reopen for investigation
Comment 7 Tod Creasey CLA 2004-10-22 16:10:23 EDT
You actually can't recreate the page as all of the widgets will be parented 
off of a disposed Composite.