本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.addAll方法的具体用法?Java ContainerUtil.addAll怎么用?Java ContainerUtil.addAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ContainerUtil
的用法示例。
在下文中一共展示了ContainerUtil.addAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findUsages
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
protected UsageInfo[] findUsages() {
ArrayList<UsageInfo> result = new ArrayList<UsageInfo>();
ContainerUtil.addAll(result, MakeStaticUtil.findClassRefsInMember(myMember, true));
if (mySettings.isReplaceUsages()) {
findExternalUsages(result);
}
if (myMember instanceof PsiMethod) {
final PsiMethod[] overridingMethods =
OverridingMethodsSearch.search((PsiMethod)myMember, myMember.getUseScope(), false).toArray(PsiMethod.EMPTY_ARRAY);
for (PsiMethod overridingMethod : overridingMethods) {
if (overridingMethod != myMember) {
result.add(new OverridingMethodUsageInfo(overridingMethod));
}
}
}
return result.toArray(new UsageInfo[result.size()]);
}
示例2: getPsiClasses
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static PsiClass[] getPsiClasses(@NotNull PsiDirectory dir, PsiFile[] psiFiles) {
FileIndexFacade index = FileIndexFacade.getInstance(dir.getProject());
VirtualFile virtualDir = dir.getVirtualFile();
boolean onlyCompiled = index.isInLibraryClasses(virtualDir) && !index.isInSourceContent(virtualDir);
List<PsiClass> classes = null;
for (PsiFile file : psiFiles) {
if (onlyCompiled && !(file instanceof ClsFileImpl)) {
continue;
}
if (file instanceof PsiClassOwner && file.getViewProvider().getLanguages().size() == 1) {
PsiClass[] psiClasses = ((PsiClassOwner)file).getClasses();
if (psiClasses.length == 0) continue;
if (classes == null) classes = new ArrayList<PsiClass>();
ContainerUtil.addAll(classes, psiClasses);
}
}
return classes == null ? PsiClass.EMPTY_ARRAY : classes.toArray(new PsiClass[classes.size()]);
}
示例3: getContentRootsFromAllModules
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public VirtualFile[] getContentRootsFromAllModules() {
List<VirtualFile> result = new ArrayList<VirtualFile>();
final Module[] modules = getModuleManager().getSortedModules();
for (Module module : modules) {
final VirtualFile[] files = ModuleRootManager.getInstance(module).getContentRoots();
ContainerUtil.addAll(result, files);
}
ContainerUtil.addIfNotNull(myProject.getBaseDir(), result);
return VfsUtilCore.toVirtualFileArray(result);
}
示例4: add
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void add(@NotNull T[] items) {
if (items.length == 0) return;
if (mySingleItem == null) {
mySingleItem = items;
return;
}
if (myAllItems == null) {
T[] elements = mySingleItem;
myAllItems = ContainerUtil.addAll(new THashSet<T>(elements.length), elements);
}
ContainerUtil.addAll(myAllItems, items);
}
示例5: compute
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected PsiType[] compute() {
List<PsiType> result = ContainerUtil.newArrayList();
ContainerUtil.addAll(result, myExprType.getParameters());
for (PsiClassType type : myTraitTypes) {
ContainerUtil.addAll(result, type.getParameters());
}
return result.toArray(new PsiType[result.size()]);
}
示例6: collectQuickFixes
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void collectQuickFixes(final QuickFix[] fixes, @NotNull RefEntity refEntity) {
if (fixes != null && fixes.length != 0) {
Set<QuickFix> localQuickFixes = getQuickFixActions().get(refEntity);
if (localQuickFixes == null) {
localQuickFixes = new HashSet<QuickFix>();
getQuickFixActions().put(refEntity, localQuickFixes);
}
ContainerUtil.addAll(localQuickFixes, fixes);
}
}
示例7: setFilters
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public final void setFilters(com.intellij.ui.classFilter.ClassFilter[] filters) {
myFilters.clear();
if (filters != null) {
ContainerUtil.addAll(myFilters, filters);
}
fireTableDataChanged();
}
示例8: installNorthComponents
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void installNorthComponents(final Project project) {
ContainerUtil.addAll(myNorthComponents, Extensions.getExtensions(IdeRootPaneNorthExtension.EP_NAME, project));
for (IdeRootPaneNorthExtension northComponent : myNorthComponents) {
myNorthPanel.add(northComponent.getComponent());
northComponent.uiSettingsChanged(myUISettings);
}
}
示例9: collectMethodsFromBody
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static void collectMethodsFromBody(@NotNull GrTypeDefinition definition, Collection<PsiMethod> result) {
for (GrMethod method : definition.getCodeMethods()) {
addExpandingReflectedMethods(result, method);
}
for (GrField field : definition.getFields()) {
if (!field.isProperty()) continue;
ContainerUtil.addAll(result, field.getGetters());
ContainerUtil.addIfNotNull(result, field.getSetter());
}
}
示例10: getLibraries
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
@NotNull
public Library[] getLibraries() {
final ArrayList<Library> result = new ArrayList<Library>();
final Iterator<Library> libraryIterator = getLibraryIterator();
ContainerUtil.addAll(result, libraryIterator);
return result.toArray(new Library[result.size()]);
}
示例11: generateMemberPrototypes
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
protected List<? extends GenerationInfo> generateMemberPrototypes(PsiClass aClass, ClassMember[] members) throws IncorrectOperationException {
ArrayList<GenerationInfo> array = new ArrayList<GenerationInfo>();
for (ClassMember member : members) {
GenerationInfo[] prototypes = generateMemberPrototypes(aClass, member);
if (prototypes != null) {
ContainerUtil.addAll(array, prototypes);
}
}
return array;
}
示例12: resetExcludePropertiesTable
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private void resetExcludePropertiesTable() {
myExcludedProperties = new ArrayList<>();
List<String> excludePropertyList = getCamelPreferenceService().getExcludePropertyFiles();
ContainerUtil.addAll(myExcludedProperties, excludePropertyList);
excludePropertyFilePanel.setData(myExcludedProperties);
}
示例13: calcFinders
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
protected PsiElementFinder[] calcFinders() {
List<PsiElementFinder> elementFinders = new ArrayList<PsiElementFinder>();
ContainerUtil.addAll(elementFinders, myProject.getExtensions(PsiElementFinder.EP_NAME));
return elementFinders.toArray(new PsiElementFinder[elementFinders.size()]);
}
示例14: ExtractClassProcessor
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public ExtractClassProcessor(PsiClass sourceClass,
List<PsiField> fields,
List<PsiMethod> methods,
List<PsiClass> classes,
String packageName,
MoveDestination moveDestination,
String newClassName,
String newVisibility,
boolean generateAccessors, List<MemberInfo> enumConstants) {
super(sourceClass.getProject());
this.sourceClass = sourceClass;
this.newPackageName = packageName;
myMoveDestination = moveDestination;
myNewVisibility = newVisibility;
myGenerateAccessors = generateAccessors;
this.enumConstants = new ArrayList<PsiField>();
for (MemberInfo constant : enumConstants) {
if (constant.isChecked()) {
this.enumConstants.add((PsiField)constant.getMember());
}
}
this.fields = new ArrayList<PsiField>(fields);
this.methods = new ArrayList<PsiMethod>(methods);
this.innerClasses = new ArrayList<PsiClass>(classes);
this.newClassName = newClassName;
delegateFieldName = calculateDelegateFieldName();
requiresBackpointer = new BackpointerUsageVisitor(fields, innerClasses, methods, sourceClass).backpointerRequired();
if (requiresBackpointer) {
ContainerUtil.addAll(typeParams, sourceClass.getTypeParameters());
}
else {
final Set<PsiTypeParameter> typeParamSet = new HashSet<PsiTypeParameter>();
final TypeParametersVisitor visitor = new TypeParametersVisitor(typeParamSet);
for (PsiField field : fields) {
field.accept(visitor);
}
for (PsiMethod method : methods) {
method.accept(visitor);
//do not include method's type parameters in class signature
typeParamSet.removeAll(Arrays.asList(method.getTypeParameters()));
}
typeParams.addAll(typeParamSet);
}
myClass = new WriteCommandAction<PsiClass>(myProject, getCommandName()){
@Override
protected void run(@NotNull Result<PsiClass> result) throws Throwable {
result.setResult(buildClass());
}
}.execute().getResultObject();
myExtractEnumProcessor = new ExtractEnumProcessor(myProject, this.enumConstants, myClass);
}
示例15: TypeParameterSearcher
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private TypeParameterSearcher(final PsiTypeParameter[] set) {
ContainerUtil.addAll(myTypeParams, set);
}