An AbstractBooleanColumn does never display the icon AbstractIcons.StatusError? [message #1271180] |
Fri, 14 March 2014 12:48 |
Fredrik Möller Messages: 15 Registered: April 2013 |
Junior Member |
|
|
Hello
The following code from the class: org.eclipse.scout.rt.ui.swt.basic.table.SwtScoutTableModel
@Override
public Image getColumnImage(Object element, int columnIndex) {
int[] columnOrder = m_swtTable.getSwtField().getColumnOrder();
if (columnOrder.length > 1) {
String iconId = null;
ICell cell = getCell(element, columnIndex);
IColumn col = m_columnManager.getColumnByModelIndex(columnIndex - 1);
if (columnOrder[1] == columnIndex && m_swtTable.getScoutObject() != null && m_swtTable.getScoutObject().isCheckable()) {
if (((ITableRow) element).isChecked()) {
iconId = SwtIcons.CheckboxYes;
}
else {
iconId = SwtIcons.CheckboxNo;
}
}
else if (col != null && cell != null && col.getDataType() == Boolean.class && (!(col instanceof ISmartColumn) || ((ISmartColumn) col).getLookupCall() == null)) {
Boolean b = (Boolean) cell.getValue();
if (b != null && b.booleanValue()) {
iconId = SwtIcons.CheckboxYes;
}
else {
iconId = SwtIcons.CheckboxNo;
}
}
else if (cell != null && cell.getErrorStatus() != null && cell.getErrorStatus().getSeverity() == IStatus.ERROR) {
iconId = AbstractIcons.StatusError;
}
else if (cell != null && cell.getIconId() != null) {
iconId = cell.getIconId();
}
else if (columnOrder[1] == columnIndex) {
ITableRow row = (ITableRow) element;
iconId = row.getIconId();
}
return m_environment.getIcon(iconId);
}
return null;
}
Seems to make it hard to display an error icon for an AbstractBooleanColumn with an error status.
Would it make sense to change the order of the if - else if statements to have the section which tests the error status first instead of the current position, or what is the reason to have it in this current order?
Kind regards
Fredrik Möller
[Updated on: Fri, 14 March 2014 12:50] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03362 seconds