Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Ctrl+s switches dirty to true
Ctrl+s switches dirty to true [message #465732] Wed, 04 April 2007 07:44 Go to next message
Eclipse UserFriend
Originally posted by: petra.k.geoaxon.com

Hi!

I'm implementing an editor with text controls. Whenever something is
changed, dirty should be set to true. For this I added a TextKeyListener
to all the text controls.

Problem is, when saving my data using Ctrl+s, it saves the data, but also
triggers the setDirty(true) call in my keyReleased method of the
TextKeyListener class. I want to avoid that, in order to allow a user to
save by pressing Ctrl+s.

I already tried adding something like this to the keyReleased method:

if (!(e.stateMask==SWT.CTRL && (e.character=='s'||e.character=='S')))
setDirty(true);
(I think this must be wrong... :-(

Any other ideas, please share with me! Thanks for the help.
Re: Ctrl+s switches dirty to true [message #465759 is a reply to message #465732] Wed, 04 April 2007 17:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bugjester.yahoo.com

I usually use a ModifyListener instead of a TextKeyListener to watch for
Text control changes. I think that will solve your problem.

> I'm implementing an editor with text controls. Whenever something is
> changed, dirty should be set to true. For this I added a TextKeyListener
> to all the text controls.
Re: Ctrl+s switches dirty to true [message #465770 is a reply to message #465759] Thu, 05 April 2007 03:58 Go to previous message
Eclipse UserFriend
Originally posted by: petra.k.geoaxon.com

Thanks, Steve, that will definitely solve the problem. I just needed a
fresh pair of eyes (and brains!) :-)

> I usually use a ModifyListener instead of a TextKeyListener to watch for
> Text control changes. I think that will solve your problem.
Previous Topic:how can we disable all the actions registered in ApplicationActionBarAdvisitor?
Next Topic:How do I add a ResourceNavigator to my rcp app
Goto Forum:
  


Current Time: Fri Apr 26 11:30:53 GMT 2024

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

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

Back to the top