作者:UN周_179 | 来源:互联网 | 2023-10-12 16:19
本文整理了Java中org.eclipse.text.edits.TextEdit.isDefined()
方法的一些代码示例,展示了TextEdit.isDefined()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextEdit.isDefined()
方法的具体详情如下:
包路径:org.eclipse.text.edits.TextEdit
类名称:TextEdit
方法名:isDefined
TextEdit.isDefined介绍
[英]Returns whether the region of this edit is defined or not.
[中]返回是否定义了此编辑的区域。
代码示例
代码示例来源:origin: org.eclipse.platform/org.eclipse.text
/**
* Returns true
if the edit covers the given edit
* other
. It is up to the concrete text edit to
* decide if a edit of length zero can cover another edit.
*
* @param other the other edit
* @return true if the edit covers the other edit;
* otherwise false
is returned.
*/
public boolean covers(TextEdit other) {
if (getLength() == 0 && !canZeroLengthCover())
return false;
if (!other.isDefined())
return true;
int thisOffset= getOffset();
int otherOffset= other.getOffset();
return thisOffset <= otherOffset && otherOffset + other.getLength() <= thisOffset + getLength();
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.text
/**
* Returns true
if the edit covers the given edit
* other
. It is up to the concrete text edit to
* decide if a edit of length zero can cover another edit.
*
* @param other the other edit
* @return true if the edit covers the other edit;
* otherwise false
is returned.
*/
public boolean covers(TextEdit other) {
if (getLength() == 0 && !canZeroLengthCover())
return false;
if (!other.isDefined())
return true;
int thisOffset= getOffset();
int otherOffset= other.getOffset();
return thisOffset <= otherOffset && otherOffset + other.getLength() <= thisOffset + getLength();
}