{
desc = String.format("%s %d-%d", sf.getType(), start, end);
}
+ String tooltip = desc;
String description = sf.getDescription();
if (description != null)
{
description = StringUtils.stripHtmlTags(description);
- if (description.length() <= 6)
+ if (description.length() > 12)
{
- desc = desc + " " + description;
+ desc = desc + " " + description.substring(0, 12) + "..";
}
else
{
- desc = desc + " " + description.substring(0, 6) + "..";
+ desc = desc + " " + description;
}
+ tooltip = tooltip + " " + description;
}
if (sf.getFeatureGroup() != null)
{
- desc = desc + " (" + sf.getFeatureGroup() + ")";
+ tooltip = tooltip + (" (" + sf.getFeatureGroup() + ")");
}
JMenuItem item = new JMenuItem(desc);
+ item.setToolTipText(tooltip);
item.addActionListener(new ActionListener()
{
@Override