com.jetbrains.plugin.structure.ide.DispatchingIdeManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-ide Show documentation
Show all versions of structure-ide Show documentation
Library for resolving class files and resources of IntelliJ Platform IDEs.
package com.jetbrains.plugin.structure.ide
import com.jetbrains.plugin.structure.intellij.version.IdeVersion
import java.nio.file.Path
class DispatchingIdeManager : IdeManager() {
private val standardIdeManager = IdeManagerImpl()
private val productInfoBasedIdeManager = ProductInfoBasedIdeManager()
override fun createIde(idePath: Path): Ide = createIde(idePath, version = null)
override fun createIde(idePath: Path, version: IdeVersion?): Ide {
val ideManager = if (productInfoBasedIdeManager.supports(idePath)) {
productInfoBasedIdeManager
} else {
standardIdeManager
}
return ideManager.createIde(idePath, version)
}
}