mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
fixed style errors
This commit is contained in:
1 parent
c170e29793
commit
29f64cea1c
1 file changed
+20
-19
+20
-19
@@ -8,10 +8,11 @@ import java.util.Map;
|
||||
import com.google.gwt.cell.client.SafeHtmlCell;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.FontWeight;
|
||||
import com.google.gwt.safecss.shared.SafeStyles;
|
||||
import com.google.gwt.safecss.shared.SafeStylesBuilder;
|
||||
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
|
||||
import com.google.gwt.safehtml.shared.SafeUri;
|
||||
import com.google.gwt.safehtml.shared.UriUtils;
|
||||
import com.google.gwt.user.cellview.client.CellTable;
|
||||
@@ -57,23 +58,23 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
|
||||
interface AnchorTemplates extends SafeHtmlTemplates {
|
||||
@SafeHtmlTemplates.Template("<a class=\"{2}\" href=\"{0}\">{1}</a>")
|
||||
SafeHtml anchor(SafeUri url, String displayName, SafeHtml styleClass);
|
||||
SafeHtml anchor(SafeUri url, String displayName, String styleClass);
|
||||
|
||||
@SafeHtmlTemplates.Template("<a target=\"{3}\" class=\"{2}\" href=\"{0}\">{1}</a>")
|
||||
SafeHtml anchorWithTarget(SafeUri url, String displayName, SafeHtml styleClass, String target);
|
||||
SafeHtml anchorWithTarget(SafeUri url, String displayName, String styleClass, String target);
|
||||
}
|
||||
|
||||
interface TextWithClassTemplate extends SafeHtmlTemplates {
|
||||
@SafeHtmlTemplates.Template("<div class=\"{1}\">{0}</div>")
|
||||
SafeHtml textWithClass(String text, SafeHtml styleClass);
|
||||
SafeHtml textWithClass(String text, String styleClass);
|
||||
|
||||
@SafeHtmlTemplates.Template("<div class=\"{2}\" style=\"min-width:{1}px;\">{0}</div>")
|
||||
SafeHtml textWithClass(String text, int widthInPx, SafeHtml styleClass);
|
||||
SafeHtml textWithClass(String text, int widthInPx, String styleClass);
|
||||
}
|
||||
|
||||
interface ColorBoxTemplate extends SafeHtmlTemplates {
|
||||
@SafeHtmlTemplates.Template("<div class=\"{1}\" style=\"background:{0};\"> </div>")
|
||||
SafeHtml colorBox(String htmlColor, SafeHtml styleClass);
|
||||
@SafeHtmlTemplates.Template("<div class=\"{1}\" style=\"{0}\"> </div>")
|
||||
SafeHtml colorBox(SafeStyles htmlColor, String styleClass);
|
||||
|
||||
@SafeHtmlTemplates.Template("<div class=\"{0}\"> </div>")
|
||||
SafeHtml nocolorBox(SafeHtml styleClass);
|
||||
@@ -224,7 +225,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
public SafeHtml getValue(StrippedLeaderboardDTO strippedLeaderboardDTO) {
|
||||
String text = strippedLeaderboardDTO.displayName != null ? strippedLeaderboardDTO.displayName : strippedLeaderboardDTO.name;
|
||||
SafeHtmlBuilder b = new SafeHtmlBuilder();
|
||||
b.append(TEXTTEMPLATE.textWithClass(text, SafeHtmlUtils.fromTrustedString(STYLE_BOATCLASS)));
|
||||
b.append(TEXTTEMPLATE.textWithClass(text, STYLE_BOATCLASS));
|
||||
return b.toSafeHtml();
|
||||
}
|
||||
};
|
||||
@@ -236,7 +237,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
public SafeHtml getValue(StrippedLeaderboardDTO leaderboard) {
|
||||
String link = EntryPointLinkFactory.createLeaderboardLink(createLeaderboardLinkParameters(leaderboard));
|
||||
return getAnchor(link, stringMessages.leaderboard(),
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_ACTIVE_LEADERBOARD));
|
||||
STYLE_ACTIVE_LEADERBOARD);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -336,7 +337,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
// render the series name
|
||||
if (!LeaderboardNameConstants.DEFAULT_SERIES_NAME.equals(series.getName())) {
|
||||
seriesGrid.setHTML(seriesRow, 0, TEXTTEMPLATE.textWithClass(series.getName(), 50,
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_TABLE_TEXT)));
|
||||
STYLE_TABLE_TEXT));
|
||||
}
|
||||
seriesGridFormatter.setVerticalAlignment(seriesRow, 0, HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
int numberOfFleets = series.getFleets().size();
|
||||
@@ -348,12 +349,12 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
for(FleetDTO fleet: series.getFleets()) {
|
||||
Color color = fleet.getColor();
|
||||
if(color != null) {
|
||||
fleetsGrid.setHTML(fleetRow, 0, COLORBOXTEMPLATE.colorBox(color.getAsHtml(),
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_COLORBOX)));
|
||||
SafeStyles bgStyle = new SafeStylesBuilder().trustedBackgroundColor(color.getAsHtml()).toSafeStyles();
|
||||
fleetsGrid.setHTML(fleetRow, 0, COLORBOXTEMPLATE.colorBox(bgStyle, STYLE_COLORBOX));
|
||||
fleetGridsFormatter.setVerticalAlignment(fleetRow, 0, HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
}
|
||||
fleetsGrid.setHTML(fleetRow, 1, TEXTTEMPLATE.textWithClass(fleet.getName(), 50,
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_TABLE_TEXT)));
|
||||
STYLE_TABLE_TEXT));
|
||||
fleetGridsFormatter.setVerticalAlignment(fleetRow, 1, HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
List<RaceColumnDTO> raceColumnsOfSeries = getRacesOfFleet(leaderboard, series, fleet);
|
||||
fleetsGrid.setHTML(fleetRow, 2, renderRacesToHTml(leaderboard.name, raceColumnsOfSeries, fleet));
|
||||
@@ -369,7 +370,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
Grid fleetsGrid = new Grid(1, 2);
|
||||
CellFormatter fleetGridsFormatter = fleetsGrid.getCellFormatter();
|
||||
fleetsGrid.setHTML(0, 0, TEXTTEMPLATE.textWithClass(displayName, 50,
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_TABLE_TEXT)));
|
||||
STYLE_TABLE_TEXT));
|
||||
fleetGridsFormatter.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
|
||||
fleetsGrid.setHTML(0, 1, renderRacesToHTml(leaderboard.name, raceColumnsOfSeries, fleet));
|
||||
seriesGrid.setWidget(seriesRow, 1, fleetsGrid);
|
||||
@@ -417,16 +418,16 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
RegattaAndRaceIdentifier raceIdentifier = race.getRaceIdentifier();
|
||||
String link = EntryPointLinkFactory.createRaceBoardLink(createRaceBoardLinkParameters(leaderboardName, raceIdentifier));
|
||||
if (isLive) {
|
||||
b.append(getAnchor(link, raceColumnName, SafeHtmlUtils.fromTrustedString(STYLE_LIVE_RACE)));
|
||||
b.append(getAnchor(link, raceColumnName, STYLE_LIVE_RACE));
|
||||
} else if (race.trackedRace.hasGPSData && race.trackedRace.hasWindData) {
|
||||
b.append(getAnchor(link, raceColumnName, SafeHtmlUtils.fromTrustedString(STYLE_ACTIVE_RACE)));
|
||||
b.append(getAnchor(link, raceColumnName, STYLE_ACTIVE_RACE));
|
||||
} else {
|
||||
b.append(TEXTTEMPLATE.textWithClass(raceColumnName,
|
||||
SafeHtmlUtils.fromTrustedString(STYLE_INACTIVE_RACE)));
|
||||
STYLE_INACTIVE_RACE));
|
||||
}
|
||||
} else {
|
||||
b.append(
|
||||
TEXTTEMPLATE.textWithClass(raceColumnName, SafeHtmlUtils.fromTrustedString(STYLE_INACTIVE_RACE)));
|
||||
TEXTTEMPLATE.textWithClass(raceColumnName, STYLE_INACTIVE_RACE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +451,7 @@ public class LeaderboardGroupPanel extends SimplePanel implements HasWelcomeWidg
|
||||
return linkParams;
|
||||
}
|
||||
|
||||
private SafeHtml getAnchor(String link, String linkText, SafeHtml style) {
|
||||
private SafeHtml getAnchor(String link, String linkText, String style) {
|
||||
if (isEmbedded) {
|
||||
return ANCHORTEMPLATE.anchorWithTarget(UriUtils.fromString(link), linkText, style, "_blank");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user