Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Filtering Events between Parts(Filtering Events between Parts)
Filtering Events between Parts [message #534006] Mon, 17 May 2010 13:21 Go to next message
nir dweck is currently offline nir dweck
Messages: 17
Registered: April 2010
Junior Member
Hi,
I am listening from one part to change events in another part
getSite().getPage().addPostSelectionListener(StocksView.VIEW_ID, this);

The problem is that I would like to filter these events in some occasions, depending on the location and the mouse button which is pressed. I've added a filter to the display:
		m_table.getDisplay().addFilter(SWT.MouseDown, new Listener(){
			/* (non-Javadoc)
			 * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
			 */
			@Override
			public void handleEvent(Event event) {
				TableItem item = m_table.getItem(new Point(event.x, event.y)); 
				if ( ( item != null) && (event.button == 3) ){ //right click
					updateSelection();
					event.type = SWT.NONE;
				}
			}
		});

this filter filters the events from reaching other listeners of the table, but does not filter the event from reaching the listeners in other parts. How can I filter the events also from other parts?
Thanks,
Nir

[Updated on: Mon, 17 May 2010 13:22]

Report message to a moderator

Re: Filtering Events between Parts [message #541331 is a reply to message #534006] Sun, 20 June 2010 04:08 Go to previous message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi, Nir,

That would be a special implementation of ISelectionListener. It is a good
idea. Consider filing a bug for it with your implementation as a patch.

Best regards,

Wim

--

Best Regards,
Wim Jongman
-- Who's General Failure & why is he reading my disk?
(Eclipse Old Skool
Quote Service)

> Hi,
> I am listening from one part to change events in another part
>
> getSite().getPage().addPostSelectionListener(StocksView.VIEW _ID, this);
> The problem is that I would like to filter these events in some occasions,
depending on the location and the mouse button which is pressed. I've added a
filter to the display:
>
> m_table.getDisplay().addFilter(SWT.MouseDown, new Listener(){
> /* (non-Javadoc)
> * @see
org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt .widgets.Event)
> */
> @Override
> public void handleEvent(Event event) {
> TableItem item = m_table.getItem(new Point(event.x, event.y));
> if ( ( item != null) && (event.button == 3) ){ //right click
> updateSelection();
> event.type = SWT.NONE;
> }
> }
> });
>
> this filter filters the events from reaching other listeners of the table,
but does not filter the event from reaching the listeners in other parts. How
can I filter the events also from other parts?
> Thanks,
> Nir
Previous Topic:Splash screen for P2-enabled RCP
Next Topic:Automatically Added Search Menu
Goto Forum:
  


Current Time: Thu Jul 24 04:42:21 EDT 2014

Powered by FUDForum. Page generated in 0.02125 seconds