コード例 #1
0
 private static void updateModifiedProperty(@NotNull VirtualFile file) {
   for (Project project : ProjectManager.getInstance().getOpenProjects()) {
     FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
     for (FileEditor editor : fileEditorManager.getAllEditors(file)) {
       if (editor instanceof TextEditorImpl) {
         ((TextEditorImpl) editor).updateModifiedProperty();
       }
     }
   }
 }
コード例 #2
0
  public FileDocumentManagerImpl(
      @NotNull VirtualFileManager virtualFileManager, @NotNull ProjectManager projectManager) {
    virtualFileManager.addVirtualFileListener(this);
    projectManager.addProjectManagerListener(this);

    myBus = ApplicationManager.getApplication().getMessageBus();
    InvocationHandler handler =
        new InvocationHandler() {
          @Nullable
          @Override
          public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            multiCast(method, args);
            return null;
          }
        };

    final ClassLoader loader = FileDocumentManagerListener.class.getClassLoader();
    myMultiCaster =
        (FileDocumentManagerListener)
            Proxy.newProxyInstance(
                loader, new Class[] {FileDocumentManagerListener.class}, handler);
  }