本文整理汇总了Java中com.intellij.find.FindModel.setSearchHighlighters方法的典型用法代码示例。如果您正苦于以下问题:Java FindModel.setSearchHighlighters方法的具体用法?Java FindModel.setSearchHighlighters怎么用?Java FindModel.setSearchHighlighters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.find.FindModel
的用法示例。
在下文中一共展示了FindModel.setSearchHighlighters方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupFindModel
import com.intellij.find.FindModel; //导入方法依赖的package包/类
static void setupFindModel(final Project project) {
final FindManager findManager = FindManager.getInstance(project);
FindModel model = findManager.getFindNextModel();
if (model == null) {
model = findManager.getFindInFileModel();
}
model.setSearchHighlighters(true);
findManager.setFindWasPerformed();
findManager.setFindNextModel(model);
}
示例2: execute
import com.intellij.find.FindModel; //导入方法依赖的package包/类
@Override
public void execute(Editor editor, DataContext dataContext){
editor.setHeaderComponent(null);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project != null) {
HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo("");
}
FindManager findManager = FindManager.getInstance(project);
if (findManager != null) {
FindModel model = findManager.getFindNextModel(editor);
if (model != null) {
model.setSearchHighlighters(false);
findManager.setFindNextModel(model);
}
}
return;
}
}
myOriginalHandler.execute(editor, dataContext);
}
示例3: execute
import com.intellij.find.FindModel; //导入方法依赖的package包/类
@Override
public void execute(Editor editor, DataContext dataContext){
editor.setHeaderComponent(null);
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
if (project != null) {
HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo("");
}
FindManager findManager = FindManager.getInstance(project);
if (findManager != null) {
FindModel model = findManager.getFindNextModel(editor);
if (model != null) {
model.setSearchHighlighters(false);
findManager.setFindNextModel(model);
}
}
return;
}
}
myOriginalHandler.execute(editor, dataContext);
}
示例4: execute
import com.intellij.find.FindModel; //导入方法依赖的package包/类
@Override
public void execute(Editor editor, DataContext dataContext){
editor.setHeaderComponent(null);
Project project = dataContext.getData(CommonDataKeys.PROJECT);
if (project != null) {
HighlightManagerImpl highlightManager = (HighlightManagerImpl)HighlightManager.getInstance(project);
if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo("");
}
FindManager findManager = FindManager.getInstance(project);
if (findManager != null) {
FindModel model = findManager.getFindNextModel(editor);
if (model != null) {
model.setSearchHighlighters(false);
findManager.setFindNextModel(model);
}
}
return;
}
}
myOriginalHandler.execute(editor, dataContext);
}
示例5: getNextSymbolOffset
import com.intellij.find.FindModel; //导入方法依赖的package包/类
private int getNextSymbolOffset(boolean searchForward, Project project) {
_editor.getSelectionModel().selectWordAtCaret(false);
int symbolStart = _editor.getSelectionModel().getSelectionStart();
int symbolEnd = _editor.getSelectionModel().getSelectionEnd();
if (symbolStart >= 0 && symbolEnd > symbolStart) {
String symbol = _editor.getDocument().getText(new TextRange(symbolStart, symbolEnd));
FindManager findManager = FindManager.getInstance(project);
FindModel findModel = (FindModel) findManager.getFindInFileModel().clone();
findModel.setFindAll(false);
findModel.setFromCursor(true);
findModel.setForward(searchForward);
findModel.setRegularExpressions(false);
findModel.setWholeWordsOnly(true);
findModel.setCaseSensitive(true);
findModel.setSearchHighlighters(false);
findModel.setPreserveCase(false);
findModel.setStringToFind(symbol);
int startOffset = _editor.getCaretModel().getOffset();
if (searchForward) {
startOffset++;
}
FindResult findResult = findManager.findString(_editor.getDocument().getText(), startOffset, findModel);
//fix errors in Appcode, which is the findManager.findString return 0, when string not found.
if (findResult.getStartOffset() == 0) {
String potentialSymbol = _editor.getDocument().getText(new TextRange(0, symbol.length()));
if (!potentialSymbol.equals(symbol)) {
return -1;
}
}
return findResult.getStartOffset();
}
return -1;
}