re-formatted to avoid tabs

This commit is contained in:
Axel Uhl committed 2014-05-21 16:04:24 +02:00
1 parent 0af7b96294
commit b753f1484d
44 files changed
+548 -484

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.home.Home/com.sap.sailing.gwt.home.Home.nocache.js"></script>
<script type="text/javascript" src="com.sap.sailing.gwt.home.Home/com.sap.sailing.gwt.home.Home.nocache.js"></script>
</head>
<!-- -->
@@ -6,7 +6,7 @@ import com.gwtplatform.mvp.client.ApplicationController;
public class HomeEntryPoint implements EntryPoint {
private static final ApplicationController controller = GWT.create(ApplicationController.class);
public void onModuleLoad() {
controller.init();
}
@@ -11,103 +11,144 @@ public interface HomeResources extends ClientBundle {
@Source("com/sap/sailing/gwt/home/css/main.css")
MainCss mainCss();
public interface MainCss extends CssResource{
String grid();
String column();
String columns();
String small1();
String small2();
String small3();
String small4();
String small5();
String small6();
String small7();
String small8();
String small9();
String small10();
String small11();
String small12();
String smalloffset0();
String smalloffset1();
String smalloffset2();
String smalloffset3();
String smalloffset4();
String smalloffset5();
String smalloffset6();
String smalloffset7();
String smalloffset8();
String smalloffset9();
String smalloffset10();
String smalloffset11();
String smallcentered();
String smalluncentered();
// String medium1();
// String medium2();
// String medium3();
// String medium4();
// String medium5();
// String medium6();
// String medium7();
// String medium8();
// String medium9();
// String medium10();
// String medium11();
// String medium12();
// String mediumoffset0();
// String mediumoffset1();
// String mediumoffset2();
// String mediumoffset3();
// String mediumoffset4();
// String mediumoffset5();
// String mediumoffset6();
// String mediumoffset7();
// String mediumoffset8();
// String mediumoffset9();
// String mediumoffset10();
// String mediumoffset11();
// String mediumcentered();
// String mediumuncentered();
// String large1();
// String large2();
// String large3();
// String large4();
// String large5();
// String large6();
// String large7();
// String large8();
// String large9();
// String large10();
// String large11();
// String large12();
// String largeoffset0();
// String largeoffset1();
// String largeoffset2();
// String largeoffset3();
// String largeoffset4();
// String largeoffset5();
// String largeoffset6();
// String largeoffset7();
// String largeoffset8();
// String largeoffset9();
// String largeoffset10();
// String largeoffset11();
// String largecentered();
// String largeuncentered();
String button();
String buttoninactive();
String label();
String labellive();
String labeless();
String labelworldcup();
String labelbundesliga();
String event();
String event_image();
String event_series();
String event_name();
String event_location();
String dummy();
}
public interface MainCss extends CssResource {
String grid();
String column();
String columns();
String small1();
String small2();
String small3();
String small4();
String small5();
String small6();
String small7();
String small8();
String small9();
String small10();
String small11();
String small12();
String smalloffset0();
String smalloffset1();
String smalloffset2();
String smalloffset3();
String smalloffset4();
String smalloffset5();
String smalloffset6();
String smalloffset7();
String smalloffset8();
String smalloffset9();
String smalloffset10();
String smalloffset11();
String smallcentered();
String smalluncentered();
// String medium1();
// String medium2();
// String medium3();
// String medium4();
// String medium5();
// String medium6();
// String medium7();
// String medium8();
// String medium9();
// String medium10();
// String medium11();
// String medium12();
// String mediumoffset0();
// String mediumoffset1();
// String mediumoffset2();
// String mediumoffset3();
// String mediumoffset4();
// String mediumoffset5();
// String mediumoffset6();
// String mediumoffset7();
// String mediumoffset8();
// String mediumoffset9();
// String mediumoffset10();
// String mediumoffset11();
// String mediumcentered();
// String mediumuncentered();
// String large1();
// String large2();
// String large3();
// String large4();
// String large5();
// String large6();
// String large7();
// String large8();
// String large9();
// String large10();
// String large11();
// String large12();
// String largeoffset0();
// String largeoffset1();
// String largeoffset2();
// String largeoffset3();
// String largeoffset4();
// String largeoffset5();
// String largeoffset6();
// String largeoffset7();
// String largeoffset8();
// String largeoffset9();
// String largeoffset10();
// String largeoffset11();
// String largecentered();
// String largeuncentered();
String button();
String buttoninactive();
String label();
String labellive();
String labeless();
String labelworldcup();
String labelbundesliga();
String event();
String event_image();
String event_series();
String event_name();
String event_location();
String dummy();
}
@Source("com/sap/sailing/gwt/home/images/sap_300_transparent.png")
ImageResource sapLogo300();
@@ -9,8 +9,8 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
@RemoteServiceRelativePath("sailingevents")
public interface SailingEventsService extends RemoteService {
List<EventDTO> getEvents();
List<EventDTO> getEvents();
EventDTO getEventById(String eventId);
EventDTO getEventById(String eventId);
}
@@ -10,7 +10,7 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
*/
public interface SailingEventsServiceAsync {
void getEvents(AsyncCallback<List<EventDTO>> callback);
void getEvents(AsyncCallback<List<EventDTO>> callback);
void getEventById(String eventId, AsyncCallback<EventDTO> callback);
void getEventById(String eventId, AsyncCallback<EventDTO> callback);
}
@@ -13,7 +13,8 @@ import com.gwtplatform.mvp.client.proxy.Proxy;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
public abstract class AbstractRootPagePresenter extends Presenter<AbstractRootPagePresenter.MyView, AbstractRootPagePresenter.MyProxy> {
public abstract class AbstractRootPagePresenter extends
Presenter<AbstractRootPagePresenter.MyView, AbstractRootPagePresenter.MyProxy> {
/**
* {@link RootPagePresenter}'s proxy.
@@ -25,18 +25,18 @@ public class ApplicationDesktopModule extends AbstractPresenterModule {
bind(AbstractRootPagePresenter.MyView.class).to(ApplicationDesktopView.class);
bind(AbstractRootPagePresenter.class).to(ApplicationDesktopPresenter.class);
bind(PlaceManager.class).in(Singleton.class);
bind(PlaceManager.class).in(Singleton.class);
// Presenters
bindPresenter(StartPagePresenter.class, StartPagePresenter.MyView.class, StartPageView.class,
StartPagePresenter.MyProxy.class);
StartPagePresenter.MyProxy.class);
bindPresenter(EventsPagePresenter.class, EventsPagePresenter.MyView.class, EventsPageView.class,
EventsPagePresenter.MyProxy.class);
EventsPagePresenter.MyProxy.class);
bindPresenter(EventPagePresenter.class, EventPagePresenter.MyView.class, EventPageView.class,
EventPagePresenter.MyProxy.class);
EventPagePresenter.MyProxy.class);
bindPresenter(AboutUsPagePresenter.class, AboutUsPagePresenter.MyView.class, AboutUsPageView.class,
AboutUsPagePresenter.MyProxy.class);
AboutUsPagePresenter.MyProxy.class);
bindPresenter(ContactPagePresenter.class, ContactPagePresenter.MyView.class, ContactPageView.class,
ContactPagePresenter.MyProxy.class);
ContactPagePresenter.MyProxy.class);
}
}
@@ -10,9 +10,9 @@ public class ApplicationDesktopPresenter extends AbstractRootPagePresenter {
super(eventBus, view, proxy);
}
@Override
protected void onBind() {
// TODO Auto-generated method stub
super.onBind();
}
@Override
protected void onBind() {
// TODO Auto-generated method stub
super.onBind();
}
}
@@ -25,7 +25,7 @@ public class ApplicationDesktopView extends ViewImpl implements AbstractRootPage
public final Widget widget;
@UiField(provided=true)
@UiField(provided = true)
HeaderPanel headerPanel;
@UiField
@@ -40,7 +40,7 @@ public class ApplicationDesktopView extends ViewImpl implements AbstractRootPage
@Inject
public ApplicationDesktopView(HeaderPanel headerPanel) {
this.headerPanel = headerPanel;
widget = uiBinder.createAndBindUi(this);
}
@@ -26,14 +26,14 @@ public class ApplicationMobileModule extends AbstractPresenterModule {
// Presenters
bindPresenter(StartPagePresenter.class, StartPagePresenter.MyView.class, StartPageMobileView.class,
StartPagePresenter.MyProxy.class);
StartPagePresenter.MyProxy.class);
bindPresenter(EventsPagePresenter.class, EventsPagePresenter.MyView.class, EventsPageView.class,
EventsPagePresenter.MyProxy.class);
EventsPagePresenter.MyProxy.class);
bindPresenter(EventPagePresenter.class, EventPagePresenter.MyView.class, EventPageView.class,
EventPagePresenter.MyProxy.class);
EventPagePresenter.MyProxy.class);
bindPresenter(AboutUsPagePresenter.class, AboutUsPagePresenter.MyView.class, AboutUsPageView.class,
AboutUsPagePresenter.MyProxy.class);
AboutUsPagePresenter.MyProxy.class);
bindPresenter(ContactPagePresenter.class, ContactPagePresenter.MyView.class, ContactPageView.class,
ContactPagePresenter.MyProxy.class);
ContactPagePresenter.MyProxy.class);
}
}
@@ -25,7 +25,7 @@ public class ApplicationMobileView extends ViewImpl implements AbstractRootPageP
public final Widget widget;
@UiField(provided=true)
@UiField(provided = true)
HeaderPanel headerPanel;
@UiField
@@ -40,9 +40,9 @@ public class ApplicationMobileView extends ViewImpl implements AbstractRootPageP
@Inject
public ApplicationMobileView(HeaderPanel headerPanel) {
this.headerPanel = headerPanel;
footerPanel = new FooterPanel();
widget = uiBinder.createAndBindUi(this);
}
@@ -26,14 +26,14 @@ public class ApplicationTabletModule extends AbstractPresenterModule {
// Presenters
bindPresenter(StartPagePresenter.class, StartPagePresenter.MyView.class, StartPageTabletView.class,
StartPagePresenter.MyProxy.class);
StartPagePresenter.MyProxy.class);
bindPresenter(EventsPagePresenter.class, EventsPagePresenter.MyView.class, EventsPageView.class,
EventsPagePresenter.MyProxy.class);
EventsPagePresenter.MyProxy.class);
bindPresenter(EventPagePresenter.class, EventPagePresenter.MyView.class, EventPageView.class,
EventPagePresenter.MyProxy.class);
EventPagePresenter.MyProxy.class);
bindPresenter(AboutUsPagePresenter.class, AboutUsPagePresenter.MyView.class, AboutUsPageView.class,
AboutUsPagePresenter.MyProxy.class);
AboutUsPagePresenter.MyProxy.class);
bindPresenter(ContactPagePresenter.class, ContactPagePresenter.MyView.class, ContactPageView.class,
ContactPagePresenter.MyProxy.class);
ContactPagePresenter.MyProxy.class);
}
}
@@ -25,7 +25,7 @@ public class ApplicationTabletView extends ViewImpl implements AbstractRootPageP
public final Widget widget;
@UiField(provided=true)
@UiField(provided = true)
HeaderPanel headerPanel;
@UiField
@@ -40,7 +40,7 @@ public class ApplicationTabletView extends ViewImpl implements AbstractRootPageP
@Inject
public ApplicationTabletView(HeaderPanel headerPanel) {
this.headerPanel = headerPanel;
widget = uiBinder.createAndBindUi(this);
}
@@ -17,13 +17,13 @@ import com.sap.sailing.gwt.home.client.shared.PageNameConstants;
public class AboutUsPagePresenter extends Presenter<AboutUsPagePresenter.MyView, AboutUsPagePresenter.MyProxy> {
private final PlaceManager placeManager;
public interface MyView extends View {
}
/**
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves
* as children of this presenter.
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves as children of this
* presenter.
*/
@ContentSlot
public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();
@@ -36,7 +36,7 @@ public class AboutUsPagePresenter extends Presenter<AboutUsPagePresenter.MyView,
@Inject
public AboutUsPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
}
@@ -30,4 +30,3 @@ public class AboutUsPageView extends Composite implements AboutUsPagePresenter.M
public void setInSlot(Object slot, IsWidget content) {
}
}
@@ -17,13 +17,13 @@ import com.sap.sailing.gwt.home.client.shared.PageNameConstants;
public class ContactPagePresenter extends Presenter<ContactPagePresenter.MyView, ContactPagePresenter.MyProxy> {
private final PlaceManager placeManager;
public interface MyView extends View {
}
/**
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves
* as children of this presenter.
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves as children of this
* presenter.
*/
@ContentSlot
public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();
@@ -36,7 +36,7 @@ public class ContactPagePresenter extends Presenter<ContactPagePresenter.MyView,
@Inject
public ContactPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
}
@@ -30,4 +30,3 @@ public class ContactPageView extends Composite implements ContactPagePresenter.M
public void setInSlot(Object slot, IsWidget content) {
}
}
@@ -22,18 +22,18 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
public class EventPagePresenter extends Presenter<EventPagePresenter.MyView, EventPagePresenter.MyProxy> {
private final PlaceManager placeManager;
private final SailingEventsServiceAsync sailingEventsService;
private final SailingEventsServiceAsync sailingEventsService;
private EventDTO event;
private String eventIdParam;
private String eventIdParam;
public interface MyView extends View {
public void setEvent(EventDTO event);
public void setEvent(EventDTO event);
}
/**
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves
* as children of this presenter.
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves as children of this
* presenter.
*/
@ContentSlot
public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();
@@ -45,9 +45,9 @@ public class EventPagePresenter extends Presenter<EventPagePresenter.MyView, Eve
@Inject
public EventPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager,
SailingEventsServiceAsync sailingEventsService) {
SailingEventsServiceAsync sailingEventsService) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
this.sailingEventsService = sailingEventsService;
}
@@ -59,25 +59,25 @@ public class EventPagePresenter extends Presenter<EventPagePresenter.MyView, Eve
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
eventIdParam = request.getParameter("id", "");
super.prepareFromRequest(request);
eventIdParam = request.getParameter("id", "");
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEventById(eventIdParam, new AsyncCallback<EventDTO>() {
@Override
public void onSuccess(EventDTO result) {
event = result;
getView().setEvent(event);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEventById(eventIdParam, new AsyncCallback<EventDTO>() {
@Override
public void onSuccess(EventDTO result) {
event = result;
getView().setEvent(event);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
}
@@ -16,7 +16,7 @@ public class EventPageView extends Composite implements EventPagePresenter.MyVie
}
private EventDTO event;
@UiField
HeadingElement title;
@@ -38,11 +38,11 @@ public class EventPageView extends Composite implements EventPagePresenter.MyVie
public void setInSlot(Object slot, IsWidget content) {
}
@Override
public void setEvent(EventDTO event) {
this.event = event;
setTitle(event.getName());
}
@Override
public void setEvent(EventDTO event) {
this.event = event;
setTitle(event.getName());
}
@Override
public void setTitle(String title) {
@@ -50,4 +50,3 @@ public class EventPageView extends Composite implements EventPagePresenter.MyVie
}
}
@@ -1,5 +1,5 @@
package com.sap.sailing.gwt.home.client.app.event;
public class EventParameterTokens {
public static final String TOKEN_ID = "id";
public static final String TOKEN_ID = "id";
}
@@ -23,17 +23,17 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
public class EventsPagePresenter extends Presenter<EventsPagePresenter.MyView, EventsPagePresenter.MyProxy> {
private final PlaceManager placeManager;
private final SailingEventsServiceAsync sailingEventsService;
private final SailingEventsServiceAsync sailingEventsService;
private List<EventDTO> events;
private List<EventDTO> events;
public interface MyView extends View {
public void setEvents(List<EventDTO> events);
public void setEvents(List<EventDTO> events);
}
/**
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves
* as children of this presenter.
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves as children of this
* presenter.
*/
@ContentSlot
public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();
@@ -45,9 +45,9 @@ public class EventsPagePresenter extends Presenter<EventsPagePresenter.MyView, E
@Inject
public EventsPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager,
SailingEventsServiceAsync sailingEventsService) {
SailingEventsServiceAsync sailingEventsService) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
this.sailingEventsService = sailingEventsService;
}
@@ -57,21 +57,21 @@ public class EventsPagePresenter extends Presenter<EventsPagePresenter.MyView, E
RevealContentEvent.fire(this, AbstractRootPagePresenter.TYPE_SetMainContent, this);
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEvents(new AsyncCallback<List<EventDTO>>() {
@Override
public void onSuccess(List<EventDTO> result) {
events = result;
getView().setEvents(events);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEvents(new AsyncCallback<List<EventDTO>>() {
@Override
public void onSuccess(List<EventDTO> result) {
events = result;
getView().setEvents(events);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
}
@@ -34,7 +34,7 @@ public class EventsPageView extends Composite implements EventsPagePresenter.MyV
@UiField
FlowPanel eventListPanel;
@UiField(provided=true)
@UiField(provided = true)
EventsTable eventsTable;
private final PlaceManager placeManager;
@@ -42,11 +42,11 @@ public class EventsPageView extends Composite implements EventsPagePresenter.MyV
@Inject
public EventsPageView(PlaceManager placeManager) {
super();
this.placeManager = placeManager;
eventsTable = new EventsTable();
initWidget(uiBinder.createAndBindUi(this));
queryInput.getElement().setId("queryInput");
}
@@ -54,7 +54,7 @@ public class EventsPageView extends Composite implements EventsPagePresenter.MyV
@UiHandler("searchButton")
void buttonClick(ClickEvent event) {
}
@Override
public void addToSlot(Object slot, IsWidget content) {
}
@@ -67,19 +67,16 @@ public class EventsPageView extends Composite implements EventsPagePresenter.MyV
public void setInSlot(Object slot, IsWidget content) {
}
@Override
public void setEvents(List<EventDTO> events) {
eventListPanel.clear();
for (EventDTO event: events) {
PlaceRequest request = new PlaceRequest.Builder()
.nameToken(PageNameConstants.eventPage)
.with(EventParameterTokens.TOKEN_ID, event.uuid.toString())
.build();
@Override
public void setEvents(List<EventDTO> events) {
eventListPanel.clear();
for (EventDTO event : events) {
PlaceRequest request = new PlaceRequest.Builder().nameToken(PageNameConstants.eventPage)
.with(EventParameterTokens.TOKEN_ID, event.uuid.toString()).build();
eventListPanel.add(new Hyperlink(event.getName(), placeManager.buildRelativeHistoryToken(request)));
}
eventsTable.setEvents(events);
}
eventsTable.setEvents(events);
}
}
@@ -30,90 +30,92 @@ public class EventsTable extends Composite {
interface EventsTableUiBinder extends UiBinder<Widget, EventsTable> {
}
private ListDataProvider<EventDTO> dataProvider = new ListDataProvider<EventDTO>();
private ListDataProvider<EventDTO> dataProvider = new ListDataProvider<EventDTO>();
@UiField(provided = true)
CellTable<EventDTO> cellTable;
@UiField(provided = true)
CellTable<EventDTO> cellTable;
/**
* The pager used to change the range of data.
*/
@UiField(provided = true)
SimplePager pager;
/**
* The pager used to change the range of data.
*/
@UiField(provided = true)
SimplePager pager;
/**
* Constructor.
* @param constants the constants
*/
public EventsTable() {
initTable();
/**
* Constructor.
*
* @param constants
* the constants
*/
public EventsTable() {
initTable();
initWidget(uiBinder.createAndBindUi(this));
}
}
public static final ProvidesKey<EventDTO> KEY_PROVIDER = new ProvidesKey<EventDTO>() {
public Object getKey(EventDTO item) {
return item == null ? null : item.uuid;
}
};
public static final ProvidesKey<EventDTO> KEY_PROVIDER = new ProvidesKey<EventDTO>() {
public Object getKey(EventDTO item) {
return item == null ? null : item.uuid;
}
};
public void initTable() {
cellTable = new CellTable<EventDTO>(KEY_PROVIDER);
cellTable.setWidth("100%", true);
public void initTable() {
cellTable = new CellTable<EventDTO>(KEY_PROVIDER);
cellTable.setWidth("100%", true);
ListHandler<EventDTO> sortHandler = new ListHandler<EventDTO>(dataProvider.getList());
cellTable.addColumnSortHandler(sortHandler);
ListHandler<EventDTO> sortHandler = new ListHandler<EventDTO>(dataProvider.getList());
cellTable.addColumnSortHandler(sortHandler);
// Create a Pager to control the table.
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
pager.setDisplay(cellTable);
// Create a Pager to control the table.
SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
pager.setDisplay(cellTable);
// Add a selection model so we can select cells.
final SelectionModel<EventDTO> selectionModel = new SingleSelectionModel<EventDTO>(KEY_PROVIDER);
cellTable.setSelectionModel(selectionModel, DefaultSelectionEventManager.<EventDTO> createCheckboxManager());
// Add a selection model so we can select cells.
final SelectionModel<EventDTO> selectionModel = new SingleSelectionModel<EventDTO>(KEY_PROVIDER);
cellTable.setSelectionModel(selectionModel, DefaultSelectionEventManager.<EventDTO> createCheckboxManager());
// Initialize the columns.
initTableColumns(selectionModel, sortHandler);
// Initialize the columns.
initTableColumns(selectionModel, sortHandler);
// Add the CellList to the adapter in the database.
dataProvider.addDataDisplay(cellTable);
}
// Add the CellList to the adapter in the database.
dataProvider.addDataDisplay(cellTable);
}
public void setEvents(List<EventDTO> events) {
dataProvider.getList().clear();
dataProvider.getList().addAll(events);
}
/**
* Add the columns to the table.
*/
private void initTableColumns(final SelectionModel<EventDTO> selectionModel, ListHandler<EventDTO> sortHandler) {
// Checkbox column. This table will uses a checkbox column for selection.
// Alternatively, you can call cellTable.setSelectionEnabled(true) to enable mouse selection.
Column<EventDTO, Boolean> checkColumn = new Column<EventDTO, Boolean>(new CheckboxCell(true, false)) {
@Override
public Boolean getValue(EventDTO object) {
// Get the value from the selection model.
return selectionModel.isSelected(object);
}
};
cellTable.addColumn(checkColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
cellTable.setColumnWidth(checkColumn, 40, Unit.PX);
public void setEvents(List<EventDTO> events) {
dataProvider.getList().clear();
dataProvider.getList().addAll(events);
}
// name.
Column<EventDTO, String> firstNameColumn = new Column<EventDTO, String>(new TextCell()) {
@Override
public String getValue(EventDTO object) {
return object.getName();
}
};
firstNameColumn.setSortable(true);
sortHandler.setComparator(firstNameColumn, new Comparator<EventDTO>() {
public int compare(EventDTO o1, EventDTO o2) {
return o1.getName().compareTo(o2.getName());
}
});
cellTable.addColumn(firstNameColumn, "name");
cellTable.setColumnWidth(firstNameColumn, 20, Unit.PCT);
}
/**
* Add the columns to the table.
*/
private void initTableColumns(final SelectionModel<EventDTO> selectionModel, ListHandler<EventDTO> sortHandler) {
// Checkbox column. This table will uses a checkbox column for selection.
// Alternatively, you can call cellTable.setSelectionEnabled(true) to enable mouse selection.
Column<EventDTO, Boolean> checkColumn = new Column<EventDTO, Boolean>(new CheckboxCell(true, false)) {
@Override
public Boolean getValue(EventDTO object) {
// Get the value from the selection model.
return selectionModel.isSelected(object);
}
};
cellTable.addColumn(checkColumn, SafeHtmlUtils.fromSafeConstant("<br/>"));
cellTable.setColumnWidth(checkColumn, 40, Unit.PX);
// name.
Column<EventDTO, String> firstNameColumn = new Column<EventDTO, String>(new TextCell()) {
@Override
public String getValue(EventDTO object) {
return object.getName();
}
};
firstNameColumn.setSortable(true);
sortHandler.setComparator(firstNameColumn, new Comparator<EventDTO>() {
public int compare(EventDTO o1, EventDTO o2) {
return o1.getName().compareTo(o2.getName());
}
});
cellTable.addColumn(firstNameColumn, "name");
cellTable.setColumnWidth(firstNameColumn, 20, Unit.PCT);
}
}
@@ -8,31 +8,32 @@ import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.home.shared.dto.EventDTO;
public class Event extends Composite {
private static EventUiBinder uiBinder = GWT.create(EventUiBinder.class);
private EventDTO event;
@UiField Label eventName;
@UiField Label eventLocation;
@UiField
Label eventName;
@UiField
Label eventLocation;
interface EventUiBinder extends UiBinder<Widget, Event> {
}
public Event() {
super();
initWidget(uiBinder.createAndBindUi(this));
}
public EventDTO getEvent() {
return event;
}
public EventDTO getEvent() {
return event;
}
public void setEvent(EventDTO event) {
this.event = event;
eventName.setText(event.getName());
eventLocation.setText(event.venue.getName());
}
public void setEvent(EventDTO event) {
this.event = event;
eventName.setText(event.getName());
eventLocation.setText(event.venue.getName());
}
}
@@ -32,10 +32,9 @@ public class StartPageMobileView extends Composite implements StartPagePresenter
@Override
public void setInSlot(Object slot, IsWidget content) {
}
@Override
public void setEvents(List<EventDTO> events) {
}
@Override
public void setEvents(List<EventDTO> events) {
}
}
@@ -16,7 +16,6 @@ import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
import com.gwtplatform.mvp.client.proxy.RevealContentEvent;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;
import com.sap.sailing.gwt.home.client.SailingEventsServiceAsync;
import com.sap.sailing.gwt.home.client.app.AbstractRootPagePresenter;
import com.sap.sailing.gwt.home.client.shared.PageNameConstants;
@@ -24,17 +23,17 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
public class StartPagePresenter extends Presenter<StartPagePresenter.MyView, StartPagePresenter.MyProxy> {
private final PlaceManager placeManager;
private final SailingEventsServiceAsync sailingEventsService;
private final SailingEventsServiceAsync sailingEventsService;
private List<EventDTO> events;
private List<EventDTO> events;
public interface MyView extends View {
public void setEvents(List<EventDTO> events);
public void setEvents(List<EventDTO> events);
}
/**
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves
* as children of this presenter.
* Child presenters can fire a RevealContentEvent with TYPE_SetMainContent to set themselves as children of this
* presenter.
*/
@ContentSlot
public static final Type<RevealContentHandler<?>> TYPE_SetMainContent = new Type<RevealContentHandler<?>>();
@@ -45,10 +44,10 @@ public class StartPagePresenter extends Presenter<StartPagePresenter.MyView, Sta
}
@Inject
public StartPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager,
SailingEventsServiceAsync sailingEventsService) {
public StartPagePresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager,
SailingEventsServiceAsync sailingEventsService) {
super(eventBus, view, proxy);
this.placeManager = placeManager;
this.sailingEventsService = sailingEventsService;
}
@@ -57,22 +56,22 @@ public class StartPagePresenter extends Presenter<StartPagePresenter.MyView, Sta
protected void revealInParent() {
RevealContentEvent.fire(this, AbstractRootPagePresenter.TYPE_SetMainContent, this);
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEvents(new AsyncCallback<List<EventDTO>>() {
@Override
public void onSuccess(List<EventDTO> result) {
events = result;
getView().setEvents(events);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
@Override
protected void onReset() {
super.onReset();
sailingEventsService.getEvents(new AsyncCallback<List<EventDTO>>() {
@Override
public void onSuccess(List<EventDTO> result) {
events = result;
getView().setEvents(events);
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Shit happens");
}
});
}
}
@@ -32,10 +32,9 @@ public class StartPageTabletView extends Composite implements StartPagePresenter
@Override
public void setInSlot(Object slot, IsWidget content) {
}
@Override
public void setEvents(List<EventDTO> events) {
}
@Override
public void setEvents(List<EventDTO> events) {
}
}
@@ -14,33 +14,38 @@ import com.sap.sailing.gwt.home.shared.dto.EventDTO;
public class StartPageView extends Composite implements StartPagePresenter.MyView {
private static StartPageViewUiBinder uiBinder = GWT.create(StartPageViewUiBinder.class);
@UiField Label bannerSeriesName;
@UiField Label bannerName;
@UiField Label bannerLocation;
@UiField Label upcomingMessage;
@UiField Label upcomingName;
@UiField Label upcomingAction;
@UiField(provided=true)
@UiField
Label bannerSeriesName;
@UiField
Label bannerName;
@UiField
Label bannerLocation;
@UiField
Label upcomingMessage;
@UiField
Label upcomingName;
@UiField
Label upcomingAction;
@UiField(provided = true)
Event event1;
@UiField(provided=true)
@UiField(provided = true)
Event event2;
@UiField(provided=true)
@UiField(provided = true)
Event event3;
@UiField(provided=true)
@UiField(provided = true)
Event event4;
@UiField(provided=true)
@UiField(provided = true)
Event event5;
@UiField(provided=true)
@UiField(provided = true)
Event event6;
interface StartPageViewUiBinder extends UiBinder<Widget, StartPageView> {
}
@@ -53,7 +58,7 @@ public class StartPageView extends Composite implements StartPagePresenter.MyVie
event4 = new Event();
event5 = new Event();
event6 = new Event();
initWidget(uiBinder.createAndBindUi(this));
}
@@ -68,21 +73,32 @@ public class StartPageView extends Composite implements StartPagePresenter.MyVie
@Override
public void setInSlot(Object slot, IsWidget content) {
}
@Override
public void setEvents(List<EventDTO> events) {
int i = 1;
for(EventDTO event: events) {
switch (i) {
case 1: event1.setEvent(event); break;
case 2: event2.setEvent(event); break;
case 3: event3.setEvent(event); break;
case 4: event4.setEvent(event); break;
case 5: event5.setEvent(event); break;
case 6: event6.setEvent(event); break;
}
i++;
}
}
}
@Override
public void setEvents(List<EventDTO> events) {
int i = 1;
for (EventDTO event : events) {
switch (i) {
case 1:
event1.setEvent(event);
break;
case 2:
event2.setEvent(event);
break;
case 3:
event3.setEvent(event);
break;
case 4:
event4.setEvent(event);
break;
case 5:
event5.setEvent(event);
break;
case 6:
event6.setEvent(event);
break;
}
i++;
}
}
}
@@ -4,7 +4,7 @@ import com.sap.sailing.gwt.home.client.i18n.TextMessages;
import com.sap.sailing.gwt.home.client.shared.MainMenu;
public interface GinjectorExtension {
TextMessages getTextMessages();
MainMenu getMainMenu();
TextMessages getTextMessages();
MainMenu getMainMenu();
}
@@ -12,7 +12,7 @@ public class SharedModule extends AbstractPresenterModule {
@Override
protected void configure() {
install(new DefaultModule());
install(new UiModule());
install(new UiModule());
bindConstant().annotatedWith(DefaultPlace.class).to(PageNameConstants.startPage);
bindConstant().annotatedWith(ErrorPlace.class).to(PageNameConstants.startPage);
@@ -4,11 +4,16 @@ import com.google.gwt.i18n.client.Messages;
public interface TextMessages extends Messages {
String chooseALanguage();
String home();
String events();
String aboutUs();
String contact();
String german();
String english();
}
@@ -5,7 +5,6 @@ import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
public class FooterPanel extends Composite {
private static FooterPanelUiBinder uiBinder = GWT.create(FooterPanelUiBinder.class);
@@ -14,7 +13,6 @@ public class FooterPanel extends Composite {
public FooterPanel() {
super();
initWidget(uiBinder.createAndBindUi(this));
}
}
@@ -6,30 +6,31 @@ import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
public class HeaderPanel extends Composite {
// @UiField Label titleLabel;
//
@UiField LocaleSelection localeSelection;
// @UiField Label titleLabel;
//
@UiField
LocaleSelection localeSelection;
@UiField(provided = true) MainMenu mainMenu;
// private static HeaderPanelUiBinder uiBinder = GWT.create(HeaderPanelUiBinder.class);
@UiField(provided = true)
MainMenu mainMenu;
// private static HeaderPanelUiBinder uiBinder = GWT.create(HeaderPanelUiBinder.class);
interface HeaderPanelUiBinder extends UiBinder<Widget, HeaderPanel> {
}
@Inject
HeaderPanel(HeaderPanelUiBinder uiBinder, MainMenu mainMenu) {
this.mainMenu = mainMenu;
this.mainMenu = mainMenu;
initWidget(uiBinder.createAndBindUi(this));
// titleLabel.setText("SAP Sailing Analytics");
// titleLabel.setText("SAP Sailing Analytics");
}
public void setTitle(String title) {
// titleLabel.setText(title);
// titleLabel.setText(title);
}
}
@@ -16,13 +16,13 @@ public class LocaleSelection extends Composite {
interface LocaleSelectionCompositeUiBinder extends UiBinder<Widget, LocaleSelection> {
}
@UiField(provided=true) ListBox localeSelection;
@UiField(provided = true)
ListBox localeSelection;
public LocaleSelection() {
localeSelection = new ListBox(false);
localeSelection.addItem("Deutsch");
localeSelection.addItem("English");
initWidget(uiBinder.createAndBindUi(this));
}
@@ -7,45 +7,50 @@ import com.google.gwt.user.client.ui.InlineHyperlink;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;
/**
* The main menu for the homepage.
*/
public class MainMenu extends Composite {
interface MainMenuUiBinder extends UiBinder<Widget, MainMenu> {
}
interface MainMenuUiBinder extends UiBinder<Widget, MainMenu> {
}
@UiField
InlineHyperlink startPageLink;
@UiField
InlineHyperlink startPageLink;
@UiField
InlineHyperlink eventsPageLink;
@UiField
InlineHyperlink aboutUsPageLink;
@UiField
InlineHyperlink contactPageLink;
@UiField
InlineHyperlink eventsPageLink;
@UiField
InlineHyperlink aboutUsPageLink;
@UiField
InlineHyperlink contactPageLink;
private final PlaceManager placeManager;
@Inject
MainMenu(MainMenuUiBinder binder, PlaceManager placeManager) {
this.placeManager = placeManager;
initWidget(binder.createAndBindUi(this));
}
public void voidSetActiveLink(String pageNameToken) {
String activeLinkStyle = "active";
switch (pageNameToken) {
case PageNameConstants.aboutUsPage:
aboutUsPageLink.addStyleName(activeLinkStyle);
break;
case PageNameConstants.contactPage:
contactPageLink.addStyleName(activeLinkStyle);
break;
case PageNameConstants.startPage:
startPageLink.addStyleName(activeLinkStyle);
break;
case PageNameConstants.eventsPage:
eventsPageLink.addStyleName(activeLinkStyle);
break;
}
}
private final PlaceManager placeManager;
@Inject
MainMenu(MainMenuUiBinder binder, PlaceManager placeManager) {
this.placeManager = placeManager;
initWidget(binder.createAndBindUi(this));
}
public void voidSetActiveLink(String pageNameToken) {
String activeLinkStyle = "active";
switch(pageNameToken) {
case PageNameConstants.aboutUsPage: aboutUsPageLink.addStyleName(activeLinkStyle); break;
case PageNameConstants.contactPage: contactPageLink.addStyleName(activeLinkStyle); break;
case PageNameConstants.startPage: startPageLink.addStyleName(activeLinkStyle); break;
case PageNameConstants.eventsPage: eventsPageLink.addStyleName(activeLinkStyle); break;
}
}
}
@@ -1,31 +1,30 @@
package com.sap.sailing.gwt.home.client.shared;
public class PageNameConstants {
public static final String startPage = "!start";
public static final String eventsPage = "!events";
public static final String eventPage = "!event";
public static final String aboutUsPage = "!aboutus";
public static final String contactPage = "!contact";
public static final String startPage = "!start";
public static final String eventsPage = "!events";
public static final String eventPage = "!event";
public static final String aboutUsPage = "!aboutus";
public static final String contactPage = "!contact";
public static String getStartPage() {
return startPage;
}
public static String getStartPage() {
return startPage;
}
public static String getEventsPage() {
return eventsPage;
}
public static String getEventsPage() {
return eventsPage;
}
public static String getEventPage() {
return eventPage;
}
public static String getEventPage() {
return eventPage;
}
public static String getAboutUsPage() {
return aboutUsPage;
}
public static String getContactPage() {
return contactPage;
}
public static String getAboutUsPage() {
return aboutUsPage;
}
public static String getContactPage() {
return contactPage;
}
}
@@ -5,7 +5,7 @@ import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
@Override
public void start(BundleContext context) throws Exception {
Activator.context = context;
@@ -14,7 +14,7 @@ public class Activator implements BundleActivator {
@Override
public void stop(BundleContext context) throws Exception {
}
public static BundleContext getDefault() {
return context;
}
@@ -6,11 +6,10 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.gwt.user.server.rpc.SerializationPolicy;
/**
* Using GWT in a proxyfied environment can be tricky and leads to strange errors
* when using GWT-RPC. This is due to the fact that GWT doesn't find the correct
* serialization rule file. For non proxyfied environments you do not need to change
* anything. In an Apache based env you need to add a line like the following to your
* configuration: RequestHeader edit X-GWT-Module-Base sapsailing.com/(home/)? sapsailing.com/home/
* Using GWT in a proxyfied environment can be tricky and leads to strange errors when using GWT-RPC. This is due to the
* fact that GWT doesn't find the correct serialization rule file. For non proxyfied environments you do not need to
* change anything. In an Apache based env you need to add a line like the following to your configuration:
* RequestHeader edit X-GWT-Module-Base sapsailing.com/(home/)? sapsailing.com/home/
*
* @author Simon Pamies (info@pamies.de)
* @since Oct 10, 2012
@@ -20,15 +19,15 @@ public abstract class ProxiedRemoteServiceServlet extends RemoteServiceServlet {
private static final long serialVersionUID = 5379097888921157936L;
@Override
protected SerializationPolicy doGetSerializationPolicy(
HttpServletRequest request, String moduleBaseURL, String strongName) {
protected SerializationPolicy doGetSerializationPolicy(HttpServletRequest request, String moduleBaseURL,
String strongName) {
String moduleBaseURLHdr = request.getHeader("X-GWT-Module-Base");
if(moduleBaseURLHdr != null){
if (moduleBaseURLHdr != null) {
moduleBaseURL = moduleBaseURLHdr;
}
return super.doGetSerializationPolicy(request, moduleBaseURL, strongName);
}
}
}
@@ -42,7 +42,7 @@ public class SailingEventsServiceImpl extends ProxiedRemoteServiceServlet implem
@Override
public EventDTO getEventById(String id) {
EventDTO result = null;
UUID eventUUID = UUID.fromString(id);
UUID eventUUID = UUID.fromString(id);
Event event = getRacingEventService().getEvent(eventUUID);
if (event != null) {
result = convertToEventDTO(event);
@@ -59,7 +59,7 @@ public class SailingEventsServiceImpl extends ProxiedRemoteServiceServlet implem
eventDTO.isPublic = event.isPublic();
eventDTO.uuid = event.getId().toString();
eventDTO.regattas = new ArrayList<RegattaDTO>();
for (Regatta regatta: event.getRegattas()) {
for (Regatta regatta : event.getRegattas()) {
RegattaDTO regattaDTO = new RegattaDTO();
regattaDTO.setName(regatta.getName());
eventDTO.regattas.add(regattaDTO);
@@ -3,10 +3,10 @@ package com.sap.sailing.gwt.home.shared.dto;
import com.google.gwt.user.client.rpc.IsSerializable;
import com.sap.sailing.domain.common.dto.NamedDTO;
public class CourseAreaDTO extends NamedDTO implements IsSerializable {
public class CourseAreaDTO extends NamedDTO implements IsSerializable {
private static final long serialVersionUID = -5279690838452265454L;
public String uuid;
public CourseAreaDTO() {
}
@@ -17,7 +17,7 @@ public class EventDTO extends NamedDTO implements IsSerializable {
public String uuid;
private Date currentServerTime;
public EventDTO() {
initCurrentServerTime();
}
@@ -1,4 +1,5 @@
package com.sap.sailing.gwt.home.shared.dto;
import java.util.List;
import com.sap.sailing.domain.common.RegattaIdentifier;
@@ -18,9 +19,10 @@ public class RegattaDTO extends NamedDTO {
public String defaultCourseAreaUuid;
public String defaultCourseAreaName;
public RegattaDTO() {}
public RegattaDTO() {
}
public RegattaDTO(String name, ScoringSchemeType scoringScheme /*, List<CompetitorDTO> competitors*/) {
public RegattaDTO(String name, ScoringSchemeType scoringScheme /* , List<CompetitorDTO> competitors */) {
super(name);
this.scoringScheme = scoringScheme;
}
@@ -28,11 +30,11 @@ public class RegattaDTO extends NamedDTO {
public RegattaIdentifier getRegattaIdentifier() {
return new RegattaName(getName());
}
/**
* @return whether this regatta defines its local per-series result discarding rules; if so, any leaderboard based
* on the regatta has to respect this and has to use a result discarding rule implementation that
* keeps discards local to each series rather than spreading them across the entire leaderboard.
* on the regatta has to respect this and has to use a result discarding rule implementation that keeps
* discards local to each series rather than spreading them across the entire leaderboard.
*/
public boolean definesSeriesDiscardThresholds() {
for (SeriesDTO s : series) {
@@ -1,4 +1,5 @@
package com.sap.sailing.gwt.home.shared.dto;
import java.util.List;
import com.sap.sailing.domain.common.dto.FleetDTO;
@@ -14,9 +15,10 @@ public class SeriesDTO extends NamedDTO {
private Boolean startsWithZeroScore;
private boolean firstColumnIsNonDiscardableCarryForward;
private boolean hasSplitFleetContiguousScoring;
public SeriesDTO() {}
public SeriesDTO() {
}
public SeriesDTO(String name, List<FleetDTO> fleets, List<RaceColumnDTO> raceColumns, boolean isMedal,
int[] discardThresholds, boolean startsWithZeroScore, boolean firstColumnIsNonDiscardableCarryForward,
boolean hasSplitFleetContiguousScoring) {
@@ -29,8 +31,7 @@ public class SeriesDTO extends NamedDTO {
this.discardThresholds = discardThresholds;
this.firstColumnIsNonDiscardableCarryForward = firstColumnIsNonDiscardableCarryForward;
}
public boolean hasSplitFleetContiguousScoring() {
return hasSplitFleetContiguousScoring;
}
@@ -58,7 +59,7 @@ public class SeriesDTO extends NamedDTO {
public void setRaceColumns(List<RaceColumnDTO> raceColumns) {
this.raceColumns = raceColumns;
}
/**
* @return whether this series defines its local result discarding rule; if so, any leaderboard based on the
* enclosing regatta has to respect this and has to use a result discarding rule implementation that keeps
@@ -71,7 +72,7 @@ public class SeriesDTO extends NamedDTO {
public int[] getDiscardThresholds() {
return discardThresholds;
}
public void setDiscardThresholds(int[] discardThresholds) {
this.discardThresholds = discardThresholds;
}
@@ -83,7 +84,7 @@ public class SeriesDTO extends NamedDTO {
public void setStartsWithZeroScore(Boolean startsWithZeroScore) {
this.startsWithZeroScore = startsWithZeroScore;
}
public void setFirstColumnIsNonDiscardableCarryForward(boolean firstColumnIsNonDiscardableCarryForward) {
this.firstColumnIsNonDiscardableCarryForward = firstColumnIsNonDiscardableCarryForward;
}
@@ -1,4 +1,5 @@
package com.sap.sailing.gwt.home.shared.dto;
import java.util.ArrayList;
import java.util.List;
@@ -15,6 +16,7 @@ public class VenueDTO extends NamedDTO {
super(name);
this.courseAreas = new ArrayList<CourseAreaDTO>();
}
public VenueDTO(String name, List<CourseAreaDTO> courseAreas) {
super(name);
this.courseAreas = courseAreas;