Examples of IInformationControl


Examples of org.eclipse.jface.text.IInformationControl

            fInformationPresenterControlCreator = informationPresenterControlCreator;
        }

        @Override
        protected IInformationControl doCreateInformationControl(final Shell parent) {
            IInformationControl control;
            if (BrowserInformationControl.isAvailable(parent)) {
                control = new BrowserInformationControl(parent,
                        JFaceResources.DIALOG_FONT,
                        EditorsUI.getTooltipAffordanceString()) {
                    @Override
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

          if (Helper.okToUse(control)) {
            if (fTraverseListener == null) {
              fTraverseListener= new TraverseListener() {
                public void keyTraversed(TraverseEvent event) {
                  if (event.detail == SWT.TRAVERSE_TAB_NEXT) {
                    IInformationControl iControl= fAdditionalInfoController.getCurrentInformationControl2();
                    if (fAdditionalInfoController.getInternalAccessor().canReplace(iControl)) {
                      fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true);
                      event.doit= false;
                    }
                  }
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

       * as well, since the content assistant is the widget token owner
       * and its closer does not know that the additional info control can
       * now also take focus.
       */
      if (fAdditionalInfoController != null) {
        IInformationControl informationControl= fAdditionalInfoController.getCurrentInformationControl2();
        if (informationControl != null && informationControl.isFocusControl())
          return true;
        InformationControlReplacer replacer= fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer();
        if (replacer != null) {
          informationControl= replacer.getCurrentInformationControl2();
          if (informationControl != null && informationControl.isFocusControl())
            return true;
        }
      }
    }

View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

  /*
   * @see org.eclipse.jface.text.IWidgetTokenKeeperExtension#setFocus(org.eclipse.jface.text.IWidgetTokenOwner)
   */
  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();
  }
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

        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);
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

        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);
      }
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

    public void handleEvent(Event event) {
      if (event.type == SWT.MouseMove) {
        if (!(event.widget instanceof Control) || event.widget.isDisposed())
          return;
       
        IInformationControl infoControl= getCurrentInformationControl2();
        if (infoControl != null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) {
//          if (DEBUG) System.out.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$
          IInformationControlExtension3 iControl3= (IInformationControlExtension3) infoControl;
          Rectangle controlBounds= iControl3.getBounds();
          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();
            }
          }
         
        } else {
          /*
           * TODO: need better understanding of why/if this is needed.
           * Looks like the same panic code we have in org.eclipse.jface.text.AbstractHoverInformationControlManager.Closer.handleMouseMove(Event)
           */
          if (fDisplay != null && !fDisplay.isDisposed())
            fDisplay.removeFilter(SWT.MouseMove, this);
        }
       
      } else if (event.type == SWT.FocusOut) {
        if (DEBUG) System.out.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$
        IInformationControl iControl= getCurrentInformationControl2();
        if (iControl != null && ! iControl.isFocusControl())
          hideInformationControl();
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

          return;
       
        if (fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer() == null)
          fAdditionalInfoController.hideInformationControl();
        else if (!fAdditionalInfoController.getInternalAccessor().isReplaceInProgress()) {
          IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2();
          // During isReplaceInProgress(), events can come from the replacing information control
          if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) {
            Control control= (Control) event.widget;
            IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl;
            if (!(iControl5.containsControl(control)))
              fAdditionalInfoController.hideInformationControl();
            else if (event.type == SWT.MouseWheel)
              fAdditionalInfoController.getInternalAccessor().replaceInformationControl(false);
          } else if (infoControl != null && infoControl.isFocusControl()) {
            fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true);
          }
        }
        break;
       
      case SWT.MouseUp:
        if (fAdditionalInfoController == null || fAdditionalInfoController.getInternalAccessor().isReplaceInProgress())
          break;
        if (event.widget instanceof Control) {
          Control control= (Control) event.widget;
          IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2();
          if (infoControl instanceof IInformationControlExtension5) {
            final IInformationControlExtension5 iControl5= (IInformationControlExtension5) infoControl;
            if (iControl5.containsControl(control)) {
              if (infoControl instanceof IDelayedInputChangeProvider) {
                final IDelayedInputChangeProvider delayedICP= (IDelayedInputChangeProvider) infoControl;
                final IInputChangedListener inputChangeListener= new DelayedInputChangeListener(delayedICP, fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer());
                delayedICP.setDelayedInputChangeListener(inputChangeListener);
                // cancel automatic input updating after a small timeout:
                control.getShell().getDisplay().timerExec(1000, new Runnable() {
                  public void run() {
                    delayedICP.setDelayedInputChangeListener(null);
                  }
                });
              }
             
              // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=212392 :
              control.getShell().getDisplay().asyncExec(new Runnable() {
                public void run() {
                  fAdditionalInfoController.getInternalAccessor().replaceInformationControl(true);
                }
              });
            }
          }
        }
        break;
 
      case SWT.Deactivate:
        if (fAdditionalInfoController == null)
          break;
        InformationControlReplacer replacer= fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer();
        if (replacer != null && fContentAssistant != null) {
          IInformationControl iControl= replacer.getCurrentInformationControl2();
          if (event.widget instanceof Control && iControl instanceof IInformationControlExtension5) {
            Control control= (Control) event.widget;
            IInformationControlExtension5 iControl5= (IInformationControlExtension5) iControl;
            if (iControl5.containsControl(control)) {
              control.getDisplay().asyncExec(new Runnable() {
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

   *
   * @param subjectArea the information area
   * @param information the information
   */
  public void showInformationControl(Rectangle subjectArea, Object information) {
    IInformationControl informationControl= getInformationControl();
   
    Rectangle controlBounds= fContentBounds;
    if (informationControl instanceof IInformationControlExtension3) {
      IInformationControlExtension3 iControl3= (IInformationControlExtension3) informationControl;
      Rectangle trim= iControl3.computeTrim();
      controlBounds= Geometry.add(controlBounds, trim);
     
      /*
       * Ensure minimal size. Interacting with a tiny information control
       * (resizing, selecting text) would be a pain.
       */
      controlBounds.width= Math.max(controlBounds.width, MIN_WIDTH);
      controlBounds.height= Math.max(controlBounds.height, MIN_HEIGHT);
     
      getInternalAccessor().cropToClosestMonitor(controlBounds);
    }
   
    Point location= Geometry.getLocation(controlBounds);
    Point size= Geometry.getSize(controlBounds);
   
    // Caveat: some IInformationControls fail unless setSizeConstraints(..) is called with concrete values
    informationControl.setSizeConstraints(size.x, size.y);
   
    if (informationControl instanceof IInformationControlExtension2)
      ((IInformationControlExtension2) informationControl).setInput(information);
    else
      informationControl.setInformation(information.toString());
   
    informationControl.setLocation(location);
    informationControl.setSize(size.x, size.y);
   
    showInformationControl(subjectArea);
  }
View Full Code Here

Examples of org.eclipse.jface.text.IInformationControl

        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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.