本文整理汇总了Java中org.waveprotocol.wave.client.editor.content.FocusedContentRange.asOrderedRange方法的典型用法代码示例。如果您正苦于以下问题:Java FocusedContentRange.asOrderedRange方法的具体用法?Java FocusedContentRange.asOrderedRange怎么用?Java FocusedContentRange.asOrderedRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.waveprotocol.wave.client.editor.content.FocusedContentRange
的用法示例。
在下文中一共展示了FocusedContentRange.asOrderedRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRouteToCollapsedKeyComboHelperInner
import org.waveprotocol.wave.client.editor.content.FocusedContentRange; //导入方法依赖的package包/类
private void testRouteToCollapsedKeyComboHelperInner(EditorEvent tabSignal,
boolean isHandledCommand, boolean isHandledBlockLevelCommand) {
final Point<ContentNode> caret =
Point.<ContentNode> end(newParaElement());
FocusedContentRange selection = new FocusedContentRange(caret);
ContentRange range = selection.asOrderedRange(true);
FakeEditorInteractor interactor = setupFakeEditorInteractor(selection);
FakeEditorEventsSubHandler subHandler = new FakeEditorEventsSubHandler();
EditorEventHandler handler = createEditorEventHandler(interactor, subHandler);
subHandler.call(FakeEditorEventsSubHandler.HANDLE_COMMAND).nOf(1).withArgs(tabSignal).returns(
isHandledCommand);
if (!isHandledCommand) {
subHandler.call(FakeEditorEventsSubHandler.HANDLE_BLOCK_LEVEL_COMMANDS).nOf(1).withArgs(
tabSignal, range).returns(isHandledBlockLevelCommand);
if (!isHandledBlockLevelCommand) {
// Stop it here by returning true, test lower down commands in other
// methods.
subHandler.call(FakeEditorEventsSubHandler.HANDLE_COLLAPSED_KEY_COMBO).nOf(1).withArgs(
tabSignal, selection.getFocus()).returns(true);
}
}
boolean cancel = handler.handleEvent(tabSignal);
interactor.checkExpectations();
subHandler.checkExpectations();
assertTrue("Handled commands should be cancelled", cancel);
}
示例2: getOrderedSelectionPoints
import org.waveprotocol.wave.client.editor.content.FocusedContentRange; //导入方法依赖的package包/类
@Override
public ContentRange getOrderedSelectionPoints() {
FocusedContentRange selection = getSelectionPoints();
return selection == null ? null : selection.asOrderedRange(NativeSelectionUtil.isOrdered());
}