Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to manage Ctrl+Space for autocomple text assist with RAP with ContentProposalAdapter
How to manage Ctrl+Space for autocomple text assist with RAP with ContentProposalAdapter [message #760105] Thu, 01 December 2011 10:37
Angelo ZERR is currently offline Angelo ZERRFriend
Messages: 122
Registered: July 2009
Senior Member
Hi RAP Team,

I'm managing autocomple text assist with RAP 1.5 with ContentProposalAdapter, it works well except that I cannot open the popup with Ctrl+Space. I have debugged RAP code and the when I do Ctrl+Space I go at ActiveKeysUtil#processEvent :

private static void processEvent( Display display, Event event ) {
    IFilterEntry[] filters = getFilterEntries( display );
    for( int i = 0; i < filters.length; i++ ) {
      if( filters[ i ].getType() == event.type ) {
        filters[ i ].getListener().handleEvent( event );
      }
    }
  }

  private static IFilterEntry[] getFilterEntries( Display display ) {
    IDisplayAdapter adapter = display.getAdapter( IDisplayAdapter.class );
    return adapter.getFilters();
  }


There is not filter for my autocomplete. So I have getted the ControlListener added by ContentProposalAdapter to my SWT Text firstNameText and add this listner to the Display.getCurrent() like this :
Listener l =firstNameText.getListeners(SWT.KeyDown)[0];
			Display.getCurrent().addFilter(SWT.KeyDown, l);
			
			firstNameText.addDisposeListener(new DisposeListener() {
				
				public void widgetDisposed(DisposeEvent event) {
					Listener l =firstNameText.getListeners(SWT.KeyDown)[0];
					Display.getCurrent().removeFilter(SWT.KeyDown, l);
					
				}
			});


With this code, Ctrl+Space works (poppup opens) but I would like if it's the right mean to manage Ctrl+Space with autocomplete.

Thanks for your answer.

Regards Angelo
Previous Topic:Eclipse View Refresh Problem
Next Topic:IRunnableWithProgress does not correctly reset the focus
Goto Forum:
  


Current Time: Fri Apr 26 09:21:37 GMT 2024

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

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

Back to the top