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


Java FindModel.setSearchHighlighters方法代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:HighlightHandlerBase.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:EscapeHandler.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:EscapeHandler.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:EscapeHandler.java

示例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;
}
 
开发者ID:whunmr,项目名称:emacsIDEAs,代码行数:43,代码来源:HighlightSymbolAction.java


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