当前位置: 首页>>代码示例>>Java>>正文


Java ContainerUtil.emptyList方法代码示例

本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.emptyList方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.emptyList方法的具体用法?Java ContainerUtil.emptyList怎么用?Java ContainerUtil.emptyList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.ContainerUtil的用法示例。


在下文中一共展示了ContainerUtil.emptyList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildDescriptors

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public List<FoldingDescriptor> buildDescriptors() {
  myCallArguments = getArguments(myCallExpression);

  if (myCallArguments != null && myCallArguments.length >= MIN_ARGS_TO_FOLD && hasLiteralExpression(myCallArguments)) {
    PsiMethod method = myCallExpression.resolveMethod();

    if (method != null) {
      myParameters = method.getParameterList().getParameters();
      if (myParameters.length == myCallArguments.length) {
        return buildDescriptorsForLiteralArguments();
      }
    }
  }

  return ContainerUtil.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ParameterNameFoldingManager.java

示例2: getCertificates

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * Select all available certificates from underlying trust store. Returned list is not supposed to be modified.
 *
 * @return certificates
 */
public List<X509Certificate> getCertificates() {
  myReadLock.lock();
  try {
    List<X509Certificate> certificates = new ArrayList<X509Certificate>();
    for (String alias : Collections.list(myKeyStore.aliases())) {
      certificates.add(getCertificate(alias));
    }
    return ContainerUtil.immutableList(certificates);
  }
  catch (Exception e) {
    LOG.error(e);
    return ContainerUtil.emptyList();
  }
  finally {
    myReadLock.unlock();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ConfirmingTrustManager.java

示例3: HighlightInfoComposite

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public HighlightInfoComposite(@NotNull List<HighlightInfo> infos) {
  super(null, null, infos.get(0).type, infos.get(0).startOffset, infos.get(0).endOffset, createCompositeDescription(infos),
        createCompositeTooltip(infos), infos.get(0).type.getSeverity(null), false, null, false, 0, infos.get(0).getProblemGroup(), infos.get(0).getGutterIconRenderer());
  highlighter = infos.get(0).highlighter;
  setGroup(infos.get(0).getGroup());
  List EMPTY = ContainerUtil.emptyList();
  List<Pair<IntentionActionDescriptor, RangeMarker>> markers = EMPTY;
  List<Pair<IntentionActionDescriptor, TextRange>> ranges = EMPTY;
  for (HighlightInfo info : infos) {
    if (info.quickFixActionMarkers != null) {
      if (markers == EMPTY) markers = new ArrayList<Pair<IntentionActionDescriptor,RangeMarker>>();
      markers.addAll(info.quickFixActionMarkers);
    }
    if (info.quickFixActionRanges != null) {
      if (ranges == EMPTY) ranges = new ArrayList<Pair<IntentionActionDescriptor, TextRange>>();
      ranges.addAll(info.quickFixActionRanges);
    }
  }
  quickFixActionMarkers = ContainerUtil.createLockFreeCopyOnWriteList(markers);
  quickFixActionRanges = ContainerUtil.createLockFreeCopyOnWriteList(ranges);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:HighlightInfoComposite.java

示例4: processRSS

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private List<Task> processRSS(@NotNull GetMethod method) throws Exception {
  // Basic authorization should be enough
  int code = myRepository.getHttpClient().executeMethod(method);
  if (code != HttpStatus.SC_OK) {
    throw new Exception(TaskBundle.message("failure.http.error", code, method.getStatusText()));
  }
  Element root = new SAXBuilder(false).build(method.getResponseBodyAsStream()).getRootElement();
  Element channel = root.getChild("channel");
  if (channel != null) {
    List<Element> children = channel.getChildren("item");
    LOG.debug("Total issues in JIRA RSS feed: " + children.size());
    return ContainerUtil.map(children, new Function<Element, Task>() {
      public Task fun(Element element) {
        return new JiraSoapTask(element, myRepository);
      }
    });
  }
  else {
    LOG.warn("JIRA channel not found");
  }
  return ContainerUtil.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:JiraLegacyApi.java

示例5: getWordsIn

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * @return list containing all words in {@code text}, or {@link ContainerUtil#emptyList()} if there are none.
 * The <b>word</b> here means the maximum sub-string consisting entirely of characters which are <code>Character.isJavaIdentifierPart(c)</code>.
 */
@NotNull
@Contract(pure = true)
public static List<String> getWordsIn(@NotNull String text) {
  List<String> result = null;
  int start = -1;
  for (int i = 0; i < text.length(); i++) {
    char c = text.charAt(i);
    boolean isIdentifierPart = Character.isJavaIdentifierPart(c);
    if (isIdentifierPart && start == -1) {
      start = i;
    }
    if (isIdentifierPart && i == text.length() - 1 && start != -1) {
      if (result == null) {
        result = new SmartList<String>();
      }
      result.add(text.substring(start, i + 1));
    }
    else if (!isIdentifierPart && start != -1) {
      if (result == null) {
        result = new SmartList<String>();
      }
      result.add(text.substring(start, i));
      start = -1;
    }
  }
  if (result == null) {
    return ContainerUtil.emptyList();
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:StringUtil.java

示例6: getChildren

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public List<File> getChildren(File file) {
  Collection<File> collection = myParentToChildrenMap.get(file);
  if (collection == null) {
    return ContainerUtil.emptyList();
  }
  return new ArrayList<File>(collection);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GroupByPackages.java

示例7: getChildren

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static List<VirtualFile> getChildren(@NotNull VirtualFile dir, @NotNull VirtualFileFilter filter) {
  List<VirtualFile> result = null;
  for (VirtualFile child : dir.getChildren()) {
    if (filter.accept(child)) {
      if (result == null) result = ContainerUtil.newSmartList();
      result.add(child);
    }
  }
  return result != null ? result : ContainerUtil.<VirtualFile>emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:VfsUtil.java

示例8: computeDefaultContexts

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public Collection<PsiFileSystemItem> computeDefaultContexts() {
  PsiFile file = getContainingFile();
  if (file == null) return ContainerUtil.emptyList();

  if (isAbsolutePathReference() && !ApplicationManager.getApplication().isUnitTestMode()) {
    return toFileSystemItems(ManagingFS.getInstance().getLocalRoots());
  }

  return super.computeDefaultContexts();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:RootFileReferenceSet.java

示例9: getInReferences

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
@NotNull
public Collection<RefElement> getInReferences() {
  if (myInReferences == null){
    return ContainerUtil.emptyList();
  }
  return myInReferences;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RefElementImpl.java

示例10: getChildren

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<LighterASTNode> getChildren(@NotNull final LighterASTNode parent) {
  final ASTNode[] children = ((NodeWrapper)parent).myNode.getChildren(null);
  if (children.length == 0) return ContainerUtil.emptyList();

  List<LighterASTNode> result = new ArrayList<LighterASTNode>(children.length);
  for (final ASTNode child : children) {
    result.add(wrap(child));
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TreeBackedLighterAST.java

示例11: getExternalProjectsData

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Collection<ExternalProjectInfo> getExternalProjectsData(@NotNull Project project, @NotNull ProjectSystemId projectSystemId) {
  if (!project.isDisposed()) {
    return ExternalProjectsDataStorage.getInstance(project).list(projectSystemId);
  }
  else {
    return ContainerUtil.emptyList();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ProjectDataManager.java

示例12: getActiveCherryPickersForProject

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static List<VcsCherryPicker> getActiveCherryPickersForProject(@Nullable final Project project) {
  if (project != null) {
    final ProjectLevelVcsManager projectLevelVcsManager = ProjectLevelVcsManager.getInstance(project);
    AbstractVcs[] vcss = projectLevelVcsManager.getAllActiveVcss();
    return ContainerUtil.mapNotNull(vcss, new Function<AbstractVcs, VcsCherryPicker>() {
      @Override
      public VcsCherryPicker fun(AbstractVcs vcs) {
        return vcs != null ? getCherryPickerFor(project, vcs.getKeyInstanceMethod()) : null;
      }
    });
  }
  return ContainerUtil.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:VcsCherryPickAction.java

示例13: selectTasksList

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected List<Object> selectTasksList(@NotNull String response, int max) throws Exception {
  @SuppressWarnings("unchecked")
  List<Object> list = (List<Object>)extractValueAndCheckType(getSelector(TASKS), response, List.class);
  if (list == null) {
    return ContainerUtil.emptyList();
  }
  return ContainerUtil.map2List(list, new Function<Object, Object>() {
    @Override
    public Object fun(Object o) {
      return o.toString();
    }
  }).subList(0, Math.min(list.size(), max));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JsonPathResponseHandler.java

示例14: getDependentRegionRangesAfterCurrentWhiteSpace

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static List<TextRange> getDependentRegionRangesAfterCurrentWhiteSpace(final SpacingImpl spaceProperty,
                                                                              final WhiteSpace whiteSpace)
{
  if (!(spaceProperty instanceof DependantSpacingImpl)) return ContainerUtil.emptyList();

  if (whiteSpace.isReadOnly() || whiteSpace.isLineFeedsAreReadOnly()) return ContainerUtil.emptyList();

  DependantSpacingImpl spacing = (DependantSpacingImpl)spaceProperty;
  return ContainerUtil.filter(spacing.getDependentRegionRanges(), new Condition<TextRange>() {
    @Override
    public boolean value(TextRange dependencyRange) {
      return whiteSpace.getStartOffset() < dependencyRange.getEndOffset();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:FormatProcessor.java

示例15: getScripts

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static List<VirtualFile> getScripts() {
  VirtualFile root = getScriptsRootDirectory();
  if (root == null) return ContainerUtil.emptyList();

  VfsUtil.markDirtyAndRefresh(false, true, true, root);
  List<VirtualFile> scripts = VfsUtil.collectChildrenRecursively(root);
  scripts = ContainerUtil.filter(scripts, ExtensionsRootType.regularFileFilter());
  ContainerUtil.sort(scripts, new FileNameComparator());
  return scripts;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:IdeStartupScripts.java


注:本文中的com.intellij.util.containers.ContainerUtil.emptyList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。