本文整理汇总了Java中com.intellij.psi.ElementManipulators.getOffsetInElement方法的典型用法代码示例。如果您正苦于以下问题:Java ElementManipulators.getOffsetInElement方法的具体用法?Java ElementManipulators.getOffsetInElement怎么用?Java ElementManipulators.getOffsetInElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.ElementManipulators
的用法示例。
在下文中一共展示了ElementManipulators.getOffsetInElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createReferences
import com.intellij.psi.ElementManipulators; //导入方法依赖的package包/类
@NotNull
public PsiReference[] createReferences(final GenericDomValue genericDomValue, final PsiElement element, final ConvertContext context) {
final String s = genericDomValue.getStringValue();
if (s != null) {
final int offset = ElementManipulators.getOffsetInElement(element);
final ArrayList<PsiReference> list = new ArrayList<PsiReference>();
int pos = -1;
while (true) {
while (pos + 1 < s.length()) {
if (!Character.isWhitespace(s.charAt(pos + 1))) {
break;
}
pos++;
}
int nextPos = s.indexOf(',', pos + 1);
if (nextPos == -1) {
createReference(element, s.substring(pos + 1), pos + 1 + offset, list);
break;
}
else {
createReference(element, s.substring(pos + 1, nextPos), pos + 1 + offset, list);
pos = nextPos;
}
}
return list.toArray(new PsiReference[list.size()]);
}
return PsiReference.EMPTY_ARRAY;
}
示例2: AntDomFileReferenceSet
import com.intellij.psi.ElementManipulators; //导入方法依赖的package包/类
public AntDomFileReferenceSet(final GenericAttributeValue attribValue, final String pathSubstring, int beginOffset, boolean validateFileRefs) {
super(cutTrailingSlash(FileUtil.toSystemIndependentName(pathSubstring)),
attribValue.getXmlAttributeValue(),
ElementManipulators.getOffsetInElement(attribValue.getXmlAttributeValue()) + beginOffset,
null,
SystemInfo.isFileSystemCaseSensitive
);
myValue = attribValue;
for (FileReference reference : getAllReferences()) {
if (reference instanceof AntDomReference) {
((AntDomReference)reference).setShouldBeSkippedByAnnotator(!validateFileRefs);
}
}
}
示例3: AntDomFileReferenceSet
import com.intellij.psi.ElementManipulators; //导入方法依赖的package包/类
public AntDomFileReferenceSet(final GenericAttributeValue attribValue, final String pathSubstring, int beginOffset, boolean validateFileRefs)
{
super(cutTrailingSlash(FileUtil.toSystemIndependentName(pathSubstring)), attribValue.getXmlAttributeValue(), ElementManipulators.getOffsetInElement(attribValue.getXmlAttributeValue()) +
beginOffset, null, SystemInfo.isFileSystemCaseSensitive);
myValue = attribValue;
for(FileReference reference : getAllReferences())
{
if(reference instanceof AntDomReference)
{
((AntDomReference) reference).setShouldBeSkippedByAnnotator(!validateFileRefs);
}
}
}
示例4: ReferenceSetBase
import com.intellij.psi.ElementManipulators; //导入方法依赖的package包/类
public ReferenceSetBase(@NotNull PsiElement element) {
this(element, ElementManipulators.getOffsetInElement(element));
}
示例5: ReferenceSetBase
import com.intellij.psi.ElementManipulators; //导入方法依赖的package包/类
public ReferenceSetBase(@Nonnull PsiElement element) {
this(element, ElementManipulators.getOffsetInElement(element));
}