mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup — use ModuleRootListener directly
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ import com.intellij.ProjectTopics
|
||||
import com.intellij.openapi.application.Application
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.roots.ModuleRootAdapter
|
||||
import com.intellij.openapi.roots.ModuleRootEvent
|
||||
import com.intellij.openapi.roots.ModuleRootListener
|
||||
import com.intellij.openapi.vfs.LocalFileSystem
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.openapi.vfs.VirtualFileManager
|
||||
@@ -45,7 +45,7 @@ class WebServerPathToFileManager(application: Application, private val project:
|
||||
}
|
||||
}
|
||||
})
|
||||
project.messageBus.connect().subscribe(ProjectTopics.PROJECT_ROOTS, object : ModuleRootAdapter() {
|
||||
project.messageBus.connect().subscribe(ProjectTopics.PROJECT_ROOTS, object : ModuleRootListener {
|
||||
override fun rootsChanged(event: ModuleRootEvent) {
|
||||
clearCache()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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,11 +19,4 @@ package com.intellij.openapi.roots;
|
||||
* @author nik
|
||||
*/
|
||||
public abstract class ModuleRootAdapter implements ModuleRootListener {
|
||||
@Override
|
||||
public void beforeRootsChange(ModuleRootEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rootsChanged(ModuleRootEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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,9 +18,12 @@ package com.intellij.openapi.roots;
|
||||
import java.util.EventListener;
|
||||
|
||||
/**
|
||||
* @author dsl
|
||||
* @author dsl
|
||||
*/
|
||||
public interface ModuleRootListener extends EventListener{
|
||||
void beforeRootsChange(ModuleRootEvent event);
|
||||
void rootsChanged(ModuleRootEvent event);
|
||||
public interface ModuleRootListener extends EventListener {
|
||||
default void beforeRootsChange(ModuleRootEvent event) {
|
||||
}
|
||||
|
||||
default void rootsChanged(ModuleRootEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user