Open sghpjuikit opened 4 years ago
Plugins are reworked to be lazy now. They no longer manage their own life-cycle, which makes them dead simple. I will push the changes after I make sure every plugin is cleaned up and Guide will become a plugin too. Then I will start implementing the compile support and move out some of the plugins as external ones.
I'm pushing the 1st stage changes. I cleaned up all plugins and removed few artificial restrictions and pain points.
One notable design change is persisting plugin configuration. So far plugins' configuration is application configuration, but this makes it difficult to separate the two, however if plugins held their own configuration, I'd have to synchronize it with application configuration to persist it. I'm not decided on the strategy just yet.
Plugin management is implemented. Nothing fancy, but still helps a lot. The only issue is that enabling a plugin does not refresh settings and user might wonder how to configure it, because the settings will not show up.
I plan on fixing this issue by implementing Configurable that is Observable, so Settings could refresh on adding/removing Configs.
[x] Fully lazy
Right now plugins are lazy as in they can be started/stopped, however this forces every implementation to undergo complicated state checking and still involves allocation even when plugin does not start. Plugin.kt should, as Widget, be a container that controls instantiating the actual plugin code.
For example, this will avoid spawning the awt thread for TrayPlugin in case it is not running.
[ ] Compilable
As widgets, to allow adding external plugins.