mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -158,7 +158,7 @@ final class ImageEditorImpl extends VirtualFileAdapter implements ImageEditor {
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
super.propertyChanged(event);
|
||||
if (file.equals(event.getFile())) {
|
||||
// Change document
|
||||
@@ -177,7 +177,7 @@ final class ImageEditorImpl extends VirtualFileAdapter implements ImageEditor {
|
||||
}
|
||||
}
|
||||
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
super.contentsChanged(event);
|
||||
if (file.equals(event.getFile())) {
|
||||
// Change document
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -523,7 +523,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
}
|
||||
|
||||
private final class VFSListener extends VirtualFileAdapter {
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
if (list != null) {
|
||||
int index = ((DefaultListModel) list.getModel()).indexOf(file);
|
||||
@@ -534,7 +534,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
VirtualFile root = thumbnailView.getRoot();
|
||||
if (root != null && VfsUtil.isAncestor(file, root, false)) {
|
||||
@@ -545,15 +545,15 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -1413,7 +1413,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
}
|
||||
|
||||
private class MyVfsListener extends VirtualFileAdapter {
|
||||
public void propertyChanged(final VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull final VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
final VirtualFile eventFile = event.getFile();
|
||||
final VirtualFile parent = event.getParent();
|
||||
@@ -1459,23 +1459,23 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
}
|
||||
}
|
||||
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
markDirtyIfSource(event.getFile(), false);
|
||||
}
|
||||
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
processNewFile(event.getFile(), true);
|
||||
}
|
||||
|
||||
public void fileCopied(final VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull final VirtualFileCopyEvent event) {
|
||||
processNewFile(event.getFile(), true);
|
||||
}
|
||||
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
processNewFile(event.getFile(), true);
|
||||
}
|
||||
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
if (myWatchedProjectsCount == 0) return;
|
||||
final VirtualFile eventFile = event.getFile();
|
||||
if ((LOG.isDebugEnabled() && eventFile.isDirectory()) || ourDebugMode) {
|
||||
@@ -1573,7 +1573,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
|
||||
notifyFilesDeleted(pathsToMark);
|
||||
}
|
||||
|
||||
public void beforeFileMovement(final VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull final VirtualFileMoveEvent event) {
|
||||
markDirtyIfSource(event.getFile(), true);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -71,7 +71,7 @@ public class ArtifactVirtualFileListener extends VirtualFileAdapter {
|
||||
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
final String oldPath = event.getOldParent().getPath() + "/" + event.getFileName();
|
||||
filePathChanged(oldPath, event.getNewParent().getPath() + "/" + event.getFileName());
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class ArtifactVirtualFileListener extends VirtualFileAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
final VirtualFile parent = event.getParent();
|
||||
if (parent != null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.MultiValuesMap;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.descriptors.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -49,11 +50,11 @@ public class ConfigFileContainerImpl implements ConfigFileContainer {
|
||||
myMetaDataProvider = descriptorMetaDataProvider;
|
||||
myProject = project;
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
public void propertyChanged(final VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull final VirtualFilePropertyEvent event) {
|
||||
fileChanged(event.getFile());
|
||||
}
|
||||
|
||||
public void fileMoved(final VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull final VirtualFileMoveEvent event) {
|
||||
fileChanged(event.getFile());
|
||||
}
|
||||
}, this);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -777,27 +777,27 @@ public class ExternalAnnotationsManagerImpl extends ReadableExternalAnnotationsM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull VirtualFileCopyEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +31,7 @@ import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.testFramework.IdeaTestCase;
|
||||
import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.model.java.JavaResourceRootType;
|
||||
import org.jetbrains.jps.model.java.JavaSourceRootType;
|
||||
@@ -501,7 +502,7 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
final List<VirtualFile> created = new ArrayList<VirtualFile>();
|
||||
VirtualFileListener l = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
VirtualFile file = e.getFile();
|
||||
checkInfoNull(file);
|
||||
created.add(file);
|
||||
@@ -562,7 +563,7 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
|
||||
VirtualFileListener l = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
assertEquals("dir", e.getFileName());
|
||||
|
||||
VirtualFile file = e.getFile();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MovePackageAsDirectoryTest extends MultiFileTestCase {
|
||||
final boolean [] fileWasDeleted = new boolean[]{false};
|
||||
final VirtualFileAdapter fileAdapter = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
fileWasDeleted[0] = !event.getFile().isDirectory();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -70,5 +70,5 @@ public abstract class FileDocumentManager implements SavingRequestor {
|
||||
return getInstance().requestWriting(document, project);
|
||||
}
|
||||
|
||||
public abstract void reloadFiles(VirtualFile... files);
|
||||
public abstract void reloadFiles(@NotNull VirtualFile... files);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,45 +15,47 @@
|
||||
*/
|
||||
package com.intellij.openapi.vfs;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class VirtualFileAdapter implements VirtualFileListener {
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event){
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event){
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event){
|
||||
public void fileCreated(@NotNull VirtualFileEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event){
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event){
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull VirtualFileCopyEvent event) {
|
||||
fileCreated(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent event){
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(VirtualFileEvent event){
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent event){
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileMovement(VirtualFileMoveEvent event){
|
||||
public void beforeFileMovement(@NotNull VirtualFileMoveEvent event){
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.intellij.openapi.vfs;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
/**
|
||||
@@ -30,68 +32,68 @@ public interface VirtualFileListener extends EventListener {
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void propertyChanged(VirtualFilePropertyEvent event);
|
||||
void propertyChanged(@NotNull VirtualFilePropertyEvent event);
|
||||
|
||||
/**
|
||||
* Fired when the contents of a virtual file is changed.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void contentsChanged(VirtualFileEvent event);
|
||||
void contentsChanged(@NotNull VirtualFileEvent event);
|
||||
|
||||
/**
|
||||
* Fired when a virtual file is created. This event is not fired for files discovered during initial VFS initialization.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void fileCreated(VirtualFileEvent event);
|
||||
void fileCreated(@NotNull VirtualFileEvent event);
|
||||
|
||||
/**
|
||||
* Fired when a virtual file is deleted.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void fileDeleted(VirtualFileEvent event);
|
||||
void fileDeleted(@NotNull VirtualFileEvent event);
|
||||
|
||||
/**
|
||||
* Fired when a virtual file is moved from within IDEA.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void fileMoved(VirtualFileMoveEvent event);
|
||||
void fileMoved(@NotNull VirtualFileMoveEvent event);
|
||||
|
||||
/**
|
||||
* Fired when a virtual file is copied from within IDEA.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void fileCopied(VirtualFileCopyEvent event);
|
||||
void fileCopied(@NotNull VirtualFileCopyEvent event);
|
||||
|
||||
/**
|
||||
* Fired before the change of a name or writable status of a file is processed.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void beforePropertyChange(VirtualFilePropertyEvent event);
|
||||
void beforePropertyChange(@NotNull VirtualFilePropertyEvent event);
|
||||
|
||||
/**
|
||||
* Fired before the change of contents of a file is processed.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void beforeContentsChange(VirtualFileEvent event);
|
||||
void beforeContentsChange(@NotNull VirtualFileEvent event);
|
||||
|
||||
/**
|
||||
* Fired before the deletion of a file is processed.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void beforeFileDeletion(VirtualFileEvent event);
|
||||
void beforeFileDeletion(@NotNull VirtualFileEvent event);
|
||||
|
||||
/**
|
||||
* Fired before the movement of a file is processed.
|
||||
*
|
||||
* @param event the event object containing information about the change.
|
||||
*/
|
||||
void beforeFileMovement(VirtualFileMoveEvent event);
|
||||
void beforeFileMovement(@NotNull VirtualFileMoveEvent event);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,7 +58,7 @@ public class BulkVirtualFileListenerAdapter implements BulkFileListener {
|
||||
}
|
||||
}
|
||||
|
||||
public static void fireAfter(VirtualFileListener adapted, final VFileEvent event) {
|
||||
public static void fireAfter(@NotNull VirtualFileListener adapted, @NotNull VFileEvent event) {
|
||||
if (event instanceof VFileContentChangeEvent) {
|
||||
final VFileContentChangeEvent ce = (VFileContentChangeEvent)event;
|
||||
final VirtualFile file = ce.getFile();
|
||||
@@ -95,7 +95,7 @@ public class BulkVirtualFileListenerAdapter implements BulkFileListener {
|
||||
}
|
||||
}
|
||||
|
||||
public static void fireBefore(VirtualFileListener adapted, final VFileEvent event) {
|
||||
public static void fireBefore(@NotNull VirtualFileListener adapted, @NotNull VFileEvent event) {
|
||||
if (event instanceof VFileContentChangeEvent) {
|
||||
final VFileContentChangeEvent ce = (VFileContentChangeEvent)event;
|
||||
final VirtualFile file = ce.getFile();
|
||||
|
||||
+2
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -90,8 +90,7 @@ public class VFileContentChangeEvent extends VFileEvent {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = myFile.hashCode();
|
||||
int result = myFile.hashCode();
|
||||
result = 31 * result + (int)(myOldModificationStamp ^ (myOldModificationStamp >>> 32));
|
||||
result = 31 * result + (int)(myNewModificationStamp ^ (myNewModificationStamp >>> 32));
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -110,7 +110,7 @@ public class MockFileDocumentManagerImpl extends FileDocumentManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadFiles(final VirtualFile... files) {
|
||||
public void reloadFiles(@NotNull final VirtualFile... files) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -247,57 +247,57 @@ public class VirtualFileManagerImpl extends VirtualFileManagerEx {
|
||||
|
||||
private static class LoggingListener implements VirtualFileListener {
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
LOG.debug("propertyChanged: file = " + event.getFile() + ", propertyName = " + event.getPropertyName() +
|
||||
", oldValue = " + event.getOldValue() + ", newValue = " + event.getNewValue() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
LOG.debug("contentsChanged: file = " + event.getFile() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
LOG.debug("fileCreated: file = " + event.getFile() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
LOG.debug("fileDeleted: file = " + event.getFile() + ", parent = " + event.getParent() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
LOG.debug("fileMoved: file = " + event.getFile() + ", oldParent = " + event.getOldParent() +
|
||||
", newParent = " + event.getNewParent() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull VirtualFileCopyEvent event) {
|
||||
LOG.debug("fileCopied: file = " + event.getFile() + "originalFile = " + event.getOriginalFile() +
|
||||
", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event) {
|
||||
LOG.debug("beforeContentsChange: file = " + event.getFile() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent event) {
|
||||
LOG.debug("beforePropertyChange: file = " + event.getFile() + ", propertyName = " + event.getPropertyName() +
|
||||
", oldValue = " + event.getOldValue() + ", newValue = " + event.getNewValue() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {
|
||||
LOG.debug("beforeFileDeletion: file = " + event.getFile() + ", requestor = " + event.getRequestor());
|
||||
LOG.assertTrue(event.getFile().isValid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileMovement(VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull VirtualFileMoveEvent event) {
|
||||
LOG.debug("beforeFileMovement: file = " + event.getFile() + ", oldParent = " + event.getOldParent() +
|
||||
", newParent = " + event.getNewParent() + ", requestor = " + event.getRequestor());
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ public class DaemonListeners implements Disposable {
|
||||
actionManagerEx.addAnActionListener(new MyAnActionListener(), this);
|
||||
virtualFileManager.addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
String propertyName = event.getPropertyName();
|
||||
if (VirtualFile.PROP_NAME.equals(propertyName)) {
|
||||
stopDaemonAndRestartAllFiles();
|
||||
|
||||
@@ -340,7 +340,7 @@ public class ModuleImpl extends PlatformComponentManagerImpl implements ModuleEx
|
||||
|
||||
private class MyVirtualFileListener extends VirtualFileAdapter {
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (!isModuleAdded) return;
|
||||
final Object requestor = event.getRequestor();
|
||||
if (MODULE_RENAMING_REQUESTOR.equals(requestor)) return;
|
||||
@@ -379,7 +379,7 @@ public class ModuleImpl extends PlatformComponentManagerImpl implements ModuleEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
final VirtualFile oldParent = event.getOldParent();
|
||||
final VirtualFile newParent = event.getNewParent();
|
||||
final String dirName = event.getFileName();
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -66,7 +66,7 @@ public class ProjectJdkTableImpl extends ProjectJdkTable implements PersistentSt
|
||||
// support external changes to jdk libraries (Endorsed Standards Override)
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
updateJdks(event.getFile());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -178,7 +178,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
|
||||
|
||||
private class MyVirtualFileListener extends VirtualFileAdapter implements BulkFileListener {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
|
||||
if (!file.isDirectory()) return;
|
||||
@@ -272,7 +272,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
|
||||
private final Key<int[]> FILES_TO_RELEASE_KEY = Key.create("DirectoryIndexImpl.MyVirtualFileListener.FILES_TO_RELEASE_KEY");
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
if (!file.isDirectory()) return;
|
||||
if (myState.getInfo(((NewVirtualFile)file).getId()) == null) return;
|
||||
@@ -297,7 +297,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
final int[] list = file.getUserData(FILES_TO_RELEASE_KEY);
|
||||
if (list == null) return;
|
||||
@@ -326,7 +326,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
if (file.isDirectory()) {
|
||||
doInitialize();
|
||||
@@ -335,7 +335,7 @@ public class DirectoryIndexImpl extends DirectoryIndex {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
VirtualFile file = event.getFile();
|
||||
if (file.isDirectory()) {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -86,7 +86,7 @@ public class ClasspathStorage implements StateStorage {
|
||||
final Listener listener = messageBus.syncPublisher(STORAGE_TOPIC);
|
||||
virtualFileTracker.addTracker(file.getUrl(), new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
listener.storageFileChanged(event, ClasspathStorage.this);
|
||||
}
|
||||
}, true, module);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -155,7 +155,7 @@ public class PlaybackDebugger implements UiDebuggerExtension, PlaybackRunner.Sta
|
||||
|
||||
myVfsListener = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
final VirtualFile file = pathToFile();
|
||||
if (file != null && file.equals(event.getFile())) {
|
||||
loadFrom(event.getFile());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -1924,7 +1924,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
|
||||
private final ManagingFS myManagingFS = ManagingFS.getInstance();
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
markDirty(event, false);
|
||||
}
|
||||
|
||||
|
||||
+9
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import com.intellij.openapi.command.CommandListener;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements VirtualFileManagerListener, CommandListener {
|
||||
private static final Key<Boolean> WAS_VERSIONED_KEY =
|
||||
@@ -81,7 +82,7 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
beginChangeSet();
|
||||
createRecursively(e.getFile());
|
||||
endChangeSet(null);
|
||||
@@ -99,7 +100,7 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(VirtualFileEvent e) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent e) {
|
||||
if (!areContentChangesVersioned(e)) return;
|
||||
VirtualFile f = e.getFile();
|
||||
|
||||
@@ -110,7 +111,7 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent e) {
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent e) {
|
||||
if (VirtualFile.PROP_NAME.equals(e.getPropertyName())) {
|
||||
VirtualFile f = e.getFile();
|
||||
f.putUserData(WAS_VERSIONED_KEY, myGateway.isVersioned(f));
|
||||
@@ -118,7 +119,7 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent e) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent e) {
|
||||
if (VirtualFile.PROP_NAME.equals(e.getPropertyName())) {
|
||||
VirtualFile f = e.getFile();
|
||||
|
||||
@@ -142,13 +143,13 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileMovement(VirtualFileMoveEvent e) {
|
||||
public void beforeFileMovement(@NotNull VirtualFileMoveEvent e) {
|
||||
VirtualFile f = e.getFile();
|
||||
f.putUserData(WAS_VERSIONED_KEY, myGateway.isVersioned(f));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent e) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent e) {
|
||||
VirtualFile f = e.getFile();
|
||||
|
||||
boolean isVersioned = myGateway.isVersioned(f);
|
||||
@@ -162,7 +163,7 @@ public class LocalHistoryEventDispatcher extends VirtualFileAdapter implements V
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent e) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent e) {
|
||||
VirtualFile f = e.getFile();
|
||||
Entry entry = myGateway.createEntryForDeletion(f);
|
||||
if (entry != null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.util.FileContentUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -85,18 +86,18 @@ public class FileUndoProvider extends VirtualFileAdapter implements UndoProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
processEvent(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent e) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent e) {
|
||||
if (!e.getPropertyName().equals(VirtualFile.PROP_NAME)) return;
|
||||
processEvent(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent e) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent e) {
|
||||
processEvent(e);
|
||||
}
|
||||
|
||||
@@ -111,14 +112,14 @@ public class FileUndoProvider extends VirtualFileAdapter implements UndoProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(VirtualFileEvent e) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent e) {
|
||||
if (shouldNotProcess(e)) return;
|
||||
if (isUndoable(e)) return;
|
||||
registerNonUndoableAction(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent e) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent e) {
|
||||
if (shouldNotProcess(e)) {
|
||||
invalidateActionsFor(e);
|
||||
return;
|
||||
@@ -133,7 +134,7 @@ public class FileUndoProvider extends VirtualFileAdapter implements UndoProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent e) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent e) {
|
||||
VirtualFile f = e.getFile();
|
||||
|
||||
DocumentReference ref = f.getUserData(DELETION_WAS_UNDOABLE);
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,70 +36,70 @@ public class VirtualFileFilteringListener implements VirtualFileListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(final VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull final VirtualFileEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.beforeContentsChange(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.beforeFileDeletion(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileMovement(final VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull final VirtualFileMoveEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.beforeFileMovement(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforePropertyChange(final VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull final VirtualFilePropertyEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.beforePropertyChange(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.contentsChanged(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(final VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull final VirtualFileCopyEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.fileCopied(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.fileCreated(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(final VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull final VirtualFileEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.fileDeleted(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(final VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull final VirtualFileMoveEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.fileMoved(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(final VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull final VirtualFilePropertyEvent event) {
|
||||
if (isGood(event)) {
|
||||
myDelegate.propertyChanged(event);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -53,7 +53,7 @@ public class DocumentReferenceManagerImpl extends DocumentReferenceManager imple
|
||||
public void initComponent() {
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile f = event.getFile();
|
||||
DocumentReference ref = myDeletedFilePathToRef.remove(new FilePath(f.getUrl()));
|
||||
if (ref != null) {
|
||||
@@ -63,13 +63,13 @@ public class DocumentReferenceManagerImpl extends DocumentReferenceManager imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile f = event.getFile();
|
||||
f.putUserData(DELETED_FILES, collectDeletedFiles(f, new ArrayList<VirtualFile>()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile f = event.getFile();
|
||||
List<VirtualFile> files = f.getUserData(DELETED_FILES);
|
||||
f.putUserData(DELETED_FILES, null);
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -72,19 +72,19 @@ public class DirectoryBasedStorage implements StateStorage, Disposable {
|
||||
final Listener listener = messageBus.syncPublisher(STORAGE_TOPIC);
|
||||
virtualFileTracker.addTracker(fileUrl, new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
if (!StringUtil.endsWithIgnoreCase(event.getFile().getName(), ".xml")) return;
|
||||
listener.storageFileChanged(event, DirectoryBasedStorage.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(final VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull final VirtualFileEvent event) {
|
||||
if (!StringUtil.endsWithIgnoreCase(event.getFile().getName(), ".xml")) return;
|
||||
listener.storageFileChanged(event, DirectoryBasedStorage.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
if (!StringUtil.endsWithIgnoreCase(event.getFile().getName(), ".xml")) return;
|
||||
listener.storageFileChanged(event, DirectoryBasedStorage.this);
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -92,17 +92,17 @@ public class FileBasedStorage extends XmlElementStorage {
|
||||
final Listener listener = messageBus.syncPublisher(STORAGE_TOPIC);
|
||||
virtualFileTracker.addTracker(fileUrl, new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
myCachedVirtualFile = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
myCachedVirtualFile = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
if (!isDisposed()) {
|
||||
listener.storageFileChanged(event, FileBasedStorage.this);
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -67,19 +67,19 @@ public class FileTreeBuilder extends AbstractTreeBuilder {
|
||||
private void installVirtualFileListener() {
|
||||
|
||||
VirtualFileAdapter myVirtualFileListener = new VirtualFileAdapter() {
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
getUpdater().addSubtreeToUpdate(getRootNode());
|
||||
}
|
||||
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
getUpdater().addSubtreeToUpdate(getRootNode());
|
||||
}
|
||||
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
getUpdater().addSubtreeToUpdate(getRootNode());
|
||||
}
|
||||
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
getUpdater().addSubtreeToUpdate(getRootNode());
|
||||
}
|
||||
};
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -136,7 +136,7 @@ public class IdeDocumentHistoryImpl extends IdeDocumentHistory implements Projec
|
||||
|
||||
VirtualFileListener fileListener = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
onFileDeleted();
|
||||
}
|
||||
};
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -343,7 +343,7 @@ class TextEditorComponent extends JBLoadingPanel implements DataProvider {
|
||||
*/
|
||||
private final class MyVirtualFileListener extends VirtualFileAdapter{
|
||||
@Override
|
||||
public void propertyChanged(final VirtualFilePropertyEvent e) {
|
||||
public void propertyChanged(@NotNull final VirtualFilePropertyEvent e) {
|
||||
if(VirtualFile.PROP_NAME.equals(e.getPropertyName())){
|
||||
// File can be invalidated after file changes name (extension also
|
||||
// can changes). The editor should be removed if it's invalid.
|
||||
@@ -355,7 +355,7 @@ class TextEditorComponent extends JBLoadingPanel implements DataProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event){
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event){
|
||||
if (event.isFromSave()){ // commit
|
||||
assertThread();
|
||||
VirtualFile file = event.getFile();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -152,12 +152,12 @@ public class SchemesManagerImpl<T extends Scheme, E extends ExternalizableScheme
|
||||
|
||||
system.addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
onFileContentChanged(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
|
||||
if (event.getRequestor() == null && isFileUnder(file, myVFSBaseDir) && !myInsideSave) {
|
||||
@@ -173,7 +173,7 @@ public class SchemesManagerImpl<T extends Scheme, E extends ExternalizableScheme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(final VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull final VirtualFileEvent event) {
|
||||
VirtualFile parent = event.getParent();
|
||||
|
||||
if (event.getRequestor() == null && parent != null && parent.equals(myVFSBaseDir) && !myInsideSave) {
|
||||
|
||||
+5
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,12 +15,14 @@
|
||||
*/
|
||||
package com.intellij.openapi.vfs;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class VirtualFileUrlChangeAdapter extends VirtualFileAdapter {
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
String oldUrl = event.getOldParent().getUrl() + "/" + event.getFileName();
|
||||
String newUrl = event.getNewParent().getUrl() + "/" + event.getFileName();
|
||||
fileUrlChanged(oldUrl, newUrl);
|
||||
@@ -29,7 +31,7 @@ public abstract class VirtualFileUrlChangeAdapter extends VirtualFileAdapter {
|
||||
protected abstract void fileUrlChanged(String oldUrl, String newUrl);
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
final VirtualFile parent = event.getFile().getParent();
|
||||
if (parent != null) {
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,7 +38,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
public VirtualFileTrackerImpl(VirtualFileManager virtualFileManager) {
|
||||
virtualFileManager.addVirtualFileListener(new VirtualFileListener() {
|
||||
@Override
|
||||
public void propertyChanged(final VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull final VirtualFilePropertyEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(final VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull final VirtualFileEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(final VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull final VirtualFileEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(final VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull final VirtualFileMoveEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(final VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull final VirtualFileCopyEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforePropertyChange(final VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull final VirtualFilePropertyEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -108,7 +108,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(final VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull final VirtualFileEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -118,7 +118,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
@@ -128,7 +128,7 @@ public class VirtualFileTrackerImpl implements VirtualFileTracker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileMovement(final VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull final VirtualFileMoveEvent event) {
|
||||
final Collection<VirtualFileListener> listeners = getListeners(event.getFile(), event.isFromRefresh());
|
||||
if (listeners == null) return;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -157,7 +157,7 @@ public class EncodingPanel extends EditorBasedWidget implements StatusBarWidget.
|
||||
}, this);
|
||||
ApplicationManager.getApplication().getMessageBus().connect(this).subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_ENCODING.equals(event.getPropertyName())) {
|
||||
updateForFile(event.getFile());
|
||||
}
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -130,7 +131,7 @@ public class ExternalChangesAndRefreshingTest extends IntegrationTestCase {
|
||||
|
||||
VirtualFileListener l = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
executeSomeCommand();
|
||||
}
|
||||
};
|
||||
@@ -159,7 +160,7 @@ public class ExternalChangesAndRefreshingTest extends IntegrationTestCase {
|
||||
final String[] content = new String[1];
|
||||
VirtualFileListener l = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent e) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent e) {
|
||||
try {
|
||||
if (!e.getFile().getPath().equals(path)) return;
|
||||
content[0] = new String(e.getFile().contentsToByteArray());
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.io.ReadOnlyAttributeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -110,12 +111,12 @@ public class FileListeningTest extends IntegrationTestCase {
|
||||
final int[] log = new int[2];
|
||||
VirtualFileListener l = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent e) {
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent e) {
|
||||
log[0] = getRevisionsFor(f).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent e) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent e) {
|
||||
log[1] = getRevisionsFor(f).size();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.vfs.ex.dummy.DummyFileSystem;
|
||||
import com.intellij.testFramework.PlatformLangTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DummyFileSystemTest extends PlatformLangTestCase {
|
||||
private DummyFileSystem fs;
|
||||
@@ -42,12 +43,12 @@ public class DummyFileSystemTest extends PlatformLangTestCase {
|
||||
final VirtualFileEvent[] events = new VirtualFileEvent[2];
|
||||
fs.addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent e) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent e) {
|
||||
events[0] = e;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeFileDeletion(VirtualFileEvent e) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent e) {
|
||||
events[1] = e;
|
||||
}
|
||||
});
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.application.WriteAction;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.testFramework.PlatformLangTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -33,7 +34,7 @@ public class VirtualFileListenerTest extends PlatformLangTestCase {
|
||||
final Ref<Boolean> eventFired = Ref.create(false);
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
eventFired.set(true);
|
||||
}
|
||||
}, myTestRootDisposable);
|
||||
|
||||
+2
-2
@@ -478,12 +478,12 @@ public class VirtualFilePointerTest extends PlatformLangTestCase {
|
||||
|
||||
VirtualFileAdapter listener = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
stressRead(pointer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
stressRead(pointer);
|
||||
}
|
||||
};
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,6 +36,7 @@ import com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.messages.MessageBus;
|
||||
import com.intellij.util.messages.MessageBusConnection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -80,14 +81,14 @@ public class PushedFilePropertiesUpdater {
|
||||
|
||||
connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
final VirtualFile file = event.getFile();
|
||||
final FilePropertyPusher[] pushers = file.isDirectory() ? myPushers : myFilePushers;
|
||||
pushRecursively(file, project, pushers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(final VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull final VirtualFileMoveEvent event) {
|
||||
final VirtualFile file = event.getFile();
|
||||
final FilePropertyPusher[] pushers = file.isDirectory() ? myPushers : myFilePushers;
|
||||
for (FilePropertyPusher pusher : pushers) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +31,7 @@ import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
@@ -313,14 +314,14 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
protected abstract boolean isDirectoryVersioningSupported();
|
||||
|
||||
private class MyVirtualFileAdapter extends VirtualFileAdapter {
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
if (isUnderMyVcs(file)) {
|
||||
VcsVFSListener.this.fileAdded(event, file);
|
||||
}
|
||||
}
|
||||
|
||||
public void fileCopied(final VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull final VirtualFileCopyEvent event) {
|
||||
if (isEventIgnored(event, true) || myChangeListManager.isIgnoredFile(event.getFile())) return;
|
||||
final AbstractVcs oldVcs = ProjectLevelVcsManager.getInstance(myProject).getVcsFor(event.getOriginalFile());
|
||||
if (oldVcs == myVcs) {
|
||||
@@ -335,7 +336,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
final VirtualFile file = event.getFile();
|
||||
if (isEventIgnored(event, true)) {
|
||||
return;
|
||||
@@ -356,7 +357,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void beforeFileMovement(final VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull final VirtualFileMoveEvent event) {
|
||||
if (isEventIgnored(event, true)) return;
|
||||
final VirtualFile file = event.getFile();
|
||||
final AbstractVcs newVcs = ProjectLevelVcsManager.getInstance(myProject).getVcsFor(event.getNewParent());
|
||||
@@ -368,7 +369,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void fileMoved(final VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull final VirtualFileMoveEvent event) {
|
||||
if (isEventIgnored(event, true)) return;
|
||||
final AbstractVcs oldVcs = ProjectLevelVcsManager.getInstance(myProject).getVcsFor(event.getOldParent());
|
||||
if (oldVcs != myVcs) {
|
||||
@@ -376,7 +377,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void beforePropertyChange(final VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull final VirtualFilePropertyEvent event) {
|
||||
if (!isEventIgnored(event, false) && event.getPropertyName().equalsIgnoreCase(VirtualFile.PROP_NAME)) {
|
||||
String oldName = (String)event.getOldValue();
|
||||
String newName = (String)event.getNewValue();
|
||||
@@ -393,7 +394,7 @@ public abstract class VcsVFSListener implements Disposable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeContentsChange(VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event) {
|
||||
VirtualFile file = event.getFile();
|
||||
assert !file.isDirectory();
|
||||
if (isUnderMyVcs(file)) {
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileAdapter;
|
||||
import com.intellij.openapi.vfs.VirtualFileEvent;
|
||||
import com.intellij.openapi.vfs.VirtualFilePropertyEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class VFSForAnnotationListener extends VirtualFileAdapter {
|
||||
private final VirtualFile myFile;
|
||||
@@ -31,7 +32,7 @@ public class VFSForAnnotationListener extends VirtualFileAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (! Comparing.equal(myFile, event.getFile())) return;
|
||||
if (! event.isFromRefresh()) return;
|
||||
|
||||
@@ -43,7 +44,7 @@ public class VFSForAnnotationListener extends VirtualFileAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (! Comparing.equal(myFile, event.getFile())) return;
|
||||
if (! event.isFromRefresh()) return;
|
||||
if (! myFile.isWritable()) {
|
||||
|
||||
+5
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,6 +24,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileAdapter;
|
||||
import com.intellij.openapi.vfs.VirtualFileEvent;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@@ -59,17 +60,17 @@ public abstract class FileAndDocumentListenersForShortDiff {
|
||||
|
||||
private class MyFileListener extends VirtualFileAdapter {
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
impl(event.getFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
impl(event.getFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
impl(event.getFile());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -197,7 +197,7 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper {
|
||||
if (myCanChangePatchFile) {
|
||||
myListener = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (myRecentPathFileChange.get() != null && myRecentPathFileChange.get().getVf() != null &&
|
||||
myRecentPathFileChange.get().getVf().equals(event.getFile())) {
|
||||
queueRequest();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -425,7 +425,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
}
|
||||
|
||||
private class MyVirtualFileListener extends VirtualFileAdapter {
|
||||
public void beforeContentsChange(VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event) {
|
||||
if (event.isFromRefresh()) {
|
||||
resetTracker(event.getFile());
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -100,7 +100,7 @@ public class XLineBreakpointManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
List<XBreakpoint<?>> toRemove = new ArrayList<XBreakpoint<?>>();
|
||||
for (XLineBreakpointImpl breakpoint : myBreakpoints.keySet()) {
|
||||
if (breakpoint.getFileUrl().equals(event.getFile().getUrl())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -157,7 +157,7 @@ public class AntConfigurationImpl extends AntConfigurationBase implements Persis
|
||||
}
|
||||
});
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
final VirtualFile vFile = event.getFile();
|
||||
// cleanup
|
||||
for (AntBuildFile file : getBuildFiles()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,7 +37,7 @@ public class NewFileTracker {
|
||||
final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance();
|
||||
virtualFileManager.addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
if (event.isFromRefresh()) return;
|
||||
newFiles.add(event.getFile());
|
||||
}
|
||||
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -101,15 +101,15 @@ public class CvsEntriesManager extends VirtualFileAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
public void beforeContentsChange(VirtualFileEvent event) {
|
||||
public void beforeContentsChange(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
fireStatusChanged(event.getFile());
|
||||
}
|
||||
|
||||
@@ -150,15 +150,15 @@ public class CvsEntriesManager extends VirtualFileAdapter {
|
||||
return getInfoFor(parent).getIgnoreFilter();
|
||||
}
|
||||
|
||||
public void beforeFileDeletion(VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
public void beforeFileMovement(VirtualFileMoveEvent event) {
|
||||
public void beforeFileMovement(@NotNull VirtualFileMoveEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
processEvent(event);
|
||||
}
|
||||
|
||||
|
||||
+9
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.vcs.AbstractVcs;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -91,7 +92,7 @@ public class CvsStorageSupportingDeletionComponent extends CvsStorageComponent i
|
||||
myProject = null;
|
||||
}
|
||||
|
||||
public void beforeFileDeletion(VirtualFileEvent event) {}
|
||||
public void beforeFileDeletion(@NotNull VirtualFileEvent event) {}
|
||||
|
||||
public DeleteHandler getDeleteHandler() {
|
||||
if (myDeleteHandler == null) {
|
||||
@@ -100,7 +101,7 @@ public class CvsStorageSupportingDeletionComponent extends CvsStorageComponent i
|
||||
return myDeleteHandler;
|
||||
}
|
||||
|
||||
public void fileDeleted(VirtualFileEvent event) {}
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {}
|
||||
|
||||
private boolean shouldProcessEvent(VirtualFileEvent event, boolean parentShouldBeUnderCvs) {
|
||||
if (myAnotherProjectCommand) {
|
||||
@@ -121,9 +122,9 @@ public class CvsStorageSupportingDeletionComponent extends CvsStorageComponent i
|
||||
return CvsUtil.fileIsUnderCvs(file.getParent());
|
||||
}
|
||||
|
||||
public void beforeFileMovement(VirtualFileMoveEvent event) {}
|
||||
public void beforeFileMovement(@NotNull VirtualFileMoveEvent event) {}
|
||||
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
fileCreated(event);
|
||||
}
|
||||
|
||||
@@ -147,20 +148,20 @@ public class CvsStorageSupportingDeletionComponent extends CvsStorageComponent i
|
||||
return ProjectLevelVcsManager.getInstance(myProject).getVcsFor(file) != CvsVcs2.getInstance(myProject);
|
||||
}
|
||||
|
||||
public void beforePropertyChange(VirtualFilePropertyEvent event) {
|
||||
public void beforePropertyChange(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (!event.getPropertyName().equals(VirtualFile.PROP_NAME)) return;
|
||||
if (!CvsUtil.fileIsUnderCvs(event.getFile())) return;
|
||||
beforeFileDeletion(event);
|
||||
}
|
||||
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (processMoveOrRename()) {
|
||||
fileDeleted(event);
|
||||
fileCreated(event);
|
||||
}
|
||||
}
|
||||
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
if (!shouldProcessEvent(event, false)) return;
|
||||
final Project project = myProject;
|
||||
if (project == null) return; // already disposed
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -110,7 +110,7 @@ public class GroovyDslFileIndex extends ScalarIndexExtension<String> {
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (event.getFileName().endsWith(".gdsl")) {
|
||||
disableFile(event.getFile(), MODIFIED);
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -109,7 +109,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
|
||||
connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkVirtualFileListenerAdapter(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(final VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull final VirtualFileEvent event) {
|
||||
myModificationCount++;
|
||||
|
||||
final VirtualFile file = event.getFile();
|
||||
@@ -185,7 +185,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
myModificationCount++;
|
||||
|
||||
final VirtualFile file = event.getFile();
|
||||
@@ -195,7 +195,7 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
final String fileName = event.getFileName();
|
||||
if (MvcModuleStructureUtil.APPLICATION_PROPERTIES.equals(fileName)) {
|
||||
queue(SyncAction.UpdateProjectStructure, event.getFile());
|
||||
@@ -203,12 +203,12 @@ public class MvcModuleStructureSynchronizer extends AbstractProjectComponent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
myModificationCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
myModificationCount++;
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -364,14 +364,14 @@ public class ResourceBundleEditor extends UserDataHolderBase implements FileEdit
|
||||
}
|
||||
myVfsListener = new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
if (PropertiesUtil.isPropertiesFile(event.getFile(), myProject)) {
|
||||
recreateEditorsPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
for (PropertiesFile file : myEditors.keySet()) {
|
||||
if (Comparing.equal(file.getVirtualFile(), event.getFile())) {
|
||||
recreateEditorsPanel();
|
||||
@@ -381,7 +381,7 @@ public class ResourceBundleEditor extends UserDataHolderBase implements FileEdit
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (PropertiesUtil.isPropertiesFile(event.getFile(), myProject)) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
recreateEditorsPanel();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileAdapter;
|
||||
import com.intellij.openapi.vfs.VirtualFileEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -37,7 +38,7 @@ public class SvnEntriesFileListener extends VirtualFileAdapter {
|
||||
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
|
||||
}
|
||||
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
if (! event.isFromRefresh()) {
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +57,7 @@ public class SvnEntriesFileListener extends VirtualFileAdapter {
|
||||
myProject.getMessageBus().syncPublisher(VcsAnnotationRefresher.LOCAL_CHANGES_CHANGED).dirtyUnder(parent);
|
||||
}
|
||||
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (! event.isFromRefresh()) {
|
||||
return;
|
||||
}
|
||||
@@ -85,7 +86,7 @@ public class SvnEntriesFileListener extends VirtualFileAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
if (!event.isFromRefresh()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -73,7 +73,7 @@ public class BuildoutFacet extends Facet<BuildoutFacetConfiguration> implements
|
||||
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (Comparing.equal(event.getFile(), getScript())) {
|
||||
updatePaths();
|
||||
attachLibrary(module);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,6 +18,7 @@ package com.jetbrains.python.psi.resolve;
|
||||
import com.intellij.openapi.vfs.*;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.QualifiedName;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -53,27 +54,27 @@ public abstract class PythonPathCache {
|
||||
|
||||
protected class MyVirtualFileAdapter extends VirtualFileAdapter {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileMoved(VirtualFileMoveEvent event) {
|
||||
public void fileMoved(@NotNull VirtualFileMoveEvent event) {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileCopied(VirtualFileCopyEvent event) {
|
||||
public void fileCopied(@NotNull VirtualFileCopyEvent event) {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
if (event.getPropertyName().equals(VirtualFile.PROP_NAME)) {
|
||||
clearCache();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -126,17 +126,17 @@ public final class DomManagerImpl extends DomManager {
|
||||
final VirtualFileAdapter listener = new VirtualFileAdapter() {
|
||||
private final List<DomEvent> myDeletionEvents = new SmartList<DomEvent>();
|
||||
|
||||
public void contentsChanged(VirtualFileEvent event) {
|
||||
public void contentsChanged(@NotNull VirtualFileEvent event) {
|
||||
if (event.isFromSave()) return;
|
||||
|
||||
processVfsChange(event.getFile());
|
||||
}
|
||||
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
public void fileCreated(@NotNull VirtualFileEvent event) {
|
||||
processVfsChange(event.getFile());
|
||||
}
|
||||
|
||||
public void beforeFileDeletion(final VirtualFileEvent event) {
|
||||
public void beforeFileDeletion(@NotNull final VirtualFileEvent event) {
|
||||
if (!myProject.isDisposed()) {
|
||||
beforeFileDeletion(event.getFile());
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public final class DomManagerImpl extends DomManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
public void fileDeleted(@NotNull VirtualFileEvent event) {
|
||||
if (!myDeletionEvents.isEmpty()) {
|
||||
if (!myProject.isDisposed()) {
|
||||
for (DomEvent domEvent : myDeletionEvents) {
|
||||
@@ -169,7 +169,7 @@ public final class DomManagerImpl extends DomManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
|
||||
final VirtualFile file = event.getFile();
|
||||
if (!file.isDirectory() && VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
processVfsChange(file);
|
||||
|
||||
Reference in New Issue
Block a user