本文整理匯總了Java中org.jetbrains.plugins.groovy.lang.psi.GroovyFile.getManager方法的典型用法代碼示例。如果您正苦於以下問題:Java GroovyFile.getManager方法的具體用法?Java GroovyFile.getManager怎麽用?Java GroovyFile.getManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jetbrains.plugins.groovy.lang.psi.GroovyFile
的用法示例。
在下文中一共展示了GroovyFile.getManager方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: importAlreadyExists
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; //導入方法依賴的package包/類
private static boolean importAlreadyExists(final PsiMember member, final GroovyFile file, final PsiElement place) {
final PsiManager manager = file.getManager();
PsiScopeProcessor processor = new PsiScopeProcessor() {
@Override
public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) {
return !manager.areElementsEquivalent(element, member);
}
@Override
public <T> T getHint(@NotNull Key<T> hintKey) {
return null;
}
@Override
public void handleEvent(@NotNull Event event, Object associated) {
}
};
boolean skipStaticImports = member instanceof PsiClass;
final GrImportStatement[] imports = file.getImportStatements();
final ResolveState initial = ResolveState.initial();
for (GrImportStatement anImport : imports) {
if (skipStaticImports == anImport.isStatic()) continue;
if (!anImport.processDeclarations(processor, initial, null, place)) return true;
}
return false;
}
示例2: GroovyScriptClass
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile; //導入方法依賴的package包/類
public GroovyScriptClass(GroovyFile file) {
super(file.getManager(), file.getLanguage());
myFile = file;
myModifierList = new LightModifierList(myManager, GroovyLanguage.INSTANCE, PsiModifier.PUBLIC);
}