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


Java EditorTestUtil.extractCaretAndSelectionMarkers方法代码示例

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


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

示例1: getPlaceholders

import com.intellij.testFramework.EditorTestUtil; //导入方法依赖的package包/类
public Pair<Document, List<AnswerPlaceholder>> getPlaceholders(String name, boolean useLength, boolean removeMarkers) {
  try {
    String text = StringUtil.convertLineSeparators(FileUtil.loadFile(new File(getBasePath(), name)));
    Document tempDocument = EditorFactory.getInstance().createDocument(text);
    if (removeMarkers) {
      EditorTestUtil.extractCaretAndSelectionMarkers(tempDocument);
    }
    List<AnswerPlaceholder> placeholders = getPlaceholders(tempDocument, useLength);
    return Pair.create(tempDocument, placeholders);
  }
  catch (IOException e) {
    LOG.error(e);
  }
  return Pair.create(null, null);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:16,代码来源:CCTestCase.java

示例2: createHeavyEditor

import com.intellij.testFramework.EditorTestUtil; //导入方法依赖的package包/类
@NotNull
private static Editor createHeavyEditor(@NotNull String name, @NotNull String text) throws IOException {
  VirtualFile myVFile = getSourceRoot().createChildData(null, name);
  VfsUtil.saveText(myVFile, text);
  final FileDocumentManager manager = FileDocumentManager.getInstance();
  final Document document = manager.getDocument(myVFile);
  manager.reloadFromDisk(document);
  Editor editor = createEditor(myVFile);
  EditorTestUtil.CaretAndSelectionState caretsState = EditorTestUtil.extractCaretAndSelectionMarkers(document);
  EditorTestUtil.setCaretsAndSelection(editor, caretsState);
  return editor;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TrailingSpacesStripperTest.java

示例3: EditorInfo

import com.intellij.testFramework.EditorTestUtil; //导入方法依赖的package包/类
public EditorInfo(final String fileText) {
  Document document = EditorFactory.getInstance().createDocument(fileText);
  caretState = EditorTestUtil.extractCaretAndSelectionMarkers(document, false);
  newFileText = document.getText();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:EditorInfo.java

示例4: verifyEditorState

import com.intellij.testFramework.EditorTestUtil; //导入方法依赖的package包/类
private static void verifyEditorState(Editor editor, String textWithMarkup) {
  final Document document = new DocumentImpl(textWithMarkup);
  EditorTestUtil.CaretAndSelectionState caretAndSelectionState = EditorTestUtil.extractCaretAndSelectionMarkers(document);
  assertEquals(document.getCharsSequence().toString(), editor.getDocument().getText());
  EditorTestUtil.verifyCaretAndSelectionState(editor, caretAndSelectionState);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:EditorMultiCaretStateRestoreTest.java


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