added embedded setting to dialog

This commit is contained in:
Kai Boernert committed 2017-02-14 10:37:07 +01:00
1 parent 3627a11369
commit 121ff8f68f
4 files changed
+13 -7

No files matched your search

@@ -25,9 +25,7 @@ public abstract class AbstractLeaderboardPerspectiveLifecycle extends AbstractPe
@Override
protected LeaderboardPerspectiveOwnSettings extractOwnGlobalSettings(LeaderboardPerspectiveOwnSettings settings) {
return new LeaderboardPerspectiveOwnSettings(settings.isShowRaceDetails(), settings.isHideToolbar(),
settings.isAutoExpandLastRaceColumn(), settings.isShowCharts(), settings.isShowOverallLeaderboard(),
settings.isShowSeriesLeaderboards(), settings.getZoomTo());
return settings;
}
@Override
@@ -194,7 +194,7 @@ public class LeaderboardEntryPoint extends AbstractSailingEntryPoint {
DockLayoutPanel mainPanel = new DockLayoutPanel(Unit.PX);
RootLayoutPanel.get().add(mainPanel);
if (!ownSettings.getEmbedded()) {
if (!ownSettings.isEmbedded()) {
// Hack to shorten the leaderboardName in case of overall leaderboards
String leaderboardDisplayName = leaderboardContextSettings.getDisplayName();
if (leaderboardDisplayName == null || leaderboardDisplayName.isEmpty()) {
@@ -21,7 +21,8 @@ public class LeaderboardPerspectiveOwnSettings extends AbstractGenericSerializab
}
LeaderboardPerspectiveOwnSettings(boolean showRaceDetails, boolean hideToolbar, boolean autoExpandLastRaceColumn,
boolean showCharts, boolean showOverallLeaderboard, boolean showSeriesLeaderboards, String zoomTo) {
boolean showCharts, boolean showOverallLeaderboard, boolean showSeriesLeaderboards, String zoomTo,
boolean embedded) {
this.showRaceDetails.setValue(showRaceDetails);
this.hideToolbar.setValue(hideToolbar);
this.autoExpandLastRaceColumn.setValue(autoExpandLastRaceColumn);
@@ -29,6 +30,7 @@ public class LeaderboardPerspectiveOwnSettings extends AbstractGenericSerializab
this.showOverallLeaderboard.setValue(showOverallLeaderboard);
this.showSeriesLeaderboards.setValue(showSeriesLeaderboards);
this.zoomTo.setValue(zoomTo);
this.embedded.setValue(embedded);
}
@Override
@@ -63,7 +65,7 @@ public class LeaderboardPerspectiveOwnSettings extends AbstractGenericSerializab
public String getZoomTo() {
return zoomTo.getValue();
}
public boolean getEmbedded() {
public boolean isEmbedded() {
return embedded.getValue();
}
}
@@ -20,7 +20,9 @@ public class LeaderboardPerspectiveOwnSettingsDialogComponent
private CheckBox showCharts;
private CheckBox showOverallLeaderboard;
private CheckBox showSeriesLeaderboards;
private TextBox zoomTo;
private CheckBox embedded;
public LeaderboardPerspectiveOwnSettingsDialogComponent(LeaderboardPerspectiveOwnSettings settings) {
this.initialSettings = settings;
@@ -56,6 +58,10 @@ public class LeaderboardPerspectiveOwnSettingsDialogComponent
showSeriesLeaderboards.setValue(initialSettings.isShowSeriesLeaderboards());
vp.add(showSeriesLeaderboards);
embedded = dialog.createCheckbox(stringMessages.embedded());
embedded.setValue(initialSettings.isEmbedded());
vp.add(embedded);
zoomTo = dialog.createTextBox(stringMessages.zoom());
zoomTo.setValue(initialSettings.getZoomTo());
vp.add(zoomTo);
@@ -66,7 +72,7 @@ public class LeaderboardPerspectiveOwnSettingsDialogComponent
public LeaderboardPerspectiveOwnSettings getResult() {
return new LeaderboardPerspectiveOwnSettings(showRaceDetails.getValue(), hideToolbar.getValue(),
autoExpandLastRaceColumn.getValue(), showCharts.getValue(), showOverallLeaderboard.getValue(),
showSeriesLeaderboards.getValue(), zoomTo.getValue());
showSeriesLeaderboards.getValue(), zoomTo.getValue(), embedded.getValue());
}
@Override