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

LMS-1187 Treatment values added as properties for InternalAbundanceColumnDefinition

SVN: 12745
parent 381dc260
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application; package ch.systemsx.cisd.openbis.plugin.phosphonetx.client.web.client.application;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback; import ch.systemsx.cisd.openbis.generic.client.web.client.application.AbstractAsyncCallback;
...@@ -125,19 +127,22 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -125,19 +127,22 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
for (AbundanceColumnDefinition definition : abundanceColumnDefinitions) for (AbundanceColumnDefinition definition : abundanceColumnDefinitions)
{ {
String header = definition.getSampleCode(); String header = definition.getSampleCode();
final long sampleID = definition.getID();
List<Treatment> treatments = definition.getTreatments(); List<Treatment> treatments = definition.getTreatments();
Map<String, String> properties = null;
if (treatments.isEmpty() == false) if (treatments.isEmpty() == false)
{ {
header = ""; header = "";
String delim = ""; String delim = "";
properties = new HashMap<String, String>();
for (Treatment treatment : treatments) for (Treatment treatment : treatments)
{ {
header += delim + treatment; header += delim + treatment;
delim = "\n"; delim = "\n";
properties.put(treatment.getTypeCode(), treatment.getValue());
} }
} }
final long sampleID = definition.getID(); columns.add(new InternalAbundanceColumnDefinition(header, properties, 100, false, sampleID));
columns.add(new InternalAbundanceColumnDefinition(header, 100, false, sampleID));
} }
definitions.addColumns(columns); definitions.addColumns(columns);
definitions.setGridCellRendererFor(ProteinColDefKind.ACCESSION_NUMBER.id(), LinkRenderer definitions.setGridCellRendererFor(ProteinColDefKind.ACCESSION_NUMBER.id(), LinkRenderer
......
...@@ -28,16 +28,19 @@ public final class InternalAbundanceColumnDefinition extends ...@@ -28,16 +28,19 @@ public final class InternalAbundanceColumnDefinition extends
private long sampleID; private long sampleID;
private Map<String, String> properties;
// GWT only // GWT only
public InternalAbundanceColumnDefinition() public InternalAbundanceColumnDefinition()
{ {
super(); super();
} }
public InternalAbundanceColumnDefinition(String headerTextOrNull, int width, public InternalAbundanceColumnDefinition(String headerTextOrNull, Map<String, String> propertiesOrNull, int width,
boolean isHidden, long sampleID) boolean isHidden, long sampleID)
{ {
super(headerTextOrNull, width, isHidden); super(headerTextOrNull, width, isHidden);
this.properties = propertiesOrNull;
this.sampleID = sampleID; this.sampleID = sampleID;
} }
...@@ -66,6 +69,12 @@ public final class InternalAbundanceColumnDefinition extends ...@@ -66,6 +69,12 @@ public final class InternalAbundanceColumnDefinition extends
return true; return true;
} }
@Override
public String tryToGetProperty(String key)
{
return properties == null ? null : properties.get(key);
}
private Double tryToGetAbundance(ProteinInfo entity) private Double tryToGetAbundance(ProteinInfo entity)
{ {
Map<Long, Double> abundances = entity.getAbundances(); Map<Long, Double> abundances = entity.getAbundances();
......
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