Skip to content
Snippets Groups Projects
Commit 2f0d4a9e authored by brinn's avatar brinn
Browse files

change: avoid storing the view context in the base-base and the sub-class

SVN: 22534
parent 110ff4c5
No related branches found
No related tags found
No related merge requests found
...@@ -60,8 +60,6 @@ public class ImageSampleSection extends TabContent ...@@ -60,8 +60,6 @@ public class ImageSampleSection extends TabContent
// ---- // ----
private final ScreeningViewContext viewContext;
private final TechId sampleId; private final TechId sampleId;
private final WellLocation wellLocationOrNull; private final WellLocation wellLocationOrNull;
...@@ -70,18 +68,23 @@ public class ImageSampleSection extends TabContent ...@@ -70,18 +68,23 @@ public class ImageSampleSection extends TabContent
WellLocation wellLocationOrNull) WellLocation wellLocationOrNull)
{ {
super(WELL_IMAGE_SECTION_TITLE, viewContext, sampleId); super(WELL_IMAGE_SECTION_TITLE, viewContext, sampleId);
this.viewContext = viewContext;
this.sampleId = sampleId; this.sampleId = sampleId;
this.wellLocationOrNull = wellLocationOrNull; this.wellLocationOrNull = wellLocationOrNull;
setIds(DisplayTypeIDGenerator.LOGICAL_IMAGE_WELL_SECTION); setIds(DisplayTypeIDGenerator.LOGICAL_IMAGE_WELL_SECTION);
} }
private ScreeningViewContext getViewContext()
{
return (ScreeningViewContext) viewContext;
}
@Override @Override
protected void showContent() protected void showContent()
{ {
add(new Text(viewContext.getMessage(Dict.LOAD_IN_PROGRESS))); final ScreeningViewContext context = getViewContext();
viewContext.getService().getImageDatasetInfosForSample(sampleId, wellLocationOrNull, add(new Text(context.getMessage(Dict.LOAD_IN_PROGRESS)));
createDisplayImagesCallback(viewContext)); context.getService().getImageDatasetInfosForSample(sampleId, wellLocationOrNull,
createDisplayImagesCallback(context));
} }
private AsyncCallback<ImageSampleContent> createDisplayImagesCallback( private AsyncCallback<ImageSampleContent> createDisplayImagesCallback(
...@@ -106,7 +109,7 @@ public class ImageSampleSection extends TabContent ...@@ -106,7 +109,7 @@ public class ImageSampleSection extends TabContent
private void addUnknownDatasetLinks(List<DatasetReference> unknownDatasets) private void addUnknownDatasetLinks(List<DatasetReference> unknownDatasets)
{ {
ImagingDatasetGuiUtils guiUtils = new ImagingDatasetGuiUtils(viewContext); ImagingDatasetGuiUtils guiUtils = new ImagingDatasetGuiUtils(getViewContext());
Widget w = guiUtils.tryCreateUnknownDatasetsLinks(unknownDatasets); Widget w = guiUtils.tryCreateUnknownDatasetsLinks(unknownDatasets);
if (w != null) if (w != null)
{ {
...@@ -123,10 +126,11 @@ public class ImageSampleSection extends TabContent ...@@ -123,10 +126,11 @@ public class ImageSampleSection extends TabContent
add(new Text(NO_IMAGES_DATASET_LABEL), margins); add(new Text(NO_IMAGES_DATASET_LABEL), margins);
} else } else
{ {
LogicalImageLayouter logicalImageLayouter = final ScreeningViewContext context = getViewContext();
new LogicalImageLayouter(viewContext, wellLocationOrNull, images); final LogicalImageLayouter logicalImageLayouter =
Widget imageDatasetsDetails = new LogicalImageLayouter(context, wellLocationOrNull, images);
new ImagingDatasetGuiUtils(viewContext) final Widget imageDatasetsDetails =
new ImagingDatasetGuiUtils(context)
.createImageDatasetDetailsRow( .createImageDatasetDetailsRow(
logicalImageLayouter.getDatasetImagesReferences(), logicalImageLayouter.getDatasetImagesReferences(),
logicalImageLayouter); logicalImageLayouter);
......
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