Skip to content
Snippets Groups Projects
Commit 0064a9ba authored by gpawel's avatar gpawel
Browse files

[LMS-2221] show tooltips when well do not have it's dataset, auto-width for tooltips

SVN: 21385
parent 635a90bd
No related branches found
No related tags found
No related merge requests found
......@@ -109,4 +109,8 @@ public class WellData
return fullyLoaded;
}
public void setFullyLoaded(boolean fullyLoaded)
{
this.fullyLoaded = fullyLoaded;
}
}
\ No newline at end of file
......@@ -276,6 +276,10 @@ class HeatmapPresenter
};
viewContext.getService().getWellFeatureVectorValues(datasetCode, datastoreCode,
location, callback);
} else
{
wellData.setFullyLoaded(true);
refreshTooltipAction.execute();
}
}
......
......@@ -34,6 +34,7 @@ import com.extjs.gxt.ui.client.widget.form.SimpleComboValue;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.extjs.gxt.ui.client.widget.tips.ToolTip;
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
import com.google.gwt.user.client.ui.Widget;
......@@ -152,8 +153,6 @@ public class PlateLayouter
config.setMouseOffset(new int[]
{ 0, 0 });
config.setAnchor(anchor);
// WORKAROUND width isn't properly updated - we set fixed value
config.setMinWidth(300);
config.setDismissDelay(10000); // 10s to hide
GWTUtils.setToolTip(wellComponent, config);
}
......@@ -419,7 +418,36 @@ public class PlateLayouter
private static Component createBox()
{
return new Text("");
return new Text("")
{
@Override
// WORKAROUND to have an auto-width feature in ToolTips. See:
// http://www.sencha.com/forum/archive/index.php/t-124754.html?s=656b4337e47b9419755bf0a6bc7409e9
public void setToolTip(ToolTipConfig config)
{
if (config != null)
{
if (toolTip == null)
{
toolTip = new ToolTip(this, config)
{
@Override
public void update(ToolTipConfig tooTipConfig)
{
super.update(tooTipConfig);
if (isRendered() && isAttached())
{
hide();
doAutoWidth();
show();
}
}
};
}
}
super.setToolTip(config);
}
};
}
// ---------
......
......@@ -19,6 +19,7 @@ package ch.systemsx.cisd.openbis.plugin.screening.client.web.client.application.
import java.util.Collections;
import java.util.List;
import ch.systemsx.cisd.common.shared.basic.utils.StringUtils;
import ch.systemsx.cisd.openbis.generic.client.web.client.application.renderer.IRealNumberRenderer;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Material;
......@@ -36,6 +37,8 @@ import ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellMetadata;
*/
class WellTooltipGenerator implements HeatmapPresenter.IWellTooltipGenerator
{
private static final String UNKNOWN_WELL_LABEL = "No well information available.";
private static final String NEWLINE = "\n";
private static final int MAX_DESCRIBED_FEATURES = 20;
......@@ -97,7 +100,7 @@ class WellTooltipGenerator implements HeatmapPresenter.IWellTooltipGenerator
tooltip += "...";
}
}
return tooltip;
return StringUtils.isBlank(tooltip) ? UNKNOWN_WELL_LABEL : tooltip;
}
private int getNumberOfLoadedFeatures(WellData wellData)
......
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