修复刷新缓存与样式测试隔离
This commit is contained in:
@@ -54,6 +54,7 @@ public class MainWindow {
|
||||
}
|
||||
|
||||
public void refreshNavItems(List<NavItem> newItems) {
|
||||
embeddedCache.clear();
|
||||
navItems = new ArrayList<>(newItems);
|
||||
navigationRail.setItems(navItems);
|
||||
showWelcomePage();
|
||||
@@ -155,7 +156,10 @@ public class MainWindow {
|
||||
if (item.action != null) {
|
||||
item.action.run();
|
||||
}
|
||||
showEmbeddedFor(item);
|
||||
if (!showEmbeddedFor(item)) {
|
||||
navigationRail.clearSelection();
|
||||
showWelcomePage();
|
||||
}
|
||||
}
|
||||
|
||||
private void showPluginToolbar(String title) {
|
||||
@@ -200,15 +204,17 @@ public class MainWindow {
|
||||
currentEmbedded = null;
|
||||
}
|
||||
|
||||
private void showEmbeddedFor(NavItem item) {
|
||||
private boolean showEmbeddedFor(NavItem item) {
|
||||
if (item.pluginId == null) {
|
||||
hidePluginToolbar();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
EmbeddedEntry entry = embeddedCache.get(item.pluginId);
|
||||
if (entry != null) {
|
||||
switchToEmbedded(item.pluginId, entry);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void embedPlugin(String pluginId, String ignoredIcon, String name, Parent content) {
|
||||
|
||||
Reference in New Issue
Block a user