protected void afterHideToolTip( Event event ) { super.afterHideToolTip( event ); visible = false; }
public void hide() { visible = false; super.hide(); }
public CheckBoxToolTip( Control control ) { super( control, ToolTip.RECREATE, true ); image = control.getDisplay().getSystemImage( SWT.ICON_INFORMATION ); listeners = new ArrayList<CheckBoxToolTipListener>(); visible = false; display = control.getDisplay(); super.setRespectMonitorBounds( true ); super.setRespectDisplayBounds( true ); super.setHideDelay( 50000 ); super.setPopupDelay( 0 ); super.setHideOnMouseDown( false ); }
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); } }
if (messageLabel.getData() instanceof ToolTip) { ToolTip toolTip = (ToolTip) messageLabel.getData(); toolTip.hide(); toolTip.deactivate(); messageLabel.setData(null); tooltip.setPopupDelay(0); tooltip.activate();
private void toolTipHide(Shell tip, Event event) { if (tip != null && !tip.isDisposed() && shouldHideToolTip(event)) { control.getShell().removeListener(SWT.Deactivate, shellListener); currentArea = null; passOnEvent(tip, event); tip.dispose(); CURRENT_TOOLTIP = null; afterHideToolTip(event); } if (event != null && event.type == SWT.Dispose) { deactivate(); data = null; } }
/** * 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; }
private Shell toolTipCreate(final Event event) { if (shouldCreateToolTip(event)) { Shell shell = new Shell(control.getShell(), SWT.ON_TOP | SWT.TOOL | SWT.NO_FOCUS); shell.setLayout(new FillLayout()); toolTipOpen(shell, event); return shell; } return null; }
/** * Adds logic to only show a tooltip if a meaningful item is under the * cursor. */ @Override protected boolean shouldCreateToolTip(Event event) { return super.shouldCreateToolTip(event) && getModelElement(event) != null; }
toolTipHide(CURRENT_TOOLTIP, event); activate();
/** * Activate tooltip support for this control */ public void activate() { deactivate(); control.addListener(SWT.Dispose, listener); control.addListener(SWT.MouseHover, listener); control.addListener(SWT.MouseMove, listener); control.addListener(SWT.MouseExit, listener); control.addListener(SWT.MouseDown, listener); control.addListener(SWT.MouseWheel, listener); }
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); } }
if (messageLabel.getData() instanceof ToolTip) { ToolTip toolTip = (ToolTip) messageLabel.getData(); toolTip.hide(); toolTip.deactivate(); messageLabel.setData(null); tooltip.setPopupDelay(0); tooltip.activate();
private void toolTipHide(Shell tip, Event event) { if (tip != null && !tip.isDisposed() && shouldHideToolTip(event)) { control.getShell().removeListener(SWT.Deactivate, shellListener); currentArea = null; passOnEvent(tip, event); tip.dispose(); CURRENT_TOOLTIP = null; afterHideToolTip(event); } if (event != null && event.type == SWT.Dispose) { deactivate(); data = null; } }
/** * 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 Shell toolTipCreate(final Event event) { if (shouldCreateToolTip(event)) { Shell shell = new Shell(control.getShell(), SWT.ON_TOP | SWT.TOOL | SWT.NO_FOCUS); shell.setLayout(new FillLayout()); toolTipOpen(shell, event); return shell; } return null; }
@Override protected boolean shouldCreateToolTip(Event event) { final Object eventItem = getToolTipItem(new Point(event.x, event.y)); boolean shouldCreate = eventItem != null && eventItem instanceof OutlineItem && super.shouldCreateToolTip(event); if (!shouldCreate) { hide(); } return shouldCreate; }
toolTipHide(CURRENT_TOOLTIP, event); activate();
/** * Activate tooltip support for this control */ public void activate() { deactivate(); control.addListener(SWT.Dispose, listener); control.addListener(SWT.MouseHover, listener); control.addListener(SWT.MouseMove, listener); control.addListener(SWT.MouseExit, listener); control.addListener(SWT.MouseDown, listener); control.addListener(SWT.MouseWheel, listener); }
/** * 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; }