Closing editor and focus events [message #325943] |
Mon, 03 March 2008 15:29  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
I'm working on custom (forms-based) editors that rely on focus-lost
events to push changes from Text widgets to the model. We've noticed,
however, that when the user is editing in a Text widget and then closes
an editor (via the X button on the editor tab), no focus-lost event is
ever getting fired for the widget.
Is this a known limitation?
I absolutely need to work around this, so even if you don't know the
direct answer any pointers in the right direction (such as what part of
the platform code to look at, or some previous discussions on the topic)
are greatly appreciated. I tried Googling but can't come up with the
right terms to produce useful results.
Thanks in advance,
Eric
|
|
|
|
|
|
Re: Closing editor and focus events [message #326131 is a reply to message #326072] |
Fri, 07 March 2008 12:20  |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Paul Webster wrote:
> Eric Rizzo wrote:
>>
>> Do you know if there was ever a bug entered about it?
>
> This is the bug we used to fix KeySequencText
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=185094#c12
>
> "SWT.Dispose is the only event that is guaranteed to come for all
> widgets in the shell when the shell is disposed."
The problem I face is that dispose-time it is too late - I need to push
the Text value to the model before the editor is even asked if it is OK
to close or if a save is needed first.
For now I've overridden EditorPart.isSaveOnCloseNeeded() in my editors
to see if one of its child widgets has the focus and if so, manually
fire a FocusOut notification before answering isSaveOnCloseNeeded.
Guess I'll enter a new bug about this, as it seems like a likely problem
in the age of data binding and forms API.
Eric
|
|
|
Powered by
FUDForum. Page generated in 1.03068 seconds