现在插件管理

This commit is contained in:
张家训
2026-07-03 17:09:39 +08:00
parent 3883323f93
commit 10d0f0d312
7 changed files with 291 additions and 20 deletions
@@ -113,6 +113,22 @@ public class WorkUtilsApplication implements CommandLineRunner {
Theme.Mode mode = Theme.Mode.LIGHT;
Platform.runLater(() -> Theme.applyTheme(mode));
// 设置导航栏刷新回调(插件管理中启用/禁用后刷新侧边栏)
settingsService.setNavItemsRefresher(items -> Platform.runLater(() -> {
if (mainWindow != null) {
mainWindow.refreshNavItems(items);
// 重新绑定插件面板
for (Plugin plugin : pluginManager.getEnabledPlugins()) {
PluginDescriptor desc = plugin.getDescriptor();
VisualPluginFactory factory = plugin.getVisualFactory();
Parent pane = factory != null ? factory.getEmbeddedPane() : null;
if (pane != null) {
mainWindow.embedPlugin(desc.getId(), desc.getIcon(), desc.getName(), pane);
}
}
}
}));
List<MainWindow.NavItem> navItems = buildNavItems();
CountDownLatch windowClosed = new CountDownLatch(1);