本文整理汇总了Java中com.intellij.openapi.vcs.changes.ChangeList.getChanges方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeList.getChanges方法的具体用法?Java ChangeList.getChanges怎么用?Java ChangeList.getChanges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.changes.ChangeList
的用法示例。
在下文中一共展示了ChangeList.getChanges方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillCompletionVariants
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document != null) {
DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
if (dataContext != null) {
result.stopHere();
if (parameters.getInvocationCount() > 0) {
ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dataContext);
if (lists != null) {
String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
for (ChangeList list : lists) {
for (Change change : list.getChanges()) {
ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
if (revision != null) {
FilePath filePath = revision.getFile();
LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).
withIcon(filePath.getFileType().getIcon());
insensitive.addElement(element);
}
}
}
}
}
}
}
}
示例2: getFilePaths
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
private static Collection<FilePath> getFilePaths(final VcsContext context) {
final Set<FilePath> files = new HashSet<FilePath>();
final ChangeList[] selectedChangeLists = context.getSelectedChangeLists();
if (selectedChangeLists != null) {
for(ChangeList changelist: selectedChangeLists) {
for(Change change: changelist.getChanges()) {
files.add(ChangesUtil.getFilePath(change));
}
}
}
return files;
}
示例3: fillCompletionVariants
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document != null) {
DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
if (dataContext != null) {
result.stopHere();
if (parameters.getInvocationCount() > 0) {
ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dataContext);
if (lists != null) {
String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
for (ChangeList list : lists) {
for (Change change : list.getChanges()) {
ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
if (revision != null) {
FilePath filePath = revision.getFile();
LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).
withIcon(filePath.getFileType().getIcon());
insensitive.addElement(element);
}
}
}
}
}
}
}
}
示例4: fillCompletionVariants
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
PsiFile file = parameters.getOriginalFile();
Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document != null) {
DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
if (dataContext != null) {
result.stopHere();
if (parameters.getInvocationCount() > 0) {
ChangeList[] lists = dataContext.getData(VcsDataKeys.CHANGE_LISTS);
if (lists != null) {
String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
for (ChangeList list : lists) {
for (Change change : list.getChanges()) {
VirtualFile virtualFile = change.getVirtualFile();
if (virtualFile != null) {
LookupElementBuilder element = LookupElementBuilder.create(virtualFile.getName()).
withIcon(VirtualFilePresentation.getIcon(virtualFile));
insensitive.addElement(element);
}
}
}
}
}
}
}
}
示例5: getFilePaths
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
private static Collection<FilePath> getFilePaths(final VcsContext context) {
final Set<FilePath> files = new HashSet<>();
final ChangeList[] selectedChangeLists = context.getSelectedChangeLists();
if (selectedChangeLists != null) {
for(ChangeList changelist: selectedChangeLists) {
for(Change change: changelist.getChanges()) {
files.add(ChangesUtil.getFilePath(change));
}
}
}
return files;
}
示例6: getScope
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
@NotNull
public AnalysisScope getScope(@NotNull AnalysisUIOptions uiOptions, @NotNull AnalysisScope defaultScope, @NotNull Project project, Module module) {
AnalysisScope scope;
if (isProjectScopeSelected()) {
scope = new AnalysisScope(project);
uiOptions.SCOPE_TYPE = AnalysisScope.PROJECT;
}
else {
final SearchScope customScope = getCustomScope();
if (customScope != null) {
scope = new AnalysisScope(customScope, project);
uiOptions.SCOPE_TYPE = AnalysisScope.CUSTOM;
uiOptions.CUSTOM_SCOPE_NAME = customScope.getDisplayName();
}
else if (isModuleScopeSelected()) {
scope = new AnalysisScope(module);
uiOptions.SCOPE_TYPE = AnalysisScope.MODULE;
}
else if (isUncommitedFilesSelected()) {
final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
List<VirtualFile> files;
if (myChangeLists.getSelectedItem() == ALL) {
files = changeListManager.getAffectedFiles();
}
else {
files = new ArrayList<VirtualFile>();
for (ChangeList list : changeListManager.getChangeListsCopy()) {
if (!Comparing.strEqual(list.getName(), (String)myChangeLists.getSelectedItem())) continue;
final Collection<Change> changes = list.getChanges();
for (Change change : changes) {
final ContentRevision afterRevision = change.getAfterRevision();
if (afterRevision != null) {
final VirtualFile vFile = afterRevision.getFile().getVirtualFile();
if (vFile != null) {
files.add(vFile);
}
}
}
}
}
scope = new AnalysisScope(project, new HashSet<VirtualFile>(files));
uiOptions.SCOPE_TYPE = AnalysisScope.UNCOMMITTED_FILES;
}
else {
scope = defaultScope;
uiOptions.SCOPE_TYPE = defaultScope.getScopeType();//just not project scope
}
}
uiOptions.ANALYZE_TEST_SOURCES = isInspectTestSources();
scope.setIncludeTestSource(isInspectTestSources());
scope.setScope(getCustomScope());
FindSettings.getInstance().setDefaultScopeName(scope.getDisplayName());
return scope;
}
示例7: getScope
import com.intellij.openapi.vcs.changes.ChangeList; //导入方法依赖的package包/类
@Nonnull
public AnalysisScope getScope(@Nonnull AnalysisUIOptions uiOptions, @Nonnull AnalysisScope defaultScope, @Nonnull Project project, Module module) {
AnalysisScope scope;
if (isProjectScopeSelected()) {
scope = new AnalysisScope(project);
uiOptions.SCOPE_TYPE = AnalysisScope.PROJECT;
}
else {
final SearchScope customScope = getCustomScope();
if (customScope != null) {
scope = new AnalysisScope(customScope, project);
uiOptions.SCOPE_TYPE = AnalysisScope.CUSTOM;
uiOptions.CUSTOM_SCOPE_NAME = customScope.getDisplayName();
}
else if (isModuleScopeSelected()) {
scope = new AnalysisScope(module);
uiOptions.SCOPE_TYPE = AnalysisScope.MODULE;
}
else if (isUncommitedFilesSelected()) {
final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
List<VirtualFile> files;
if (myChangeLists.getSelectedItem() == ALL) {
files = changeListManager.getAffectedFiles();
}
else {
files = new ArrayList<VirtualFile>();
for (ChangeList list : changeListManager.getChangeListsCopy()) {
if (!Comparing.strEqual(list.getName(), (String)myChangeLists.getSelectedItem())) continue;
final Collection<Change> changes = list.getChanges();
for (Change change : changes) {
final ContentRevision afterRevision = change.getAfterRevision();
if (afterRevision != null) {
final VirtualFile vFile = afterRevision.getFile().getVirtualFile();
if (vFile != null) {
files.add(vFile);
}
}
}
}
}
scope = new AnalysisScope(project, new HashSet<VirtualFile>(files));
uiOptions.SCOPE_TYPE = AnalysisScope.UNCOMMITTED_FILES;
}
else {
scope = defaultScope;
uiOptions.SCOPE_TYPE = defaultScope.getScopeType();//just not project scope
}
}
uiOptions.ANALYZE_TEST_SOURCES = isInspectTestSources();
scope.setIncludeTestSource(isInspectTestSources());
scope.setScope(getCustomScope());
FindSettings.getInstance().setDefaultScopeName(scope.getDisplayName());
return scope;
}