本文整理汇总了Java中com.intellij.openapi.vcs.AbstractVcs.getName方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractVcs.getName方法的具体用法?Java AbstractVcs.getName怎么用?Java AbstractVcs.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.AbstractVcs
的用法示例。
在下文中一共展示了AbstractVcs.getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVcsName
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的package包/类
@Nullable
@NonNls
public String getVcsName(Project project) {
final AbstractVcs vcs = getVcs(project);
// if the parent group was customized and then the plugin was disabled, we could have an action group with no VCS
return vcs != null ? vcs.getName() : null;
}
示例2: getDetailedVcsMappings
import com.intellij.openapi.vcs.AbstractVcs; //导入方法依赖的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;
}