use of org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn in project tdi-studio-se by Talend.
the class AbstractHL7MetadataTableEditorView method configureDbColumnName.
/**
* DOC amaumont Comment method "configureNameColumn".
*
* @param tableViewerCreator
*/
protected void configureDbColumnName(TableViewerCreator<B> tableViewerCreator) {
TableViewerCreatorColumn column;
column = new TableViewerCreatorColumn(tableViewerCreator);
column.setId(ID_COLUMN_DBCOLUMNNAME);
//$NON-NLS-1$
column.setTitle("Mapping Column");
//$NON-NLS-1$
column.setToolTipHeader(Messages.getString("MetadataTableEditorView.ColumnTitle"));
column.setBeanPropertyAccessors(getDbColumnNameAccessor());
column.setWeight(25);
column.setModifiable(!isReadOnly());
column.setMinimumWidth(45);
final TextCellEditor cellEditor = new TextCellEditor(tableViewerCreator.getTable());
column.setCellEditor(cellEditor);
column.setColumnCellModifier(new ColumnCellModifier(column) {
@Override
public boolean canModify(Object bean) {
return super.canModify(bean) && canModifyDBColumn(bean);
}
});
column.setCellEditorAppliedListener(new ITableCellValueModifiedListener() {
public void cellValueModified(TableCellValueModifiedEvent e) {
linker.getMainui().redrawLinkers();
linker.getBackgroundRefresher().refreshBackground();
}
});
if (!dbColumnNameWritable) {
column.setColorProvider(new IColumnColorProvider() {
public Color getBackgroundColor(Object bean) {
return READONLY_CELL_BG_COLOR;
}
public Color getForegroundColor(Object bean) {
return null;
}
});
}
}
use of org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn in project tdi-studio-se by Talend.
the class AbstractHL7MetadataTableEditorView method configureNameColumn.
/**
* DOC amaumont Comment method "configureNameColumn".
*
* @param tableViewerCreator
*/
protected void configureNameColumn(TableViewerCreator<B> tableViewerCreator) {
TableViewerCreatorColumn column;
column = new TableViewerCreatorColumn(tableViewerCreator);
column.setId(ID_COLUMN_NAME);
//$NON-NLS-1$
column.setTitle("User Column(Click to edit)");
//$NON-NLS-1$
column.setToolTipHeader(Messages.getString("MetadataTableEditorView.ColumnTitle"));
column.setBeanPropertyAccessors(getLabelAccessor());
final Image imageKey = ImageProvider.getImage(EImage.KEY_ICON);
final Image imageEmpty = org.talend.commons.ui.runtime.image.ImageProvider.getImage(EImage.EMPTY);
final TextCellEditor cellEditor = new TextCellEditor(tableViewerCreator.getTable());
column.setCellEditor(cellEditor);
cellEditor.addListener(new DialogErrorForCellEditorListener(cellEditor, column) {
@Override
public void newValidValueTyped(int itemIndex, Object previousValue, Object newValue, CELL_EDITOR_STATE state) {
}
@Override
public String validateValue(String newValue, int beanPosition) {
return validateColumnName(newValue, beanPosition);
}
});
column.setImageProvider(new IColumnImageProvider() {
public Image getImage(Object element) {
if (getKeyAccesor().get((B) element)) {
return imageKey;
} else {
return imageEmpty;
}
}
});
column.setWeight(25);
column.setModifiable(!isReadOnly());
column.setMinimumWidth(45);
// final TextCellEditor cellEditor = new TextCellEditor(tableViewerCreator.getTable());
// cellEditor.addListener(new DialogErrorForCellEditorListener(cellEditor, column) {
//
// @Override
// public void newValidValueTyped(int itemIndex, Object previousValue, Object newValue, CELL_EDITOR_STATE state)
// {
// }
//
// @Override
// public String validateValue(String newValue, int beanPosition) {
// return validateColumnName(newValue, beanPosition);
// }
//
// });
// column.setCellEditor(cellEditor);
nameColumn = column;
}
use of org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn in project tdi-studio-se by Talend.
the class AbstractHL7MetadataTableEditorView method configurePrecisionColumn.
/**
* DOC amaumont Comment method "configurePrecisionColumn".
*
* @param tableViewerCreator
*/
protected void configurePrecisionColumn(TableViewerCreator<B> tableViewerCreator) {
TableViewerCreatorColumn column;
column = new TableViewerCreatorColumn(tableViewerCreator);
//$NON-NLS-1$
column.setTitle(Messages.getString("MetadataTableEditorView.PrecisionTitle"));
//$NON-NLS-1$
column.setToolTipHeader(Messages.getString("MetadataTableEditorView.PrecisionTitle"));
column.setId(ID_COLUMN_PRECISION);
column.setBeanPropertyAccessors(getPrecisionAccessor());
column.setModifiable(!isReadOnly());
column.setWeight(10);
column.setMinimumWidth(10);
column.setCellEditor(new TextCellEditor(tableViewerCreator.getTable()), CellEditorValueAdapterFactory.getPositiveIntAdapter());
}
use of org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn in project tdi-studio-se by Talend.
the class AbstractHL7MetadataTableEditorView method configureCommentColumn.
/**
* DOC amaumont Comment method "configureCommentColumn".
*
* @param tableViewerCreator
*/
protected void configureCommentColumn(TableViewerCreator<B> tableViewerCreator) {
TableViewerCreatorColumn column;
column = new TableViewerCreatorColumn(tableViewerCreator);
//$NON-NLS-1$
column.setTitle(Messages.getString("MetadataTableEditorView.CommentTitle"));
//$NON-NLS-1$
column.setToolTipHeader(Messages.getString("MetadataTableEditorView.CommentTitle"));
column.setId(ID_COLUMN_COMMENT);
column.setBeanPropertyAccessors(getCommentAccessor());
column.setWeight(10);
column.setModifiable(!isReadOnly());
column.setMinimumWidth(20);
column.setCellEditor(new TextCellEditor(tableViewerCreator.getTable()));
}
use of org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumn in project tdi-studio-se by Talend.
the class AbstractHL7MetadataTableEditorView method configureLengthColumn.
/**
* DOC amaumont Comment method "configureLengthColumn".
*
* @param tableViewerCreator
* @param positiveIntValueAdapter
*/
protected void configureLengthColumn(TableViewerCreator<B> tableViewerCreator) {
TableViewerCreatorColumn column;
column = new TableViewerCreatorColumn(tableViewerCreator);
//$NON-NLS-1$
column.setTitle(Messages.getString("MetadataTableEditorView.LengthTitle"));
//$NON-NLS-1$
column.setToolTipHeader(Messages.getString("MetadataTableEditorView.LengthTitle"));
column.setId(ID_COLUMN_LENGHT);
column.setBeanPropertyAccessors(getLengthAccessor());
column.setModifiable(!isReadOnly());
column.setWeight(10);
column.setMinimumWidth(10);
column.setCellEditor(new TextCellEditor(tableViewerCreator.getTable()), CellEditorValueAdapterFactory.getPositiveIntAdapter(true));
}
Aggregations