cleanup — use ModuleRootListener directly

This commit is contained in:
Vladimir Krivosheev
2016-04-06 18:02:01 +02:00
parent a4392c9fc9
commit e28cf11cb4
3 changed files with 11 additions and 15 deletions
@@ -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) {
}
}