use of org.talend.commons.ui.runtime.swt.tableviewer.behavior.IColumnImageProvider 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.runtime.swt.tableviewer.behavior.IColumnImageProvider in project tdi-studio-se by Talend.
the class JSONFileOutputMetadataEmfTableEditorView method configureNameColumn.
protected void configureNameColumn(TableViewerCreator<MetadataColumn> tableViewerCreator) {
TableViewerCreatorColumn column = new TableViewerCreatorColumn(tableViewerCreator);
column.setId(ID_COLUMN_NAME);
//$NON-NLS-1$
column.setTitle("Schema List");
column.setWidth(100);
column.setToolTipHeader("Column");
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((MetadataColumn) element)) {
return imageKey;
} else {
return imageEmpty;
}
}
});
column.setWeight(25);
column.setModifiable(!isReadOnly());
column.setMinimumWidth(20);
// nameColumn = column;
}
Aggregations