use of com.intellij.struts2.dom.struts.model.StrutsManager in project intellij-plugins by JetBrains.
the class StrutsModelFactory method computeAllModels.
protected List<StrutsModel> computeAllModels(@NotNull final Module module) {
final PsiManager psiManager = PsiManager.getInstance(module.getProject());
final StrutsManager strutsManager = StrutsManager.getInstance(module.getProject());
final Set<StrutsFileSet> fileSets = strutsManager.getAllConfigFileSets(module);
final List<StrutsModel> models = new ArrayList<>(fileSets.size());
for (final StrutsFileSet set : fileSets) {
if (set.isRemoved()) {
continue;
}
final Set<XmlFile> files = new LinkedHashSet<>(set.getFiles().size());
for (final VirtualFilePointer filePointer : set.getFiles()) {
if (!filePointer.isValid())
continue;
final VirtualFile file = filePointer.getFile();
if (file == null) {
continue;
}
final PsiFile psiFile = psiManager.findFile(file);
if (psiFile instanceof XmlFile) {
final StrutsRoot strutsRootDom = getDom((XmlFile) psiFile);
if (strutsRootDom != null) {
files.add((XmlFile) psiFile);
// TODO addIncludes(files, strutsRootDom);
}
}
}
if (!files.isEmpty()) {
final DomFileElement<StrutsRoot> element = createMergedModelRoot(files);
final StrutsModel model;
if (element != null) {
model = new StrutsModelImpl(element, files);
models.add(model);
}
}
}
return models;
}
Aggregations