Java 类com.intellij.openapi.vfs.VirtualFilePropertyEvent 实例源码

项目:intellij-ce-playground    文件:ArtifactVirtualFileListener.java   
@Override
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
  if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
    final VirtualFile parent = event.getParent();
    if (parent != null) {
      filePathChanged(parent.getPath() + "/" + event.getOldValue(), parent.getPath() + "/" + event.getNewValue());
    }
  }
}
项目:intellij-ce-playground    文件:TextEditorComponent.java   
@Override
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.
    updateValidProperty();
    if (Comparing.equal(e.getFile(), myFile) &&
        (FileContentUtilCore.FORCE_RELOAD_REQUESTOR.equals(e.getRequestor()) ||
         !Comparing.equal(e.getOldValue(), e.getNewValue()))) {
      updateHighlighters();
    }
  }
}
项目:intellij-ce-playground    文件:VFSForAnnotationListener.java   
@Override
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
  if (! Comparing.equal(myFile, event.getFile())) return;
  if (! event.isFromRefresh()) return;

  if (VirtualFile.PROP_WRITABLE.equals(event.getPropertyName())) {
    if (((Boolean)event.getOldValue()).booleanValue()) {
      myFileAnnotation.close();
    }
  }
}
项目:intellij-ce-playground    文件:BreadcrumbsLoaderComponent.java   
@Override
public void propertyChanged(@NotNull VirtualFilePropertyEvent event) {
  if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
    FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
    VirtualFile file = event.getFile();
    if (fileEditorManager.isFileOpen(file)) {
      reinitBreadcrumbsComponent(fileEditorManager, file);
    }
  }
}
项目:tools-idea    文件:ArtifactVirtualFileListener.java   
@Override
public void propertyChanged(VirtualFilePropertyEvent event) {
  if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
    final VirtualFile parent = event.getParent();
    if (parent != null) {
      filePathChanged(parent.getPath() + "/" + event.getOldValue(), parent.getPath() + "/" + event.getNewValue());
    }
  }
}
项目:tools-idea    文件:TextEditorComponent.java   
@Override
public void propertyChanged(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.
    updateValidProperty();
    updateHighlighters();
  }
}
项目:tools-idea    文件:VFSForAnnotationListener.java   
public void propertyChanged(VirtualFilePropertyEvent event) {
  if (! Comparing.equal(myFile, event.getFile())) return;
  if (! event.isFromRefresh()) return;

  if (VirtualFile.PROP_WRITABLE.equals(event.getPropertyName())) {
    if (((Boolean)event.getOldValue()).booleanValue()) {
      myFileAnnotation.close();
    }
  }
}
项目:floobits-intellij    文件:Listener.java   
public synchronized void start(final EditorEventHandler editorManager) {
    this.editorManager = editorManager;
    connection.subscribe(VirtualFileManager.VFS_CHANGES, this);
    connection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, this);
    em.addDocumentListener(this);
    em.addSelectionListener(this);
    em.addCaretListener(this);
    em.addVisibleAreaListener(this);


    virtualFileAdapter = new VirtualFileAdapter() {
        public void beforePropertyChange(@NotNull final VirtualFilePropertyEvent event) {
            if (!event.getPropertyName().equals(VirtualFile.PROP_NAME)) {
                return;
            }
            VirtualFile parent = event.getParent();
            if (parent == null) {
                return;
            }
            String parentPath = parent.getPath();
            // XXX: pretty sure is this wrong.
            String newValue = parentPath + "/" + event.getNewValue().toString();
            String oldValue = parentPath + "/" + event.getOldValue().toString();
            editorManager.rename(oldValue, newValue);
        }
    };
    VirtualFileManager.getInstance().addVirtualFileListener(virtualFileAdapter);
}
项目:consulo    文件:ArtifactVirtualFileListener.java   
@Override
public void propertyChanged(@Nonnull VirtualFilePropertyEvent event) {
  if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
    final VirtualFile parent = event.getParent();
    if (parent != null) {
      filePathChanged(parent.getPath() + "/" + event.getOldValue(), parent.getPath() + "/" + event.getNewValue());
    }
  }
}
项目:consulo    文件:TextEditorComponent.java   
@Override
public void propertyChanged(@Nonnull 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.
    updateValidProperty();
    if (Comparing.equal(e.getFile(), myFile) &&
        (FileContentUtilCore.FORCE_RELOAD_REQUESTOR.equals(e.getRequestor()) || !Comparing.equal(e.getOldValue(), e.getNewValue()))) {
      updateHighlighters();
    }
  }
}
项目:consulo    文件:VFSForAnnotationListener.java   
public void propertyChanged(@Nonnull VirtualFilePropertyEvent event) {
  if (! Comparing.equal(myFile, event.getFile())) return;
  if (! event.isFromRefresh()) return;

  if (VirtualFile.PROP_WRITABLE.equals(event.getPropertyName())) {
    if (((Boolean)event.getOldValue()).booleanValue()) {
      myFileAnnotation.close();
    }
  }
}
项目:consulo    文件:BreadcrumbsInitializingActivity.java   
@Override
public void propertyChanged(@Nonnull VirtualFilePropertyEvent event) {
  if (VirtualFile.PROP_NAME.equals(event.getPropertyName()) && !myProject.isDisposed()) {
    FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
    VirtualFile file = event.getFile();
    if (fileEditorManager.isFileOpen(file)) {
      reinitBreadcrumbsComponent(fileEditorManager, file);
    }
  }
}