mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
improved component child handling
This commit is contained in:
1 parent
8c6c6e0f3c
commit
b44f5cc0d1
3 files changed
+6
-2
No files matched your search
+1
-1
@@ -179,7 +179,7 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
|
||||
final LeaderboardPerspectiveLifecycle lifecycle = new LeaderboardPerspectiveLifecycle(getStringMessages());
|
||||
final LeaderboardComponentContext componentContext = new LeaderboardComponentContext(lifecycle,
|
||||
new UserSettingsStorageManager<>(getUserService(),
|
||||
UserSettingsStorageManager.buildContextDefinitionId("LeaderboardEntryPoint", "Meta"),
|
||||
UserSettingsStorageManager.buildContextDefinitionId("LeaderboardEntryPoint", "Single"),
|
||||
leaderboardContextSettings.getRegattaName()));
|
||||
componentContext.initInitialSettings(new OnSettingsLoadedCallback<PerspectiveCompositeSettings<LeaderboardPerspectiveOwnSettings>>() {
|
||||
@Override
|
||||
|
||||
+1
@@ -76,6 +76,7 @@ public class LeaderboardViewer extends AbstractLeaderboardViewer<LeaderboardPers
|
||||
|
||||
mainPanel.add(getLeaderboardPanel());
|
||||
mainPanel.add(multiCompetitorChart);
|
||||
addChildComponent(multiCompetitorChart);
|
||||
|
||||
addComponentToNavigationMenu(getLeaderboardPanel(), false, null, /* hasSettingsWhenComponentIsInvisible*/ true);
|
||||
addComponentToNavigationMenu(multiCompetitorChart, true, null, /* hasSettingsWhenComponentIsInvisible*/ true);
|
||||
|
||||
+4
-1
@@ -33,7 +33,10 @@ public abstract class AbstractPerspectiveComposite<PL extends PerspectiveLifecyc
|
||||
* @param childComponent The component to be added as a child to this perspective
|
||||
*/
|
||||
protected void addChildComponent(Component<? extends Settings> childComponent) {
|
||||
childComponents.put(childComponent.getId(), childComponent);
|
||||
Component<? extends Settings> old = childComponents.put(childComponent.getId(), childComponent);
|
||||
if (old != null) {
|
||||
throw new IllegalStateException("Child with same id is allready added");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user