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


Java MultiMap.size方法代码示例

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


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

示例1: doOKAction

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
protected void doOKAction() {
  MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
  if (myCreateInnerClassRb.isSelected()) {
    final PsiClass innerClass = myTargetClass.findInnerClassByName(myInnerClassName.getText(), false);
    if (innerClass != null) {
      conflicts.putValue(innerClass, "Inner class " + myInnerClassName.getText() + " already defined in class " + myTargetClass.getName());
    }
  }
  if (conflicts.size() > 0) {
    final ConflictsDialog conflictsDialog = new ConflictsDialog(myProject, conflicts);
    if (!conflictsDialog.showAndGet()) {
      if (conflictsDialog.isShowConflicts()) close(CANCEL_EXIT_CODE);
      return;
    }
  }

  final JCheckBox makeVarargsCb = myCreateInnerClassRb.isSelected() ? myCbMakeVarargs : myCbMakeVarargsAnonymous;
  if (makeVarargsCb != null && makeVarargsCb.isSelected()) {
    final VariableData data = myInputVariables[myInputVariables.length - 1];
    if (data.type instanceof PsiArrayType) {
      data.type = new PsiEllipsisType(((PsiArrayType)data.type).getComponentType());
    }
  }
  super.doOKAction();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ExtractMethodObjectDialog.java

示例2: preprocessUsages

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
protected final boolean preprocessUsages(@NotNull final Ref<UsageInfo[]> refUsages) {
  UsageInfo[] usagesIn = refUsages.get();
  if (myPrepareSuccessfulSwingThreadCallback != null) {
    MultiMap<PsiElement, String> conflicts = getConflictDescriptions(usagesIn);
    if (conflicts.size() > 0) {
      ConflictsDialog conflictsDialog = prepareConflictsDialog(conflicts, refUsages.get());
      if (!conflictsDialog.showAndGet()) {
        if (conflictsDialog.isShowConflicts()) prepareSuccessful();
        return false;
      }
    }
    if(!mySettings.isChangeSignature()) {
      refUsages.set(filterInternalUsages(usagesIn));
    }
  }
  final Set<UsageInfo> toMakeStatic = new LinkedHashSet<UsageInfo>();
  refUsages.set(filterOverriding(usagesIn, toMakeStatic));
  if (!findAdditionalMembers(toMakeStatic)) return false;
  prepareSuccessful();
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:MakeMethodOrClassStaticProcessor.java

示例3: stringifyBranchesByRepos

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
protected static String stringifyBranchesByRepos(@NotNull Map<GitRepository, String> heads) {
  MultiMap<String, VirtualFile> grouped = groupByBranches(heads);
  if (grouped.size() == 1) {
    return grouped.keySet().iterator().next();
  }
  return StringUtil.join(grouped.entrySet(), new Function<Map.Entry<String, Collection<VirtualFile>>, String>() {
    @Override
    public String fun(Map.Entry<String, Collection<VirtualFile>> entry) {
      String roots = StringUtil.join(entry.getValue(), new Function<VirtualFile, String>() {
        @Override
        public String fun(VirtualFile file) {
          return file.getName();
        }
      }, ", ");
      return entry.getKey() + " (in " + roots + ")";
    }
  }, "<br/>");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GitBranchOperation.java

示例4: isOK

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
public boolean isOK(IntroduceVariableSettings settings) {
  String name = settings.getEnteredName();
  final PsiElement anchor;
  final boolean replaceAllOccurrences = settings.isReplaceAllOccurrences();
  if (replaceAllOccurrences) {
    anchor = myAnchorStatementIfAll;
  } else {
    anchor = myAnchorStatement;
  }
  final PsiElement scope = anchor.getParent();
  if(scope == null) return true;
  final MultiMap<PsiElement, String> conflicts = new MultiMap<PsiElement, String>();
  final HashSet<PsiVariable> reportedVariables = new HashSet<PsiVariable>();
  JavaUnresolvableLocalCollisionDetector.CollidingVariableVisitor visitor = new JavaUnresolvableLocalCollisionDetector.CollidingVariableVisitor() {
    public void visitCollidingElement(PsiVariable collidingVariable) {
      if (!reportedVariables.contains(collidingVariable)) {
        reportedVariables.add(collidingVariable);
        String message = RefactoringBundle.message("introduced.variable.will.conflict.with.0", RefactoringUIUtil.getDescription(collidingVariable, true));
        conflicts.putValue(collidingVariable, message);
      }
    }
  };
  JavaUnresolvableLocalCollisionDetector.visitLocalsCollisions(anchor, name, scope, anchor, visitor);
  if (replaceAllOccurrences) {
    final PsiExpression[] occurences = myOccurenceManager.getOccurrences();
    for (PsiExpression occurence : occurences) {
      IntroduceVariableBase.checkInLoopCondition(occurence, conflicts);
    }
  } else {
    IntroduceVariableBase.checkInLoopCondition(myOccurenceManager.getMainOccurence(), conflicts);
  }

  if (conflicts.size() > 0) {
    return myIntroduceVariableBase.reportConflicts(conflicts, myProject, settings);
  } else {
    return true;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:InputValidator.java

示例5: formErrorReport

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
private static String formErrorReport(@NotNull Map<GitRepository, GitCommandResult> errorResults) {
  MultiMap<String, GitRepository> grouped = groupByResult(errorResults);
  if (grouped.size() == 1) {
    return "<code>" + grouped.keySet().iterator().next() + "</code>";
  }
  return StringUtil.join(grouped.entrySet(), new Function<Map.Entry<String, Collection<GitRepository>>, String>() {
    @NotNull
    @Override
    public String fun(@NotNull Map.Entry<String, Collection<GitRepository>> entry) {
      return joinRepos(entry.getValue()) + ":<br/><code>" + entry.getKey() + "</code>";
    }
  }, "<br/>");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GitResetOperation.java

示例6: getChildren

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@NotNull
public StructureViewTreeElement[] getChildren() {
  final MultiMap<String, IProperty> propertyNames = getPropertiesMap(myResourceBundle, myShowOnlyIncomplete);
  List<StructureViewTreeElement> result = new ArrayList<StructureViewTreeElement>(propertyNames.size());
  for (Map.Entry<String, Collection<IProperty>> entry : propertyNames.entrySet()) {
    final Collection<IProperty> properties = entry.getValue();
    final PropertiesAnchorizer.PropertyAnchor anchor = myAnchorizer.createOrUpdate(properties);
    result.add(new ResourceBundlePropertyStructureViewElement(myResourceBundle, anchor));
  }
  return result.toArray(new StructureViewTreeElement[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ResourceBundleFileStructureViewElement.java

示例7: isOK

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
@Override
public boolean isOK(GrIntroduceDialog dialog) {
  final GrIntroduceSettings settings = dialog.getSettings();
  if (settings == null) return false;
  String varName = settings.getName();
  boolean allOccurrences = settings.replaceAllOccurrences();
  final MultiMap<PsiElement, String> conflicts = isOKImpl(varName, allOccurrences);
  return conflicts.size() <= 0 || reportConflicts(conflicts, getProject());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GrIntroduceValidatorEngine.java

示例8: processGlobalRequestsOptimized

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
private boolean processGlobalRequestsOptimized(@NotNull MultiMap<Set<IdIndexEntry>, RequestWithProcessor> singles,
                                               @NotNull ProgressIndicator progress,
                                               @NotNull final Map<RequestWithProcessor, Processor<PsiElement>> localProcessors) {
  if (singles.isEmpty()) {
    return true;
  }

  if (singles.size() == 1) {
    final Collection<? extends RequestWithProcessor> requests = singles.values();
    if (requests.size() == 1) {
      final RequestWithProcessor theOnly = requests.iterator().next();
      return processSingleRequest(theOnly.request, theOnly.refProcessor);
    }
  }

  progress.pushState();
  progress.setText(PsiBundle.message("psi.scanning.files.progress"));
  boolean result;

  try {
    // intersectionCandidateFiles holds files containing words from all requests in `singles` and words in corresponding container names
    final MultiMap<VirtualFile, RequestWithProcessor> intersectionCandidateFiles = createMultiMap();
    // restCandidateFiles holds files containing words from all requests in `singles` but EXCLUDING words in corresponding container names
    final MultiMap<VirtualFile, RequestWithProcessor> restCandidateFiles = createMultiMap();
    collectFiles(singles, progress, intersectionCandidateFiles, restCandidateFiles);

    if (intersectionCandidateFiles.isEmpty() && restCandidateFiles.isEmpty()) {
      return true;
    }

    final Set<String> allWords = new TreeSet<String>();
    for (RequestWithProcessor singleRequest : localProcessors.keySet()) {
      allWords.add(singleRequest.request.word);
    }
    progress.setText(PsiBundle.message("psi.search.for.word.progress", getPresentableWordsDescription(allWords)));

    if (intersectionCandidateFiles.isEmpty()) {
      result = processCandidates(localProcessors, restCandidateFiles, progress, restCandidateFiles.size(), 0);
    }
    else {
      int totalSize = restCandidateFiles.size() + intersectionCandidateFiles.size();
      result = processCandidates(localProcessors, intersectionCandidateFiles, progress, totalSize, 0);
      if (result) {
        result = processCandidates(localProcessors, restCandidateFiles, progress, totalSize, intersectionCandidateFiles.size());
      }
    }
  }
  finally {
    progress.popState();
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:54,代码来源:PsiSearchHelperImpl.java

示例9: saveInclusionSettings

import com.intellij.util.containers.MultiMap; //导入方法依赖的package包/类
synchronized void saveInclusionSettings(@Nullable DataNode<ProjectData> projectDataNode) {
  if (projectDataNode == null) return;

  final MultiMap<String, String> inclusionMap = MultiMap.create();
  final MultiMap<String, String> exclusionMap = MultiMap.create();
  ExternalSystemApiUtil.visit(projectDataNode, new Consumer<DataNode<?>>() {
    @Override
    public void consume(DataNode dataNode) {
      try {
        dataNode.getDataBytes();
        DataNode<ExternalConfigPathAware> projectNode = resolveProjectNode(dataNode);
        if (projectNode != null) {
          final String projectPath = projectNode.getData().getLinkedExternalProjectPath();
          if (projectNode.isIgnored() || dataNode.isIgnored()) {
            exclusionMap.putValue(projectPath, dataNode.getKey().getDataType());
          }
          else {
            inclusionMap.putValue(projectPath, dataNode.getKey().getDataType());
          }
        }
      }
      catch (IOException e) {
        dataNode.clear(true);
      }
    }
  });
  final MultiMap<String, String> map;
  ProjectState projectState = new ProjectState();
  if (inclusionMap.size() < exclusionMap.size()) {
    projectState.isInclusion = true;
    map = inclusionMap;
  }
  else {
    projectState.isInclusion = false;
    map = exclusionMap;
  }

  for (String path : map.keySet()) {
    projectState.map.put(path, new ModuleState(map.get(path)));
  }

  myState.map.put(projectDataNode.getData().getLinkedExternalProjectPath(), projectState);
  changed.set(true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:ExternalProjectsDataStorage.java


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