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


Java ContainerUtil.createLockFreeCopyOnWriteList方法代码示例

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


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

示例1: registerFix

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public void registerFix(@Nullable IntentionAction action,
                        @Nullable List<IntentionAction> options,
                        @Nullable String displayName,
                        @Nullable TextRange fixRange,
                        @Nullable HighlightDisplayKey key) {
  if (action == null) return;
  if (fixRange == null) fixRange = new TextRange(startOffset, endOffset);
  if (quickFixActionRanges == null) {
    quickFixActionRanges = ContainerUtil.createLockFreeCopyOnWriteList();
  }
  IntentionActionDescriptor desc = new IntentionActionDescriptor(action, options, displayName, null, key, getProblemGroup(), getSeverity());
  quickFixActionRanges.add(Pair.create(desc, fixRange));
  fixStartOffset = Math.min (fixStartOffset, fixRange.getStartOffset());
  fixEndOffset = Math.max (fixEndOffset, fixRange.getEndOffset());
  if (action instanceof HintAction) {
    setHint(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:HighlightInfo.java

示例2: 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

示例3: findAllConstructorInitializers

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public static List<PsiExpression> findAllConstructorInitializers(PsiField field) {
  final List<PsiExpression> result = ContainerUtil.createLockFreeCopyOnWriteList();
  ContainerUtil.addIfNotNull(result, field.getInitializer());

  final PsiClass containingClass = field.getContainingClass();
  if (containingClass != null && !(containingClass instanceof PsiCompiledElement)) {
    result.addAll(getAllConstructorFieldInitializers(containingClass).get(field));
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DfaPsiUtil.java

示例4: addStateDelegate

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public final void addStateDelegate(@NotNull ProgressIndicatorEx delegate) {
  delegate.initStateFrom(this);
  synchronized (this) {
    List<ProgressIndicatorEx> stateDelegates = myStateDelegates;
    if (stateDelegates == null) {
      myStateDelegates = stateDelegates = ContainerUtil.createLockFreeCopyOnWriteList();
    }
    else {
      LOG.assertTrue(!stateDelegates.contains(delegate), "Already registered: " + delegate);
    }
    stateDelegates.add(delegate);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AbstractProgressIndicatorExBase.java

示例5: notifyOnSubscription

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
void notifyOnSubscription(final MessageBusConnectionImpl connection, final Topic topic) {
  checkNotDisposed();
  List<MessageBusConnectionImpl> topicSubscribers = mySubscribers.get(topic);
  if (topicSubscribers == null) {
    topicSubscribers = ContainerUtil.createLockFreeCopyOnWriteList();
    topicSubscribers = ConcurrencyUtil.cacheOrGet(mySubscribers, topic, topicSubscribers);
  }

  topicSubscribers.add(connection);
  getRootBus().clearSubscriberCache();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MessageBusImpl.java

示例6: clone

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public MavenImportingSettings clone() {
  try {
    MavenImportingSettings result = (MavenImportingSettings)super.clone();
    result.myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
    return result;
  }
  catch (CloneNotSupportedException e) {
    throw new Error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MavenImportingSettings.java

示例7: clone

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@Override
public MavenGeneralSettings clone() {
  try {
    MavenGeneralSettings result = (MavenGeneralSettings)super.clone();
    result.myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
    result.myBulkUpdateLevel = 0;
    return result;
  }
  catch (CloneNotSupportedException e) {
    throw new Error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MavenGeneralSettings.java

示例8: calcDevPatternClassNames

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
private static Set<String> calcDevPatternClassNames(@NotNull final Project project) {
  final List<String> roots = ContainerUtil.createLockFreeCopyOnWriteList();
  JavaPsiFacade psiFacade = JavaPsiFacade.getInstance(project);
  PsiClass beanClass = psiFacade.findClass(PatternClassBean.class.getName(), GlobalSearchScope.allScope(project));
  if (beanClass != null) {
    GlobalSearchScope scope = GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), StdFileTypes.XML);
    final TextOccurenceProcessor occurenceProcessor = new TextOccurenceProcessor() {
      @Override
      public boolean execute(@NotNull PsiElement element, int offsetInElement) {
        XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class);
        String className = tag == null ? null : tag.getAttributeValue("className");
        if (StringUtil.isNotEmpty(className) && tag.getLocalName().endsWith("patternClass")) {
          roots.add(className);
        }
        return true;
      }
    };
    final StringSearcher searcher = new StringSearcher("patternClass", true, true);
    CacheManager.SERVICE.getInstance(beanClass.getProject()).processFilesWithWord(new Processor<PsiFile>() {
      @Override
      public boolean process(PsiFile psiFile) {
        LowLevelSearchUtil.processElementsContainingWordInElement(occurenceProcessor, psiFile, searcher, true,
                                                                   new EmptyProgressIndicator());
        return true;
      }
    }, searcher.getPattern(), UsageSearchContext.IN_FOREIGN_LANGUAGES, scope, searcher.isCaseSensitive());
  }
  return ContainerUtil.newHashSet(roots);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PatternEditorContextMembersProvider.java

示例9: TestFailedState

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
public TestFailedState(@Nullable final String localizedMessage,
                       @Nullable final String stackTrace)
{
  myPresentationText =
    ContainerUtil.createLockFreeCopyOnWriteList(Collections.singleton(buildErrorPresentationText(localizedMessage, stackTrace)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:TestFailedState.java


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