当前位置: 首页>>代码示例>>Java>>正文


Java ChangeListManager.addChangeList方法代码示例

本文整理汇总了Java中com.intellij.openapi.vcs.changes.ChangeListManager.addChangeList方法的典型用法代码示例。如果您正苦于以下问题:Java ChangeListManager.addChangeList方法的具体用法?Java ChangeListManager.addChangeList怎么用?Java ChangeListManager.addChangeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.vcs.changes.ChangeListManager的用法示例。


在下文中一共展示了ChangeListManager.addChangeList方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SvnConcurrentChangeListManagerTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SvnConcurrentChangeListManagerTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnConcurrentChangeListManagerTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnConcurrentChangeListManagerTest.java

示例5: 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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ChangeListChooserPanel.java

示例6: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SvnConcurrentChangeListManagerTest.java

示例7: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:44,代码来源:SvnConcurrentChangeListManagerTest.java


注:本文中的com.intellij.openapi.vcs.changes.ChangeListManager.addChangeList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。