Skip to content
Snippets Groups Projects
Commit bc5f2228 authored by cramakri's avatar cramakri
Browse files

LMS-1367 Fix problems with translation from Jython to Java

SVN: 14754
parent 7701f65c
No related merge requests found
...@@ -18,9 +18,12 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.column ...@@ -18,9 +18,12 @@ package ch.systemsx.cisd.openbis.generic.client.web.client.application.ui.column
import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel; import ch.systemsx.cisd.openbis.generic.shared.basic.GridRowModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition; import ch.systemsx.cisd.openbis.generic.shared.basic.IColumnDefinition;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DateTableCell;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DoubleTableCell;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableColumnHeader; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableColumnHeader;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.GenericTableRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ISerializableComparable;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IntegerTableCell;
/** /**
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
...@@ -46,7 +49,19 @@ public class GenericTableRowColumnDefinition implements IColumnDefinition<Generi ...@@ -46,7 +49,19 @@ public class GenericTableRowColumnDefinition implements IColumnDefinition<Generi
public Comparable<?> tryGetComparableValue(GridRowModel<GenericTableRow> rowModel) public Comparable<?> tryGetComparableValue(GridRowModel<GenericTableRow> rowModel)
{ {
return getCellValue(rowModel); ISerializableComparable value = getCellValue(rowModel);
Comparable<?> result;
// TODO CR --This code should be a method on ISerializableComparable and implemented using
// polymorphism.
if (value instanceof DateTableCell)
result = ((DateTableCell) value).getDateTime();
else if (value instanceof DoubleTableCell)
result = ((DoubleTableCell) value).getNumber();
else if (value instanceof IntegerTableCell)
result = ((IntegerTableCell) value).getNumber();
else
result = value.toString();
return result;
} }
public String getHeader() public String getHeader()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment