本文整理汇总了Java中com.intellij.openapi.vcs.changes.VcsDirtyScopeManager类的典型用法代码示例。如果您正苦于以下问题:Java VcsDirtyScopeManager类的具体用法?Java VcsDirtyScopeManager怎么用?Java VcsDirtyScopeManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VcsDirtyScopeManager类属于com.intellij.openapi.vcs.changes包,在下文中一共展示了VcsDirtyScopeManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: VcsVFSListener
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
protected VcsVFSListener(@NotNull Project project, @NotNull AbstractVcs vcs) {
myProject = project;
myVcs = vcs;
myChangeListManager = ChangeListManager.getInstance(project);
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
final MyVirtualFileAdapter myVFSListener = new MyVirtualFileAdapter();
final MyCommandAdapter myCommandListener = new MyCommandAdapter();
myVcsManager = ProjectLevelVcsManager.getInstance(project);
myAddOption = myVcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.ADD, vcs);
myRemoveOption = myVcsManager.getStandardConfirmation(VcsConfiguration.StandardConfirmation.REMOVE, vcs);
VirtualFileManager.getInstance().addVirtualFileListener(myVFSListener, this);
CommandProcessor.getInstance().addCommandListener(myCommandListener, this);
myVcsFileListenerContextHelper = VcsFileListenerContextHelper.getInstance(myProject);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VcsVFSListener.java
示例2: LineStatusTracker
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private LineStatusTracker(@NotNull final Document document,
@NotNull final Document vcsDocument,
@NotNull final Project project,
@NotNull final VirtualFile virtualFile,
@NotNull final Mode mode) {
myDocument = document;
myVcsDocument = vcsDocument;
myProject = project;
myVirtualFile = virtualFile;
myApplication = ApplicationManager.getApplication();
myFileEditorManager = FileEditorManager.getInstance(myProject);
myVcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
myMode = mode;
myRanges = new ArrayList<Range>();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LineStatusTracker.java
示例3: editFiles
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
public static void editFiles(final Project project, final List<VirtualFile> files, final List<VcsException> exceptions) {
ChangesUtil.processVirtualFilesByVcs(project, files, new ChangesUtil.PerVcsProcessor<VirtualFile>() {
public void process(final AbstractVcs vcs, final List<VirtualFile> items) {
final EditFileProvider provider = vcs.getEditFileProvider();
if (provider != null) {
try {
provider.editFiles(VfsUtil.toVirtualFileArray(items));
}
catch (VcsException e1) {
exceptions.add(e1);
}
for(VirtualFile file: items) {
VcsDirtyScopeManager.getInstance(project).fileDirty(file);
FileStatusManager.getInstance(project).fileStatusChanged(file);
}
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:EditAction.java
示例4: postRefresh
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private static void postRefresh(Project project, VirtualFile[] files) {
VcsDirtyScopeManager dirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
for (VirtualFile f : files) {
if (f.isDirectory()) {
dirtyScopeManager.dirDirtyRecursively(f);
}
else {
dirtyScopeManager.fileDirty(f);
}
}
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo(IdeBundle.message("action.sync.completed.successfully", getMessage(files)));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SynchronizeCurrentFileAction.java
示例5: testAddDirEditFileAndAfterRevert
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Test
public void testAddDirEditFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final List<VirtualFile> files = getAllFiles(subTree);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VfsUtil.toVirtualFileArray(files), clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.myRootDir, "source");
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.myRootDir, "target");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager);
for (VirtualFile file : files) {
Assert.assertTrue(file.getPath(), clManager.isUnversioned(file));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnChangesCorrectlyRefreshedTest.java
示例6: testRenameFileAndAfterRevert
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Test
public void testRenameFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
final String newName = "newName";
renameFileInCommand(subTree.myS1File, newName);
assertVF(subTree.mySourceDir, newName);
sleep(300);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.myS1File}, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.mySourceDir, "s1.txt");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:SvnChangesCorrectlyRefreshedTest.java
示例7: refreshFiles
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private void refreshFiles(final Project project) {
final List<VirtualFile> toRefreshFiles = new ArrayList<VirtualFile>();
final List<VirtualFile> toRefreshDirs = new ArrayList<VirtualFile>();
for (VirtualFile file : myFilesToRefresh) {
if (file == null) continue;
if (file.isDirectory()) {
toRefreshDirs.add(file);
} else {
toRefreshFiles.add(file);
}
}
// if refresh asynchronously, local changes would also be notified that they are dirty asynchronously,
// and commit could be executed while not all changes are visible
filterOutInvalid(myFilesToRefresh);
RefreshQueue.getInstance().refresh(true, true, new Runnable() {
public void run() {
if (project.isDisposed()) return;
filterOutInvalid(toRefreshFiles);
filterOutInvalid(toRefreshDirs);
final VcsDirtyScopeManager vcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
vcsDirtyScopeManager.filesDirty(toRefreshFiles, toRefreshDirs);
}
}, myFilesToRefresh);
myFilesToRefresh.clear();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnFileSystemListener.java
示例8: createDeleteRunnable
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private static Runnable createDeleteRunnable(final Project project,
final SvnVcs vcs,
final Collection<FilePath> filesToProcess,
final List<VcsException> exceptions) {
return new Runnable() {
public void run() {
for(FilePath file: filesToProcess) {
VirtualFile vFile = file.getVirtualFile(); // for deleted directories
final File ioFile = new File(file.getPath());
try {
createDeleteAction(vcs, ioFile, true).execute();
if (vFile != null && vFile.isValid() && vFile.isDirectory()) {
vFile.refresh(true, true);
VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(vFile);
}
else {
VcsDirtyScopeManager.getInstance(project).fileDirty(file);
}
}
catch (VcsException e) {
exceptions.add(e);
}
}
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnFileSystemListener.java
示例9: MyUpdateSessionAdapter
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private MyUpdateSessionAdapter(@NotNull final FilePath[] contentRoots, final UpdatedFiles updatedFiles, final List<VcsException> exceptions) {
super(exceptions, false);
myContentRoots = contentRoots;
myUpdatedFiles = updatedFiles;
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myVcs.getProject());
if (! isDryRun()) {
myGroupWorkers = Arrays.asList(new MyTextConflictWorker(), new MyConflictWorker(FileGroup.MERGED_WITH_PROPERTY_CONFLICT_ID) {
protected List<VirtualFile> merge() {
return null;
}
}, new MyTreeConflictWorker(), new MyReplacedWorker());
} else {
myGroupWorkers = Collections.emptyList();
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AbstractSvnUpdateIntegrateEnvironment.java
示例10: finishActions
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private void finishActions(final boolean wasCanceled) {
if (! wasCanceled) {
if (! ApplicationManager.getApplication().isUnitTestMode() &&
(! myDryRun) && (myExceptions.isEmpty()) && (! myAccumulatedFiles.containErrors()) &&
((! myAccumulatedFiles.isEmpty()) || (myMergeTarget != null))) {
if (myInfo.isUnderProjectRoot()) {
showLocalCommit();
} else {
showAlienCommit();
}
return;
}
}
final Collection<FilePath> files = gatherChangedPaths();
VcsDirtyScopeManager.getInstance(myProject).filePathsDirty(files, null);
prepareAndShowResults();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnIntegrateChangesTask.java
示例11: showLocalCommit
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private void showLocalCommit() {
final Collection<FilePath> files = gatherChangedPaths();
// for changes to be detected, we need switch to background change list manager update thread and back to dispatch thread
// so callback is used; ok to be called after VCS update markup closed: no remote operations
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.invokeAfterUpdate(new Runnable() {
public void run() {
Collection<Change> changes = new ArrayList<Change>();
for (FilePath file : files) {
ContainerUtil.addIfNotNull(changes, changeListManager.getChange(file));
}
CommitChangeListDialog.commitChanges(myProject, changes, null, null, myMerger.getComment());
prepareAndShowResults();
}
}, InvokeAfterUpdateMode.SYNCHRONOUS_CANCELLABLE, myTitle,
new Consumer<VcsDirtyScopeManager>() {
public void consume(final VcsDirtyScopeManager vcsDirtyScopeManager) {
vcsDirtyScopeManager.filePathsDirty(files, null);
}
}, null);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnIntegrateChangesTask.java
示例12: testMoveFileAndAfterRevert
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Test
public void testMoveFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
moveFileInCommand(subTree.myS1File, subTree.myTargetDir);
assertVF(subTree.myTargetDir, "s1.txt");
sleep(300);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {subTree.myS1File}, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.mySourceDir, "s1.txt");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SvnChangesCorrectlyRefreshedNativeTest.java
示例13: testAddDirEditFileAndAfterRevert
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Test
public void testAddDirEditFileAndAfterRevert() throws Throwable {
final SubTree subTree = new SubTree(myWorkingCopyDir);
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final List<VirtualFile> files = getAllFiles(subTree);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(VfsUtil.toVirtualFileArray(files), clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
assertVF(subTree.myRootDir, "source");
assertVF(subTree.mySourceDir, "s1.txt");
assertVF(subTree.myRootDir, "target");
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager);
for (VirtualFile file : files) {
Assert.assertTrue(file.getPath(), clManager.isUnversioned(file));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnChangesCorrectlyRefreshedNativeTest.java
示例14: testModificationAndAfterRevert
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Test
public void testModificationAndAfterRevert() throws Exception {
final SubTree subTree = new SubTree(myWorkingCopyDir);
checkin();
sleep(100);
VcsTestUtil.editFileInCommand(myProject, subTree.myS1File, "new content");
final CharSequence text1 = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals("new content", text1.toString());
sleep(100);
LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(subTree.myS1File.getPath()));
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
final VcsException updateException = ((ChangeListManagerImpl)clManager).getUpdateException();
if (updateException != null) {
updateException.printStackTrace();
}
Assert.assertNull(updateException == null ? null : updateException.getMessage(), updateException);
DuringChangeListManagerUpdateTestScheme
.checkFilesAreInList(new VirtualFile[]{subTree.myS1File}, clManager.getDefaultListName(), clManager);
final Collection<Change> changes = clManager.getDefaultChangeList().getChanges();
final RollbackWorker worker = new RollbackWorker(myProject);
worker.doRollback(changes, false, null, null);
final CharSequence text = LoadTextUtil.loadText(subTree.myS1File);
Assert.assertEquals(SubTree.ourS1Contents, text.toString());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
DuringChangeListManagerUpdateTestScheme.checkFilesAreInList(new VirtualFile[] {}, clManager.getDefaultListName(), clManager);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:SvnChangesCorrectlyRefreshedNativeTest.java
示例15: setUp
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
myVcs = SvnVcs.getInstance(myProject);
myChangeListManager = ChangeListManager.getInstance(myProject);
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
myIsClosed = false;
myIsClosed1 = false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnAnnotationIsClosedTest.java
示例16: doRefresh
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
public static void doRefresh(final Project project) {
if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) return;
FileDocumentManager.getInstance().saveAllDocuments();
invokeCustomRefreshes(project);
VirtualFileManager.getInstance().asyncRefresh(new Runnable() {
public void run() {
// already called in EDT or under write action
if (!project.isDisposed()) {
VcsDirtyScopeManager.getInstance(project).markEverythingDirty();
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:RefreshAction.java
示例17: actionPerformed
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
if (file != null) {
VcsDirtyScopeManager.getInstance(project).fileDirty(file);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MarkFileDirtyAction.java
示例18: markFilesDirty
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
public static void markFilesDirty(@NotNull Project project, @NotNull Collection<VirtualFile> affectedFiles) {
final VcsDirtyScopeManager dirty = VcsDirtyScopeManager.getInstance(project);
for (VirtualFile file : affectedFiles) {
if (file.isDirectory()) {
dirty.dirDirtyRecursively(file);
}
else {
dirty.fileDirty(file);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:VcsFileUtil.java
示例19: testImpl
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
private void testImpl(VirtualFile file) {
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
clManager.ensureUpToDate(false);
Assert.assertTrue(clManager.getDefaultChangeList().getChanges().isEmpty());
VcsDirtyScopeManager.getInstance(myProject).fileDirty(file);
clManager.ensureUpToDate(false);
Assert.assertTrue(clManager.getDefaultChangeList().getChanges().isEmpty());
final FileStatus status = clManager.getStatus(file);
Assert.assertTrue(status.getText(), FileStatus.IGNORED.equals(status));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnIgnoreTest.java
示例20: execute
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; //导入依赖的package包/类
public void execute() {
saveAllDocuments();
AccessToken token = DvcsUtil.workingTreeChangeStarted(myProject);
Map<GitRepository, GitCommandResult> results = ContainerUtil.newHashMap();
try {
for (Map.Entry<GitRepository, VcsFullCommitDetails> entry : myCommits.entrySet()) {
GitRepository repository = entry.getKey();
VirtualFile root = repository.getRoot();
String target = entry.getValue().getId().asString();
GitLocalChangesWouldBeOverwrittenDetector detector = new GitLocalChangesWouldBeOverwrittenDetector(root, RESET);
GitCommandResult result = myGit.reset(repository, myMode, target, detector);
if (!result.success() && detector.wasMessageDetected()) {
GitCommandResult smartResult = proposeSmartReset(detector, repository, target);
if (smartResult != null) {
result = smartResult;
}
}
results.put(repository, result);
repository.update();
VfsUtil.markDirtyAndRefresh(true, true, false, root);
VcsDirtyScopeManager.getInstance(myProject).dirDirtyRecursively(root);
}
}
finally {
DvcsUtil.workingTreeChangeFinished(myProject, token);
}
notifyResult(results);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:GitResetOperation.java
注:本文中的com.intellij.openapi.vcs.changes.VcsDirtyScopeManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论