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