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

LMS-1888 don't show image viewer launch button if no data set. Fix bug in PlateLayouter

SVN: 18887
parent c58ffd2e
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,8 @@ public class WellContentDialog extends Dialog
DatasetImagesReference imageDatasetOrNull, DefaultChannelState channelState,
final IViewContext<IScreeningClientServiceAsync> viewContext)
{
final WellContentDialog contentDialog = createContentDialog(wellData, viewContext);
final WellContentDialog contentDialog =
createContentDialog(wellData, viewContext, imageDatasetOrNull != null);
showContentDialog(contentDialog, imageDatasetOrNull, channelState, viewContext);
}
......@@ -122,7 +123,7 @@ public class WellContentDialog extends Dialog
}
private static WellContentDialog createContentDialog(final WellData wellData,
final IViewContext<IScreeningClientServiceAsync> viewContext)
final IViewContext<IScreeningClientServiceAsync> viewContext, boolean hasDataSet)
{
WellLocation wellLocation = wellData.getWellLocation();
WellMetadata wellMetadata = wellData.tryGetMetadata();
......@@ -133,7 +134,7 @@ public class WellContentDialog extends Dialog
wellOrNull = wellMetadata.getWellSample();
wellPropertiesOrNull = wellMetadata.getWellSample().getProperties();
}
return new WellContentDialog(wellOrNull, wellPropertiesOrNull, wellLocation,
return new WellContentDialog(wellOrNull, wellPropertiesOrNull, wellLocation, hasDataSet,
getExperiment(wellData), viewContext);
}
......@@ -177,7 +178,7 @@ public class WellContentDialog extends Dialog
{
public void handleEvent(BaseEvent be)
{
showContentDialog(viewContext, wellContent, imageDataset);
showContentDialog(viewContext, wellContent, imageDataset, false);
}
});
}
......@@ -186,10 +187,10 @@ public class WellContentDialog extends Dialog
}
private static void showContentDialog(IViewContext<IScreeningClientServiceAsync> viewContext,
WellContent wellContent, DatasetImagesReference imageDatasetOrNull)
WellContent wellContent, DatasetImagesReference imageDatasetOrNull, boolean hasDataSet)
{
WellContentDialog contentDialog =
new WellContentDialog(wellContent.getWell(), null, wellContent.tryGetLocation(),
new WellContentDialog(wellContent.getWell(), null, wellContent.tryGetLocation(), hasDataSet,
getExperiment(wellContent.getExperiment()), viewContext);
// NOTE: channel chooser state will be not reused among different dialogs
......@@ -369,6 +370,7 @@ public class WellContentDialog extends Dialog
private WellContentDialog(IEntityInformationHolderWithPermId wellOrNull,
List<IEntityProperty> wellPropertiesOrNull, final WellLocation wellLocationOrNull,
boolean hasDataSet,
final SingleExperimentSearchCriteria experimentCriteria,
final IViewContext<IScreeningClientServiceAsync> viewContext)
{
......@@ -405,7 +407,7 @@ public class WellContentDialog extends Dialog
center();
}
});
if (wellLocationOrNull != null
if (wellLocationOrNull != null && hasDataSet
&& "true".equals(viewContext.getPropertyOrNull("image-viewer-enabled")))
{
addImageViewerLaunchButton();
......
......@@ -295,14 +295,21 @@ public class PlateLayouter
public void handleEvent(BaseEvent ce)
{
IScreeningClientServiceAsync service = screeningViewContext.getService();
// Reload meta data because they might be out dated especially when
// image transformer factory has changed. For the image URL the
// signature of the factory is needed to distinguish them. This is important
// because Web browser cache images.
service.getPlateContentForDataset(new TechId(model.tryGetImageDataset()
.getDatasetId()), new AbstractAsyncCallback<PlateImages>(
screeningViewContext)
{
DatasetImagesReference dataset = model.tryGetImageDataset();
if (dataset == null)
{
WellContentDialog.showContentDialog(wellData, null, channelState,
screeningViewContext);
} else
{
// Reload meta data because they might be out dated especially when
// image transformer factory has changed. For the image URL the
// signature of the factory is needed to distinguish them. This is important
// because Web browser cache images.
service.getPlateContentForDataset(new TechId(dataset
.getDatasetId()), new AbstractAsyncCallback<PlateImages>(
screeningViewContext)
{
@Override
protected void process(PlateImages plateContent)
{
......@@ -310,7 +317,8 @@ public class PlateLayouter
WellContentDialog.showContentDialog(wellData, ds, channelState,
screeningViewContext);
}
});
});
}
}
});
widget.sinkEvents(Events.OnMouseDown.getEventCode());
......
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