本文整理匯總了Java中com.intellij.psi.PsiReference.isReferenceTo方法的典型用法代碼示例。如果您正苦於以下問題:Java PsiReference.isReferenceTo方法的具體用法?Java PsiReference.isReferenceTo怎麽用?Java PsiReference.isReferenceTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.psi.PsiReference
的用法示例。
在下文中一共展示了PsiReference.isReferenceTo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import com.intellij.psi.PsiReference; //導入方法依賴的package包/類
@Override
public boolean execute(@NotNull PsiElement element, int offsetInElement) {
String selector;
if (element instanceof AppleScriptHandlerCall) {
AppleScriptHandlerCall handlerCall = (AppleScriptHandlerCall) element;
selector = handlerCall.getHandlerSelector();
if (myHandlerSelector.equals(selector)) {
for (PsiReference ref : element.getReferences()) {
if (ref.isReferenceTo(myHandler)) {
return myConsumer.process(ref);
}
}
}
}
return true;
}
示例2: execute
import com.intellij.psi.PsiReference; //導入方法依賴的package包/類
@Override
public boolean execute(@NotNull PsiElement element, int offsetInElement) {
String selector = null;
if (element instanceof AppleScriptCommandHandlerCall) {
AppleScriptCommandHandlerCall handlerCall = (AppleScriptCommandHandlerCall) element;
selector = handlerCall.getCommandName();
}//todo: handle other component types
else if (element instanceof DictionaryCompositeElement) {
DictionaryCompositeElement dictionaryCompositeElement = (DictionaryCompositeElement) element;
selector = dictionaryCompositeElement.getCompositeNameElement().getCompositeName();
}
if (selector != null) {
boolean selectorMatches;
selectorMatches = myComponentName.equals(selector);
if (selectorMatches) {
for (PsiReference ref : element.getReferences()) {
if (ref.isReferenceTo(myDictionaryComponent)) {
return myConsumer.process(ref);
}
}
}
}
return true;
}
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:25,代碼來源:AppleScriptDictionaryComponentReferencesSearch.java