use of com.intellij.openapi.vfs.pointers.VirtualFilePointer in project intellij-community by JetBrains.
the class FileAssociationsManagerImpl method copy.
private static HashMap<VirtualFilePointer, VirtualFilePointerContainer> copy(FileAssociationsManagerImpl other) {
final HashMap<VirtualFilePointer, VirtualFilePointerContainer> hashMap = new LinkedHashMap<>();
final Set<VirtualFilePointer> virtualFilePointers = other.myAssociations.keySet();
for (VirtualFilePointer pointer : virtualFilePointers) {
final VirtualFilePointerContainer container = other.myFilePointerManager.createContainer(other.myProject);
container.addAll(other.myAssociations.get(pointer));
hashMap.put(other.myFilePointerManager.duplicate(pointer, other.myProject, null), container);
}
return hashMap;
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointer in project intellij-community by JetBrains.
the class FileAssociationsManagerImpl method writeExternal.
public void writeExternal(Element element) throws WriteExternalException {
for (VirtualFilePointer pointer : myAssociations.keySet()) {
final Element e = new Element("file");
e.setAttribute("url", pointer.getUrl());
final VirtualFilePointerContainer container = myAssociations.get(pointer);
container.writeExternal(e, "association");
element.addContent(e);
}
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointer 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;
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointer in project intellij-plugins by JetBrains.
the class StrutsFacetConfiguration method writeExternal.
public void writeExternal(final Element element) throws WriteExternalException {
for (final StrutsFileSet fileSet : myFileSets) {
final Element setElement = new Element(FILESET);
setElement.setAttribute(SET_ID, fileSet.getId());
setElement.setAttribute(SET_NAME, fileSet.getName());
setElement.setAttribute(SET_REMOVED, Boolean.toString(fileSet.isRemoved()));
element.addContent(setElement);
for (final VirtualFilePointer fileName : fileSet.getFiles()) {
final Element fileElement = new Element(FILE);
fileElement.setText(fileName.getUrl());
setElement.addContent(fileElement);
}
}
final Element propertiesElement = new Element(PROPERTIES_KEYS);
propertiesElement.setAttribute(PROPERTIES_KEYS_DISABLED, Boolean.toString(myPropertiesKeysDisabled));
element.addContent(propertiesElement);
}
use of com.intellij.openapi.vfs.pointers.VirtualFilePointer in project intellij-plugins by JetBrains.
the class StrutsFileSet method addFile.
public void addFile(@NonNls final String url) {
if (!StringUtil.isEmptyOrSpaces(url)) {
final VirtualFilePointer filePointer = VirtualFilePointerManager.getInstance().create(url, this, null);
files.add(filePointer);
}
}
Aggregations