本文整理汇总了Java中com.intellij.openapi.vcs.changes.ChangeListManager.moveChangesTo方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeListManager.moveChangesTo方法的具体用法?Java ChangeListManager.moveChangesTo怎么用?Java ChangeListManager.moveChangesTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vcs.changes.ChangeListManager
的用法示例。
在下文中一共展示了ChangeListManager.moveChangesTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRenameList
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testRenameList() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
final String newName = "renamed";
myScheme.doTest(new Runnable() {
@Override
public void run() {
changeListManager.editName(list.getName(), newName);
checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file}, newName, changeListManager);
}
示例2: testMove
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
myScheme.doTest(new Runnable() {
@Override
public void run() {
changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
}
示例3: testDoubleMoveBack
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDoubleMoveBack() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
myScheme.doTest(new Runnable() {
@Override
public void run() {
changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file}, list.getName(), changeListManager);
}
示例4: testAddPlusMove
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testAddPlusMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
final String targetName = "target";
myScheme.doTest(new Runnable() {
@Override
public void run() {
final LocalChangeList target = changeListManager.addChangeList(targetName, null);
changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file}, targetName, changeListManager);
}
示例5: testDoubleMove
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testDoubleMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
final LocalChangeList target2 = changeListManager.addChangeList("target2", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file)});
myScheme.doTest(new Runnable() {
@Override
public void run() {
changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, target.getName(), changeListManager);
changeListManager.moveChangesTo(target2, new Change[] {changeListManager.getChange(file)});
checkFilesAreInList(new VirtualFile[] {file}, target2.getName(), changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file}, target2.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file}, target2.getName(), changeListManager);
}
示例6: testComplex
import com.intellij.openapi.vcs.changes.ChangeListManager; //导入方法依赖的package包/类
@Test
public void testComplex() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final VirtualFile fileB = createFileInCommand("b.txt", "old content");
final VirtualFile fileC = createFileInCommand("c.txt", "old content");
final VirtualFile fileD = createFileInCommand("d.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList toBeDeletedList = changeListManager.addChangeList("toBeDeletedList", null);
changeListManager.moveChangesTo(list, new Change[] {changeListManager.getChange(file), changeListManager.getChange(fileB)});
changeListManager.moveChangesTo(toBeDeletedList, new Change[] {changeListManager.getChange(fileC), changeListManager.getChange(fileD)});
changeListManager.ensureUpToDate(false);
final String targetName = "target";
final String finalName = "final list name";
myScheme.doTest(new Runnable() {
@Override
public void run() {
final LocalChangeList target = changeListManager.addChangeList(targetName, null);
changeListManager.moveChangesTo(target, new Change[] {changeListManager.getChange(file), changeListManager.getChange(fileB)});
checkFilesAreInList(new VirtualFile[] {file, fileB}, targetName, changeListManager);
changeListManager.editName(targetName, finalName);
checkFilesAreInList(new VirtualFile[] {file, fileB}, finalName, changeListManager);
changeListManager.removeChangeList(toBeDeletedList.getName());
checkFilesAreInList(new VirtualFile[] {fileC, fileD}, myDefaulListName, changeListManager);
changeListManager.moveChangesTo(LocalChangeList.createEmptyChangeList(myProject, finalName),
new Change[] {changeListManager.getChange(fileC)});
checkFilesAreInList(new VirtualFile[] {file, fileB, fileC}, finalName, changeListManager);
checkFilesAreInList(new VirtualFile[] {fileD}, myDefaulListName, changeListManager);
}
});
checkFilesAreInList(new VirtualFile[] {file, fileB, fileC}, finalName, changeListManager);
checkFilesAreInList(new VirtualFile[] {fileD}, myDefaulListName, changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] {file, fileB, fileC}, finalName, changeListManager);
checkFilesAreInList(new VirtualFile[] {fileD}, myDefaulListName, changeListManager);
}