Skip to content
Snippets Groups Projects
Commit b32d61fb authored by tpylak's avatar tpylak
Browse files

SE-124 phosphonetx: make the uniprotId a link (instead of description which...

SE-124 phosphonetx: make the uniprotId a link (instead of description which can be empty) in proteins-in-experiment browser

SVN: 12076
parent ac148f02
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -75,7 +75,7 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
toolbar = new ProteinByExperimentBrowerToolBar(viewContext); toolbar = new ProteinByExperimentBrowerToolBar(viewContext);
toolbar.setBrowserGrid(this); toolbar.setBrowserGrid(this);
setDisplayTypeIDGenerator(PhosphoNetXDisplayTypeIDGenerator.PROTEIN_BY_EXPERIMENT_BROWSER_GRID); setDisplayTypeIDGenerator(PhosphoNetXDisplayTypeIDGenerator.PROTEIN_BY_EXPERIMENT_BROWSER_GRID);
registerLinkClickListenerFor(ProteinColDefKind.DESCRIPTION.id(), registerLinkClickListenerFor(ProteinColDefKind.UNIPROT_ID.id(),
new ICellListener<ProteinInfo>() new ICellListener<ProteinInfo>()
{ {
public void handle(ProteinInfo rowItem) public void handle(ProteinInfo rowItem)
...@@ -104,7 +104,7 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn ...@@ -104,7 +104,7 @@ class ProteinByExperimentBrowserGrid extends AbstractSimpleBrowserGrid<ProteinIn
protected ColumnDefsAndConfigs<ProteinInfo> createColumnsDefinition() protected ColumnDefsAndConfigs<ProteinInfo> createColumnsDefinition()
{ {
ColumnDefsAndConfigs<ProteinInfo> definitions = super.createColumnsDefinition(); ColumnDefsAndConfigs<ProteinInfo> definitions = super.createColumnsDefinition();
definitions.setGridCellRendererFor(ProteinColDefKind.DESCRIPTION.id(), LinkRenderer definitions.setGridCellRendererFor(ProteinColDefKind.UNIPROT_ID.id(), LinkRenderer
.createLinkRenderer()); .createLinkRenderer());
return definitions; return definitions;
} }
......
...@@ -86,7 +86,7 @@ public class ProteinViewer extends ...@@ -86,7 +86,7 @@ public class ProteinViewer extends
new ProteinViewer(viewContext, experimentOrNull, proteinInfo.getId()); new ProteinViewer(viewContext, experimentOrNull, proteinInfo.getId());
DatabaseModificationAwareComponent c = DatabaseModificationAwareComponent c =
new DatabaseModificationAwareComponent(viewer, viewer); new DatabaseModificationAwareComponent(viewer, viewer);
String description = StringUtils.abbreviate(proteinInfo.getDescription(), 30); String description = getAbbreviatedDescription(proteinInfo);
String identifier = String identifier =
experimentOrNull == null ? "?" : experimentOrNull.getIdentifier(); experimentOrNull == null ? "?" : experimentOrNull.getIdentifier();
return DefaultTabItem.create(viewContext.getMessage( return DefaultTabItem.create(viewContext.getMessage(
...@@ -96,6 +96,16 @@ public class ProteinViewer extends ...@@ -96,6 +96,16 @@ public class ProteinViewer extends
}; };
} }
private static String getAbbreviatedDescription(final ProteinInfo proteinInfo)
{
String info = proteinInfo.getDescription();
if (info == null)
{
info = proteinInfo.getUniprotID();
}
return StringUtils.abbreviate(info, 30);
}
static String createWidgetID(TechId proteinReferenceID) static String createWidgetID(TechId proteinReferenceID)
{ {
return ID_PREFIX + proteinReferenceID.getId(); return ID_PREFIX + proteinReferenceID.getId();
......
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