Skip to content
Snippets Groups Projects
Commit c19631d0 authored by felmer's avatar felmer
Browse files

LMS-1231 Introducing DateTableCell

SVN: 13027
parent 72741cbb
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ package ch.systemsx.cisd.openbis.dss.generic.server.plugins.demo; ...@@ -18,6 +18,7 @@ package ch.systemsx.cisd.openbis.dss.generic.server.plugins.demo;
import java.io.File; import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
...@@ -28,6 +29,7 @@ import ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.AbstractData ...@@ -28,6 +29,7 @@ import ch.systemsx.cisd.openbis.dss.generic.server.plugins.standard.AbstractData
import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.IReportingPluginTask; import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.IReportingPluginTask;
import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.SimpleTableModelBuilder; import ch.systemsx.cisd.openbis.dss.generic.server.plugins.tasks.SimpleTableModelBuilder;
import ch.systemsx.cisd.openbis.dss.generic.shared.utils.ImageUtil; import ch.systemsx.cisd.openbis.dss.generic.shared.utils.ImageUtil;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DateTableCell;
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.ImageTableCell; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ImageTableCell;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NumberTableCell; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NumberTableCell;
...@@ -55,7 +57,8 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep ...@@ -55,7 +57,8 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep
builder.addHeader("Dataset Code"); builder.addHeader("Dataset Code");
builder.addHeader("Thumbnail"); builder.addHeader("Thumbnail");
builder.addHeader("Name"); builder.addHeader("Name");
builder.addHeader("Size"); builder.addHeader("Last Modified");
builder.addHeader("Size", true);
for (DatasetDescription dataset : datasets) for (DatasetDescription dataset : datasets)
{ {
File file = getDataSubDir(dataset); File file = getDataSubDir(dataset);
...@@ -92,7 +95,8 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep ...@@ -92,7 +95,8 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep
List<ISerializableComparable> row = List<ISerializableComparable> row =
Arrays.<ISerializableComparable> asList(new StringTableCell(datasetCode), image, Arrays.<ISerializableComparable> asList(new StringTableCell(datasetCode), image,
new StringTableCell(file.getName()), new StringTableCell(file.getName()),
new StringTableCell("[does not exist]")); new DateTableCell(new Date(file.lastModified())),
new NumberTableCell(0));
builder.addRow(row); builder.addRow(row);
} }
...@@ -114,6 +118,7 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep ...@@ -114,6 +118,7 @@ public class DemoReportingPlugin extends AbstractDatastorePlugin implements IRep
List<ISerializableComparable> row = List<ISerializableComparable> row =
Arrays.<ISerializableComparable> asList(new StringTableCell(dataset Arrays.<ISerializableComparable> asList(new StringTableCell(dataset
.getDatasetCode()), image, new StringTableCell(file.getName()), .getDatasetCode()), image, new StringTableCell(file.getName()),
new DateTableCell(new Date(file.lastModified())),
new NumberTableCell(getSize(file))); new NumberTableCell(getSize(file)));
builder.addRow(row); builder.addRow(row);
} }
......
...@@ -32,8 +32,8 @@ import ch.systemsx.cisd.common.logging.LogFactory; ...@@ -32,8 +32,8 @@ import ch.systemsx.cisd.common.logging.LogFactory;
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.StringTableCell; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.StringTableCell;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel.TableModelColumnHeader;
/** /**
* A table model builder that can take new columns and rows iteratively. * A table model builder that can take new columns and rows iteratively.
......
...@@ -21,8 +21,8 @@ import java.util.List; ...@@ -21,8 +21,8 @@ import java.util.List;
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.TableModel; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel.TableModelColumnHeader;
/** /**
* Helps in building a {@link TableModel} * Helps in building a {@link TableModel}
...@@ -41,11 +41,16 @@ public class SimpleTableModelBuilder ...@@ -41,11 +41,16 @@ public class SimpleTableModelBuilder
this.header = new ArrayList<TableModelColumnHeader>(); this.header = new ArrayList<TableModelColumnHeader>();
} }
public void addHeader(String title) public void addHeader(String title, boolean numeric)
{ {
header.add(new TableModelColumnHeader(title, header.size())); header.add(new TableModelColumnHeader(title, header.size(), numeric));
} }
public void addHeader(String title)
{
addHeader(title, false);
}
public void addRow(List<ISerializableComparable> values) public void addRow(List<ISerializableComparable> values)
{ {
assert values.size() == header.size() : "header has different number of columns than a row"; assert values.size() == header.size() : "header has different number of columns than a row";
......
...@@ -28,8 +28,8 @@ import org.testng.annotations.Test; ...@@ -28,8 +28,8 @@ import org.testng.annotations.Test;
import ch.systemsx.cisd.common.logging.LogInitializer; import ch.systemsx.cisd.common.logging.LogInitializer;
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.TableModel; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelColumnHeader;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModelRow;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TableModel.TableModelColumnHeader;
import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription; import ch.systemsx.cisd.openbis.generic.shared.dto.DatasetDescription;
/** /**
......
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