Java Code Examples for com.intellij.util.containers.MultiMap#createSet()

The following examples show how to use com.intellij.util.containers.MultiMap#createSet() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VcsDirtyScopeManagerImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
private MultiMap<AbstractVcs, FilePath> getEverythingDirtyRoots() {
  MultiMap<AbstractVcs, FilePath> dirtyRoots = MultiMap.createSet();
  dirtyRoots.putAllValues(groupByVcs(toFilePaths(DefaultVcsRootPolicy.getInstance(myProject).getDirtyRoots())));

  List<VcsDirectoryMapping> mappings = myVcsManager.getDirectoryMappings();
  for (VcsDirectoryMapping mapping : mappings) {
    if (!mapping.isDefaultMapping() && mapping.getVcs() != null) {
      AbstractVcs vcs = myVcsManager.findVcsByName(mapping.getVcs());
      if (vcs != null) {
        dirtyRoots.putValue(vcs, VcsUtil.getFilePath(mapping.getDirectory(), true));
      }
    }
  }
  return dirtyRoots;
}
 
Example 2
Source File: VcsAnnotationLocalChangesListenerImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
public VcsAnnotationLocalChangesListenerImpl(Project project, final ProjectLevelVcsManager vcsManager) {
  myLock = new Object();
  myUpdateStuff = createUpdateStuff();
  myUpdater = new ZipperUpdater(ApplicationManager.getApplication().isUnitTestMode() ? 10 : 300, Alarm.ThreadToUse.POOLED_THREAD, project);
  myConnection = project.getMessageBus().connect();
  myLocalFileSystem = LocalFileSystem.getInstance();
  VcsAnnotationRefresher handler = createHandler();
  myDirtyPaths = new HashSet<>();
  myDirtyChanges = new HashMap<>();
  myDirtyFiles = new HashSet<>();
  myFileAnnotationMap = MultiMap.createSet();
  myVcsManager = vcsManager;
  myVcsKeySet = new HashSet<>();

  myConnection.subscribe(VcsAnnotationRefresher.LOCAL_CHANGES_CHANGED, handler);
}
 
Example 3
Source File: DirtBuilder.java    From consulo with Apache License 2.0 5 votes vote down vote up
public DirtBuilder(final VcsGuess guess) {
  myGuess = guess;
  myDirs = MultiMap.createSet();
  myFiles = MultiMap.createSet();
  myEverythingDirty = false;
  myFileTypeManager = FileTypeManager.getInstance();
}
 
Example 4
Source File: VcsDirtyScopeManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
private MultiMap<AbstractVcs, FilePath> groupByVcs(@Nullable final Collection<FilePath> from) {
  if (from == null) return MultiMap.empty();
  MultiMap<AbstractVcs, FilePath> map = MultiMap.createSet();
  for (FilePath path : from) {
    AbstractVcs vcs = myGuess.getVcsForDirty(path);
    if (vcs != null) {
      map.putValue(vcs, path);
    }
  }
  return map;
}
 
Example 5
Source File: AutoMatchStrategy.java    From consulo with Apache License 2.0 4 votes vote down vote up
AutoMatchStrategy(final VirtualFile baseDir) {
  myBaseDir = baseDir;
  myResult = new LinkedList<>();
  myFolderDecisions = MultiMap.createSet();
}