I use ContentProposalAdapter on editor in table:
String[] newProposals = getAllProposals();
SimpleContentProposalProvider scp = new SimpleContentProposalProvider( newProposals );
adapter = new ContentProposalAdapter(editor, new TextContentAdapter(), scp,null,null);
adapter.setPopupSize(new Point(100, 200));
editor is a text created like this:
final Text editor = new Text(cursor, SWT.NONE)
cursor is a table cursor;
The UI has following structure:
shell
main-view
table
editor
Now when popup is displayed for content assist it’s located at the left of the shell window instead of under editor in table.
How do I fix it’s location?
The problem is that content proposal adapter created each time on input changed this resulted into unexpected behavior.
The correct way is to create content proposal adapter instance only once and attach to the text field.