data.width = FEATURELIST_TOOLTIP_SIZE;
data.height = FEATURELIST_TOOLTIP_SIZE;
infoButton.setLayoutData(data);
- infoButton.setToolTipText(feature.getOverheadRankingMessage());
+ infoButton.setData("tooltipmsg", feature.getOverheadRankingMessage());
infoButton.addListener(SWT.MouseHover, new Listener() {
@Override
public void handleEvent(Event event) {
DACustomButton tempButton = (DACustomButton)event.widget;
Point p = tempButton.toDisplay(tempButton.getLocation());
tooltip.open(tempButton.getShell());
- tooltip.setTooltipMessage(tempButton.getToolTipText());
+ tooltip.setTooltipMessage((String)tempButton.getData("tooltipmsg"));
// TODO: Need to set tool box image and size for DACustomTooltip
tooltip.setTooltipLocation(p, -50, -630);
}
infoButton.addListener(SWT.MouseExit, new Listener() {
@Override
public void handleEvent(Event event) {
- tooltip.close();
+ if (tooltip != null)
+ tooltip.close();
}
});