Search in sources :

Example 1 with AutoConversionProposalProvider

use of org.talend.core.ui.proposal.AutoConversionProposalProvider in project tdi-studio-se by Talend.

the class AutoConversionTypesEditorView method createConversionFunctionColumn.

private TableViewerCreatorColumn createConversionFunctionColumn(TableViewerCreator<AutoConversionType> tableViewerCreator) {
    TableViewerCreatorColumn column = new TableViewerCreatorColumn(tableViewerCreator);
    //$NON-NLS-1$
    column.setTitle(Messages.getString("AutoConversionTypesEditor.table.column.conversionFunction"));
    column.setBeanPropertyAccessors(new IBeanPropertyAccessors<AutoConversionType, String>() {

        @Override
        public String get(AutoConversionType bean) {
            return bean.getConversionFunction();
        }

        @Override
        public void set(AutoConversionType bean, String value) {
            bean.setConversionFunction(value);
        }
    });
    column.setModifiable(true);
    column.setWeight(60);
    column.setMinimumWidth(50);
    //$NON-NLS-1$
    column.setDefaultInternalValue("");
    AutoConversionProposalProvider functionProposalProvider = new AutoConversionProposalProvider();
    TextCellEditorWithProposal textCellEditor = new TextCellEditorWithProposal(tableViewerCreator.getTable(), column);
    textCellEditor.setContentProposalProvider(functionProposalProvider);
    column.setCellEditor(textCellEditor);
    return column;
}
Also used : AutoConversionType(org.talend.core.model.metadata.types.AutoConversionType) TextCellEditorWithProposal(org.talend.commons.ui.swt.proposal.TextCellEditorWithProposal) AutoConversionProposalProvider(org.talend.core.ui.proposal.AutoConversionProposalProvider) TableViewerCreatorColumn(org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn)

Aggregations

TextCellEditorWithProposal (org.talend.commons.ui.swt.proposal.TextCellEditorWithProposal)1 TableViewerCreatorColumn (org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn)1 AutoConversionType (org.talend.core.model.metadata.types.AutoConversionType)1 AutoConversionProposalProvider (org.talend.core.ui.proposal.AutoConversionProposalProvider)1