|
Re: FIRE/PROPAGATE EVENTS TO SPECIFIC CONTROLS [message #495902 is a reply to message #495548] |
Fri, 06 November 2009 15:01 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm using Table, not TableViewer, but there shouldn't be a difference
event-wise since TableViewer receives all of its events from its Table
anyways.
Starting with
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet96. java ,
this works for me if I add the listeners below. Use of notifyListeners()
should not stop subsequent event propogation. Does the TableCursor listener
below help with your case?
table.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
System.out.println("table mouseDown at: " + event.x + "," +
event.y);
}
});
cursor.addListener(SWT.MouseDown, new Listener() {
public void handleEvent(Event event) {
System.out.println("cursor mouseDown at: " + event.x + "," +
event.y);
Point tableLocation = event.widget.getDisplay().map(cursor, table,
new Point(event.x, event.y));
event.x = tableLocation.x; event.y = tableLocation.y;
table.notifyListeners(event.type, event);
}
});
Grant
"Juan Miguel" <j.avila@iactive.es> wrote in message
news:hcuagk$ib$1@build.eclipse.org...
> Hi everybody,
>
> I need help with the following issue:
>
> I have a tablecursor with a listener that captures a click event over a
> cell in a tableviewer. I need to pass that event to the tableviewer
> everytime i get it n the tablecursor.
>
> I tried to do it by using notifyListeners() but it seems that stpp all
> the event propagation :(
>
> How can I do it? Is a fireEvent() method or similar?
>
> Thanks in advance
>
> Regards!
|
|
|
Powered by
FUDForum. Page generated in 0.03047 seconds