本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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();
}
}
});
}
示例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();
}
}
});
}
示例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;
}
示例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();
}
});
}
示例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;
}
示例9: initProjectMessage
import com.intellij.openapi.vcs.impl.DefaultVcsRootPolicy; //导入依赖的package包/类
public void initProjectMessage() {
myProjectButtonComment.setText(XmlStringUtil.wrapInHtml(DefaultVcsRootPolicy.getInstance(myProject).getProjectConfigurationMessage(myProject)));
}