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


Java HintManager.HIDE_BY_TEXT_CHANGE属性代码示例

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


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

示例1: showPreviewEditorErrorToolTip

public static void showPreviewEditorErrorToolTip(Editor editor, int offset, HintManagerImpl hintMgr, String msg) {
	int flags =
		HintManager.HIDE_BY_ANY_KEY|
			HintManager.HIDE_BY_TEXT_CHANGE|
			HintManager.HIDE_BY_SCROLLING;
	int timeout = 0; // default?
	hintMgr.showErrorHint(editor, msg,
	                      offset, offset+1,
	                      HintManager.ABOVE, flags, timeout);
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:10,代码来源:InputPanel.java

示例2: showDecisionEventToolTip

public static void showDecisionEventToolTip(Editor editor, int offset, HintManagerImpl hintMgr, String msg) {
	int flags =
		HintManager.HIDE_BY_ANY_KEY|
			HintManager.HIDE_BY_TEXT_CHANGE|
			HintManager.HIDE_BY_SCROLLING;
	int timeout = 0; // default?
	JComponent infoLabel = HintUtil.createInformationLabel(msg);
	LightweightHint hint = new LightweightHint(infoLabel);
	final LogicalPosition pos = editor.offsetToLogicalPosition(offset);
	final Point p = HintManagerImpl.getHintPosition(hint, editor, pos, HintManager.ABOVE);
	hintMgr.showEditorHint(hint, editor, p, flags, timeout, false);
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:12,代码来源:InputPanel.java

示例3: showActiveHint

public static void showActiveHint(@NotNull Range range,
                                  @NotNull Editor editor,
                                  @Nullable Point mousePosition,
                                  @NotNull LineStatusTracker tracker) {
  final Disposable disposable = Disposer.newDisposable();

  List<DiffFragment> wordDiff = computeWordDiff(range, tracker);

  installEditorHighlighters(range, editor, tracker, wordDiff, disposable);
  Pair<JComponent, Integer> editorComponent = createEditorComponent(range, editor, tracker, wordDiff);

  ActionToolbar toolbar = buildToolbar(range, editor, tracker, disposable);
  toolbar.updateActionsImmediately(); // we need valid ActionToolbar.getPreferredSize() to calc size of popup

  PopupPanel popupPanel = new PopupPanel(editor, toolbar, editorComponent.first, editorComponent.second);

  LightweightHint hint = new LightweightHint(popupPanel);
  HintListener closeListener = new HintListener() {
    public void hintHidden(final EventObject event) {
      Disposer.dispose(disposable);
    }
  };
  hint.addHintListener(closeListener);

  int line = editor.getCaretModel().getLogicalPosition().line;
  Point point = HintManagerImpl.getHintPosition(hint, editor, new LogicalPosition(line, 0), HintManager.UNDER);
  if (mousePosition != null) { // show right after the nearest line
    int lineHeight = editor.getLineHeight();
    int delta = (point.y - mousePosition.y) % lineHeight;
    if (delta < 0) delta += lineHeight;
    point.y = mousePosition.y + delta;
  }
  point.x -= popupPanel.getEditorTextOffset(); // align main editor with the one in popup

  int flags = HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_SCROLLING;
  HintManagerImpl.getInstanceImpl().showEditorHint(hint, editor, point, flags, -1, false, new HintHint(editor, point));

  if (!hint.isVisible()) {
    closeListener.hintHidden(null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:LineStatusTrackerDrawing.java

示例4: showHintAt

public void showHintAt(@Nullable Point mousePosition) {
  if (!myTracker.isValid()) return;
  final Disposable disposable = Disposer.newDisposable();

  FileType fileType = getFileType();
  List<DiffFragment> wordDiff = computeWordDiff();

  installMasterEditorHighlighters(wordDiff, disposable);
  JComponent editorComponent = createEditorComponent(fileType, wordDiff);

  ActionToolbar toolbar = buildToolbar(mousePosition, disposable);
  toolbar.updateActionsImmediately(); // we need valid ActionToolbar.getPreferredSize() to calc size of popup
  toolbar.setReservePlaceAutoPopupIcon(false);

  PopupPanel popupPanel = new PopupPanel(myEditor, toolbar, editorComponent);

  LightweightHint hint = new LightweightHint(popupPanel);
  HintListener closeListener = new HintListener() {
    public void hintHidden(final EventObject event) {
      Disposer.dispose(disposable);
    }
  };
  hint.addHintListener(closeListener);

  int line = myEditor.getCaretModel().getLogicalPosition().line;
  Point point = HintManagerImpl.getHintPosition(hint, myEditor, new LogicalPosition(line, 0), HintManager.UNDER);
  if (mousePosition != null) { // show right after the nearest line
    int lineHeight = myEditor.getLineHeight();
    int delta = (point.y - mousePosition.y) % lineHeight;
    if (delta < 0) delta += lineHeight;
    point.y = mousePosition.y + delta;
  }
  point.x -= popupPanel.getEditorTextOffset(); // align main editor with the one in popup

  int flags = HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_SCROLLING;
  HintManagerImpl.getInstanceImpl().showEditorHint(hint, myEditor, point, flags, -1, false, new HintHint(myEditor, point));

  if (!hint.isVisible()) {
    closeListener.hintHidden(null);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:41,代码来源:LineStatusMarkerPopup.java


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