Plug-in Beginner [message #331372] |
Wed, 03 September 2008 17:17  |
Eclipse User |
|
|
|
Hello,
I am writing an eclipse plug-in.
//get the current display, eclipse display
Display currentDisplay = PlatformUI.getWorkbench().getDisplay();
From here I would like to add event listeners to the currentDisplay to
detect any events that happen within eclipse. I am just looking for a
little direction, not the exact program. I mean if someone has the exact
why I'd love to take a look at it.
Thanks in advance,
Jason
|
|
|
|
|
|
|
Re: Plug-in Beginner [message #331416 is a reply to message #331407] |
Fri, 05 September 2008 04:51   |
Eclipse User |
|
|
|
On Fri, 5 Sep 2008 02:46:07 +0000 (UTC), jasoncartercs@gmail.com
(Jason Carter) wrote:
>Could you please give me an example of this?
Display currentDisplay = PlatformUI.getWorkbench().getDisplay();
// add a filter for all interesting event, i.e. KeyDown/Up,
// MouseDown/Up, MouseMove, ...
// example for KeyDown
currentDisplay.addFilter(SWT.KeyDown, new Listener(){
@Override
public void handleEvent(Event event) {
// log your event, don't modify the event instance!
// you know that this is a KeyDown event, so
// you may call an appropriate logger.
}});
Achim
--
Achim Lörke
Eclipse-Stammtisch in the Braunschweig, Germany area:
http://www.bredex.de/de/news/events.html
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07505 seconds