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