diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java index 7d32c5815bb897151dff01563a2f05c0a6d468a9..b8121830c65141b4e96036d5eaeadd3d51e3b8e1 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/WellContentDialog.java @@ -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(); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java index b0fe1ede874b08d94a0196a0fdbabb51bc7800fd..02c58353a97c5da34cd78a9075e6827e7eeb6154 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/client/web/client/application/detailviewers/heatmaps/PlateLayouter.java @@ -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());