use of com.intellij.util.containers.ArrayListSet in project intellij-community by JetBrains.
the class AntDomTargetReference method getExistingNames.
private Set<String> getExistingNames() {
final AntDomElement hostingElement = getHostingAntDomElement();
if (hostingElement == null) {
return Collections.emptySet();
}
final AntDomTarget contextTarget = hostingElement.getParentOfType(AntDomTarget.class, false);
if (contextTarget == null) {
return Collections.emptySet();
}
final Set<String> existing = new ArrayListSet<>();
final String selfName = contextTarget.getName().getStringValue();
if (selfName != null) {
existing.add(selfName);
}
final String dependsString = contextTarget.getDependsList().getRawText();
if (dependsString != null) {
final StringTokenizer tokenizer = new StringTokenizer(dependsString, ",", false);
while (tokenizer.hasMoreTokens()) {
existing.add(tokenizer.nextToken().trim());
}
}
return existing;
}
use of com.intellij.util.containers.ArrayListSet in project intellij-community by JetBrains.
the class EditorsSplitters method getSelectedFiles.
@NotNull
public VirtualFile[] getSelectedFiles() {
final Set<VirtualFile> files = new ArrayListSet<>();
for (final EditorWindow window : myWindows) {
final VirtualFile file = window.getSelectedFile();
if (file != null) {
files.add(file);
}
}
final VirtualFile[] virtualFiles = VfsUtilCore.toVirtualFileArray(files);
final VirtualFile currentFile = getCurrentFile();
if (currentFile != null) {
for (int i = 0; i != virtualFiles.length; ++i) {
if (Comparing.equal(virtualFiles[i], currentFile)) {
virtualFiles[i] = virtualFiles[0];
virtualFiles[0] = currentFile;
break;
}
}
}
return virtualFiles;
}
Aggregations