@Override public void mouseExit(MouseEvent e) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl()) || !inKeepUpZone(e.x, e.y, fSubjectControl, fSubjectArea, false)) { fMouseLostWhileComputing= true; deactivate(); } }
/** * Tests whether the given information control allows the mouse to be moved * into it. * * @param iControl information control or <code>null</code> if none * @return <code>true</code> if information control allows mouse move into * control, <code>false</code> otherwise */ boolean canMoveIntoInformationControl(IInformationControl iControl) { return fEnrichMode != null && canReplace(iControl); }
@Override protected void hideInformationControl() { cancelReplacingDelay(); super.hideInformationControl(); }
@Override public void mouseMove(MouseEvent event) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) { if (!fSubjectArea.contains(event.x, event.y)) { hideInformationControl(); } } else if (getCurrentInformationControl() != null && !getCurrentInformationControl().isFocusControl()) { if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, true)) { hideInformationControl(); } } }
return; IInformationControl iControl= getCurrentInformationControl(); if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(iControl)) { if (AbstractHoverInformationControlManager.this instanceof AnnotationBarHoverManager) { if (getInternalAccessor().getAllowMouseExit()) return; hideInformationControl(); return; Rectangle tooltipBounds= event.display.map(null, eventControl, controlBounds); if (tooltipBounds.contains(event.x, event.y)) { if (!isReplaceInProgress() && event.type != SWT.MouseExit) startReplaceInformationControl(event.display); return; cancelReplacingDelay(); hideInformationControl(); return;
case SWT.Activate: case SWT.MouseVerticalWheel: if (!hasInformationControlReplacer()) hideInformationControl(); else if (!isReplaceInProgress()) { IInformationControl infoControl= getCurrentInformationControl(); IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl; if (!(iControl5.containsControl(control))) hideInformationControl(); else if (event.type == SWT.MouseVerticalWheel && cancelReplacingDelay()) replaceInformationControl(false); } else if (infoControl != null && infoControl.isFocusControl() && cancelReplacingDelay()) { replaceInformationControl(true); if (!hasInformationControlReplacer()) hideInformationControl(); else if (!isReplaceInProgress()) { IInformationControl infoControl= getCurrentInformationControl(); if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) { Control control= (Control) event.widget; final IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl; if (!(iControl5.containsControl(control))) { hideInformationControl(); } else if (cancelReplacingDelay()) { if (event.type == SWT.MouseUp) { final IInputChangedListener inputChangeListener= new DelayedInputChangeListener(delayedICP, getInformationControlReplacer()); delayedICP.setDelayedInputChangeListener(inputChangeListener);
return true; IInformationControl iControl= getCurrentInformationControl(); if ((iControl instanceof IInformationControlExtension5 && !((IInformationControlExtension5) iControl).isVisible())) { iControl= null; if (getInformationControlReplacer() != null) { iControl= getInformationControlReplacer().getCurrentInformationControl2(); if ((iControl instanceof IInformationControlExtension5 && !((IInformationControlExtension5) iControl).isVisible())) { return false; if (blowUp && isReplaceInProgress()) { int margin= getInformationControlReplacer().getKeepUpMargin(); Geometry.expand(totalBounds, margin, margin, margin, margin);
@Override public void showAnnotationsOverview(boolean show) { boolean old= fIsOverviewRulerVisible; fIsOverviewRulerVisible= (show && fOverviewRuler != null); if (old != fIsOverviewRulerVisible) { if (fComposite != null && !fComposite.isDisposed()) fComposite.layout(); if (fIsOverviewRulerVisible) { ensureOverviewHoverManagerInstalled(); } else if (fOverviewRulerHoveringController != null) { fOverviewRulerHoveringController.dispose(); fOverviewRulerHoveringController= null; } } }
@Override protected Point computeInformationControlLocation(Rectangle subjectArea, Point controlSize) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; boolean allowMouseExit= extension.canHandleMouseCursor(); if (allowMouseExit) { return computeLocation(subjectArea, controlSize, ANCHOR_RIGHT); } } return super.computeInformationControlLocation(subjectArea, controlSize); }
@Override protected Point computeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) { Point constraints= super.computeSizeConstraints(subjectControl, subjectArea, informationControl); // make as big as text area, if possible StyledText styledText= fSourceViewer.getTextWidget(); if (styledText != null) { Rectangle r= styledText.getClientArea(); if (r != null) { constraints.x= r.width; constraints.y= r.height; } } return constraints; }
@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); boolean allowMouseExit= false; if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; allowMouseExit= extension.canHandleMouseCursor(); } boolean hideOnMouseWheel= true; if (hover instanceof IAnnotationHoverExtension2) { IAnnotationHoverExtension2 extension= (IAnnotationHoverExtension2) hover; hideOnMouseWheel= !extension.canHandleMouseWheel(); } fHideOnMouseWheel= hideOnMouseWheel; if (allowMouseExit) { fAllowMouseExit= true; Control subjectControl= getSubjectControl(); // return a location that just overlaps the annotation on the bar if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT) return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2); else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT) return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2); } fAllowMouseExit= false; return super.computeLocation(subjectArea, controlSize, anchor); }
fAreaControl.addMouseMoveListener(this); doShowInformation();
return; IInformationControl iControl= getCurrentInformationControl(); if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(iControl)) { if (AbstractHoverInformationControlManager.this instanceof AnnotationBarHoverManager) { if (getInternalAccessor().getAllowMouseExit()) return; hideInformationControl(); return; Rectangle tooltipBounds= event.display.map(null, eventControl, controlBounds); if (tooltipBounds.contains(event.x, event.y)) { if (!isReplaceInProgress() && event.type != SWT.MouseExit) startReplaceInformationControl(event.display); return; cancelReplacingDelay(); hideInformationControl(); return;
case SWT.Activate: case SWT.MouseVerticalWheel: if (!hasInformationControlReplacer()) hideInformationControl(); else if (!isReplaceInProgress()) { IInformationControl infoControl= getCurrentInformationControl(); IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl; if (!(iControl5.containsControl(control))) hideInformationControl(); else if (event.type == SWT.MouseVerticalWheel && cancelReplacingDelay()) replaceInformationControl(false); } else if (infoControl != null && infoControl.isFocusControl() && cancelReplacingDelay()) { replaceInformationControl(true); if (!hasInformationControlReplacer()) hideInformationControl(); else if (!isReplaceInProgress()) { IInformationControl infoControl= getCurrentInformationControl(); if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) { Control control= (Control) event.widget; final IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl; if (!(iControl5.containsControl(control))) { hideInformationControl(); } else if (cancelReplacingDelay()) { if (event.type == SWT.MouseUp) { final IInputChangedListener inputChangeListener= new DelayedInputChangeListener(delayedICP, getInformationControlReplacer()); delayedICP.setDelayedInputChangeListener(inputChangeListener);
@Override public void mouseMove(MouseEvent event) { if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) { if (!fSubjectArea.contains(event.x, event.y)) { hideInformationControl(); } } else if (getCurrentInformationControl() != null && !getCurrentInformationControl().isFocusControl()) { if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, true)) { hideInformationControl(); } } }
return true; IInformationControl iControl= getCurrentInformationControl(); if ((iControl instanceof IInformationControlExtension5 && !((IInformationControlExtension5) iControl).isVisible())) { iControl= null; if (getInformationControlReplacer() != null) { iControl= getInformationControlReplacer().getCurrentInformationControl2(); if ((iControl instanceof IInformationControlExtension5 && !((IInformationControlExtension5) iControl).isVisible())) { return false; if (blowUp && isReplaceInProgress()) { int margin= getInformationControlReplacer().getKeepUpMargin(); Geometry.expand(totalBounds, margin, margin, margin, margin);
@Override public void showAnnotationsOverview(boolean show) { boolean old= fIsOverviewRulerVisible; fIsOverviewRulerVisible= (show && fOverviewRuler != null); if (old != fIsOverviewRulerVisible) { if (fComposite != null && !fComposite.isDisposed()) fComposite.layout(); if (fIsOverviewRulerVisible) { ensureOverviewHoverManagerInstalled(); } else if (fOverviewRulerHoveringController != null) { fOverviewRulerHoveringController.dispose(); fOverviewRulerHoveringController= null; } } }
@Override protected Point computeInformationControlLocation(Rectangle subjectArea, Point controlSize) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; boolean allowMouseExit= extension.canHandleMouseCursor(); if (allowMouseExit) { return computeLocation(subjectArea, controlSize, ANCHOR_RIGHT); } } return super.computeInformationControlLocation(subjectArea, controlSize); }
@Override protected Point computeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) { Point constraints= super.computeSizeConstraints(subjectControl, subjectArea, informationControl); // make as big as text area, if possible StyledText styledText= fSourceViewer.getTextWidget(); if (styledText != null) { Rectangle r= styledText.getClientArea(); if (r != null) { constraints.x= r.width; constraints.y= r.height; } } return constraints; }
@Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { MouseEvent event= getHoverEvent(); IAnnotationHover hover= getHover(event); boolean allowMouseExit= false; if (hover instanceof IAnnotationHoverExtension) { IAnnotationHoverExtension extension= (IAnnotationHoverExtension) hover; allowMouseExit= extension.canHandleMouseCursor(); } boolean hideOnMouseWheel= true; if (hover instanceof IAnnotationHoverExtension2) { IAnnotationHoverExtension2 extension= (IAnnotationHoverExtension2) hover; hideOnMouseWheel= !extension.canHandleMouseWheel(); } fHideOnMouseWheel= hideOnMouseWheel; if (allowMouseExit) { fAllowMouseExit= true; Control subjectControl= getSubjectControl(); // return a location that just overlaps the annotation on the bar if (anchor == AbstractInformationControlManager.ANCHOR_RIGHT) return subjectControl.toDisplay(subjectArea.x - 4, subjectArea.y - 2); else if (anchor == AbstractInformationControlManager.ANCHOR_LEFT) return subjectControl.toDisplay(subjectArea.x + subjectArea.width - controlSize.x + 4, subjectArea.y - 2); } fAllowMouseExit= false; return super.computeLocation(subjectArea, controlSize, anchor); }