/** * This method is called before the tooltip is hidden * * @param event * the event trying to hide the tooltip * @return <code>true</code> if the tooltip should be hidden */ private boolean shouldHideToolTip(Event event) { if (event != null && event.type == SWT.MouseMove && (style & NO_RECREATE) != 0) { Object tmp = getToolTipArea(event); // No new area close the current tooltip if (tmp == null) { hide(); return false; } boolean rv = !tmp.equals(currentArea); return rv; } return true; }
/** * This method is called before the tooltip is hidden * * @param event * the event trying to hide the tooltip * @return <code>true</code> if the tooltip should be hidden */ private boolean shouldHideToolTip(Event event) { if (event != null && event.type == SWT.MouseMove && (style & NO_RECREATE) != 0) { Object tmp = getToolTipArea(event); // No new area close the current tooltip if (tmp == null) { hide(); return false; } boolean rv = !tmp.equals(currentArea); return rv; } return true; }
/** * Should the tooltip displayed because of the given event. * <p> * <b>Subclasses may overwrite this to get custom behavior</b> * </p> * * @param event * the event * @return <code>true</code> if tooltip should be displayed */ protected boolean shouldCreateToolTip(Event event) { if ((style & NO_RECREATE) != 0) { Object tmp = getToolTipArea(event); // No new area close the current tooltip if (tmp == null) { hide(); return false; } boolean rv = !tmp.equals(currentArea); return rv; } return true; }
/** * Should the tooltip displayed because of the given event. * <p> * <b>Subclasses may overwrite this to get custom behavior</b> * </p> * * @param event * the event * @return <code>true</code> if tooltip should be displayed */ protected boolean shouldCreateToolTip(Event event) { if ((style & NO_RECREATE) != 0) { Object tmp = getToolTipArea(event); // No new area close the current tooltip if (tmp == null) { hide(); return false; } boolean rv = !tmp.equals(currentArea); return rv; } return true; }
private void toolTipShow(Shell tip, Event event) { if (!tip.isDisposed()) { currentArea = getToolTipArea(event); createToolTipContentArea(event, tip); if (isHideOnMouseDown()) { toolTipHookBothRecursively(tip); } else { toolTipHookByTypeRecursively(tip, true, SWT.MouseExit); } tip.pack(); Point size = tip.getSize(); Point location = fixupDisplayBounds(size, getLocation(size, event)); // Need to adjust a bit more if the mouse cursor.y == tip.y and // the cursor.x is inside the tip Point cursorLocation = tip.getDisplay().getCursorLocation(); if (cursorLocation.y == location.y && location.x < cursorLocation.x && location.x + size.x > cursorLocation.x) { location.y -= 2; } tip.setLocation(location); tip.setVisible(true); } }
private void toolTipShow(Shell tip, Event event) { if (!tip.isDisposed()) { currentArea = getToolTipArea(event); createToolTipContentArea(event, tip); if (isHideOnMouseDown()) { toolTipHookBothRecursively(tip); } else { toolTipHookByTypeRecursively(tip, true, SWT.MouseExit); } tip.pack(); Point size = tip.getSize(); Point location = fixupDisplayBounds(size, getLocation(size, event)); // Need to adjust a bit more if the mouse cursor.y == tip.y and // the cursor.x is inside the tip Point cursorLocation = tip.getDisplay().getCursorLocation(); if (cursorLocation.y == location.y && location.x < cursorLocation.x && location.x + size.x > cursorLocation.x) { location.y -= 2; } tip.setLocation(location); tip.setVisible(true); } }