本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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);
}
}