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


Java DefaultVcsRootPolicy类代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy的典型用法代码示例。如果您正苦于以下问题:Java DefaultVcsRootPolicy类的具体用法?Java DefaultVcsRootPolicy怎么用?Java DefaultVcsRootPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getEverythingDirtyRoots

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
@NotNull
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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:VcsDirtyScopeManagerImpl.java

示例2: markEverythingDirty

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
private void markEverythingDirty() {
  myScopes.clear();
  myEverythingDirty = true;
  final DirtBuilder builder = new DirtBuilder(myGuess);
  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
  final List<VcsDirectoryMapping> mappings = vcsManager.getDirectoryMappings();

  final LocalFileSystem lfs = LocalFileSystem.getInstance();
  for (VcsDirectoryMapping mapping : mappings) {
    if (mapping.isDefaultMapping()) {
      DefaultVcsRootPolicy.getInstance(myProject).markDefaultRootsDirty(builder, myGuess);
    } else {
      if (mapping.getVcs() != null) {
        final String vcsName = mapping.getVcs();
        final AbstractVcs vcs = vcsManager.findVcsByName(vcsName);
        final VirtualFile file = lfs.findFileByPath(mapping.getDirectory());
        if (file != null) {
          builder.addDirtyDirRecursively(new VcsRoot(vcs, file));
        }
      }
    }
  }

  DefaultVcsRootPolicy.getInstance(myProject).markDefaultRootsDirty(builder, myGuess);
  takeDirt(builder);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:Scopes.java

示例3: getEverythingDirtyRoots

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
@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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:VcsDirtyScopeManagerImpl.java

示例4: NewMappings

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public NewMappings(final Project project, final MessageBus messageBus, final ProjectLevelVcsManagerImpl vcsManager,
                   FileStatusManager fileStatusManager) {
  myProject = project;
  myMessageBus = messageBus;
  myVcsManager = vcsManager;
  myFileStatusManager = fileStatusManager;
  myLock = new Object();
  myVcsToPaths = new HashMap<String, List<VcsDirectoryMapping>>();
  myFileWatchRequestsManager = new FileWatchRequestsManager(myProject, this, LocalFileSystem.getInstance());
  myDefaultVcsRootPolicy = DefaultVcsRootPolicy.getInstance(project);
  myActiveVcses = new AbstractVcs[0];

  if (!myProject.isDefault()) {
    final ArrayList<VcsDirectoryMapping> listStr = new ArrayList<VcsDirectoryMapping>();
    final VcsDirectoryMapping mapping = new VcsDirectoryMapping("", "");
    listStr.add(mapping);
    myVcsToPaths.put("", listStr);
    mySortedMappings = new VcsDirectoryMapping[]{mapping};
  }
  else {
    mySortedMappings = VcsDirectoryMapping.EMPTY_ARRAY;
  }
  myActivated = false;

  vcsManager.addInitializationRequest(VcsInitObject.MAPPINGS, new DumbAwareRunnable() {
    public void run() {
      if (!myProject.isDisposed()) {
        activateActiveVcses();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:NewMappings.java

示例5: NewMappings

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public NewMappings(final Project project, final MessageBus messageBus,
                   final ProjectLevelVcsManagerImpl vcsManager, FileStatusManager fileStatusManager, FileIndexFacade excludedFileIndex) {
  myProject = project;
  myMessageBus = messageBus;
  myFileStatusManager = fileStatusManager;
  myExcludedFileIndex = excludedFileIndex;
  myLock = new Object();
  myVcsToPaths = new HashMap<String, List<VcsDirectoryMapping>>();
  myFileWatchRequestsManager = new FileWatchRequestsManager(myProject, this, LocalFileSystem.getInstance());
  myDefaultVcsRootPolicy = DefaultVcsRootPolicy.getInstance(project);
  myActiveVcses = new AbstractVcs[0];

  if (! myProject.isDefault()) {
    final ArrayList<VcsDirectoryMapping> listStr = new ArrayList<VcsDirectoryMapping>();
    final VcsDirectoryMapping mapping = new VcsDirectoryMapping("", "");
    listStr.add(mapping);
    myVcsToPaths.put("", listStr);
    mySortedMappings = new VcsDirectoryMapping[] {mapping};
  } else {
    mySortedMappings = VcsDirectoryMapping.EMPTY_ARRAY;
  }
  myActivated = false;

  vcsManager.addInitializationRequest(VcsInitObject.MAPPINGS, new DumbAwareRunnable() {
    public void run() {
      if (!myProject.isDisposed()) {
        activateActiveVcses();
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:NewMappings.java

示例6: getDetailedVcsMappings

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public List<VirtualFile> getDetailedVcsMappings(final AbstractVcs vcs) {
  // same as above, but no compression
  final List<VirtualFile> result = myMappings.getMappingsAsFilesUnderVcs(vcs);

  boolean addInnerModules = true;
  final String vcsName = vcs.getName();
  final List<VcsDirectoryMapping> directoryMappings = myMappings.getDirectoryMappings(vcsName);
  for (VcsDirectoryMapping directoryMapping : directoryMappings) {
    if (directoryMapping.isDefaultMapping()) {
      addInnerModules = false;
      break;
    }
  }

  Collections.sort(result, FilePathComparator.getInstance());
  if (addInnerModules) {
    final FileIndexFacade facade = PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class);
    final Collection<VirtualFile> modules = DefaultVcsRootPolicy.getInstance(myProject).getDefaultVcsRoots(myMappings, vcsName);
    ApplicationManager.getApplication().runReadAction(() -> {
      Iterator<VirtualFile> iterator = modules.iterator();
      while (iterator.hasNext()) {
        final VirtualFile module = iterator.next();
        boolean included = false;
        for (VirtualFile root : result) {
          if (facade.isValidAncestor(root, module)) {
            included = true;
            break;
          }
        }
        if (! included) {
          iterator.remove();
        }
      }
    });
    result.addAll(modules);
  }
  result.removeIf(file -> !file.isDirectory());
  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:MappingsToRoots.java

示例7: NewMappings

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public NewMappings(Project project,
                   ProjectLevelVcsManagerImpl vcsManager,
                   FileStatusManager fileStatusManager) {
  myProject = project;
  myVcsManager = vcsManager;
  myFileStatusManager = fileStatusManager;
  myLock = new Object();
  myVcsToPaths = MultiMap.createOrderedSet();
  myFileWatchRequestsManager = new FileWatchRequestsManager(myProject, this, LocalFileSystem.getInstance());
  myDefaultVcsRootPolicy = DefaultVcsRootPolicy.getInstance(project);
  myActiveVcses = new AbstractVcs[0];

  if (!myProject.isDefault()) {
    VcsDirectoryMapping mapping = new VcsDirectoryMapping("", "");
    myVcsToPaths.putValue("", mapping);
    mySortedMappings = new VcsDirectoryMapping[]{mapping};
  }
  else {
    mySortedMappings = VcsDirectoryMapping.EMPTY_ARRAY;
  }
  myActivated = false;

  vcsManager.addInitializationRequest(VcsInitObject.MAPPINGS, (DumbAwareRunnable)() -> {
    if (!myProject.isDisposed()) {
      activateActiveVcses();
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:29,代码来源:NewMappings.java

示例8: getDetailedVcsMappings

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public List<VirtualFile> getDetailedVcsMappings(final AbstractVcs vcs) {
  // same as above, but no compression
  final List<VirtualFile> result = myMappings.getMappingsAsFilesUnderVcs(vcs);

  boolean addInnerModules = true;
  final String vcsName = vcs.getName();
  final List<VcsDirectoryMapping> directoryMappings = myMappings.getDirectoryMappings(vcsName);
  for (VcsDirectoryMapping directoryMapping : directoryMappings) {
    if (directoryMapping.isDefaultMapping()) {
      addInnerModules = false;
      break;
    }
  }

  Collections.sort(result, FilePathComparator.getInstance());
  if (addInnerModules) {
    final FileIndexFacade facade = PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class);
    final DefaultVcsRootPolicy defaultVcsRootPolicy = DefaultVcsRootPolicy.getInstance(myProject);
    final List<VirtualFile> modules = new ArrayList<VirtualFile>();
    defaultVcsRootPolicy.addDefaultVcsRoots(myMappings, vcsName, modules);
    ApplicationManager.getApplication().runReadAction(new Runnable() {
      public void run() {
        final Iterator<VirtualFile> iterator = modules.iterator();
        while (iterator.hasNext()) {
          final VirtualFile module = iterator.next();
          boolean included = false;
          for (VirtualFile root : result) {
            if (facade.isValidAncestor(root, module)) {
              included = true;
              break;
            }
          }
          if (! included) {
            iterator.remove();
          }
        }
      }
    });
    result.addAll(modules);
  }

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

示例9: initProjectMessage

import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public void initProjectMessage() {
  myProjectButtonComment.setText(XmlStringUtil.wrapInHtml(DefaultVcsRootPolicy.getInstance(myProject).getProjectConfigurationMessage(myProject)));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:VcsMappingConfigurationDialog.java


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