final TableViewer tableViewer = fSuperInterfacesDialogField.getTableViewer();
tableViewer.setColumnProperties(new String[] {
INTERFACE
});
TableTextCellEditor cellEditor = new TableTextCellEditor(tableViewer, 0) {
@Override
protected void doSetFocus() {
if (text != null) {
text.setFocus();
text.setSelection(text.getText().length());
checkSelection();
checkDeleteable();
checkSelectable();
}
}
};
JavaTypeCompletionProcessor superInterfaceCompletionProcessor = new JavaTypeCompletionProcessor(false, false, true);
superInterfaceCompletionProcessor.setCompletionContextRequestor(new CompletionContextRequestor() {
@Override
public StubTypeContext getStubTypeContext() {
return getSuperInterfacesStubTypeContext();
}
});
SubjectControlContentAssistant contentAssistant = ControlContentAssistHelper.createJavaContentAssistant(superInterfaceCompletionProcessor);
Text cellEditorText = cellEditor.getText();
ContentAssistHandler.createHandlerForText(cellEditorText, contentAssistant);
TextFieldNavigationHandler.install(cellEditorText);
cellEditor.setContentAssistant(contentAssistant);
tableViewer.setCellEditors(new CellEditor[] {
cellEditor
});
tableViewer.setCellModifier(new ICellModifier() {