Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » JFace TextCellEditor fires events twice...
JFace TextCellEditor fires events twice... [message #107701] Wed, 06 August 2003 21:35 Go to next message
Erik Johnson is currently offline Erik JohnsonFriend
Messages: 36
Registered: July 2009
Member
I am in the process of bringing my project up to the current release of
Eclipse. Previously this code worked fine in 2.1 M5, but now with 2.1.1
something has changed which is resulting in some strange behavior.

I am using the Properties view--TextCellEditor--to allow the user to change
the name of elements in my program. Because these elements translate to
Java class names, I prompt the user for confirmation before I actually
rename the application element.

Now, if you type a new name and press 'Enter/Return' the TextCellEditor
catches the key pressed event and calls fireApplyEditorValue(). Because I
prompt the user for confirmation, I open up a MessageDialog message box,
which then causes the same TextCellEditor to handle the WM_KILLFOCUS event
which in turn calls focusLost() that calls fireApplyEditorValue.

This results in 2 rename events that I try to process--the first for the key
pressed and the 2nd for the focus lost and both try to attempt the same
operation.

Does anyone know when this functionality for keypressed/focus lost changed
and any way to get around this new behavior?

Thanks in advance,
Erik
Re: JFace TextCellEditor fires events twice... [message #107722 is a reply to message #107701] Wed, 06 August 2003 22:11 Go to previous messageGo to next message
Erik Johnson is currently offline Erik JohnsonFriend
Messages: 36
Registered: July 2009
Member
Figured out part of it... CellEditor did not have a focusLost() handler in
2.1 M5, so my old code worked fine. I'm assuming this functionality is new
in 2.1 RCx or in 2.1.1

I found a work around for it, but I'm not all that happy with it....
Are there any good ways to ignore focusLost events??

Erik

"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:bgrs97$1nr$1@eclipse.org...
> I am in the process of bringing my project up to the current release of
> Eclipse. Previously this code worked fine in 2.1 M5, but now with 2.1.1
> something has changed which is resulting in some strange behavior.
>
> I am using the Properties view--TextCellEditor--to allow the user to
change
> the name of elements in my program. Because these elements translate to
> Java class names, I prompt the user for confirmation before I actually
> rename the application element.
>
> Now, if you type a new name and press 'Enter/Return' the TextCellEditor
> catches the key pressed event and calls fireApplyEditorValue(). Because I
> prompt the user for confirmation, I open up a MessageDialog message box,
> which then causes the same TextCellEditor to handle the WM_KILLFOCUS event
> which in turn calls focusLost() that calls fireApplyEditorValue.
>
> This results in 2 rename events that I try to process--the first for the
key
> pressed and the 2nd for the focus lost and both try to attempt the same
> operation.
>
> Does anyone know when this functionality for keypressed/focus lost changed
> and any way to get around this new behavior?
>
> Thanks in advance,
> Erik
>
>
Re: JFace TextCellEditor fires events twice... [message #1246037 is a reply to message #107722] Fri, 14 February 2014 16:34 Go to previous message
Monikka R is currently offline Monikka RFriend
Messages: 1
Registered: February 2014
Junior Member
Could you please tell me the workaround you came up with for this issue?
I am facing a similar problem with my implementation. In my case a focus lost event is sent when i increase the item's height dynamically on entering 'return' in the textcelleditor.
Previous Topic:Consistent installations
Next Topic:How to convert an Editor to a View ?
Goto Forum:
  


Current Time: Sat Apr 27 01:47:41 GMT 2024

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

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

Back to the top