Profile: make profile abstract
This commit is contained in:
parent
98852aeaec
commit
d8c6ff82e3
@ -1,7 +1,7 @@
|
||||
package io.neoterm.component.config
|
||||
|
||||
import io.neoterm.component.config.loader.NeoLangConfigureLoader
|
||||
import io.neoterm.component.config.loader.OldConfigureLoader
|
||||
import io.neoterm.component.config.loaders.NeoLangConfigureLoader
|
||||
import io.neoterm.component.config.loaders.OldConfigureLoader
|
||||
import io.neoterm.frontend.component.NeoComponent
|
||||
import java.io.File
|
||||
|
||||
@ -24,7 +24,7 @@ class ConfigureComponent : NeoComponent {
|
||||
return CONFIG_LOADER_VERSION
|
||||
}
|
||||
|
||||
fun newLoader(configFile: File): IConfigureFileLoader {
|
||||
fun newLoader(configFile: File): IConfigureLoader {
|
||||
return when (configFile.extension) {
|
||||
"nl" -> NeoLangConfigureLoader(configFile)
|
||||
else -> OldConfigureLoader(configFile)
|
||||
|
@ -5,6 +5,6 @@ import io.neoterm.frontend.config.NeoConfigureFile
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
interface IConfigureFileLoader {
|
||||
interface IConfigureLoader {
|
||||
fun loadConfigure() : NeoConfigureFile?
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
package io.neoterm.component.config.loader
|
||||
package io.neoterm.component.config.loaders
|
||||
|
||||
import io.neoterm.component.config.IConfigureFileLoader
|
||||
import io.neoterm.component.config.IConfigureLoader
|
||||
import io.neoterm.frontend.config.NeoConfigureFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class NeoLangConfigureLoader(val configFile: File) : IConfigureFileLoader {
|
||||
class NeoLangConfigureLoader(private val configFile: File) : IConfigureLoader {
|
||||
override fun loadConfigure(): NeoConfigureFile? {
|
||||
val configureFile = NeoConfigureFile(configFile)
|
||||
return if (configureFile.parseConfigure()) configureFile else null
|
@ -1,4 +1,4 @@
|
||||
package io.neoterm.component.config.loader
|
||||
package io.neoterm.component.config.loaders
|
||||
|
||||
import io.neolang.runtime.type.NeoLangValue
|
||||
import io.neoterm.component.color.NeoColorScheme
|
@ -1,13 +1,13 @@
|
||||
package io.neoterm.component.config.loader
|
||||
package io.neoterm.component.config.loaders
|
||||
|
||||
import io.neoterm.component.config.IConfigureFileLoader
|
||||
import io.neoterm.component.config.IConfigureLoader
|
||||
import io.neoterm.frontend.config.NeoConfigureFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class OldConfigureLoader(val configFile: File) : IConfigureFileLoader {
|
||||
class OldConfigureLoader(private val configFile: File) : IConfigureLoader {
|
||||
override fun loadConfigure(): NeoConfigureFile? {
|
||||
return when (configFile.extension) {
|
||||
"eks" -> returnConfigure(OldExtraKeysConfigureFile(configFile))
|
@ -1,4 +1,4 @@
|
||||
package io.neoterm.component.config.loader
|
||||
package io.neoterm.component.config.loaders
|
||||
|
||||
import io.neolang.runtime.type.NeoLangValue
|
||||
import io.neolang.visitor.ConfigVisitor
|
@ -0,0 +1,6 @@
|
||||
package io.neoterm.component.profile
|
||||
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
abstract class NeoProfile
|
@ -2,6 +2,7 @@ package io.neoterm.frontend.session.shell
|
||||
|
||||
import io.neoterm.component.color.ColorSchemeComponent
|
||||
import io.neoterm.component.font.FontComponent
|
||||
import io.neoterm.component.profile.NeoProfile
|
||||
import io.neoterm.frontend.component.ComponentManager
|
||||
import io.neoterm.frontend.config.DefaultValues
|
||||
import io.neoterm.frontend.config.NeoPreference
|
||||
@ -9,7 +10,7 @@ import io.neoterm.frontend.config.NeoPreference
|
||||
/**
|
||||
* @author kiva
|
||||
*/
|
||||
class ShellProfile {
|
||||
class ShellProfile : NeoProfile() {
|
||||
var loginShell = DefaultValues.loginShell
|
||||
var initialCommand = DefaultValues.initialCommand
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user