From d23e251fc8bb3d2d91a357a8378e56f5b52ef0ba Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Mon, 28 Sep 2009 15:42:50 +0000 Subject: [PATCH] LMS-1187 Treatment values added as properties for InternalAbundanceColumnDefinition SVN: 12745 --- .../application/ProteinByExperimentBrowserGrid.java | 9 +++++++-- .../columns/InternalAbundanceColumnDefinition.java | 11 ++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java index 1ac810f23fc..e8dd4aa28ee 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/ProteinByExperimentBrowserGrid.java @@ -17,7 +17,9 @@ package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; @@ -125,19 +127,22 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn for (AbundanceColumnDefinition definition : abundanceColumnDefinitions) { String header = definition.getSampleCode(); + final long sampleID = definition.getID(); List<Treatment> treatments = definition.getTreatments(); + Map<String, String> properties = null; if (treatments.isEmpty() == false) { header = ""; String delim = ""; + properties = new HashMap<String, String>(); for (Treatment treatment : treatments) { header += delim + treatment; delim = "\n"; + properties.put(treatment.getTypeCode(), treatment.getValue()); } } - final long sampleID = definition.getID(); - columns.add(new InternalAbundanceColumnDefinition(header, 100, false, sampleID)); + columns.add(new InternalAbundanceColumnDefinition(header, properties, 100, false, sampleID)); } definitions.addColumns(columns); definitions.setGridCellRendererFor(ProteinColDefKind.ACCESSION_NUMBER.id(), LinkRenderer diff --git a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/InternalAbundanceColumnDefinition.java b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/InternalAbundanceColumnDefinition.java index 3cb39e3b7d4..242d34b1288 100644 --- a/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/InternalAbundanceColumnDefinition.java +++ b/rtd_phosphonetx/source/java/ch/systemsx/cisd/openbis/plugin/phosphonetx/client/web/client/application/columns/InternalAbundanceColumnDefinition.java @@ -28,16 +28,19 @@ public final class InternalAbundanceColumnDefinition extends private long sampleID; + private Map<String, String> properties; + // GWT only public InternalAbundanceColumnDefinition() { super(); } - public InternalAbundanceColumnDefinition(String headerTextOrNull, int width, + public InternalAbundanceColumnDefinition(String headerTextOrNull, Map<String, String> propertiesOrNull, int width, boolean isHidden, long sampleID) { super(headerTextOrNull, width, isHidden); + this.properties = propertiesOrNull; this.sampleID = sampleID; } @@ -66,6 +69,12 @@ public final class InternalAbundanceColumnDefinition extends return true; } + @Override + public String tryToGetProperty(String key) + { + return properties == null ? null : properties.get(key); + } + private Double tryToGetAbundance(ProteinInfo entity) { Map<Long, Double> abundances = entity.getAbundances(); -- GitLab