mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 09:41:00 +00:00
added tablet version and i18n support for the main menu
This commit is contained in:
1 parent
d9fe67e93a
commit
5720bcbee4
15 files changed
+224
-30
No files matched your search
+39
@@ -0,0 +1,39 @@
|
||||
package com.sap.sailing.gwt.home.client.app;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
import com.sap.sailing.gwt.home.client.aboutuspage.AboutUsPagePresenter;
|
||||
import com.sap.sailing.gwt.home.client.aboutuspage.AboutUsPageView;
|
||||
import com.sap.sailing.gwt.home.client.contactpage.ContactPagePresenter;
|
||||
import com.sap.sailing.gwt.home.client.contactpage.ContactPageView;
|
||||
import com.sap.sailing.gwt.home.client.eventpage.EventPagePresenter;
|
||||
import com.sap.sailing.gwt.home.client.eventpage.EventPageView;
|
||||
import com.sap.sailing.gwt.home.client.eventspage.EventsPagePresenter;
|
||||
import com.sap.sailing.gwt.home.client.eventspage.EventsPageView;
|
||||
import com.sap.sailing.gwt.home.client.startpage.StartPageTabletView;
|
||||
import com.sap.sailing.gwt.home.client.startpage.StartPagePresenter;
|
||||
|
||||
public class ApplicationTabletModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
// Application Presenters
|
||||
bind(ApplicationTabletPresenter.class).in(Singleton.class);
|
||||
bind(ApplicationTabletView.class).in(Singleton.class);
|
||||
bind(AbstractRootPagePresenter.MyProxy.class).asEagerSingleton();
|
||||
bind(AbstractRootPagePresenter.MyView.class).to(ApplicationTabletView.class);
|
||||
bind(AbstractRootPagePresenter.class).to(ApplicationTabletPresenter.class);
|
||||
|
||||
// Presenters
|
||||
bindPresenter(StartPagePresenter.class, StartPagePresenter.MyView.class, StartPageTabletView.class,
|
||||
StartPagePresenter.MyProxy.class);
|
||||
bindPresenter(EventsPagePresenter.class, EventsPagePresenter.MyView.class, EventsPageView.class,
|
||||
EventsPagePresenter.MyProxy.class);
|
||||
bindPresenter(EventPagePresenter.class, EventPagePresenter.MyView.class, EventPageView.class,
|
||||
EventPagePresenter.MyProxy.class);
|
||||
bindPresenter(AboutUsPagePresenter.class, AboutUsPagePresenter.MyView.class, AboutUsPageView.class,
|
||||
AboutUsPagePresenter.MyProxy.class);
|
||||
bindPresenter(ContactPagePresenter.class, ContactPagePresenter.MyView.class, ContactPageView.class,
|
||||
ContactPagePresenter.MyProxy.class);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.sap.sailing.gwt.home.client.app;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
|
||||
public class ApplicationTabletPresenter extends AbstractRootPagePresenter {
|
||||
|
||||
@Inject
|
||||
public ApplicationTabletPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy) {
|
||||
super(eventBus, view, proxy);
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.sap.sailing.gwt.home.client.app;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Element;
|
||||
import com.google.gwt.dom.client.Style.Visibility;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.IsWidget;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.gwtplatform.mvp.client.ViewImpl;
|
||||
import com.sap.sailing.gwt.home.client.shared.FooterPanel;
|
||||
import com.sap.sailing.gwt.home.client.shared.HeaderPanel;
|
||||
|
||||
/**
|
||||
* This is the top-level view of the application. Every time another presenter wants to reveal itself,
|
||||
* {@link ApplicationTabletView} will add its content of the target inside the {@code mainContantPanel}.
|
||||
*/
|
||||
public class ApplicationTabletView extends ViewImpl implements AbstractRootPagePresenter.MyView {
|
||||
interface ApplicationTabletViewUiBinder extends UiBinder<Widget, ApplicationTabletView> {
|
||||
}
|
||||
|
||||
private static ApplicationTabletViewUiBinder uiBinder = GWT.create(ApplicationTabletViewUiBinder.class);
|
||||
|
||||
public final Widget widget;
|
||||
|
||||
@UiField(provided=true)
|
||||
HeaderPanel headerPanel;
|
||||
|
||||
@UiField(provided=true)
|
||||
FooterPanel footerPanel;
|
||||
|
||||
@UiField
|
||||
FlowPanel mainContentPanel;
|
||||
|
||||
@UiField
|
||||
Element loadingMessage;
|
||||
|
||||
public ApplicationTabletView() {
|
||||
headerPanel = new HeaderPanel();
|
||||
footerPanel = new FooterPanel();
|
||||
|
||||
widget = uiBinder.createAndBindUi(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Widget asWidget() {
|
||||
return widget;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInSlot(Object slot, IsWidget content) {
|
||||
if (slot == AbstractRootPagePresenter.TYPE_SetMainContent) {
|
||||
setMainContent(content);
|
||||
} else {
|
||||
super.setInSlot(slot, content);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMainContent(IsWidget content) {
|
||||
mainContentPanel.clear();
|
||||
|
||||
if (content != null) {
|
||||
mainContentPanel.add(content);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLoading(boolean visibile) {
|
||||
loadingMessage.getStyle().setVisibility(visibile ? Visibility.VISIBLE : Visibility.HIDDEN);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<!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">
|
||||
|
||||
<g:HTMLPanel>
|
||||
<div ui:field="loadingMessage" style="position:absolute; top:0; left:0; background-color:yellow;">Loading...</div>
|
||||
|
||||
<s:HeaderPanel ui:field="headerPanel" />
|
||||
|
||||
<g:FlowPanel ui:field="mainContentPanel" />
|
||||
|
||||
<s:FooterPanel ui:field="footerPanel" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+1
-5
@@ -6,9 +6,5 @@ import com.gwtplatform.mvp.client.UiHandlers;
|
||||
* {@link ApplicationDesktopView}'s {@link UiHandlers}.
|
||||
*/
|
||||
public interface ApplicationUiHandlers extends UiHandlers {
|
||||
void revealAllProductsList();
|
||||
|
||||
void revealFavoriteProductsList();
|
||||
|
||||
void revealSpecialsList();
|
||||
void revealEvents();
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.sap.sailing.gwt.home.client.gin;
|
||||
|
||||
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
|
||||
import com.sap.sailing.gwt.home.client.app.ApplicationTabletModule;
|
||||
|
||||
public class TabletModule extends AbstractPresenterModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
install(new ApplicationTabletModule());
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -3,9 +3,9 @@ package com.sap.sailing.gwt.home.client.i18n;
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
|
||||
public interface TextMessages extends Messages {
|
||||
String IsafId();
|
||||
String Password();
|
||||
String ForgotIsafId();
|
||||
String ForgotPassword();
|
||||
String ChooseALanguage();
|
||||
String chooseALanguage();
|
||||
String home();
|
||||
String events();
|
||||
String aboutUs();
|
||||
String contact();
|
||||
}
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
IsafId=ISAF-ID
|
||||
Password=Password
|
||||
ForgotIsafId=Forgot ISAF-ID?
|
||||
ForgotPassword=Forgot Password?
|
||||
ChooseALanguage=Choose a language
|
||||
chooseALanguage=Choose a language
|
||||
events=Events
|
||||
home=Home
|
||||
aboutUs=About us
|
||||
contact=Contact
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
IsafId=ISAF-ID
|
||||
Password=Passwort
|
||||
ForgotIsafId=ISAF-ID vergessen?
|
||||
ForgotPassword=Passwort vergessen?
|
||||
ChooseALanguage=Wähle eine Sprache
|
||||
chooseALanguage=Wähle eine Sprache
|
||||
events=Veranstaltungen
|
||||
home=Startseite
|
||||
aboutUs=Über uns
|
||||
contact=Kontakt
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
<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">
|
||||
<ui:with field='i18n' type='com.sap.sailing.gwt.home.client.i18n.TextMessages'/>
|
||||
<ui:style>
|
||||
.panel {
|
||||
width: 100%;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<!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='i18nTexts' type='com.sap.sailing.gwt.home.client.i18n.TextMessages'/>
|
||||
<ui:with field='i18n' type='com.sap.sailing.gwt.home.client.i18n.TextMessages'/>
|
||||
<g:HorizontalPanel>
|
||||
<g:Label text="{i18nTexts.ChooseALanguage}:" />
|
||||
<g:Label text="{i18n.chooseALanguage}:" />
|
||||
<g:ListBox ui:field="localeSelection" />
|
||||
</g:HorizontalPanel>
|
||||
</ui:UiBinder>
|
||||
+6
-6
@@ -1,14 +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">
|
||||
|
||||
<ui:with type="com.sap.sailing.gwt.home.client.shared.PageNameConstants" field="pageNames"></ui:with>
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.home.client.i18n.TextMessages"/>
|
||||
<ui:with field="pageNames" type="com.sap.sailing.gwt.home.client.shared.PageNameConstants" />
|
||||
|
||||
<g:HTMLPanel>
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getStartPage}">Home</g:InlineHyperlink> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getEventsPage}">Events</g:InlineHyperlink> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getAboutUsPage}">About Us</g:InlineHyperlink> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getContactPage}">Contact</g:InlineHyperlink>
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getStartPage}" text="{i18n.home}" /> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getEventsPage}" text="{i18n.events}" /> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getAboutUsPage}" text="{i18n.aboutUs}" /> |
|
||||
<g:InlineHyperlink targetHistoryToken="{pageNames.getContactPage}" text="{i18n.contact}" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.sap.sailing.gwt.home.client.startpage;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.IsWidget;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class StartPageTabletView extends Composite implements StartPagePresenter.MyView {
|
||||
private static StartPageMobileViewUiBinder uiBinder = GWT.create(StartPageMobileViewUiBinder.class);
|
||||
|
||||
interface StartPageMobileViewUiBinder extends UiBinder<Widget, StartPageTabletView> {
|
||||
}
|
||||
|
||||
public StartPageTabletView() {
|
||||
super();
|
||||
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addToSlot(Object slot, IsWidget content) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFromSlot(Object slot, IsWidget content) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInSlot(Object slot, IsWidget content) {
|
||||
}
|
||||
}
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<!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:style>
|
||||
.panel {
|
||||
width: 100%;
|
||||
background-color: rgb(255,255,255);
|
||||
border: solid 1px black;
|
||||
}
|
||||
</ui:style>
|
||||
|
||||
<g:VerticalPanel styleName="{style.panel}">
|
||||
<g:HTML>
|
||||
Home content TABLET
|
||||
</g:HTML>
|
||||
</g:VerticalPanel>
|
||||
</ui:UiBinder>
|
||||
@@ -49,10 +49,8 @@
|
||||
value="com.sap.sailing.gwt.home.client.gin.DesktopModule" />
|
||||
<set-configuration-property name="gin.ginjector.module.mobile"
|
||||
value="com.sap.sailing.gwt.home.client.gin.MobileModule" />
|
||||
<!--
|
||||
<set-configuration-property name="gin.ginjector.module.tablet"
|
||||
value="com.sap.sailing.gwt.home.client.gin.TabletModule" />
|
||||
-->
|
||||
|
||||
<!-- Shared modules -->
|
||||
<set-configuration-property name="gin.ginjector.modules"
|
||||
|
||||
Reference in new issue
Block a user