本文整理汇总了Java中com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener类的典型用法代码示例。如果您正苦于以下问题:Java VcsAnnotationLocalChangesListener类的具体用法?Java VcsAnnotationLocalChangesListener怎么用?Java VcsAnnotationLocalChangesListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VcsAnnotationLocalChangesListener类属于com.intellij.openapi.vcs.changes包,在下文中一共展示了VcsAnnotationLocalChangesListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testClosedByCommitFromIdea
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByCommitFromIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
myDirtyScopeManager.fileDirty(tree.myS1File);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例2: testClosedByExternalUpdate
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByExternalUpdate() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
update();
myWorkingCopyDir.refresh(false, true);
imitateEvent(myWorkingCopyDir);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例3: testNotClosedByRenaming
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testNotClosedByRenaming() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
VcsTestUtil.renameFileInCommand(myProject, tree.myS1File, "5364536");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
}
示例4: testAnnotateRenamed
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testAnnotateRenamed() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
}
示例5: testClosedByExternalCommit
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByExternalCommit() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
checkin();
myWorkingCopyDir.refresh(false, true);
imitateEvent(myWorkingCopyDir);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例6: testClosedByUpdateInIdea
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
imitUpdate(myProject);
Assert.assertTrue(myIsClosed);
}
示例7: testClosedChangedByUpdateInIdea
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedChangedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = createTestAnnotation(myVcs.getAnnotationProvider(), tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
VcsTestUtil.editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
imitUpdate(myProject);
Assert.assertTrue(myIsClosed);
}
示例8: annotateFirst
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
private void annotateFirst(final VirtualFile first) throws VcsException {
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(first);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myFirstClosed = true;
listener.unregisterAnnotation(first, annotation);
}
});
listener.registerAnnotation(first, annotation);
}
示例9: annotateSecond
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
private void annotateSecond() throws VcsException {
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(second);
annotation.setCloser(new Runnable() {
@Override
public void run() {
mySecondClosed = true;
listener.unregisterAnnotation(second, annotation);
}
});
listener.registerAnnotation(second, annotation);
}
示例10: testClosedByCommitFromIdea
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByCommitFromIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
final List<VcsException> exceptions = myVcs.getCheckinEnvironment().commit(Collections.singletonList(change), "commit");
Assert.assertTrue(exceptions == null || exceptions.isEmpty());
myDirtyScopeManager.fileDirty(tree.myS1File);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例11: testClosedByExternalUpdate
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByExternalUpdate() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2"); // take #2
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
update();
myWorkingCopyDir.refresh(false, true);
imitateEvent(myWorkingCopyDir);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例12: testNotClosedByRenaming
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testNotClosedByRenaming() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
Assert.assertFalse(myIsClosed); // not closed on typing
renameFileInCommand(myProject, tree.myS1File, "5364536");
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
}
示例13: testAnnotateRenamed
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testAnnotateRenamed() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin();
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4++\n");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
Assert.assertFalse(myIsClosed); // not closed on typing
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
final Change change = myChangeListManager.getChange(tree.myS1File);
Assert.assertNotNull(change);
}
示例14: testClosedByExternalCommit
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByExternalCommit() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
editFileInCommand(myProject, tree.myS1File, "1+\n2\n3\n4\n");
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
Assert.assertFalse(myIsClosed);
checkin();
myWorkingCopyDir.refresh(false, true);
imitateEvent(myWorkingCopyDir);
myChangeListManager.ensureUpToDate(false);
myChangeListManager.ensureUpToDate(false); // wait for after-events like annotations recalculation
sleep(100); // zipper updater
Assert.assertTrue(myIsClosed);
}
示例15: testClosedByUpdateInIdea
import com.intellij.openapi.vcs.changes.VcsAnnotationLocalChangesListener; //导入依赖的package包/类
@Test
public void testClosedByUpdateInIdea() throws Exception {
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin(); //#1
editFileInCommand(myProject, tree.myS1File, "1\n2\n3\n4\n");
checkin(); //#2
editFileInCommand(myProject, tree.myS1File, "1\n2\n3**\n4\n");
checkin(); //#3
runInAndVerifyIgnoreOutput("up", "-r", "2");
final VcsAnnotationLocalChangesListener listener = ProjectLevelVcsManager.getInstance(myProject).getAnnotationLocalChangesListener();
final FileAnnotation annotation = myVcs.getAnnotationProvider().annotate(tree.myS1File);
annotation.setCloser(new Runnable() {
@Override
public void run() {
myIsClosed = true;
listener.unregisterAnnotation(tree.myS1File, annotation);
}
});
listener.registerAnnotation(tree.myS1File, annotation);
myDirtyScopeManager.markEverythingDirty();
myChangeListManager.ensureUpToDate(false);
imitUpdate(myProject);
Assert.assertTrue(myIsClosed);
}