本文整理汇总了Java中com.intellij.util.containers.ArrayListSet类的典型用法代码示例。如果您正苦于以下问题:Java ArrayListSet类的具体用法?Java ArrayListSet怎么用?Java ArrayListSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayListSet类属于com.intellij.util.containers包,在下文中一共展示了ArrayListSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectedFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull public VirtualFile[] getSelectedFiles() {
final Set<VirtualFile> files = new ArrayListSet<VirtualFile>();
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;
}
示例2: getExistingNames
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
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<String>();
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;
}
示例3: getSelectedFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull public VirtualFile[] getSelectedFiles() {
final ArrayListSet<VirtualFile> files = new ArrayListSet<VirtualFile>();
for (final EditorWindow window : myWindows) {
final VirtualFile file = window.getSelectedFile();
if (file != null) {
files.add(file);
}
}
final VirtualFile[] virtualFiles = VfsUtil.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;
}
示例4: getOpenFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@Override
@Nonnull
public VirtualFile[] getOpenFiles() {
final Set<VirtualFile> files = new ArrayListSet<>();
for (final DesktopEditorWindow myWindow : myWindows) {
final EditorWithProviderComposite[] editors = myWindow.getEditors();
for (final EditorWithProviderComposite editor : editors) {
VirtualFile file = editor.getFile();
// background thread may call this method when invalid file is being removed
// do not return it here as it will quietly drop out soon
if (file.isValid()) {
files.add(file);
}
}
}
return VfsUtilCore.toVirtualFileArray(files);
}
示例5: getSelectedFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@Override
@Nonnull
public VirtualFile[] getSelectedFiles() {
final Set<VirtualFile> files = new ArrayListSet<>();
for (final DesktopEditorWindow 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;
}
示例6: getPluginsForInstall
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@Nonnull
public static Set<IdeaPluginDescriptor> getPluginsForInstall(List<IdeaPluginDescriptor> pluginsToInstall, List<IdeaPluginDescriptor> allPlugins) {
final List<PluginId> pluginIds = new ArrayList<>();
for (IdeaPluginDescriptor pluginNode : pluginsToInstall) {
pluginIds.add(pluginNode.getPluginId());
}
final Set<IdeaPluginDescriptor> toInstallAll = new ArrayListSet<>();
for (IdeaPluginDescriptor toInstall : pluginsToInstall) {
Set<PluginNode> depends = new ArrayListSet<>();
collectDepends(toInstall, pluginIds, depends, allPlugins);
toInstallAll.addAll(depends);
toInstallAll.add(toInstall);
}
if(toInstallAll.isEmpty()) {
throw new IllegalArgumentException("No plugins for install");
}
return toInstallAll;
}
示例7: projectOpened
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@Override
public void projectOpened() {
work = new ArrayListSet<InferenceCapable>();
inferenceQueueProcessor =
new QueueProcessor<InferenceCapable>(new InferenceQueue(myProject), myProject.getDisposed(), false);
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new Runnable() {
@Override
public void run() {
DumbService.getInstance(myProject).runWhenSmart(new InitRunnable());
}
});
}
示例8: getOpenFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull public VirtualFile[] getOpenFiles() {
final Set<VirtualFile> files = new ArrayListSet<VirtualFile>();
for (final EditorWindow myWindow : myWindows) {
final EditorWithProviderComposite[] editors = myWindow.getEditors();
for (final EditorWithProviderComposite editor : editors) {
VirtualFile file = editor.getFile();
// background thread may call this method when invalid file is being removed
// do not return it here as it will quietly drop out soon
if (file.isValid()) {
files.add(file);
}
}
}
return VfsUtilCore.toVirtualFileArray(files);
}
示例9: getOpenFiles
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull public VirtualFile[] getOpenFiles() {
final ArrayListSet<VirtualFile> files = new ArrayListSet<VirtualFile>();
for (final EditorWindow myWindow : myWindows) {
final EditorWithProviderComposite[] editors = myWindow.getEditors();
for (final EditorWithProviderComposite editor : editors) {
VirtualFile file = editor.getFile();
// background thread may call this method when invalid file is being removed
// do not return it here as it will quietly drop out soon
if (file.isValid()) {
files.add(file);
}
}
}
return VfsUtil.toVirtualFileArray(files);
}
示例10: getDomainKeys
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull
private Set<String> getDomainKeys(@NotNull String domain) {
Set<String> uniqueKeySet = new ArrayListSet<String>();
for(Set<String> splits: FileBasedIndex.getInstance().getValues(TranslationStubIndex.KEY, domain, GlobalSearchScope.allScope(getProject()))) {
ContainerUtil.addAll(uniqueKeySet, splits);
}
return uniqueKeySet;
}
示例11: VariableAssignedVisitor
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
public VariableAssignedVisitor(@NotNull JSVariable variable,
@NotNull JSElement context,
@NotNull Set<JSVariable> notUpdatedSymbols) {
this.variable = variable;
this.context = context;
this.notUpdatedSymbols = notUpdatedSymbols;
this.candidateSymbols = new ArrayListSet<JSVariable>();
this.candidateSymbols.add(variable);
}
示例12: getDataType
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@NotNull
@Override
public DataType getDataType() {
Set<DataType.Feature> features = new ArrayListSet<>();
return new DataType("type", "type", 1,1, LengthUnit.BYTE, true, "a", "a", false, null, features, 0);
}
示例13: getPropInfoWithSupers
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
static Set<PropertyDetector.PropInfo> getPropInfoWithSupers(UClass uClass){
Set<PropertyDetector.PropInfo> mSet = new ArrayListSet<>();
getPropInfoWithSupers(uClass.getPsi(), mSet);
return mSet;
}
示例14: PackageIndex
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
PackageIndex(Project project) {
this.project = project;
// build toQualified by traversing directories
//final GlobalSearchScope scope = new ProjectAndLibrariesScope(project);
final ProjectRootManager prm = ProjectRootManager.getInstance(project);
final ProjectFileIndexImpl idx = (ProjectFileIndexImpl)prm.getFileIndex();
ContentIterator iter = new ContentIterator() {
@Override
public boolean processFile(VirtualFile fileOrDir) {
if (fileOrDir.isDirectory()) {
if (idx.isIgnored(fileOrDir))
return true;
// ignore resource files (some resource directories are just sitting in regular packages. Not
// much we can do. Those will just never have classes in them.
if (idx.isUnderSourceRootOfType(fileOrDir, JavaModuleSourceRootTypes.RESOURCES))
return true;
// source file
VirtualFile root = idx.getSourceRootForFile(fileOrDir);
// class file
if (root == null)
root = idx.getClassRootForFile(fileOrDir);
// if not source, not class, or root, ignore
if (root == null || root.getUrl().equals(fileOrDir.getUrl()))
return true;
String qpkg = fileOrDir.getPath().substring(root.getPath().length()).replace('/','.');
// hacky, but we know no better way
if (qpkg.isEmpty() || qpkg.equals(".") || qpkg.startsWith("META-INF"))
return true;
// non-jar classes end up with a '.' in front
if (qpkg.charAt(0) == '.')
qpkg = qpkg.substring(1);
String pkg = qpkg.substring(qpkg.lastIndexOf('.')+1);
Set<String> quals = toQualified.get(pkg);
if (quals == null) {
quals = new ArrayListSet<String>();
toQualified.put(pkg,quals);
}
quals.add(qpkg);
}
return true;
}
};
FileBasedIndex.getInstance().iterateIndexableFiles(iter, project, null);
}
示例15: getStatements
import com.intellij.util.containers.ArrayListSet; //导入依赖的package包/类
@RequiredReadAction
private DotNetStatement[] getStatements(PsiFile file, int startOffset, int endOffset)
{
Set<DotNetStatement> set = new ArrayListSet<DotNetStatement>();
PsiElement element1 = file.findElementAt(startOffset);
PsiElement element2 = file.findElementAt(endOffset - 1);
if(element1 instanceof PsiWhiteSpace)
{
startOffset = element1.getTextRange().getEndOffset();
element1 = file.findElementAt(startOffset);
}
if(element2 instanceof PsiWhiteSpace)
{
endOffset = element2.getTextRange().getStartOffset();
element2 = file.findElementAt(endOffset - 1);
}
PsiElement statement1 = getTopmostParentOfType(element1, DotNetStatement.class);
if(statement1 == null)
{
return EMPTY_ARRAY;
}
PsiElement statement2 = getTopmostParentOfType(element2, DotNetStatement.class);
if(statement2 == null)
{
return EMPTY_ARRAY;
}
PsiElement temp = statement1;
while(temp != null)
{
if(temp instanceof DotNetStatement)
{
set.add((DotNetStatement) temp);
}
if(temp == statement2)
{
return ContainerUtil.toArray(set, EMPTY_ARRAY);
}
temp = temp.getNextSibling();
}
return EMPTY_ARRAY;
}