mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 03:00:00 +00:00
Show multiple events for a search result
This commit is contained in:
1 parent
dd4913a924
commit
419fead7a1
12 files changed
+234
-109
No files matched your search
+7
-44
@@ -1,9 +1,8 @@
|
||||
package com.sap.sailing.gwt.home.communication.search;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
import com.sap.sailing.domain.base.EventBase;
|
||||
@@ -16,7 +15,7 @@ public class SearchResultDTO implements DTO {
|
||||
private String leaderboardName;
|
||||
private String baseUrl;
|
||||
private boolean isOnRemoteServer;
|
||||
private ArrayList<EventInfoDTO> events = new ArrayList<>();
|
||||
private TreeSet<SearchResultEventInfoDTO> events = new TreeSet<>();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private SearchResultDTO() {
|
||||
@@ -27,11 +26,11 @@ public class SearchResultDTO implements DTO {
|
||||
this.leaderboardName = hit.getLeaderboard().getName();
|
||||
this.displayName = hit.getLeaderboard().getDisplayName() != null ? hit.getLeaderboard().getDisplayName() :
|
||||
(hit.getRegattaName() != null ? hit.getRegattaName() : leaderboardName);
|
||||
for (EventBase event : hit.getEvents()) {
|
||||
events.add(new EventInfoDTO(event));
|
||||
}
|
||||
this.baseUrl = baseUrl.toString();
|
||||
this.isOnRemoteServer = isOnRemoteServer;
|
||||
for (EventBase event : hit.getEvents()) {
|
||||
events.add(new SearchResultEventInfoDTO(event));
|
||||
}
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
@@ -50,44 +49,8 @@ public class SearchResultDTO implements DTO {
|
||||
return isOnRemoteServer;
|
||||
}
|
||||
|
||||
public ArrayList<EventInfoDTO> getEvents() {
|
||||
public Set<SearchResultEventInfoDTO> getEvents() {
|
||||
return events;
|
||||
}
|
||||
|
||||
public class EventInfoDTO implements DTO {
|
||||
private UUID id;
|
||||
private String name;
|
||||
private String venueName;
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
|
||||
@GwtIncompatible
|
||||
public EventInfoDTO(EventBase event) {
|
||||
this.id = (UUID) event.getId();
|
||||
this.name = event.getName();
|
||||
this.venueName = event.getVenue() != null ? event.getVenue().getName() : null;
|
||||
this.startDate = event.getStartDate() != null ? event.getStartDate().asDate() : null;
|
||||
this.endDate = event.getEndDate() != null ? event.getEndDate().asDate() : null;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getVenueName() {
|
||||
return venueName;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.sap.sailing.gwt.home.communication.search;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.core.shared.GwtIncompatible;
|
||||
import com.sap.sailing.domain.base.EventBase;
|
||||
import com.sap.sailing.gwt.dispatch.client.DTO;
|
||||
import com.sap.sse.common.util.NaturalComparator;
|
||||
|
||||
public class SearchResultEventInfoDTO implements DTO, Comparable<SearchResultEventInfoDTO> {
|
||||
|
||||
private UUID id;
|
||||
private String name;
|
||||
private String venueName;
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private SearchResultEventInfoDTO() {
|
||||
}
|
||||
|
||||
@GwtIncompatible
|
||||
public SearchResultEventInfoDTO(EventBase event) {
|
||||
this.id = (UUID) event.getId();
|
||||
this.name = event.getName();
|
||||
this.venueName = event.getVenue() != null ? event.getVenue().getName() : null;
|
||||
this.startDate = event.getStartDate() != null ? event.getStartDate().asDate() : null;
|
||||
this.endDate = event.getEndDate() != null ? event.getEndDate().asDate() : null;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getVenueName() {
|
||||
return venueName;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(SearchResultEventInfoDTO other) {
|
||||
return new NaturalComparator().compare(this.name, other.name);
|
||||
}
|
||||
|
||||
}
|
||||
+14
-21
@@ -2,56 +2,49 @@ package com.sap.sailing.gwt.home.desktop.partials.searchresult;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.AnchorElement;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO.EventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.partials.searchresult.AbstractSearchResultItem;
|
||||
|
||||
public class SearchResultItem extends AbstractSearchResultItem {
|
||||
|
||||
private static SearchResultUiBinder uiBinder = GWT.create(SearchResultUiBinder.class);
|
||||
private static SearchResultItemUiBinder uiBinder = GWT.create(SearchResultItemUiBinder.class);
|
||||
|
||||
interface SearchResultUiBinder extends UiBinder<Element, SearchResultItem> {
|
||||
interface SearchResultItemUiBinder extends UiBinder<Element, SearchResultItem> {
|
||||
}
|
||||
|
||||
@UiField AnchorElement resultTitleUi;
|
||||
@UiField SpanElement resultDescriptionUi;
|
||||
@UiField AnchorElement eventNameUi;
|
||||
@UiField SpanElement eventVenueUi;
|
||||
@UiField SpanElement eventDateUi;
|
||||
@UiField DivElement eventInfoContainerUi;
|
||||
private final DesktopPlacesNavigator navigator;
|
||||
private final SearchResultDTO item;
|
||||
|
||||
SearchResultItem(DesktopPlacesNavigator navigator, SearchResultDTO item) {
|
||||
this.navigator = navigator;
|
||||
this.item = item;
|
||||
init(uiBinder.createAndBindUi(this), item);
|
||||
EventInfoDTO event = item.getEvents().get(0);
|
||||
SearchResultEventInfoDTO event = item.getEvents().iterator().next();
|
||||
String eventId = String.valueOf(event.getId()), leaderboardName = item.getLeaderboardName(), baseUrl = item.getBaseUrl();
|
||||
PlaceNavigation<?> regattaNavigation = navigator.getRegattaNavigation(eventId, leaderboardName, baseUrl, item.isOnRemoteServer());
|
||||
regattaNavigation.configureAnchorElement(resultTitleUi);
|
||||
PlaceNavigation<?> eventNavigation = navigator.getEventNavigation(eventId, baseUrl, item.isOnRemoteServer());
|
||||
eventNavigation.configureAnchorElement(eventNameUi);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getResultTitleUi() {
|
||||
return resultTitleUi;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Element getEventNameUi() {
|
||||
return eventNameUi;
|
||||
protected void addEventInfo(SearchResultEventInfoDTO event) {
|
||||
eventInfoContainerUi.appendChild(new SearchResultItemEventInfo(
|
||||
navigator, event, item.getBaseUrl(), item.isOnRemoteServer()).getElement());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventVenueUi() {
|
||||
return eventVenueUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventDateUi() {
|
||||
return eventDateUi;
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -3,15 +3,10 @@
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.searchresult.SearchResultResources" />
|
||||
<div class="{local_res.css.searchresult_content_item}">
|
||||
<div class="{local_res.css.searchresult_content_item}" ui:field="eventInfoContainerUi">
|
||||
<a ui:field="resultTitleUi" class="{local_res.css.searchresult_content_item_headline}" />
|
||||
<div class="{local_res.css.searchresult_content_item_description}"><span ui:field="resultDescriptionUi" />
|
||||
<!-- <a href="http://" class="{local_res.css.searchresult_content_item_description_morelink}">More</a>-->
|
||||
</div>
|
||||
<div class="{local_res.css.searchresult_content_item_footer}">
|
||||
<a ui:field="eventNameUi" class="{local_res.css.searchresult_content_item_footer_link}" />
|
||||
<span class="{local_res.css.searchresult_content_item_footer_separator}">|</span><span ui:field="eventVenueUi" />
|
||||
<span class="{local_res.css.searchresult_content_item_footer_separator}">|</span><span ui:field="eventDateUi" />
|
||||
</div>
|
||||
</div>
|
||||
</ui:UiBinder>
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.sap.sailing.gwt.home.desktop.partials.searchresult;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.AnchorElement;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.desktop.app.DesktopPlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.partials.searchresult.AbstractSearchResultItemEventInfo;
|
||||
|
||||
public class SearchResultItemEventInfo extends AbstractSearchResultItemEventInfo {
|
||||
|
||||
private static SearchResultItemEventInfoUiBinder uiBinder = GWT.create(SearchResultItemEventInfoUiBinder.class);
|
||||
|
||||
interface SearchResultItemEventInfoUiBinder extends UiBinder<Element, SearchResultItemEventInfo> {
|
||||
}
|
||||
|
||||
@UiField AnchorElement eventNameUi;
|
||||
@UiField SpanElement eventVenueUi;
|
||||
@UiField SpanElement eventDateUi;
|
||||
|
||||
SearchResultItemEventInfo(DesktopPlacesNavigator navigator, SearchResultEventInfoDTO event, String baseUrl,
|
||||
boolean isOnRemoteServer) {
|
||||
init(uiBinder.createAndBindUi(this), event);
|
||||
String eventId = String.valueOf(event.getId());
|
||||
PlaceNavigation<?> eventNavigation = navigator.getEventNavigation(eventId, baseUrl, isOnRemoteServer);
|
||||
eventNavigation.configureAnchorElement(eventNameUi);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventNameUi() {
|
||||
return eventNameUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventVenueUi() {
|
||||
return eventVenueUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventDateUi() {
|
||||
return eventDateUi;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.desktop.partials.searchresult.SearchResultResources" />
|
||||
<div class="{local_res.css.searchresult_content_item_footer}">
|
||||
<a ui:field="eventNameUi" class="{local_res.css.searchresult_content_item_footer_link}" />
|
||||
<span class="{local_res.css.searchresult_content_item_footer_separator}">|</span><span ui:field="eventVenueUi" />
|
||||
<span class="{local_res.css.searchresult_content_item_footer_separator}">|</span><span ui:field="eventDateUi" />
|
||||
</div>
|
||||
</ui:UiBinder>
|
||||
+9
-19
@@ -4,11 +4,10 @@ import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.AnchorElement;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO.EventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.partials.searchresult.AbstractSearchResultItem;
|
||||
@@ -21,14 +20,14 @@ public class SearchResultItem extends AbstractSearchResultItem {
|
||||
}
|
||||
|
||||
@UiField DivElement resultTitleUi;
|
||||
@UiField DivElement eventNameUi;
|
||||
@UiField SpanElement eventVenueUi;
|
||||
@UiField SpanElement eventDateUi;
|
||||
@UiField DivElement eventInfoContainerUi;
|
||||
private final AnchorElement anchorUi;
|
||||
private final MobilePlacesNavigator navigator;
|
||||
|
||||
SearchResultItem(MobilePlacesNavigator navigator, SearchResultDTO item) {
|
||||
this.navigator = navigator;
|
||||
init(anchorUi = uiBinder.createAndBindUi(this), item);
|
||||
EventInfoDTO event = item.getEvents().get(0);
|
||||
SearchResultEventInfoDTO event = item.getEvents().iterator().next();
|
||||
String eventId = String.valueOf(event.getId()), leaderboardName = item.getLeaderboardName(), baseUrl = item.getBaseUrl();
|
||||
PlaceNavigation<?> regattaNavigation = navigator.getRegattaOverviewNavigation(eventId, leaderboardName, baseUrl, item.isOnRemoteServer());
|
||||
regattaNavigation.configureAnchorElement(anchorUi);
|
||||
@@ -38,20 +37,11 @@ public class SearchResultItem extends AbstractSearchResultItem {
|
||||
protected Element getResultTitleUi() {
|
||||
return resultTitleUi;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected Element getEventNameUi() {
|
||||
return eventNameUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventVenueUi() {
|
||||
return eventVenueUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventDateUi() {
|
||||
return eventDateUi;
|
||||
protected void addEventInfo(SearchResultEventInfoDTO event) {
|
||||
if (eventInfoContainerUi.hasChildNodes()) return; // TODO: Temporary add only one event on mobile
|
||||
eventInfoContainerUi.appendChild(new SearchResultItemEventInfo(navigator, event).getElement());
|
||||
}
|
||||
|
||||
}
|
||||
+1
-7
@@ -6,13 +6,7 @@
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.mobile.partials.searchresult.SearchResultResources" />
|
||||
<a class="{local_res.css.searchresult_item} {res.mediaCss.small12} {res.mediaCss.columns}">
|
||||
<div class="{local_res.css.searchresult_item_headline}" ui:field="resultTitleUi"> </div>
|
||||
<div class="{local_res.css.searchresult_item_event}">
|
||||
<div class="{local_res.css.searchresult_item_event_link}" ui:field="eventNameUi"></div>
|
||||
<div>
|
||||
<span class="{local_res.css.searchresult_item_event_separator}" ui:field="eventVenueUi"></span>
|
||||
<span ui:field="eventDateUi"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div ui:field="eventInfoContainerUi"></div>
|
||||
<div class="{local_res.css.searchresult_item_arrow}"></div>
|
||||
</a>
|
||||
</ui:UiBinder>
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.searchresult;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.mobile.app.MobilePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.shared.partials.searchresult.AbstractSearchResultItemEventInfo;
|
||||
|
||||
public class SearchResultItemEventInfo extends AbstractSearchResultItemEventInfo {
|
||||
|
||||
private static SearchResultItemEventInfoUiBinder uiBinder = GWT.create(SearchResultItemEventInfoUiBinder.class);
|
||||
|
||||
interface SearchResultItemEventInfoUiBinder extends UiBinder<Element, SearchResultItemEventInfo> {
|
||||
}
|
||||
|
||||
@UiField DivElement eventNameUi;
|
||||
@UiField SpanElement eventVenueUi;
|
||||
@UiField SpanElement eventDateUi;
|
||||
|
||||
SearchResultItemEventInfo(MobilePlacesNavigator navigator, SearchResultEventInfoDTO event) {
|
||||
init(uiBinder.createAndBindUi(this), event);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventNameUi() {
|
||||
return eventNameUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventVenueUi() {
|
||||
return eventVenueUi;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Element getEventDateUi() {
|
||||
return eventDateUi;
|
||||
}
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared" xmlns:mp="urn:import:com.sap.sailing.gwt.home.mobile.partials">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.mobile.partials.searchresult.SearchResultResources" />
|
||||
<div class="{local_res.css.searchresult_item_event}">
|
||||
<div class="{local_res.css.searchresult_item_event_link}" ui:field="eventNameUi"></div>
|
||||
<div>
|
||||
<span class="{local_res.css.searchresult_item_event_separator}" ui:field="eventVenueUi"></span>
|
||||
<span ui:field="eventDateUi"></span>
|
||||
</div>
|
||||
</div>
|
||||
</ui:UiBinder>
|
||||
+4
-12
@@ -1,30 +1,22 @@
|
||||
package com.sap.sailing.gwt.home.shared.partials.searchresult;
|
||||
|
||||
import static com.sap.sailing.gwt.home.shared.utils.EventDatesFormatterUtil.formatDateRangeWithYear;
|
||||
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultDTO.EventInfoDTO;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
|
||||
public abstract class AbstractSearchResultItem extends Widget {
|
||||
|
||||
protected final void init(Element element, SearchResultDTO item) {
|
||||
setElement(element);
|
||||
getResultTitleUi().setInnerText(item.getDisplayName());
|
||||
EventInfoDTO event = item.getEvents().get(0);
|
||||
getEventNameUi().setInnerText(event.getName());
|
||||
getEventVenueUi().setInnerText(event.getVenueName());
|
||||
if (event.getStartDate() != null && event.getEndDate() != null) {
|
||||
getEventDateUi().setInnerText(formatDateRangeWithYear(event.getStartDate(), event.getEndDate()));
|
||||
for (SearchResultEventInfoDTO event : item.getEvents()) {
|
||||
addEventInfo(event);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Element getResultTitleUi();
|
||||
|
||||
protected abstract Element getEventNameUi();
|
||||
protected abstract void addEventInfo(SearchResultEventInfoDTO event);
|
||||
|
||||
protected abstract Element getEventVenueUi();
|
||||
|
||||
protected abstract Element getEventDateUi();
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.sap.sailing.gwt.home.shared.partials.searchresult;
|
||||
|
||||
import static com.sap.sailing.gwt.home.shared.utils.EventDatesFormatterUtil.formatDateRangeWithYear;
|
||||
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.user.client.ui.UIObject;
|
||||
import com.sap.sailing.gwt.home.communication.search.SearchResultEventInfoDTO;
|
||||
|
||||
public abstract class AbstractSearchResultItemEventInfo extends UIObject {
|
||||
|
||||
protected final void init(Element element, SearchResultEventInfoDTO event) {
|
||||
setElement(element);
|
||||
getEventNameUi().setInnerText(event.getName());
|
||||
getEventVenueUi().setInnerText(event.getVenueName());
|
||||
if (event.getStartDate() != null && event.getEndDate() != null) {
|
||||
getEventDateUi().setInnerText(formatDateRangeWithYear(event.getStartDate(), event.getEndDate()));
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Element getEventNameUi();
|
||||
|
||||
protected abstract Element getEventVenueUi();
|
||||
|
||||
protected abstract Element getEventDateUi();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user