|
|
|
Re: SWT equivalent to AWT EventQueue replace? [message #534505 is a reply to message #534501] |
Wed, 19 May 2010 11:39 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Just in handle event method set e.type=SWT.NONE;
it effects all the controls
This way you can stop any event or modify paramaters of any event.
Even log them...
In my case we built a automated recording playback tool based on this!!!
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Wed, 19 May 2010 11:45] Report message to a moderator
|
|
|
|
Re: SWT equivalent to AWT EventQueue replace? [message #534773 is a reply to message #534760] |
Thu, 20 May 2010 09:53 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
You will be able to see the button press,
but the associated listeners where the code had been written for what to do with button press will not be fired.
button.addSelectionListener(new SelectionListener(){
public void selectionChanged()
{
System.out.println("Button Pressed");
}
}}
if you add a filter for selection(and do event type none) then "Button Pressed" will not be printed.
Now questions..
Is your playback happening properly??
Is user not able to interact in playback or do you not want user interaction to happeni in playback??
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
[Updated on: Thu, 20 May 2010 11:29] Report message to a moderator
|
|
|
|
Re: SWT equivalent to AWT EventQueue replace? [message #535093 is a reply to message #535086] |
Fri, 21 May 2010 09:44 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
May be use display thread to post u r events..
use display.syncexec if u r not already in display thread(the whole loop not just display.post)....
That way display will not be responsive,but u have to do display.readanddispatch in u r post loop,so that refresh and all other events are taken care of(u r post events)...
but all this may make the UI unresponsive for u r posts also...
other way can be put a marker in u r events(which r posted) and in display filter allow those events only to be processed....
was wondering how did u save u r events...
(specificaly how are u grabbing the same control on which u have to post the event)
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
|
Re: SWT equivalent to AWT EventQueue replace? [message #535529 is a reply to message #535522] |
Mon, 24 May 2010 09:33 |
Vijay Raj Messages: 608 Registered: July 2009 |
Senior Member |
|
|
Quote: | For AWT I used Window.getWindows() and Container.getComponents recursively to build a list (the list must be redone every time you save an event because it may change). From that list I save the index of the component. When I need to recover the event source I rebuild the list and I get the component on the saved index. It is not very elegant but it worked.
|
exactly the same thing i did for SWT....
i also agree its not elegant but i searched every where, there is no other way,
identifing controls by name(text) or control class is inconsistant..
---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04624 seconds