# HG changeset patch # Parent 42fdcbdedd817578e91a433c0ff4c272dfa33771 diff --git a/editor.lib/src/org/netbeans/editor/ext/ToolTipSupport.java b/editor.lib/src/org/netbeans/editor/ext/ToolTipSupport.java --- a/editor.lib/src/org/netbeans/editor/ext/ToolTipSupport.java +++ b/editor.lib/src/org/netbeans/editor/ext/ToolTipSupport.java @@ -573,6 +573,26 @@ * @since 2.3 */ public void setToolTipVisible(boolean visible) { + setToolTipVisible(true, true); + } + + /** + * Set the visibility of the tooltip. + * Behaves like {@link #setToolTipVisible(boolean)}, except that it can skip + * forwarding the tooltip request to the view hierarchy. This is useful when + * tooltips are actively displayed by the code, not initiated by user's mouse hover + * or gesture. This call should be then followed by a call to {@code setTooltip} + * to actually set the tooltip's value and position. + *

+ * Use {@link #setToolTipVisible(boolean)} to display a tooltip relevant to the + * mouse position. + * + * @param visible whether tooltip should become visible or not. + * @param updateFromView if true, ask DocumentView to build a tooltip. + * + * @since 2.3 + */ + public final void setToolTipVisible(boolean visible, boolean updateFromView) { LOG.log(Level.FINE, "setToolTipVisible: visible={0}, status={1}, enabled={2}", new Object [] { //NOI18N visible, status, enabled }); @@ -588,7 +608,9 @@ if (visible) { // try to show the tooltip if (enabled) { setStatus(STATUS_VISIBILITY_ENABLED); - updateToolTip(); + if (updateFromView) { + updateToolTip(); + } } } else { // hide tip