Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage
[Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage [message #650938] Thu, 27 January 2011 08:45 Go to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
I just stumbled across the following problem in my own FieldEditor
implementation (Eclipse 3.6.1) where I override the dispose function:
This function is never called by the embedding
FieldEditorPreferencePage. This seems curious, because
FieldEditorPreferencePage was specifically designed to ease the creation
of typical standard preference pages. FieldEditorPreferencePage already
controls the life-cycle of the hosted FieldEditors by resetting (pe
being a FieldEditor)

pe.setPage(null);
pe.setPropertyChangeListener(null);
pe.setPreferenceStore(null);

but does not invoke pe.dispose(). It seems to me that either the
dispose() function within the FieldEditor was a design error or that
FieldEditorPreferencePage should call pe.dispose() in it's own dispose()
function - I tend to prefer the latter.

I would like to wait for some comments that might explain the current
state before submitting a defect report.

Thanks for any input & Greetings from Bremen,

Daniel Krügler
Re: [Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage [message #651145 is a reply to message #650938] Fri, 28 January 2011 00:25 Go to previous messageGo to next message
Carsten Habicht is currently offline Carsten Habicht
Messages: 14
Registered: January 2011
Junior Member
Sorry, didn't have the time for looking into this in more detail. But I remember having seen a similar problem in a composite inside a ScrolledComposite within a TabItem located within an EditorPart. So maybe the cause of this is not be the preference page itself but a composite it incorporates.

Sylphen - Ihr Systemhaus in Mittelhessen - http://www.sylphen.com/
Re: [Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage [message #651167 is a reply to message #651145] Fri, 28 January 2011 06:42 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 2011-01-28 01:25, Carsten Habicht wrote:
> Sorry, didn't have the time for looking into this in more detail. But I
> remember having seen a similar problem in a composite inside a
> ScrolledComposite within a TabItem located within an EditorPart. So
> maybe the cause of this is not be the preference page itself but a
> composite it incorporates.

What I'm noting here is not only an observation of a particular
code-example that does not work: I analyzed the complete interaction of
FieldEditors and FieldEditorPreferencePage (which is not much of code)
and the clear outcome that the hosting preference page does *never* call
FieldEditor.dispose() at all.

My understanding is, that you have a different example in mind:
FieldEditor itself is no control or composite (in fact it does not
refine or implement any base class or interface), so I don't see the
relation to composites here. FieldEditorPreferencePage contains an
internal (private) List of FieldEditors and does not provide a single
choice to the remaining JFace API to reference the contained editors.
This means, that FieldEditorPreferencePage is the one and only one
responsible container for FieldEditors.

Greetings from Bremen,

- Daniel Krügler
Re: [Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage [message #651264 is a reply to message #651167] Fri, 28 January 2011 16:18 Go to previous message
Carsten Habicht is currently offline Carsten Habicht
Messages: 14
Registered: January 2011
Junior Member
Daniel Krügler wrote on Fri, 28 January 2011 01:42
My understanding is, that you have a different example in mind:
FieldEditor itself is no control or composite (in fact it does not
refine or implement any base class or interface), so I don't see the
relation to composites here.

You're right. I thought that a FieldEditorPreferencePage is or references some sort of composite, containing FieldEditor controls.


Sylphen - Ihr Systemhaus in Mittelhessen - http://www.sylphen.com/
Previous Topic:[Preferences] StringFieldEditor misses setter for widthInChars
Next Topic:how to sort ComboBoxCellEditor in a table
Goto Forum:
  


Current Time: Fri Oct 24 11:36:52 GMT 2014

Powered by FUDForum. Page generated in 0.02972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software