@Override public void run() { hideInformationControl(); } });
return; IInformationControl infoControl= getCurrentInformationControl2(); if (infoControl != null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) { if (controlBounds != null) { Point mouseLoc= event.display.map((Control) event.widget, null, event.x, event.y); int margin= getKeepUpMargin(); Geometry.expand(controlBounds, margin, margin, margin, margin); if (!controlBounds.contains(mouseLoc)) { hideInformationControl(); IInformationControl iControl= getCurrentInformationControl2(); if (iControl != null && ! iControl.isFocusControl()) hideInformationControl();
@Override public boolean requestWidgetToken(IWidgetTokenOwner owner, int priority) { if (getCurrentInformationControl2() != null) { if (getCurrentInformationControl2().isFocusControl()) { if (DEBUG) System.out.println("StickyHoverManager kept widget token (focused)"); //$NON-NLS-1$ return false; } else if (priority > WIDGET_PRIORITY) { hideInformationControl(); if (DEBUG) System.out.println("StickyHoverManager gave up widget token (prio)"); //$NON-NLS-1$ return true; } else { if (DEBUG) System.out.println("StickyHoverManager kept widget token (prio)"); //$NON-NLS-1$ return false; } } if (DEBUG) System.out.println("StickyHoverManager gave up widget token (no iControl)"); //$NON-NLS-1$ return true; }
/** * After this method has been executed the caller knows that any installed text hover has been installed. */ private void ensureHoverControlManagerInstalled() { if (fTextHovers != null && !fTextHovers.isEmpty() && fHoverControlCreator != null && fTextHoverManager == null) { fTextHoverManager= new TextViewerHoverManager(this, fHoverControlCreator); fTextHoverManager.install(this.getTextWidget()); fTextHoverManager.setSizeConstraints(TEXT_HOVER_WIDTH_CHARS, TEXT_HOVER_HEIGHT_CHARS, false, true); fTextHoverManager.setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override public boolean setFocus(IWidgetTokenOwner owner) { IInformationControl iControl= getCurrentInformationControl2(); if (iControl instanceof IInformationControlExtension5) { IInformationControlExtension5 iControl5= (IInformationControlExtension5) iControl; if (iControl5.isVisible()) { iControl.setFocus(); return iControl.isFocusControl(); } return false; } iControl.setFocus(); return iControl.isFocusControl(); }
return; IInformationControl infoControl= getCurrentInformationControl2(); if (infoControl != null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) { if (controlBounds != null) { Point mouseLoc= event.display.map((Control) event.widget, null, event.x, event.y); int margin= getKeepUpMargin(); Geometry.expand(controlBounds, margin, margin, margin, margin); if (!controlBounds.contains(mouseLoc)) { hideInformationControl(); IInformationControl iControl= getCurrentInformationControl2(); if (iControl != null && ! iControl.isFocusControl()) hideInformationControl();
@Override public boolean requestWidgetToken(IWidgetTokenOwner owner, int priority) { if (getCurrentInformationControl2() != null) { if (getCurrentInformationControl2().isFocusControl()) { if (DEBUG) System.out.println("StickyHoverManager kept widget token (focused)"); //$NON-NLS-1$ return false; } else if (priority > WIDGET_PRIORITY) { hideInformationControl(); if (DEBUG) System.out.println("StickyHoverManager gave up widget token (prio)"); //$NON-NLS-1$ return true; } else { if (DEBUG) System.out.println("StickyHoverManager kept widget token (prio)"); //$NON-NLS-1$ return false; } } if (DEBUG) System.out.println("StickyHoverManager gave up widget token (no iControl)"); //$NON-NLS-1$ return true; }
/** * After this method has been executed the caller knows that any installed text hover has been installed. */ private void ensureHoverControlManagerInstalled() { if (fTextHovers != null && !fTextHovers.isEmpty() && fHoverControlCreator != null && fTextHoverManager == null) { fTextHoverManager= new TextViewerHoverManager(this, fHoverControlCreator); fTextHoverManager.install(this.getTextWidget()); fTextHoverManager.setSizeConstraints(TEXT_HOVER_WIDTH_CHARS, TEXT_HOVER_HEIGHT_CHARS, false, true); fTextHoverManager.setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override public boolean setFocus(IWidgetTokenOwner owner) { IInformationControl iControl= getCurrentInformationControl2(); if (iControl instanceof IInformationControlExtension5) { IInformationControlExtension5 iControl5= (IInformationControlExtension5) iControl; if (iControl5.isVisible()) { iControl.setFocus(); return iControl.isFocusControl(); } return false; } iControl.setFocus(); return iControl.isFocusControl(); }
@Override public void controlResized(ControlEvent e) { hideInformationControl(); }
/** * After this method has been executed the caller knows that any installed overview hover has been installed. */ protected void ensureOverviewHoverManagerInstalled() { if (fOverviewRuler != null && fOverviewRulerAnnotationHover != null && fOverviewRulerHoveringController == null && fHoverControlCreator != null) { fOverviewRulerHoveringController= new OverviewRulerHoverManager(fOverviewRuler, this, fOverviewRulerAnnotationHover, fHoverControlCreator); fOverviewRulerHoveringController.install(fOverviewRuler.getControl()); fOverviewRulerHoveringController.getInternalAccessor().setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override public void stop() { if (!fIsActive) return; fIsActive= false; fTextViewer.removeViewportListener(this); if (fSubjectControl != null && !fSubjectControl.isDisposed()) { fSubjectControl.removeControlListener(this); fSubjectControl.removeMouseListener(this); fSubjectControl.removeKeyListener(this); } IInformationControl fInformationControlToClose= getCurrentInformationControl2(); if (fInformationControlToClose != null) fInformationControlToClose.removeFocusListener(this); if (fDisplay != null && !fDisplay.isDisposed()) { fDisplay.removeFilter(SWT.MouseMove, this); fDisplay.removeFilter(SWT.FocusOut, this); } fDisplay= null; }
@Override public void viewportChanged(int topIndex) { hideInformationControl(); }
/** * After this method has been executed the caller knows that any installed overview hover has been installed. */ protected void ensureOverviewHoverManagerInstalled() { if (fOverviewRuler != null && fOverviewRulerAnnotationHover != null && fOverviewRulerHoveringController == null && fHoverControlCreator != null) { fOverviewRulerHoveringController= new OverviewRulerHoverManager(fOverviewRuler, this, fOverviewRulerAnnotationHover, fHoverControlCreator); fOverviewRulerHoveringController.install(fOverviewRuler.getControl()); fOverviewRulerHoveringController.getInternalAccessor().setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override public void stop() { if (!fIsActive) return; fIsActive= false; fTextViewer.removeViewportListener(this); if (fSubjectControl != null && !fSubjectControl.isDisposed()) { fSubjectControl.removeControlListener(this); fSubjectControl.removeMouseListener(this); fSubjectControl.removeKeyListener(this); } IInformationControl fInformationControlToClose= getCurrentInformationControl2(); if (fInformationControlToClose != null) fInformationControlToClose.removeFocusListener(this); if (fDisplay != null && !fDisplay.isDisposed()) { fDisplay.removeFilter(SWT.MouseMove, this); fDisplay.removeFilter(SWT.FocusOut, this); } fDisplay= null; }
@Override public void mouseDown(MouseEvent e) { hideInformationControl(); }
/** * After this method has been executed the caller knows that any installed annotation hover has been installed. */ protected void ensureAnnotationHoverManagerInstalled() { if (fVerticalRuler != null && (fAnnotationHover != null || !isVerticalRulerOnlyShowingAnnotations()) && fVerticalRulerHoveringController == null && fHoverControlCreator != null) { fVerticalRulerHoveringController= new AnnotationBarHoverManager(fVerticalRuler, this, fAnnotationHover, fHoverControlCreator); fVerticalRulerHoveringController.install(fVerticalRuler.getControl()); fVerticalRulerHoveringController.getInternalAccessor().setInformationControlReplacer(new StickyHoverManager(this)); } }
@Override public void start(Rectangle informationArea) { if (fIsActive) return; fIsActive= true; if (fSubjectControl != null && !fSubjectControl.isDisposed()) { fSubjectControl.addControlListener(this); fSubjectControl.addMouseListener(this); fSubjectControl.addKeyListener(this); } fTextViewer.addViewportListener(this); IInformationControl fInformationControlToClose= getCurrentInformationControl2(); if (fInformationControlToClose != null) fInformationControlToClose.addFocusListener(this); fDisplay= fSubjectControl.getDisplay(); if (!fDisplay.isDisposed()) { fDisplay.addFilter(SWT.MouseMove, this); fDisplay.addFilter(SWT.FocusOut, this); } }