From 19dae30f7acd7a93c432909db03a3373ded74e20 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Fri, 21 Aug 2015 17:05:14 +0100 Subject: [PATCH] JAL-1834 capped the tool-tip text at 500. once that is exceeded an ellipsis is added --- src/jalview/jbgui/GPDBSearchPanel.java | 8 ++++++-- src/jalview/jbgui/GStructureChooser.java | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/jalview/jbgui/GPDBSearchPanel.java b/src/jalview/jbgui/GPDBSearchPanel.java index 473f634..5a73b7c 100644 --- a/src/jalview/jbgui/GPDBSearchPanel.java +++ b/src/jalview/jbgui/GPDBSearchPanel.java @@ -93,8 +93,12 @@ public abstract class GPDBSearchPanel extends JPanel { e.printStackTrace(); } - toolTipText = (toolTipText == null ? null : JvSwingUtils.wrapTooltip( - true, toolTipText)); + toolTipText = (toolTipText == null ? null + : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip( + true, "\"" + toolTipText.subSequence(0, 500) + + "...\"") : JvSwingUtils.wrapTooltip(true, + toolTipText))); + return toolTipText; } }; diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index caba85f..2c51b3d 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -165,8 +165,11 @@ public abstract class GStructureChooser extends JPanel implements { e.printStackTrace(); } - toolTipText = (toolTipText == null ? null : JvSwingUtils.wrapTooltip( - true, toolTipText)); + toolTipText = (toolTipText == null ? null + : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip( + true, "\"" + toolTipText.subSequence(0, 500) + + "...\"") : JvSwingUtils.wrapTooltip(true, + toolTipText))); return toolTipText; } }; -- 1.7.10.2