本文整理汇总了Java中com.intellij.codeInsight.hint.TooltipController.showTooltip方法的典型用法代码示例。如果您正苦于以下问题:Java TooltipController.showTooltip方法的具体用法?Java TooltipController.showTooltip怎么用?Java TooltipController.showTooltip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.hint.TooltipController
的用法示例。
在下文中一共展示了TooltipController.showTooltip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}