use of org.talend.designer.filemultischemas.data.SchemasKeyData in project tdi-studio-se by Talend.
the class SchemaDetailsPropertiesProvider method getColumnText.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
*/
public String getColumnText(Object element, int columnIndex) {
if (columnIndex == 0) {
// column name
if (element instanceof MultiMetadataColumn) {
return ((MultiMetadataColumn) element).getLabel();
}
if (element instanceof MultiSchemasMetadataColumn) {
return ((MultiSchemasMetadataColumn) element).getData();
}
} else if (columnIndex == 1) {
// level
if (element instanceof MultiMetadataColumn) {
MultiMetadataColumn multiMetadataColumn = (MultiMetadataColumn) element;
return validateValue(multiMetadataColumn.getContainerTagLevel());
}
} else if (columnIndex == 2) {
// key
if (element instanceof MultiMetadataColumn) {
MultiMetadataColumn multiMetadataColumn = (MultiMetadataColumn) element;
// first column(record type)
SchemasKeyData container = multiMetadataColumn.getContainer();
if (container != null && container.getMetadataColumnsInModel().indexOf(multiMetadataColumn) == uiManager.getSelectedColumnIndex()) {
return null;
}
return validateValue(multiMetadataColumn.isKey());
}
} else {
if (element instanceof MultiSchemasMetadataColumn) {
MultiSchemasMetadataColumn column = (MultiSchemasMetadataColumn) element;
switch(columnIndex) {
case // type
3:
return getTypeLabel(column.getTalendType());
case // length
4:
return validateValue(column.getLength());
// return column.getCard();
case // pattern
5:
return column.getPattern();
}
}
}
return null;
}
Aggregations