本文整理汇总了Java中org.eclipse.jface.text.ITextViewerExtension5.exposeModelRange方法的典型用法代码示例。如果您正苦于以下问题:Java ITextViewerExtension5.exposeModelRange方法的具体用法?Java ITextViewerExtension5.exposeModelRange怎么用?Java ITextViewerExtension5.exposeModelRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.ITextViewerExtension5
的用法示例。
在下文中一共展示了ITextViewerExtension5.exposeModelRange方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import org.eclipse.jface.text.ITextViewerExtension5; //导入方法依赖的package包/类
private void select() {
ITextViewer viewer = fCurrentTarget.getViewer();
if (viewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension5 = (ITextViewerExtension5) viewer;
extension5.exposeModelRange(new Region(fFramePosition.offset, fFramePosition.length));
} else if (!viewer.overlapsWithVisibleRegion(fFramePosition.offset, fFramePosition.length)) {
viewer.resetVisibleRegion();
}
viewer.revealRange(fFramePosition.offset, fFramePosition.length);
viewer.setSelectedRange(fFramePosition.offset, fFramePosition.length);
}
示例2: adjustHighlightRange
import org.eclipse.jface.text.ITextViewerExtension5; //导入方法依赖的package包/类
/**
* Adjusts the highlight range so that at least the specified range
* is highlighted.
* <p>
* Subclasses may re-implement this method.</p>
* @param viewer
*
* @param offset the offset of the range which at least should be highlighted
* @param length the length of the range which at least should be highlighted
*/
protected void adjustHighlightRange(ITextViewer viewer, int offset, int length) {
if (viewer == null)
return;
if (viewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= (ITextViewerExtension5) viewer;
extension.exposeModelRange(new Region(offset, length));
} else if (!isVisible(viewer, offset, length)) {
viewer.resetVisibleRegion();
}
}
示例3: adjustHighlightRange
import org.eclipse.jface.text.ITextViewerExtension5; //导入方法依赖的package包/类
@Override
protected void adjustHighlightRange(int offset, int length) {
ISourceViewer viewer = getSourceViewer();
if (viewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension = (ITextViewerExtension5) viewer;
extension.exposeModelRange(new Region(offset, length));
}
}