Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » FIRE/PROPAGATE EVENTS TO SPECIFIC CONTROLS
FIRE/PROPAGATE EVENTS TO SPECIFIC CONTROLS [message #495548] Thu, 05 November 2009 10:47 Go to next message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
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!
Re: FIRE/PROPAGATE EVENTS TO SPECIFIC CONTROLS [message #495902 is a reply to message #495548] Fri, 06 November 2009 15:01 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
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!
Previous Topic:Resize composites.
Next Topic:[Draw2D] turning on advanced graphics
Goto Forum:
  


Current Time: Mon Aug 19 08:37:34 GMT 2019

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

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

Back to the top