本文整理匯總了Java中com.intellij.psi.codeStyle.ReferenceAdjuster類的典型用法代碼示例。如果您正苦於以下問題:Java ReferenceAdjuster類的具體用法?Java ReferenceAdjuster怎麽用?Java ReferenceAdjuster使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ReferenceAdjuster類屬於com.intellij.psi.codeStyle包,在下文中一共展示了ReferenceAdjuster類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shortenClassReferences
import com.intellij.psi.codeStyle.ReferenceAdjuster; //導入依賴的package包/類
@NotNull
@Override
public PsiElement shortenClassReferences(@NotNull PsiElement element, int flags) throws IncorrectOperationException
{
CheckUtil.checkWritable(element);
if(!SourceTreeToPsiMap.hasTreeElement(element))
{
return element;
}
final boolean addImports = (flags & DO_NOT_ADD_IMPORTS) == 0;
final boolean incompleteCode = (flags & INCOMPLETE_CODE) != 0;
final ReferenceAdjuster adjuster = ReferenceAdjuster.Extension.getReferenceAdjuster(element.getLanguage());
if(adjuster != null)
{
final ASTNode reference = adjuster.process(element.getNode(), addImports, incompleteCode, myProject);
return SourceTreeToPsiMap.treeToPsiNotNull(reference);
}
else
{
return element;
}
}
示例2: qualifyClassReferences
import com.intellij.psi.codeStyle.ReferenceAdjuster; //導入依賴的package包/類
@NotNull
@Override
public PsiElement qualifyClassReferences(@NotNull PsiElement element)
{
final ReferenceAdjuster adjuster = ReferenceAdjuster.Extension.getReferenceAdjuster(element.getLanguage());
if(adjuster != null)
{
final ASTNode reference = adjuster.process(element.getNode(), false, false, true, true);
return SourceTreeToPsiMap.treeToPsiNotNull(reference);
}
return element;
}