mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 06:17:27 +00:00
More generic handling of the quickfinder to make it reusable for series
This commit is contained in:
1 parent
db9b0e7022
commit
8e9bdb2c87
6 files changed
+22
-6
No files matched your search
+3
-4
@@ -17,7 +17,6 @@ import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.EventListener;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.mobile.places.RegattaLeaderboardNavigationProvider;
|
||||
|
||||
public class Quickfinder extends Widget implements HasSelectionHandlers<String> {
|
||||
private static QuickfinderUiBinder uiBinder = GWT.create(QuickfinderUiBinder.class);
|
||||
@@ -30,16 +29,16 @@ public class Quickfinder extends Widget implements HasSelectionHandlers<String>
|
||||
@UiField
|
||||
protected SelectElement selectUi;
|
||||
|
||||
public Quickfinder(final RegattaLeaderboardNavigationProvider presenter) {
|
||||
public Quickfinder(final QuickfinderNavigationHandler presenter) {
|
||||
setElement(uiBinder.createAndBindUi(this));
|
||||
Event.sinkEvents(selectUi, Event.ONCHANGE);
|
||||
Event.setEventListener(selectUi, new EventListener() {
|
||||
@Override
|
||||
public void onBrowserEvent(Event event) {
|
||||
OptionElement oe = event.getEventTarget().cast();
|
||||
presenter.getRegattaMiniLeaderboardNavigation(oe.getValue()).goToPlace();
|
||||
presenter.navigate(oe.getValue());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package com.sap.sailing.gwt.home.mobile.partials.quickfinder;
|
||||
|
||||
public interface QuickfinderNavigationHandler {
|
||||
void navigate(String value);
|
||||
}
|
||||
+5
@@ -143,6 +143,11 @@ public class EventActivity extends AbstractActivity implements Presenter {
|
||||
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void navigate(String regattaId) {
|
||||
getRegattaMiniLeaderboardNavigation(regattaId).goToPlace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventContext;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.quickfinder.QuickfinderNavigationHandler;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.updatesBox.NewsItemLinkProvider;
|
||||
import com.sap.sailing.gwt.home.mobile.places.RegattaLeaderboardNavigationProvider;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
@@ -24,7 +25,7 @@ public interface EventView {
|
||||
|
||||
void setMediaForImpressions(int nrOfImages, int nrOfVideos, List<SailingImageDTO> images);
|
||||
|
||||
public interface Presenter extends NewsItemLinkProvider, RegattaLeaderboardNavigationProvider {
|
||||
public interface Presenter extends NewsItemLinkProvider, RegattaLeaderboardNavigationProvider, QuickfinderNavigationHandler {
|
||||
EventContext getCtx();
|
||||
DispatchSystem getDispatch();
|
||||
String getRaceViewerURL(String regattaName, String trackedRaceName);
|
||||
|
||||
+5
@@ -62,6 +62,11 @@ public class MiniLeaderboardActivity extends AbstractActivity implements Present
|
||||
public EventContext getCtx() {
|
||||
return place.getCtx();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void navigate(String regattaId) {
|
||||
getRegattaMiniLeaderboardNavigation(regattaId).goToPlace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
|
||||
|
||||
+2
-1
@@ -4,13 +4,14 @@ import java.util.Collection;
|
||||
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventContext;
|
||||
import com.sap.sailing.gwt.home.mobile.partials.quickfinder.QuickfinderNavigationHandler;
|
||||
import com.sap.sailing.gwt.home.mobile.places.RegattaLeaderboardNavigationProvider;
|
||||
import com.sap.sailing.gwt.home.shared.dispatch.DispatchSystem;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.RegattaMetadataDTO;
|
||||
|
||||
public interface MiniLeaderboardView {
|
||||
|
||||
public interface Presenter extends RegattaLeaderboardNavigationProvider {
|
||||
public interface Presenter extends RegattaLeaderboardNavigationProvider, QuickfinderNavigationHandler {
|
||||
|
||||
DispatchSystem getDispatch();
|
||||
|
||||
|
||||
Reference in new issue
Block a user