use of org.talend.core.model.metadata.types.AutoConversionType in project tdi-studio-se by Talend.
the class AutoConversionTypesEditorView method createSourceDataTypeColumn.
private TableViewerCreatorColumn createSourceDataTypeColumn(TableViewerCreator<AutoConversionType> tableViewerCreator) {
TableViewerCreatorColumn column = new TableViewerCreatorColumn(tableViewerCreator);
//$NON-NLS-1$
column.setTitle(Messages.getString("AutoConversionTypesEditor.table.column.sourceDataType"));
column.setBeanPropertyAccessors(new IBeanPropertyAccessors<AutoConversionType, String>() {
@Override
public String get(AutoConversionType bean) {
return bean.getSourceDataType();
}
@Override
public void set(AutoConversionType bean, String value) {
bean.setSourceDataType(value);
}
});
column.setModifiable(true);
column.setWeight(30);
column.setMinimumWidth(50);
configureTypeColumn(tableViewerCreator, column);
return column;
}
use of org.talend.core.model.metadata.types.AutoConversionType in project tdi-studio-se by Talend.
the class AutoConversionTypesEditorView method initToolBar.
@Override
protected ExtendedToolbarView initToolBar() {
return new ExtendedToolbarView(getMainComposite(), SWT.NONE, getExtendedTableViewer()) {
@Override
protected AddPushButtonForExtendedTable createAddPushButton() {
return new AddPushButtonForExtendedTable(this.toolbar, getExtendedTableViewer()) {
@Override
protected Object getObjectToAdd() {
AutoConversionType bean = new AutoConversionType();
bean.setSourceDataType(JavaTypesManager.getDefaultJavaType().getId());
bean.setTargetDataType(JavaTypesManager.getDefaultJavaType().getId());
//$NON-NLS-1$
bean.setConversionFunction("String.valueOf(${0})");
return bean;
}
};
}
@Override
protected PastePushButton createPastePushButton() {
return new PastePushButtonForExtendedTable(toolbar, extendedTableViewer) {
@Override
protected Command getCommandToExecute(ExtendedTableModel extendedTableModel, Integer indexWhereInsert) {
return new ExtendedTablePasteCommand(extendedTableModel, indexWhereInsert) {
@Override
public List<AutoConversionType> createPastableBeansList(ExtendedTableModel extendedTableModel, List copiedObjectsList) {
List<AutoConversionType> beans = new ArrayList<>();
beans.addAll(copiedObjectsList);
return beans;
}
};
}
};
}
};
}
use of org.talend.core.model.metadata.types.AutoConversionType 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;
}
Aggregations