Renamed views and moved classes to better reflect events structure

This commit is contained in:
Papick Garcia Taboada committed 2015-02-25 11:53:21 +01:00
1 parent 39eea7d47c
commit 2d1a088996
39 files changed
+235 -226

No files matched your search

@@ -25,7 +25,7 @@ import com.google.gwt.user.client.ui.Widget;
public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
private static TabPanelUiBinder ourUiBinder = GWT.create(TabPanelUiBinder.class);
private final Map<Class<Place>, TabActivity<Place, PLACECONTEXT, PRESENTER>> knownTabs = new HashMap<>();
private final Map<Class<Place>, TabView<Place, PLACECONTEXT, PRESENTER>> knownTabs = new HashMap<>();
@UiField
SimplePanel additionalHeader;
@UiField
@@ -33,7 +33,7 @@ public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
@UiField
TabBar tabBar;
@UiField BreadcrumbPane breadcrumbs;
private TabActivity<Place, PLACECONTEXT, PRESENTER> currentTab;
private TabView<Place, PLACECONTEXT, PRESENTER> currentTab;
private final PlaceContextProvider<PLACECONTEXT> contextProvider;
private final PlaceHistoryMapper historyMapper;
@@ -46,7 +46,7 @@ public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
initWidget(ourUiBinder.createAndBindUi(this));
}
public TabActivity<?, PLACECONTEXT, PRESENTER> getCurrentTab() {
public TabView<?, PLACECONTEXT, PRESENTER> getCurrentTab() {
return currentTab;
}
@@ -64,7 +64,7 @@ public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
* The label for the tab.
*/
@UiChild
public void addTabContent(final TabActivity<Place, PLACECONTEXT, PRESENTER> tab, String title) {
public void addTabContent(final TabView<Place, PLACECONTEXT, PRESENTER> tab, String title) {
GWT.log("Adding TAB: " + title);
@@ -85,7 +85,7 @@ public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
@UiHandler("tabBar")
void onTabSelection(SelectionEvent<Class<Place>> event) {
TabActivity<?, PLACECONTEXT, PRESENTER> selectedTabActivity = knownTabs.get(event.getSelectedItem());
TabView<?, PLACECONTEXT, PRESENTER> selectedTabActivity = knownTabs.get(event.getSelectedItem());
if (selectedTabActivity != null) {
GWT.log("Tab selection: " + selectedTabActivity.getPlaceClassForActivation().getName());
if (currentTab != null) {
@@ -105,7 +105,7 @@ public class TabPanel<PLACECONTEXT, PRESENTER> extends Composite {
public void activatePlace(Place placeToGo) {
if (knownTabs.containsKey(placeToGo.getClass())) {
final TabActivity<Place, PLACECONTEXT, PRESENTER> newTabActivity = knownTabs.get(placeToGo.getClass());
final TabView<Place, PLACECONTEXT, PRESENTER> newTabActivity = knownTabs.get(placeToGo.getClass());
newTabActivity.start(placeToGo, tabContentPanelUi);
tabBar.select(placeToGo);
@@ -10,9 +10,9 @@ public class TabPanelPlaceSelectionEvent<CONTEXT> extends GwtEvent<TabPanelPlace
public final static Type<Handler> TYPE = new Type<Handler>();
private TabActivity<?, CONTEXT, ?> selectedActivity;
private TabView<?, CONTEXT, ?> selectedActivity;
public TabPanelPlaceSelectionEvent(TabActivity<?, CONTEXT, ?> selectedActivity) {
public TabPanelPlaceSelectionEvent(TabView<?, CONTEXT, ?> selectedActivity) {
this.selectedActivity = selectedActivity;
}
@@ -21,7 +21,7 @@ public class TabPanelPlaceSelectionEvent<CONTEXT> extends GwtEvent<TabPanelPlace
return TYPE;
}
public TabActivity<?, CONTEXT, ?> getSelectedActivity() {
public TabView<?, CONTEXT, ?> getSelectedActivity() {
return selectedActivity;
}
@@ -9,7 +9,7 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
* <p/>
* Created by pgtaboada on 25.11.14.
*/
public interface TabActivity<PLACE extends Place, PLACECONTEXT, PRESENTER> {
public interface TabView<PLACE extends Place, PLACECONTEXT, PRESENTER> {
/**
* The place type that activates this tab.
@@ -6,13 +6,13 @@ import com.sap.sailing.gwt.home.client.place.aboutus.AboutUsPlace;
import com.sap.sailing.gwt.home.client.place.contact.ContactPlace;
import com.sap.sailing.gwt.home.client.place.event.EventPlace;
import com.sap.sailing.gwt.home.client.place.event2.EventDefaultPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.media.MultiRegattaMediaPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.overview.MultiRegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.regattas.EventRegattasPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.leaderboard.EventLeaderboardPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.media.MediaPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.races.EventRacesPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.MultiregattaMediaPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.MultiregattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.MultiregattaRegattasPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaLeaderboardPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaMediaPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaRacesPlace;
import com.sap.sailing.gwt.home.client.place.events.EventsPlace;
import com.sap.sailing.gwt.home.client.place.regatta.RegattaPlace;
import com.sap.sailing.gwt.home.client.place.searchresult.SearchResultPlace;
@@ -29,14 +29,14 @@ import com.sap.sailing.gwt.home.client.place.whatsnew.WhatsNewPlace;
// Event tab places...
EventDefaultPlace.Tokenizer.class,//
// Multiregatta places:
MultiRegattaMediaPlace.Tokenizer.class, //
MultiRegattaOverviewPlace.Tokenizer.class,//
EventRegattasPlace.Tokenizer.class,//
MultiregattaMediaPlace.Tokenizer.class, //
MultiregattaOverviewPlace.Tokenizer.class,//
MultiregattaRegattasPlace.Tokenizer.class,//
// Regatta places:
RegattaOverviewPlace.Tokenizer.class,//
EventRacesPlace.Tokenizer.class, //
EventLeaderboardPlace.Tokenizer.class, //
MediaPlace.Tokenizer.class
RegattaRacesPlace.Tokenizer.class, //
RegattaLeaderboardPlace.Tokenizer.class, //
RegattaMediaPlace.Tokenizer.class
})
public interface ApplicationHistoryMapper extends PlaceHistoryMapper {
@@ -2,14 +2,14 @@ package com.sap.sailing.gwt.home.client.place.event2;
import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.place.shared.Place;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.home.client.place.event.EventClientFactory;
import com.sap.sailing.gwt.home.client.place.event2.EventView.PlaceCallback;
import com.sap.sailing.gwt.home.client.place.event2.model.EventDTO;
import com.sap.sailing.gwt.home.client.place.event2.model.EventReferenceDTO;
import com.sap.sailing.gwt.home.client.place.event2.model.EventType;
import com.sap.sailing.gwt.home.client.place.event2.model.RegattaDTO;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
public abstract class EventActivity<PLACE extends AbstractEventPlace> extends AbstractActivity implements EventView.Presenter {
@@ -21,7 +21,7 @@ public abstract class EventActivity<PLACE extends AbstractEventPlace> extends Ab
public EventActivity(PLACE place, EventClientFactory clientFactory) {
this.currentPlace = place;
this.ctx = new EventContext(clientFactory, place.getCtx());
this.ctx = new EventContext(place.getCtx());
this.clientFactory = clientFactory;
}
@@ -32,7 +32,7 @@ public abstract class EventActivity<PLACE extends AbstractEventPlace> extends Ab
}
@Override
public void handleTabPlaceSelection(TabActivity<?, EventContext, ? extends EventView.Presenter> selectedActivity) {
public void handleTabPlaceSelection(TabView<?, EventContext, ? extends EventView.Presenter> selectedActivity) {
Place tabPlaceToGo = selectedActivity.placeToFire(ctx);
clientFactory.getPlaceController().goTo(tabPlaceToGo);
}
@@ -11,10 +11,10 @@ import com.sap.sailing.gwt.home.client.place.event2.model.RegattaDTO;
import com.sap.sailing.gwt.home.client.place.event2.model.State;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.AbstractMultiregattaEventPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaActivity;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.overview.MultiRegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.MultiregattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaActivity;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
import com.sap.sse.gwt.client.mvp.AbstractActivityProxy;
public class EventActivityProxy extends AbstractActivityProxy {
@@ -119,6 +119,6 @@ public class EventActivityProxy extends AbstractActivityProxy {
if(event.getType() == EventType.SINGLE_REGATTA) {
return new RegattaOverviewPlace(ctx.withRegattaId(event.getRegattas().get(0).getName()));
}
return new MultiRegattaOverviewPlace(place.getCtx());
return new MultiregattaOverviewPlace(place.getCtx());
}
}
@@ -1,6 +1,5 @@
package com.sap.sailing.gwt.home.client.place.event2;
import com.sap.sailing.gwt.home.client.place.event.EventClientFactory;
import com.sap.sailing.gwt.home.client.place.event2.model.EventDTO;
/**
@@ -11,7 +10,6 @@ import com.sap.sailing.gwt.home.client.place.event2.model.EventDTO;
*/
public class EventContext {
private EventClientFactory clientFactory;
private String eventId;
private String regattaId;
@@ -28,10 +26,9 @@ public class EventContext {
updateContext(dto);
}
public EventContext(EventClientFactory clientFactory, EventContext ctx) {
public EventContext(EventContext ctx) {
updateContext(ctx.getEventDTO());
withRegattaId(ctx.regattaId);
this.clientFactory = clientFactory;
}
public EventContext withId(String eventId) {
@@ -73,12 +70,6 @@ public class EventContext {
return regattaId;
}
public EventClientFactory getClientFactory() {
return clientFactory;
}
public void setClientFactory(EventClientFactory clientFactory) {
this.clientFactory = clientFactory;
}
}
@@ -2,13 +2,13 @@ package com.sap.sailing.gwt.home.client.place.event2;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.IsWidget;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
public interface EventView<PLACE extends AbstractEventPlace, PRES extends EventView.Presenter> extends IsWidget {
public interface Presenter {
EventContext getCtx();
void handleTabPlaceSelection(TabActivity<?, EventContext, ? extends Presenter> selectedActivity);
void handleTabPlaceSelection(TabView<?, EventContext, ? extends Presenter> selectedActivity);
String getUrl(Place place);
void navigateTo(Place place);
boolean needsSelectionInHeader();
@@ -0,0 +1,10 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta;
import com.google.gwt.place.shared.Place;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
public interface MultiregattaTabView<PLACE extends Place> extends
TabView<PLACE, EventContext, EventMultiregattaView.Presenter> {
}
@@ -8,7 +8,7 @@ import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.common.client.controls.tabbar.PlaceContextProvider;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabPanelPlaceSelectionEvent;
import com.sap.sailing.gwt.home.client.app.ApplicationHistoryMapper;
@@ -67,7 +67,7 @@ public class TabletAndDesktopEventView extends Composite implements EventMultire
@UiHandler("tabPanelUi")
public void onTabSelection(TabPanelPlaceSelectionEvent<?> e) {
currentPresenter.handleTabPlaceSelection((TabActivity<?, EventContext, EventMultiregattaView.Presenter>) e.getSelectedActivity());
currentPresenter.handleTabPlaceSelection((TabView<?, EventContext, EventMultiregattaView.Presenter>) e.getSelectedActivity());
}
private void initBreadCrumbs() {
@@ -50,10 +50,10 @@
<h:EventHeader ui:field="eventHeader" />
</c:header>
<c:tabcontent title="Overview">
<tabs:overview.MultiRegattaOverviewWidgetAndActivity />
<tabs:MultiregattaOverviewTabView />
</c:tabcontent>
<c:tabcontent title="Regattas">
<tabs:regattas.EventRegattasWidgetAndActivity />
<tabs:MultiregattaRegattasTabView />
</c:tabcontent>
</c:TabPanel>
</g:HTMLPanel>
@@ -1,27 +1,27 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.media;
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.AbstractMultiregattaEventPlace;
public class MultiRegattaMediaPlace extends AbstractMultiregattaEventPlace {
public MultiRegattaMediaPlace(String id) {
public class MultiregattaMediaPlace extends AbstractMultiregattaEventPlace {
public MultiregattaMediaPlace(String id) {
super(id);
}
public MultiRegattaMediaPlace(EventContext context) {
public MultiregattaMediaPlace(EventContext context) {
super(context);
}
public static class Tokenizer implements PlaceTokenizer<MultiRegattaMediaPlace> {
public static class Tokenizer implements PlaceTokenizer<MultiregattaMediaPlace> {
@Override
public String getToken(MultiRegattaMediaPlace place) {
public String getToken(MultiregattaMediaPlace place) {
return place.getEventUuidAsString();
}
@Override
public MultiRegattaMediaPlace getPlace(String token) {
return new MultiRegattaMediaPlace(token);
public MultiregattaMediaPlace getPlace(String token) {
return new MultiregattaMediaPlace(token);
}
}
}
@@ -1,31 +1,30 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.media;
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaView;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.MultiregattaTabView;
/**
* Created by pgtaboada on 25.11.14.
*/
public class MultiRegattaMediaWidgetAndActivity extends Composite implements
TabActivity<MultiRegattaMediaPlace, EventContext, EventMultiregattaView.Presenter> {
public class MultiregattaMediaTabView extends Composite implements MultiregattaTabView<MultiregattaMediaPlace> {
public MultiRegattaMediaWidgetAndActivity() {
public MultiregattaMediaTabView() {
}
@Override
public Class<MultiRegattaMediaPlace> getPlaceClassForActivation() {
return MultiRegattaMediaPlace.class;
public Class<MultiregattaMediaPlace> getPlaceClassForActivation() {
return MultiregattaMediaPlace.class;
}
@Override
public void start(MultiRegattaMediaPlace myPlace, AcceptsOneWidget contentArea) {
public void start(MultiregattaMediaPlace myPlace, AcceptsOneWidget contentArea) {
initWidget(ourUiBinder.createAndBindUi(this));
@@ -37,14 +36,14 @@ public class MultiRegattaMediaWidgetAndActivity extends Composite implements
}
interface MyBinder extends UiBinder<HTMLPanel, MultiRegattaMediaWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, MultiregattaMediaTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public MultiRegattaMediaPlace placeToFire(EventContext ctx) {
return new MultiRegattaMediaPlace(ctx);
public MultiregattaMediaPlace placeToFire(EventContext ctx) {
return new MultiregattaMediaPlace(ctx);
}
@Override
@@ -1,27 +1,27 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.overview;
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.AbstractMultiregattaEventPlace;
public class MultiRegattaOverviewPlace extends AbstractMultiregattaEventPlace {
public MultiRegattaOverviewPlace(String id) {
public class MultiregattaOverviewPlace extends AbstractMultiregattaEventPlace {
public MultiregattaOverviewPlace(String id) {
super(id);
}
public MultiRegattaOverviewPlace(EventContext context) {
public MultiregattaOverviewPlace(EventContext context) {
super(context);
}
public static class Tokenizer implements PlaceTokenizer<MultiRegattaOverviewPlace> {
public static class Tokenizer implements PlaceTokenizer<MultiregattaOverviewPlace> {
@Override
public String getToken(MultiRegattaOverviewPlace place) {
public String getToken(MultiregattaOverviewPlace place) {
return place.getEventUuidAsString();
}
@Override
public MultiRegattaOverviewPlace getPlace(String token) {
return new MultiRegattaOverviewPlace(token);
public MultiregattaOverviewPlace getPlace(String token) {
return new MultiregattaOverviewPlace(token);
}
}
}
@@ -1,27 +1,26 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.overview;
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaView;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.MultiregattaTabView;
/**
* Created by pgtaboada on 25.11.14.
*/
public class MultiRegattaOverviewWidgetAndActivity extends Composite implements
TabActivity<MultiRegattaOverviewPlace, EventContext, EventMultiregattaView.Presenter> {
public class MultiregattaOverviewTabView extends Composite implements MultiregattaTabView<MultiregattaOverviewPlace> {
public MultiRegattaOverviewWidgetAndActivity() {
public MultiregattaOverviewTabView() {
}
@Override
public Class<MultiRegattaOverviewPlace> getPlaceClassForActivation() {
return MultiRegattaOverviewPlace.class;
public Class<MultiregattaOverviewPlace> getPlaceClassForActivation() {
return MultiregattaOverviewPlace.class;
}
@Override
@@ -31,7 +30,7 @@ public class MultiRegattaOverviewWidgetAndActivity extends Composite implements
}
@Override
public void start(MultiRegattaOverviewPlace myPlace, AcceptsOneWidget contentArea) {
public void start(MultiregattaOverviewPlace myPlace, AcceptsOneWidget contentArea) {
initWidget(ourUiBinder.createAndBindUi(this));
@@ -43,14 +42,14 @@ public class MultiRegattaOverviewWidgetAndActivity extends Composite implements
}
interface MyBinder extends UiBinder<HTMLPanel, MultiRegattaOverviewWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, MultiregattaOverviewTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public MultiRegattaOverviewPlace placeToFire(EventContext ctx) {
return new MultiRegattaOverviewPlace(ctx);
public MultiregattaOverviewPlace placeToFire(EventContext ctx) {
return new MultiregattaOverviewPlace(ctx);
}
}
@@ -0,0 +1,27 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.AbstractMultiregattaEventPlace;
public class MultiregattaRegattasPlace extends AbstractMultiregattaEventPlace {
public MultiregattaRegattasPlace(String id) {
super(id);
}
public MultiregattaRegattasPlace(EventContext context) {
super(context);
}
public static class Tokenizer implements PlaceTokenizer<MultiregattaRegattasPlace> {
@Override
public String getToken(MultiregattaRegattasPlace place) {
return place.getEventUuidAsString();
}
@Override
public MultiregattaRegattasPlace getPlace(String token) {
return new MultiregattaRegattasPlace(token);
}
}
}
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.regattas;
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -10,38 +10,38 @@ import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.PushButton;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.model.EventDTO;
import com.sap.sailing.gwt.home.client.place.event2.model.RegattaDTO;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaView;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaView.Presenter;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.MultiregattaTabView;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
/**
* Created by pgtaboada on 25.11.14.
*/
public class EventRegattasWidgetAndActivity extends Composite implements TabActivity<EventRegattasPlace, EventContext, EventMultiregattaView.Presenter> {
public class MultiregattaRegattasTabView extends Composite implements MultiregattaTabView<MultiregattaRegattasPlace> {
@UiField FlowPanel content;
private Presenter presenter;
public EventRegattasWidgetAndActivity() {
public MultiregattaRegattasTabView() {
}
@Override
public Class<EventRegattasPlace> getPlaceClassForActivation() {
return EventRegattasPlace.class;
public Class<MultiregattaRegattasPlace> getPlaceClassForActivation() {
return MultiregattaRegattasPlace.class;
}
@Override
public void setPresenter(Presenter presenter) {
public void setPresenter(EventMultiregattaView.Presenter presenter) {
this.presenter = presenter;
}
@Override
public void start(final EventRegattasPlace myPlace, AcceptsOneWidget contentArea) {
public void start(final MultiregattaRegattasPlace myPlace, AcceptsOneWidget contentArea) {
initWidget(ourUiBinder.createAndBindUi(this));
@@ -66,14 +66,14 @@ public class EventRegattasWidgetAndActivity extends Composite implements TabActi
}
interface MyBinder extends UiBinder<HTMLPanel, EventRegattasWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, MultiregattaRegattasTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public EventRegattasPlace placeToFire(EventContext ctx) {
return new EventRegattasPlace(ctx);
public MultiregattaRegattasPlace placeToFire(EventContext ctx) {
return new MultiregattaRegattasPlace(ctx);
}
}
@@ -1,27 +0,0 @@
package com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.regattas;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.AbstractMultiregattaEventPlace;
public class EventRegattasPlace extends AbstractMultiregattaEventPlace {
public EventRegattasPlace(String id) {
super(id);
}
public EventRegattasPlace(EventContext context) {
super(context);
}
public static class Tokenizer implements PlaceTokenizer<EventRegattasPlace> {
@Override
public String getToken(EventRegattasPlace place) {
return place.getEventUuidAsString();
}
@Override
public EventRegattasPlace getPlace(String token) {
return new EventRegattasPlace(token);
}
}
}
@@ -6,6 +6,7 @@ import com.sap.sailing.gwt.home.client.place.event.EventClientFactory;
import com.sap.sailing.gwt.home.client.place.event2.EventActivity;
import com.sap.sailing.gwt.home.client.place.event2.model.EventDTO;
import com.sap.sailing.gwt.home.client.place.event2.model.EventType;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
public class EventRegattaActivity extends EventActivity<AbstractEventRegattaPlace> implements EventRegattaView.Presenter {
@@ -35,4 +36,9 @@ public class EventRegattaActivity extends EventActivity<AbstractEventRegattaPlac
}
return super.getEventName();
}
@Override
public void gotoOverview() {
clientFactory.getPlaceController().goTo(new RegattaOverviewPlace(this.ctx));
}
}
@@ -5,5 +5,7 @@ import com.sap.sailing.gwt.home.client.place.event2.EventView;
public interface EventRegattaView extends EventView<AbstractEventRegattaPlace, EventRegattaView.Presenter> {
public interface Presenter extends EventView.Presenter {
void gotoOverview();
}
}
@@ -0,0 +1,10 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta;
import com.google.gwt.place.shared.Place;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
public interface RegattaTabView<PLACE extends Place> extends
TabView<PLACE, EventContext, EventRegattaView.Presenter> {
}
@@ -8,7 +8,7 @@ import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.common.client.controls.tabbar.PlaceContextProvider;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabPanelPlaceSelectionEvent;
import com.sap.sailing.gwt.home.client.app.ApplicationHistoryMapper;
@@ -66,7 +66,7 @@ public class TabletAndDesktopEventView extends Composite implements EventRegatta
@UiHandler("tabPanelUi")
public void onTabSelection(TabPanelPlaceSelectionEvent<?> e) {
currentPresenter.handleTabPlaceSelection((TabActivity<?, EventContext, EventRegattaView.Presenter>) e.getSelectedActivity());
currentPresenter.handleTabPlaceSelection((TabView<?, EventContext, EventRegattaView.Presenter>) e.getSelectedActivity());
}
private void initBreadCrumbs() {
@@ -51,16 +51,16 @@
<h:EventHeader ui:field="eventHeader" />
</c:header>
<c:tabcontent title="Overview">
<tabs:overview.RegattaOverviewWidgetAndActivity />
<tabs:RegattaOverviewTabView />
</c:tabcontent>
<c:tabcontent title="Races">
<tabs:races.EventRacesWidgetAndActivity />
<tabs:RegattaRacesTabView />
</c:tabcontent>
<c:tabcontent title="Leaderboard">
<tabs:leaderboard.EventLeaderboardWidgetAndActivity />
<tabs:RegattaLeaderboardTabView />
</c:tabcontent>
<c:tabcontent title="Media">
<tabs:leaderboard.EventLeaderboardWidgetAndActivity />
<tabs:RegattaMediaTabView />
</c:tabcontent>
</c:TabPanel>
</g:HTMLPanel>
@@ -0,0 +1,21 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
public class RegattaLeaderboardPlace extends AbstractEventRegattaPlace {
public RegattaLeaderboardPlace(String id, String regattaId) {
super(id, regattaId);
}
public RegattaLeaderboardPlace(EventContext context) {
super(context);
}
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<RegattaLeaderboardPlace> {
@Override
protected RegattaLeaderboardPlace getRealPlace(String eventId, String leaderboardName) {
return new RegattaLeaderboardPlace(eventId, leaderboardName);
}
}
}
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.leaderboard;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
@@ -8,35 +8,35 @@ import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Label;
import com.sap.sailing.domain.common.dto.LeaderboardDTO;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView;
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview.RegattaOverviewPlace;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView.Presenter;
import com.sap.sailing.gwt.home.client.place.event2.regatta.RegattaTabView;
/**
* Created by pgtaboada on 25.11.14.
*/
public class EventLeaderboardWidgetAndActivity extends Composite implements TabActivity<EventLeaderboardPlace, EventContext, EventRegattaView.Presenter> {
public class RegattaLeaderboardTabView extends Composite implements RegattaTabView<RegattaLeaderboardPlace> {
private LeaderboardDTO leaderboardDTO;
private Presenter currentPresenter;
public EventLeaderboardWidgetAndActivity() {
public RegattaLeaderboardTabView() {
}
@Override
public Class<EventLeaderboardPlace> getPlaceClassForActivation() {
return EventLeaderboardPlace.class;
public Class<RegattaLeaderboardPlace> getPlaceClassForActivation() {
return RegattaLeaderboardPlace.class;
}
@Override
public void setPresenter(EventRegattaView.Presenter presenter) {
// TODO Auto-generated method stub
public void setPresenter(EventRegattaView.Presenter currentPresenter) {
this.currentPresenter = currentPresenter;
}
@Override
public void start(final EventLeaderboardPlace selectedPlace, final AcceptsOneWidget contentArea) {
public void start(final RegattaLeaderboardPlace selectedPlace, final AcceptsOneWidget contentArea) {
String regattaId = selectedPlace.getRegattaId();
@@ -47,12 +47,7 @@ public class EventLeaderboardWidgetAndActivity extends Composite implements TabA
new Timer() {
@Override
public void run() {
// chain is not nice...
selectedPlace
.getCtx()
.getClientFactory()
.getPlaceController()
.goTo(new RegattaOverviewPlace(selectedPlace.getCtx()));
currentPresenter.gotoOverview();
}
}.schedule(3000);
@@ -77,14 +72,14 @@ public class EventLeaderboardWidgetAndActivity extends Composite implements TabA
}
interface MyBinder extends UiBinder<HTMLPanel, EventLeaderboardWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, RegattaLeaderboardTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public EventLeaderboardPlace placeToFire(EventContext ctx) {
return new EventLeaderboardPlace(ctx);
public RegattaLeaderboardPlace placeToFire(EventContext ctx) {
return new RegattaLeaderboardPlace(ctx);
}
}
@@ -1,22 +1,22 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.media;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
public class MediaPlace extends AbstractEventRegattaPlace {
public MediaPlace(String id, String regattaId) {
public class RegattaMediaPlace extends AbstractEventRegattaPlace {
public RegattaMediaPlace(String id, String regattaId) {
super(id, regattaId);
}
public MediaPlace(EventContext context) {
public RegattaMediaPlace(EventContext context) {
super(context);
}
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<MediaPlace> {
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<RegattaMediaPlace> {
@Override
protected MediaPlace getRealPlace(String eventId, String regattaId) {
return new MediaPlace(eventId, regattaId);
protected RegattaMediaPlace getRealPlace(String eventId, String regattaId) {
return new RegattaMediaPlace(eventId, regattaId);
}
}
}
@@ -1,37 +1,31 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.races;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView.Presenter;
/**
* Created by pgtaboada on 25.11.14.
*/
public class EventRacesWidgetAndActivity extends Composite implements TabActivity<EventRacesPlace, EventContext, EventRegattaView.Presenter> {
public class RegattaMediaTabView extends Composite implements
TabView<RegattaMediaPlace, EventContext, EventRegattaView.Presenter> {
public EventRacesWidgetAndActivity() {
public RegattaMediaTabView() {
}
@Override
public Class<EventRacesPlace> getPlaceClassForActivation() {
return EventRacesPlace.class;
}
@Override
public void setPresenter(Presenter presenter) {
// TODO Auto-generated method stub
public Class<RegattaMediaPlace> getPlaceClassForActivation() {
return RegattaMediaPlace.class;
}
@Override
public void start(EventRacesPlace myPlace, AcceptsOneWidget contentArea) {
public void start(RegattaMediaPlace myPlace, AcceptsOneWidget contentArea) {
initWidget(ourUiBinder.createAndBindUi(this));
@@ -43,14 +37,20 @@ public class EventRacesWidgetAndActivity extends Composite implements TabActivit
}
interface MyBinder extends UiBinder<HTMLPanel, EventRacesWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, RegattaMediaTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public EventRacesPlace placeToFire(EventContext ctx) {
return new EventRacesPlace(ctx);
public RegattaMediaPlace placeToFire(EventContext ctx) {
return new RegattaMediaPlace(ctx);
}
@Override
public void setPresenter(EventRegattaView.Presenter presenter) {
// TODO Auto-generated method stub
}
}
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
@@ -1,21 +1,20 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.overview;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView;
import com.sap.sailing.gwt.home.client.place.event2.regatta.RegattaTabView;
/**
* Created by pgtaboada on 25.11.14.
*/
public class RegattaOverviewWidgetAndActivity extends Composite implements
TabActivity<RegattaOverviewPlace, EventContext, EventRegattaView.Presenter> {
public class RegattaOverviewTabView extends Composite implements RegattaTabView<RegattaOverviewPlace> {
public RegattaOverviewWidgetAndActivity() {
public RegattaOverviewTabView() {
}
@@ -37,7 +36,7 @@ public class RegattaOverviewWidgetAndActivity extends Composite implements
}
interface MyBinder extends UiBinder<HTMLPanel, RegattaOverviewWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, RegattaOverviewTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@@ -1,21 +1,21 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.races;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
public class EventRacesPlace extends AbstractEventRegattaPlace {
public EventRacesPlace(String id, String leaderboardName) {
public class RegattaRacesPlace extends AbstractEventRegattaPlace {
public RegattaRacesPlace(String id, String leaderboardName) {
super(id, leaderboardName);
}
public EventRacesPlace(EventContext context) {
public RegattaRacesPlace(EventContext context) {
super(context);
}
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<EventRacesPlace> {
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<RegattaRacesPlace> {
@Override
protected EventRacesPlace getRealPlace(String eventId, String leaderboardName) {
return new EventRacesPlace(eventId, leaderboardName);
protected RegattaRacesPlace getRealPlace(String eventId, String leaderboardName) {
return new RegattaRacesPlace(eventId, leaderboardName);
}
}
}
@@ -1,32 +1,36 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.media;
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabActivity;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView;
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaView.Presenter;
import com.sap.sailing.gwt.home.client.place.event2.regatta.RegattaTabView;
/**
* Created by pgtaboada on 25.11.14.
*/
public class MediaWidgetAndActivity extends Composite implements
TabActivity<MediaPlace, EventContext, EventRegattaView.Presenter> {
public class RegattaRacesTabView extends Composite implements RegattaTabView<RegattaRacesPlace> {
public MediaWidgetAndActivity() {
public RegattaRacesTabView() {
}
@Override
public Class<MediaPlace> getPlaceClassForActivation() {
return MediaPlace.class;
public Class<RegattaRacesPlace> getPlaceClassForActivation() {
return RegattaRacesPlace.class;
}
@Override
public void setPresenter(Presenter presenter) {
// TODO Auto-generated method stub
}
@Override
public void start(MediaPlace myPlace, AcceptsOneWidget contentArea) {
public void start(RegattaRacesPlace myPlace, AcceptsOneWidget contentArea) {
initWidget(ourUiBinder.createAndBindUi(this));
@@ -38,20 +42,14 @@ public class MediaWidgetAndActivity extends Composite implements
}
interface MyBinder extends UiBinder<HTMLPanel, MediaWidgetAndActivity> {
interface MyBinder extends UiBinder<HTMLPanel, RegattaRacesTabView> {
}
private static MyBinder ourUiBinder = GWT.create(MyBinder.class);
@Override
public MediaPlace placeToFire(EventContext ctx) {
return new MediaPlace(ctx);
}
@Override
public void setPresenter(Presenter presenter) {
// TODO Auto-generated method stub
public RegattaRacesPlace placeToFire(EventContext ctx) {
return new RegattaRacesPlace(ctx);
}
}
@@ -1,21 +0,0 @@
package com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.leaderboard;
import com.sap.sailing.gwt.home.client.place.event2.EventContext;
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
public class EventLeaderboardPlace extends AbstractEventRegattaPlace {
public EventLeaderboardPlace(String id, String regattaId) {
super(id, regattaId);
}
public EventLeaderboardPlace(EventContext context) {
super(context);
}
public static class Tokenizer extends AbstractEventRegattaPlace.Tokenizer<EventLeaderboardPlace> {
@Override
protected EventLeaderboardPlace getRealPlace(String eventId, String leaderboardName) {
return new EventLeaderboardPlace(eventId, leaderboardName);
}
}
}