Revision: 8023
Author: [email protected]
Date: Fri Apr 30 11:05:48 2010
Log: Rough first pass at something vaguely resembling mobile versions of the
scaffold and customized expense apps.
Review at http://gwt-code-reviews.appspot.com/392804
Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=8023
Added:
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobileShell.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobileShell.ui.xml
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.ui.xml
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseList.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileReportList.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobileShell.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobileShell.ui.xml
Modified:
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobile.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldActivities.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobile.java
/branches/2.1/bikeshed/war/ExpensesMobile.html
/branches/2.1/bikeshed/war/ScaffoldMobile.html
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobileShell.java
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.sample.expenses.gwt.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.SpanElement;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.sample.expenses.gwt.request.ExpenseRecord;
+import com.google.gwt.sample.expenses.gwt.request.ExpensesRequestFactory;
+import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiFactory;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * TODO
+ */
+public class ExpensesMobileShell extends Composite {
+
+ interface ShellUiBinder extends UiBinder<Widget, ExpensesMobileShell> { }
+ private static ShellUiBinder BINDER = GWT.create(ShellUiBinder.class);
+
+ private final ExpensesRequestFactory requestFactory;
+
+ @UiField DeckPanel deck;
+ @UiField MobileReportList reportList;
+ @UiField MobileExpenseList expenseList;
+ @UiField MobileExpenseDetails expenseDetails;
+
+ @UiField Button backButton, forwardButton;
+ @UiField SpanElement titleSpan;
+
+ public ExpensesMobileShell(ExpensesRequestFactory requestFactory) {
+ this.requestFactory = requestFactory;
+ initWidget(BINDER.createAndBindUi(this));
+
+ deck.showWidget(0);
+ }
+
+ @UiFactory
+ MobileReportList createReportList() {
+ return new MobileReportList(new MobileReportList.Listener() {
+ public void onReportSelected(ReportRecord report) {
+ expenseList.show(report);
+ deck.showWidget(1);
+ }
+ }, requestFactory);
+ }
+
+ @UiFactory
+ MobileExpenseList createExpenseList() {
+ return new MobileExpenseList(new MobileExpenseList.Listener() {
+ public void onExpenseSelected(ExpenseRecord expense) {
+ expenseDetails.show(expense);
+ deck.showWidget(2);
+ }
+ }, requestFactory);
+ }
+
+ @UiHandler("backButton")
+ void onBack(ClickEvent evt) {
+ int idx = deck.getVisibleWidget();
+ if (idx > 0) {
+ deck.showWidget(idx - 1);
+ }
+ }
+
+ @UiHandler("forwardButton")
+ void onForward(ClickEvent evt) {
+ }
+}
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobileShell.ui.xml
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,51 @@
+<!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:l='urn:import:com.google.gwt.bikeshed.list.client'
+ xmlns:c='urn:import:com.google.gwt.sample.expenses.gwt.client'>
+
+ <ui:with field='styles'
type='com.google.gwt.sample.bikeshed.style.client.Styles' />
+
+ <ui:style>
+ .title {
+ border-bottom: 1px solid #c3c3c3;
+ }
+
+ .titleText {
+ font-family: Times New Roman, sans-serif;
+ color: #7b8fae;
+ font-size: 18pt;
+ font-weight: bold;
+ }
+
+ .bar {
+ position: relative;
+ border-bottom: 1px solid #c3c3c3;
+ }
+
+ .backButton {
+ }
+
+ .forwardButton {
+ position: absolute;
+ right: 0px;
+ }
+ </ui:style>
+
+ <g:HTMLPanel styleName='{style.title}'>
+ <div class='{style.title}'>Expenses Sample</div>
+
+ <div class='{style.bar}'>
+ <g:Button styleName='{style.backButton}'
ui:field='backButton'><</g:Button>
+ <span ui:field='titleSpan'/>
+ <g:Button styleName='{style.forwardButton}'
ui:field='forwardButton'>></g:Button>
+ </div>
+
+ <g:DeckPanel ui:field='deck'>
+ <c:MobileReportList ui:field='reportList'/>
+ <c:MobileExpenseList ui:field='expenseList'/>
+ <c:MobileExpenseDetails ui:field='expenseDetails'/>
+ </g:DeckPanel>
+ </g:HTMLPanel>
+</ui:UiBinder>
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.java
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.sample.expenses.gwt.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.sample.expenses.gwt.request.ExpenseRecord;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+import java.util.Date;
+
+/**
+ * TODO
+ */
+public class MobileExpenseDetails extends Composite {
+
+ interface Binder extends UiBinder<Widget, MobileExpenseDetails> { }
+ private static Binder BINDER = GWT.create(Binder.class);
+
+ @UiField TextBox nameText, categoryText, priceText;
+ @UiField ListBox dateYear, dateMonth, dateDay;
+
+ public MobileExpenseDetails() {
+ initWidget(BINDER.createAndBindUi(this));
+
+ populateList(dateYear, 2000, 2010);
+ populateList(dateMonth, 1, 12);
+ populateList(dateDay, 1, 31);
+ }
+
+ private void populateList(ListBox list, int start, int end) {
+ for (int i = start; i <= end; ++i) {
+ if (i < 10) {
+ list.addItem("0" + i);
+ } else {
+ list.addItem("" + i);
+ }
+ }
+ }
+
+ public void show(ExpenseRecord expense) {
+ nameText.setText(expense.getDescription());
+ categoryText.setText(expense.getCategory());
+
priceText.setText(ExpensesMobile.formatCurrency(expense.getAmount().intValue()));
+
+ Date d = expense.getDate();
+ dateYear.setSelectedIndex(d.getYear() + 1900 - 2000);
+ dateMonth.setSelectedIndex(d.getMonth());
+ dateDay.setSelectedIndex(d.getDate() - 1);
+ }
+}
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.ui.xml
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,23 @@
+<!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:l='urn:import:com.google.gwt.bikeshed.list.client'
+ xmlns:c='urn:import:com.google.gwt.sample.expenses.gwt.client'>
+
+ <ui:with field='styles'
type='com.google.gwt.sample.bikeshed.style.client.Styles' />
+
+ <ui:style>
+ </ui:style>
+
+ <g:HTMLPanel>
+ <div>Name: <g:TextBox ui:field='nameText'/></div>
+ <div>
+ Date: <g:ListBox ui:field='dateYear'/> /
+ <g:ListBox ui:field='dateMonth'/> /
+ <g:ListBox ui:field='dateDay'/>
+ </div>
+ <div>Category: <g:TextBox ui:field='categoryText'/></div>
+ <div>Price: <g:TextBox ui:field='priceText'/></div>
+ </g:HTMLPanel>
+</ui:UiBinder>
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseList.java
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.sample.expenses.gwt.client;
+
+import com.google.gwt.bikeshed.cells.client.Cell;
+import com.google.gwt.bikeshed.list.client.CellList;
+import com.google.gwt.bikeshed.list.shared.ListViewAdapter;
+import com.google.gwt.bikeshed.list.shared.SelectionModel;
+import com.google.gwt.bikeshed.list.shared.SingleSelectionModel;
+import
com.google.gwt.bikeshed.list.shared.SelectionModel.SelectionChangeEvent;
+import com.google.gwt.requestfactory.shared.Receiver;
+import com.google.gwt.sample.expenses.gwt.request.ExpenseRecord;
+import com.google.gwt.sample.expenses.gwt.request.ExpensesRequestFactory;
+import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.valuestore.shared.Property;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * TODO
+ */
+public class MobileExpenseList extends Composite implements
+ Receiver<List<ExpenseRecord>> {
+
+ /**
+ * TODO
+ */
+ public interface Listener {
+ void onExpenseSelected(ExpenseRecord expense);
+ }
+
+ private final ExpensesRequestFactory requestFactory;
+ private final CellList<ExpenseRecord> expenseList;
+ private final ListViewAdapter<ExpenseRecord> expenseAdapter;
+ private final SingleSelectionModel<ExpenseRecord> expenseSelection;
+
+ public MobileExpenseList(final Listener listener,
+ final ExpensesRequestFactory requestFactory) {
+ this.requestFactory = requestFactory;
+ expenseAdapter = new ListViewAdapter<ExpenseRecord>();
+
+ expenseList = new CellList<ExpenseRecord>(
+ new Cell<ExpenseRecord>() {
+ @Override
+ public void render(ExpenseRecord value, Object viewData,
+ StringBuilder sb) {
+ sb.append(value.getDescription() + " " +
+
ExpensesMobile.formatCurrency(value.getAmount().intValue()));
+ }
+ });
+
+ expenseSelection = new SingleSelectionModel<ExpenseRecord>();
+ expenseList.setSelectionModel(expenseSelection);
+ expenseSelection.addSelectionChangeHandler(new
SelectionModel.SelectionChangeHandler() {
+ public void onSelectionChange(SelectionChangeEvent event) {
+ listener.onExpenseSelected(expenseSelection.getSelectedObject());
+ }
+ });
+
+ expenseAdapter.addView(expenseList);
+ initWidget(expenseList);
+ }
+
+ public void onSuccess(List<ExpenseRecord> newValues) {
+ expenseAdapter.setList(newValues);
+ }
+
+ public void show(ReportRecord report) {
+ requestFactory.expenseRequest().findExpensesByReport(
+
report.getRef(ReportRecord.id)).forProperties(getExpenseColumns()).to(
+ this).fire();
+ }
+
+ private Collection<Property<?>> getExpenseColumns() {
+ List<Property<?>> columns = new ArrayList<Property<?>>();
+ columns.add(ExpenseRecord.description);
+ columns.add(ExpenseRecord.amount);
+ return columns;
+ }
+}
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileReportList.java
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.sample.expenses.gwt.client;
+
+import com.google.gwt.bikeshed.cells.client.Cell;
+import com.google.gwt.bikeshed.list.client.CellList;
+import com.google.gwt.bikeshed.list.shared.ListViewAdapter;
+import com.google.gwt.bikeshed.list.shared.SelectionModel;
+import com.google.gwt.bikeshed.list.shared.SingleSelectionModel;
+import
com.google.gwt.bikeshed.list.shared.SelectionModel.SelectionChangeEvent;
+import com.google.gwt.requestfactory.shared.Receiver;
+import com.google.gwt.sample.expenses.gwt.request.ExpensesRequestFactory;
+import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.valuestore.shared.Property;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * TODO
+ */
+public class MobileReportList extends Composite implements
+ Receiver<List<ReportRecord>> {
+
+ /**
+ * TODO
+ */
+ public interface Listener {
+ void onReportSelected(ReportRecord report);
+ }
+
+ private final CellList<ReportRecord> reportList;
+ private final ListViewAdapter<ReportRecord> reportAdapter;
+ private final SingleSelectionModel<ReportRecord> reportSelection;
+
+ public MobileReportList(final Listener listener,
+ final ExpensesRequestFactory requestFactory) {
+ reportAdapter = new ListViewAdapter<ReportRecord>();
+
+ reportList = new CellList<ReportRecord>(
+ new Cell<ReportRecord>() {
+ @Override
+ public void render(ReportRecord value, Object viewData,
+ StringBuilder sb) {
+ sb.append(value.getPurpose());
+ }
+ });
+
+ reportSelection = new SingleSelectionModel<ReportRecord>();
+ reportSelection.addSelectionChangeHandler(new
SelectionModel.SelectionChangeHandler() {
+ public void onSelectionChange(SelectionChangeEvent event) {
+ listener.onReportSelected(reportSelection.getSelectedObject());
+ }
+ });
+
+ reportList.setSelectionModel(reportSelection);
+ reportAdapter.addView(reportList);
+
+ initWidget(reportList);
+
+ requestFactory.reportRequest().findAllReports().forProperties(
+ getReportColumns()).to(this).fire();
+ }
+
+ public void onSuccess(List<ReportRecord> newValues) {
+ reportAdapter.setList(newValues);
+ }
+
+ private Collection<Property<?>> getReportColumns() {
+ List<Property<?>> columns = new ArrayList<Property<?>>();
+ columns.add(ReportRecord.created);
+ columns.add(ReportRecord.purpose);
+ return columns;
+ }
+}
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobileShell.java
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
not
+ * use this file except in compliance with the License. You may obtain a
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
under
+ * the License.
+ */
+package com.google.gwt.sample.expenses.gwt.client;
+
+import com.google.gwt.app.place.PlacePickerView;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.sample.expenses.gwt.client.place.ListScaffoldPlace;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * TODO
+ */
+public class ScaffoldMobileShell extends Composite {
+
+ interface Binder extends UiBinder<Widget, ScaffoldMobileShell> { }
+ private static final Binder BINDER = GWT.create(Binder.class);
+
+ @UiField SimplePanel body;
+ @UiField DivElement error;
+ @UiField PlacePickerView<ListScaffoldPlace> placesBox;
+
+ public ScaffoldMobileShell() {
+ initWidget(BINDER.createAndBindUi(this));
+ }
+
+ /**
+ * @return the body
+ */
+ public SimplePanel getBody() {
+ return body;
+ }
+
+ public PlacePickerView<ListScaffoldPlace> getPlacesBox() {
+ return placesBox;
+ }
+
+ /**
+ * @param string
+ */
+ public void setError(String string) {
+ error.setInnerText(string);
+ }
+}
=======================================
--- /dev/null
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobileShell.ui.xml
Fri Apr 30 11:05:48 2010
@@ -0,0 +1,39 @@
+<!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:a='urn:import:com.google.gwt.app.client'>
+
+ <ui:style>
+ .disabled {
+ color: gray;
+ }
+
+ .banner {
+ background-color: wheat;
+ }
+
+ .title {
+ text-align: left;
+ margin-left: 1em;
+ }
+
+ .error {
+ text-align: center;
+ background-color: red;
+ }
+
+ .users {
+ }
+ </ui:style>
+
+ <g:HTMLPanel>
+ <g:HTML styleName='{style.banner}'>
+ <div class='{style.error}' ui:field='error'></div>
+ <h2 class='{style.title}'>Expenses Entity Browser</h2>
+ </g:HTML>
+
+ <a:ListBoxPlacePickerView width='90%' visibleItemCount='10'
ui:field='placesBox'/>
+
+ <g:SimplePanel ui:field='body'/>
+ </g:HTMLPanel>
+</ui:UiBinder>
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobile.java
Thu Apr 29 11:11:29 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpensesMobile.java
Fri Apr 30 11:05:48 2010
@@ -19,17 +19,39 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.sample.expenses.gwt.request.ExpensesRequestFactory;
-import com.google.gwt.sample.expenses.gwt.request.ReportRecord;
-import com.google.gwt.sample.expenses.gwt.request.ReportRecordChanged;
import com.google.gwt.user.client.ui.RootLayoutPanel;
-import com.google.gwt.valuestore.shared.DeltaValueStore;
/**
* Entry point for the mobile version of the Expenses app.
- *
- * TODO(jgw): Make this actually mobile-friendly.
*/
public class ExpensesMobile implements EntryPoint {
+
+ /**
+ * TODO(jgw): Put this some place more sensible.
+ */
+ public static String formatCurrency(int price) {
+ StringBuilder sb = new StringBuilder();
+
+ boolean negative = price < 0;
+ if (negative) {
+ price = -price;
+ }
+ int dollars = price / 100;
+ int cents = price % 100;
+
+ if (negative) {
+ sb.append("-");
+ }
+ sb.append("$");
+ sb.append(dollars);
+ sb.append('.');
+ if (cents < 10) {
+ sb.append('0');
+ }
+ sb.append(cents);
+
+ return sb.toString();
+ }
/**
* This is the entry point method.
@@ -39,20 +61,7 @@
final ExpensesRequestFactory requestFactory =
GWT.create(ExpensesRequestFactory.class);
requestFactory.init(eventBus);
- RootLayoutPanel root = RootLayoutPanel.get();
-
- final ExpensesShell shell = new ExpensesShell();
-
- root.add(shell);
-
- shell.setListener(new ExpensesShell.Listener() {
- public void setPurpose(ReportRecord report, String purpose) {
- DeltaValueStore deltaValueStore =
requestFactory.getValueStore().spawnDeltaView();
- deltaValueStore.set(ReportRecord.purpose, report, purpose);
- requestFactory.syncRequest(deltaValueStore).fire();
- }
- });
-
- eventBus.addHandler(ReportRecordChanged.TYPE, shell);
+ final ExpensesMobileShell shell = new
ExpensesMobileShell(requestFactory);
+ RootLayoutPanel.get().add(shell);
}
}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldActivities.java
Wed Apr 28 13:19:55 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldActivities.java
Fri Apr 30 11:05:48 2010
@@ -53,7 +53,6 @@
public Activity getActivity(ScaffoldPlace place) {
return place.acceptFilter(new ScaffoldPlaceFilter<Activity>() {
-
public Activity filter(EmployeeScaffoldPlace place) {
return employeeActivitiesBuilder.getActivity(place);
}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobile.java
Wed Apr 28 13:19:55 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ScaffoldMobile.java
Fri Apr 30 11:05:48 2010
@@ -57,7 +57,7 @@
/* Top level UI */
- final ScaffoldShell shell = new ScaffoldShell();
+ final ScaffoldMobileShell shell = new ScaffoldMobileShell();
/* Left side lets us pick from all the types of entities */
=======================================
--- /branches/2.1/bikeshed/war/ExpensesMobile.html Wed Apr 28 08:53:39 2010
+++ /branches/2.1/bikeshed/war/ExpensesMobile.html Fri Apr 30 11:05:48 2010
@@ -16,6 +16,9 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="viewport" content="width=device-width, user-scalable=no">
+
<title>Expenses</title>
<script type="text/javascript" language="javascript"
src="expensesMobile/expensesMobile.nocache.js"></script>
<script type="text/javascript" language="javascript"
src="json2.js"></script>
=======================================
--- /branches/2.1/bikeshed/war/ScaffoldMobile.html Wed Apr 28 13:19:55 2010
+++ /branches/2.1/bikeshed/war/ScaffoldMobile.html Fri Apr 30 11:05:48 2010
@@ -16,12 +16,15 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>Expenses Entity Browser</title>
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="viewport" content="width=device-width, user-scalable=no">
+
+ <title>Scaffold Entity Browser</title>
<script type="text/javascript" language="javascript"
src="scaffoldMobile/scaffoldMobile.nocache.js"></script>
</head>
<body>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1'
style="position:absolute;width:0;height:0;border:0"></iframe>
- <span id='loading'><i>…loading…</i></span>
+ <span id='loading'><i>…loading…</i></span>
</body>
</html>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors