edvin
04/02/2017, 5:23 PMnimakro
04/02/2017, 5:28 PMconfig
helper 😀 while I am implementing the new config
helper, but I can gladly keep config
😉...
Alright I so I will start with re implementing the config
helper and then we can discuss more as soon as I have some code.edvin
04/02/2017, 5:28 PMnimakro
04/02/2017, 6:27 PMscope
so I could get it in the component
class?
Or should I add a property globalConfig to the FX
class? 🙈edvin
04/02/2017, 7:02 PMnimakro
04/02/2017, 7:03 PMedvin
04/02/2017, 7:06 PMnimakro
04/02/2017, 8:17 PM{
window : {
x: 30.0
y: 40.0
list: [2,3,4]
}
}
Which of the three variants would you prefer:
config {
// Nested config values example
// 1. Variant
set("window") to {
set("x" to 30.0)
set("y" to 40.0)
set("list" to listOf(2, 3, 4))
}
// 2. Variant
set("window"/"x" to 30.0)
set("window"/"y" to 40.0)
set("window"/"list" to listOf(2, 3, 4))
// 3. Variant
set("window.x" to 30.0)
set("window.y" to 40.0)
set("window.list" to listOf(2, 3, 4))
}
nimakro
04/02/2017, 8:18 PMcarlw
04/02/2017, 8:59 PMnimakro
04/03/2017, 7:16 AMconfig
helper apiedvin
04/03/2017, 8:55 AMconfig
.edvin
04/03/2017, 8:55 AMedvin
04/03/2017, 11:24 AMcarlw
04/03/2017, 11:46 AMnimakro
04/03/2017, 11:55 AMconfig
helper.. so I will only add the COMPONENT
GLOBAL
scope stuff to the implementation for now and then we can see if we need other features in the future? Did you think already about were the best place would be to store the GLOBAL
config object?
@carlw That makes all sense and I see what you are saying but my original question was more related to the syntax for the new config
helper api, and in my opinion it is nice to have support for json files and have a nice way to easily retrieving those properties pragmatically from within the programcarlw
04/03/2017, 1:04 PMnimakro
04/03/2017, 1:20 PMwindow
was just en example), I am working on some improvements (at least I hope they will be improvements 🙈😀) on the tornadofx config
helper api and was just trying out different api syntax to save and restore config items.carlw
04/03/2017, 1:47 PMedvin
04/03/2017, 4:55 PMedvin
04/03/2017, 5:54 PMconfig
as well @nimakroedvin
04/03/2017, 6:49 PMedvin
04/03/2017, 6:49 PMnimakro
04/03/2017, 8:12 PMedvin
04/03/2017, 8:28 PMnimakro
04/03/2017, 9:13 PMGLOBAL
config object to allow:
config(GLOBAL) {
set("username" to "name")
}
edvin
04/03/2017, 9:37 PMnimakro
04/03/2017, 9:52 PMedvin
04/03/2017, 9:54 PMConfig
? We would do class Config : Properties
to keep compatibility. Then we can pretty easily add an option to use json format for config files inside JsonConfig
perhaps.edvin
04/03/2017, 9:55 PMJsonConfig.configFormat = JsonConfig.ConfigFormat.JSON
instead of the default JsonConfig.ConfigFormat.PROPERTIES
perhaps?