当前位置: 首页>>代码示例>>Java>>正文


Java TooltipController.getInstance方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.hint.TooltipController.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java TooltipController.getInstance方法的具体用法?Java TooltipController.getInstance怎么用?Java TooltipController.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.hint.TooltipController的用法示例。


在下文中一共展示了TooltipController.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mouseMoved

import com.intellij.codeInsight.hint.TooltipController; //导入方法依赖的package包/类
@Override
public void mouseMoved(MouseEvent e) {
  int line = EditorUtil.yPositionToLogicalLine(editor, e.getPoint());
  if (line == lastGutterToolTipLine) {
    return;
  }

  TooltipController controller = TooltipController.getInstance();
  if (lastGutterToolTipLine != -1) {
    controller.cancelTooltip(TOOLTIP_GROUP, e, true);
  }

  String toolTip = gutterContentProvider.getToolTip(line, editor);
  setCursor(toolTip == null ? Cursor.getDefaultCursor() : Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  if (toolTip == null) {
    lastGutterToolTipLine = -1;
    controller.cancelTooltip(TOOLTIP_GROUP, e, false);
  }
  else {
    lastGutterToolTipLine = line;
    RelativePoint showPoint = new RelativePoint(this, e.getPoint());
    controller.showTooltipByMouseMove(editor,
                                      showPoint,
                                      ((EditorMarkupModel)editor.getMarkupModel()).getErrorStripTooltipRendererProvider().calcTooltipRenderer(toolTip),
                                      false,
                                      TOOLTIP_GROUP,
                                      new HintHint(this, e.getPoint()).setAwtTooltip(true));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ConsoleGutterComponent.java

示例2: mouseMoved

import com.intellij.codeInsight.hint.TooltipController; //导入方法依赖的package包/类
@Override
public void mouseMoved(@NotNull MouseEvent e) {
  if (getMouseSelectionState() != MOUSE_SELECTION_STATE_NONE) {
    if (myMousePressedEvent != null && myMousePressedEvent.getComponent() == e.getComponent()) {
      Point lastPoint = myMousePressedEvent.getPoint();
      Point point = e.getPoint();
      int deadZone = Registry.intValue("editor.mouseSelectionStateResetDeadZone");
      if (Math.abs(lastPoint.x - point.x) >= deadZone || Math.abs(lastPoint.y - point.y) >= deadZone) {
        resetMouseSelectionState(e);
      }
    }
    else {
      validateMousePointer(e);
    }
  }
  else {
    validateMousePointer(e);
  }

  myMouseMovedEvent = e;

  EditorMouseEvent event = new EditorMouseEvent(EditorImpl.this, e, getMouseEventArea(e));
  if (e.getSource() == myGutterComponent) {
    myGutterComponent.mouseMoved(e);
  }

  if (event.getArea() == EditorMouseEventArea.EDITING_AREA) {
    FoldRegion fold = myFoldingModel.getFoldingPlaceholderAt(e.getPoint());
    TooltipController controller = TooltipController.getInstance();
    if (fold != null && !fold.shouldNeverExpand()) {
      DocumentFragment range = createDocumentFragment(fold);
      final Point p =
        SwingUtilities.convertPoint((Component)e.getSource(), e.getPoint(), getComponent().getRootPane().getLayeredPane());
      controller.showTooltip(EditorImpl.this, p, new DocumentFragmentTooltipRenderer(range), false, FOLDING_TOOLTIP_GROUP);
    }
    else {
      controller.cancelTooltip(FOLDING_TOOLTIP_GROUP, e, true);
    }
  }

  for (EditorMouseMotionListener listener : myMouseMotionListeners) {
    listener.mouseMoved(event);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:bigFile.java

示例3: cancelMyToolTips

import com.intellij.codeInsight.hint.TooltipController; //导入方法依赖的package包/类
private void cancelMyToolTips(final MouseEvent e, boolean checkIfShouldSurvive) {
  final TooltipController tooltipController = TooltipController.getInstance();
  if (!checkIfShouldSurvive || !tooltipController.shouldSurvive(e)) {
    tooltipController.cancelTooltip(ERROR_STRIPE_TOOLTIP_GROUP, e, true);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:EditorMarkupModelImpl.java

示例4: showTooltip

import com.intellij.codeInsight.hint.TooltipController; //导入方法依赖的package包/类
private void showTooltip(MouseEvent e, final TooltipRenderer tooltipObject, @NotNull HintHint hintHint) {
  TooltipController tooltipController = TooltipController.getInstance();
  tooltipController.showTooltipByMouseMove(myEditor, new RelativePoint(e), tooltipObject,
                                           myEditor.getVerticalScrollbarOrientation() == EditorEx.VERTICAL_SCROLLBAR_RIGHT,
                                           ERROR_STRIPE_TOOLTIP_GROUP, hintHint);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:EditorMarkupModelImpl.java

示例5: mouseMoved

import com.intellij.codeInsight.hint.TooltipController; //导入方法依赖的package包/类
@Override
public void mouseMoved(@Nonnull MouseEvent e) {
  if (getMouseSelectionState() != MOUSE_SELECTION_STATE_NONE) {
    if (myMousePressedEvent != null && myMousePressedEvent.getComponent() == e.getComponent()) {
      Point lastPoint = myMousePressedEvent.getPoint();
      Point point = e.getPoint();
      int deadZone = Registry.intValue("editor.mouseSelectionStateResetDeadZone");
      if (Math.abs(lastPoint.x - point.x) >= deadZone || Math.abs(lastPoint.y - point.y) >= deadZone) {
        resetMouseSelectionState(e);
      }
    }
    else {
      validateMousePointer(e);
    }
  }
  else {
    validateMousePointer(e);
  }

  myMouseMovedEvent = e;

  EditorMouseEvent event = new EditorMouseEvent(EditorImpl.this, e, getMouseEventArea(e));
  if (e.getSource() == myGutterComponent) {
    myGutterComponent.mouseMoved(e);
  }

  if (event.getArea() == EditorMouseEventArea.EDITING_AREA) {
    FoldRegion fold = myFoldingModel.getFoldingPlaceholderAt(e.getPoint());
    TooltipController controller = TooltipController.getInstance();
    if (fold != null && !fold.shouldNeverExpand()) {
      DocumentFragment range = createDocumentFragment(fold);
      final Point p = SwingUtilities.convertPoint((Component)e.getSource(), e.getPoint(), getComponent().getRootPane().getLayeredPane());
      controller.showTooltip(EditorImpl.this, p, new DocumentFragmentTooltipRenderer(range), false, FOLDING_TOOLTIP_GROUP);
    }
    else {
      controller.cancelTooltip(FOLDING_TOOLTIP_GROUP, e, true);
    }
  }

  for (EditorMouseMotionListener listener : myMouseMotionListeners) {
    listener.mouseMoved(event);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:44,代码来源:EditorImpl.java


注:本文中的com.intellij.codeInsight.hint.TooltipController.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。