本文整理汇总了Java中com.intellij.openapi.vcs.changes.ChangeListManager.findChangeList方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeListManager.findChangeList方法的具体用法?Java ChangeListManager.findChangeList怎么用?Java ChangeListManager.findChangeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.changes.ChangeListManager
的用法示例。
在下文中一共展示了ChangeListManager.findChangeList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAffectedFiles
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@NotNull
private static List<VirtualFile> getAffectedFiles(String changeListName, Project project) {
final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
if (changeListName == null) {
return changeListManager.getAffectedFiles();
}
final LocalChangeList changeList = changeListManager.findChangeList(changeListName);
if (changeList != null) {
List<VirtualFile> files = new ArrayList<VirtualFile>();
for (Change change : changeList.getChanges()) {
final ContentRevision afterRevision = change.getAfterRevision();
if (afterRevision != null) {
final VirtualFile file = afterRevision.getFile().getVirtualFile();
if (file != null) {
files.add(file);
}
}
}
return files;
}
return Collections.emptyList();
}
示例2: setupDefaultEmptyChangeListForMerge
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
private boolean setupDefaultEmptyChangeListForMerge() {
ChangeListManager changeListManager = ChangeListManager.getInstance(myMergeContext.getProject());
int i = 0;
boolean needRefresh = false;
while (true) {
String name = myMergeContext.getTitle() + (i > 0 ? " (" + i + ")" : "");
LocalChangeList changeList = changeListManager.findChangeList(name);
if (changeList == null) {
changeListManager.setDefaultChangeList(changeListManager.addChangeList(name, null));
needRefresh = true;
break;
}
if (changeList.getChanges().isEmpty()) {
if (!changeList.isDefault()) {
changeListManager.setDefaultChangeList(changeList);
needRefresh = true;
}
break;
}
i++;
}
return needRefresh;
}
示例3: getSelectedList
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Nullable
public LocalChangeList getSelectedList(Project project) {
ChangeListManager manager = ChangeListManager.getInstance(project);
if (myRbNew.isSelected()) {
String newText = myNewListPanel.getChangeListName();
if (manager.findChangeList(newText) != null) {
Messages.showErrorDialog(project,
VcsBundle.message("changes.newchangelist.warning.already.exists.text", newText),
VcsBundle.message("changes.newchangelist.warning.already.exists.title"));
return null;
}
}
if (myRbExisting.isSelected()) {
return (LocalChangeList)myExistingListsCombo.getSelectedItem();
}
else {
LocalChangeList changeList = manager.addChangeList(myNewListPanel.getChangeListName(), myNewListPanel.getDescription());
myNewListPanel.changelistCreatedOrChanged(changeList);
if (myNewListPanel.getMakeActiveCheckBox().isSelected()) {
manager.setDefaultChangeList(changeList);
}
VcsConfiguration.getInstance(project).MAKE_NEW_CHANGELIST_ACTIVE = myNewListPanel.getMakeActiveCheckBox().isSelected();
return changeList;
}
}
示例4: actionPerformed
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) return;
final ShelvedChangeList[] changeLists = e.getData(ShelvedChangesViewManager.SHELVED_CHANGELIST_KEY);
List<ShelvedChange> changes = e.getData(ShelvedChangesViewManager.SHELVED_CHANGE_KEY);
List<ShelvedBinaryFile> binaryFiles = e.getData(ShelvedChangesViewManager.SHELVED_BINARY_FILE_KEY);
if (changes != null && binaryFiles != null && changes.size() == 0 && binaryFiles.size() == 0) {
changes = null;
binaryFiles = null;
}
LOG.assertTrue(changeLists != null);
final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
final List<LocalChangeList> allChangeLists = changeListManager.getChangeListsCopy();
String defaultName = changeLists[0].DESCRIPTION;
LocalChangeList list = null;
if (changeLists.length == 1) {
final LocalChangeList sameNamedList = changeListManager.findChangeList(defaultName);
if (sameNamedList != null) {
list = sameNamedList;
}
else {
list = tryToMatchWithExistingChangelist(changeListManager, defaultName);
}
}
if (list == null) {
list = changeListManager.getDefaultChangeList();
}
final ChangeListChooser chooser = new ChangeListChooser(project, allChangeLists, list,
VcsBundle.message("unshelve.changelist.chooser.title"), defaultName);
if (!chooser.showAndGet()) {
return;
}
FileDocumentManager.getInstance().saveAllDocuments();
final List<ShelvedBinaryFile> finalBinaryFiles = binaryFiles;
final List<ShelvedChange> finalChanges = changes;
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Unshelve Changes", true, BackgroundFromStartOption.getInstance()) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
for (ShelvedChangeList changeList : changeLists) {
ShelveChangesManager.getInstance(project)
.unshelveChangeList(changeList, finalChanges, finalBinaryFiles, chooser.getSelectedList(), true);
}
}
});
}