checkstyle passes.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@111 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DayFilterWidget.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DayFilterWidget.java
index 7992538..bc20b59 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DayFilterWidget.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DayFilterWidget.java
@@ -25,12 +25,14 @@
import com.google.gwt.user.client.ui.Widget;
/**
- * A UI Widget that allows a user to filter the days being displayed in
- * the dynamic table.
+ * A UI Widget that allows a user to filter the days being displayed in the
+ * dynamic table.
*/
public class DayFilterWidget extends Composite {
private class DayCheckBox extends CheckBox {
+ public final int day;
+
public DayCheckBox(String caption, int day) {
super(caption);
@@ -43,8 +45,6 @@
// Initialize based on the calendar's current value.
setChecked(calendar.getDayIncluded(day));
}
-
- public final int day;
}
private class DayCheckBoxListener implements ClickListener {
@@ -54,6 +54,12 @@
}
}
+ private final SchoolCalendarWidget calendar;
+
+ private final VerticalPanel outer = new VerticalPanel();
+
+ private final DayCheckBoxListener dayCheckBoxListener = new DayCheckBoxListener();
+
public DayFilterWidget(SchoolCalendarWidget calendar) {
this.calendar = calendar;
initWidget(outer);
@@ -97,8 +103,4 @@
}
}
}
-
- private final SchoolCalendarWidget calendar;
- private final VerticalPanel outer = new VerticalPanel();
- private final DayCheckBoxListener dayCheckBoxListener = new DayCheckBoxListener();
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DynaTableWidget.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DynaTableWidget.java
index 0ad3307..131fd46 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DynaTableWidget.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/DynaTableWidget.java
@@ -34,6 +34,14 @@
private class NavBar extends Composite implements ClickListener {
+ public final DockPanel bar = new DockPanel();
+
+ public final Button gotoFirst = new Button("<<", this);
+
+ public final Button gotoNext = new Button(">", this);
+ public final Button gotoPrev = new Button("<", this);
+ public final HTML status = new HTML();
+
public NavBar() {
initWidget(bar);
bar.setStyleName("navbar");
@@ -72,12 +80,6 @@
refresh();
}
}
-
- public final DockPanel bar = new DockPanel();
- public final Button gotoFirst = new Button("<<", this);
- public final Button gotoNext = new Button(">", this);
- public final Button gotoPrev = new Button("<", this);
- public final HTML status = new HTML();
}
private class RowDataAcceptorImpl implements RowDataAcceptor {
@@ -129,12 +131,24 @@
}
}
+ private final RowDataAcceptor acceptor = new RowDataAcceptorImpl();
+
+ private final NavBar navbar = new NavBar();
+
+ private final DockPanel outer = new DockPanel();
+
+ private final DynaTableDataProvider provider;
+
+ private int startRow = 0;
+
+ private final Grid grid = new Grid();
+
public DynaTableWidget(DynaTableDataProvider provider, String[] columns,
String[] columnStyles, int rowCount) {
if (columns.length == 0) {
throw new IllegalArgumentException(
- "expecting a positive number of columns");
+ "expecting a positive number of columns");
}
if (columnStyles != null && columns.length != columnStyles.length) {
@@ -150,22 +164,6 @@
setStyleName("DynaTable-DynaTableWidget");
}
- private void initTable(String[] columns, String[] columnStyles, int rowCount) {
- // Set up the header row. It's one greater than the number of visible rows.
- //
- grid.resize(rowCount + 1, columns.length);
- for (int i = 0, n = columns.length; i < n; i++) {
- grid.setText(0, i, columns[i]);
- if (columnStyles != null) {
- grid.getCellFormatter().setStyleName(0, i, columnStyles[i] + " header");
- }
- }
- }
-
- public void setStatusText(String text) {
- navbar.status.setText(text);
- }
-
public void clearStatusText() {
navbar.status.setHTML(" ");
}
@@ -185,14 +183,23 @@
grid.resizeRows(rows);
}
+ public void setStatusText(String text) {
+ navbar.status.setText(text);
+ }
+
private int getDataRowCount() {
return grid.getRowCount() - 1;
}
- private final RowDataAcceptor acceptor = new RowDataAcceptorImpl();
- private final NavBar navbar = new NavBar();
- private final DockPanel outer = new DockPanel();
- private final DynaTableDataProvider provider;
- private int startRow = 0;
- private final Grid grid = new Grid();
+ private void initTable(String[] columns, String[] columnStyles, int rowCount) {
+ // Set up the header row. It's one greater than the number of visible rows.
+ //
+ grid.resize(rowCount + 1, columns.length);
+ for (int i = 0, n = columns.length; i < n; i++) {
+ grid.setText(0, i, columns[i]);
+ if (columnStyles != null) {
+ grid.getCellFormatter().setStyleName(0, i, columnStyles[i] + " header");
+ }
+ }
+ }
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Person.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Person.java
index 08571a1..a715e22 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Person.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Person.java
@@ -18,11 +18,15 @@
import com.google.gwt.user.client.rpc.IsSerializable;
/**
- * Hold relevant data for Person. This class is meant to be serialized in
- * RPC calls.
+ * Hold relevant data for Person. This class is meant to be serialized in RPC
+ * calls.
*/
public abstract class Person implements IsSerializable {
+ private String description = "DESC";
+
+ private String name;
+
public Person() {
}
@@ -43,7 +47,4 @@
public void setName(String name) {
this.name = name;
}
-
- private String description = "DESC";
- private String name;
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Professor.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Professor.java
index b1c7933..01cb7df 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Professor.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Professor.java
@@ -16,11 +16,13 @@
package com.google.gwt.sample.dynatable.client;
/**
- * Holds relevant data for a Professor type Person. This class is intended
- * to be serialized in RPC calls.
+ * Holds relevant data for a Professor type Person. This class is intended to be
+ * serialized in RPC calls.
*/
public class Professor extends Person {
+ private Schedule teachingSchedule = new Schedule();
+
public Professor() {
}
@@ -31,6 +33,4 @@
public Schedule getTeachingSchedule() {
return teachingSchedule;
}
-
- private Schedule teachingSchedule = new Schedule();
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Schedule.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Schedule.java
index 38bab94..c00323c 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Schedule.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Schedule.java
@@ -27,6 +27,11 @@
*/
public class Schedule implements IsSerializable {
+ /**
+ * @gwt.typeArgs <com.google.gwt.sample.dynatable.client.TimeSlot>
+ */
+ private List timeSlots = new ArrayList();
+
public Schedule() {
}
@@ -58,9 +63,4 @@
return getDescription(null);
}
- /**
- * @gwt.typeArgs <com.google.gwt.sample.dynatable.client.TimeSlot>
- */
- private List timeSlots = new ArrayList();
-
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/SchoolCalendarWidget.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/SchoolCalendarWidget.java
index c5b4b08..e485dba 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/SchoolCalendarWidget.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/SchoolCalendarWidget.java
@@ -23,17 +23,25 @@
import com.google.gwt.user.client.ui.Composite;
/**
- * A Composite widget that abstracts a DynaTableWidget and a data provider
- * tied to the <@link SchoolCalendarService> RPC endpoint.
+ * A Composite widget that abstracts a DynaTableWidget and a data provider tied
+ * to the <@link SchoolCalendarService> RPC endpoint.
*/
public class SchoolCalendarWidget extends Composite {
/**
- * A data provider that bridges the provides row level updates from the
- * data available through a <@link SchoolCalendarService>.
+ * A data provider that bridges the provides row level updates from the data
+ * available through a <@link SchoolCalendarService>.
*/
public class CalendarProvider implements DynaTableDataProvider {
+ private final SchoolCalendarServiceAsync calService;
+
+ private int lastMaxRows = -1;
+
+ private Person[] lastPeople;
+
+ private int lastStartRow = -1;
+
public CalendarProvider() {
// Initialize the service.
//
@@ -44,10 +52,10 @@
// (Which is a totally demo hack, by the way :-)
//
ServiceDefTarget target = (ServiceDefTarget) calService;
-
- // Use a module-relative URLs to ensure that this client code can find
- // its way home, even when the URL changes (as might happen when you
- // deploy this as a webapp under an external servlet container).
+
+ // Use a module-relative URLs to ensure that this client code can find
+ // its way home, even when the URL changes (as might happen when you
+ // deploy this as a webapp under an external servlet container).
String moduleRelativeURL = GWT.getModuleBaseURL() + "calendar";
target.setServiceEntryPoint(moduleRelativeURL);
}
@@ -110,18 +118,22 @@
}
acceptor.accept(startRow, rows);
}
-
- private final SchoolCalendarServiceAsync calService;
- private int lastMaxRows = -1;
- private Person[] lastPeople;
- private int lastStartRow = -1;
}
private static final boolean USE_STATIC_RPC_ANSWERS = true;
+ private final CalendarProvider calProvider = new CalendarProvider();
+
+ private final boolean[] daysFilter = new boolean[] {
+ true, true, true, true, true, true, true};
+
+ private final DynaTableWidget dynaTable;
+
+ private Command pendingRefresh;
+
public SchoolCalendarWidget(int visibleRows) {
- String[] columns = new String[]{"Name", "Description", "Schedule"};
- String[] styles = new String[]{"name", "desc", "sched"};
+ String[] columns = new String[] {"Name", "Description", "Schedule"};
+ String[] styles = new String[] {"name", "desc", "sched"};
dynaTable = new DynaTableWidget(calProvider, columns, styles, visibleRows);
initWidget(dynaTable);
}
@@ -152,10 +164,4 @@
DeferredCommand.add(pendingRefresh);
}
}
-
- private final CalendarProvider calProvider = new CalendarProvider();
- private final boolean[] daysFilter = new boolean[]{
- true, true, true, true, true, true, true};
- private final DynaTableWidget dynaTable;
- private Command pendingRefresh;
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Student.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Student.java
index 994b164..d53b920 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Student.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/Student.java
@@ -16,11 +16,13 @@
package com.google.gwt.sample.dynatable.client;
/**
- * Holds relevant data for a Student type Person. This class is intended
- * to be serialized in RPC calls.
+ * Holds relevant data for a Student type Person. This class is intended to be
+ * serialized in RPC calls.
*/
public class Student extends Person {
+ private Schedule classSchedule = new Schedule();
+
public Schedule getClassSchedule() {
return classSchedule;
}
@@ -28,6 +30,4 @@
public String getSchedule(boolean[] daysFilter) {
return classSchedule.getDescription(daysFilter);
}
-
- private Schedule classSchedule = new Schedule();
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/TimeSlot.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/TimeSlot.java
index 393abc6..c9ab9aa 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/client/TimeSlot.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/client/TimeSlot.java
@@ -18,13 +18,19 @@
import com.google.gwt.user.client.rpc.IsSerializable;
/**
- * Hold relevant data for a time slot. This class is intended to be
- * serialized as part of RPC calls.
+ * Hold relevant data for a time slot. This class is intended to be serialized
+ * as part of RPC calls.
*/
public class TimeSlot implements IsSerializable, Comparable {
- private static final transient String[] DAYS = new String[]{
- "Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"};
+ private static final transient String[] DAYS = new String[] {
+ "Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"};
+
+ private int endMinutes;
+
+ private int startMinutes;
+
+ private int zeroBasedDayOfWeek;
public TimeSlot() {
}
@@ -58,7 +64,7 @@
public String getDescription() {
return DAYS[zeroBasedDayOfWeek] + " " + getHrsMins(startMinutes) + "-"
- + getHrsMins(endMinutes);
+ + getHrsMins(endMinutes);
}
public int getEndMinutes() {
@@ -94,10 +100,6 @@
int remainder = mins % 60;
return hrs + ":"
- + (remainder < 10 ? "0" + remainder : String.valueOf(remainder));
+ + (remainder < 10 ? "0" + remainder : String.valueOf(remainder));
}
-
- private int endMinutes;
- private int startMinutes;
- private int zeroBasedDayOfWeek;
}
diff --git a/samples/dynatable/src/com/google/gwt/sample/dynatable/server/SchoolCalendarServiceImpl.java b/samples/dynatable/src/com/google/gwt/sample/dynatable/server/SchoolCalendarServiceImpl.java
index 9be01f5..99e76a6 100644
--- a/samples/dynatable/src/com/google/gwt/sample/dynatable/server/SchoolCalendarServiceImpl.java
+++ b/samples/dynatable/src/com/google/gwt/sample/dynatable/server/SchoolCalendarServiceImpl.java
@@ -28,24 +28,41 @@
import java.util.List;
import java.util.Random;
+/**
+ * The implemenation of the RPC service which runs on the server.
+ */
public class SchoolCalendarServiceImpl extends RemoteServiceServlet implements
SchoolCalendarService {
- private static final String[] FIRST_NAMES = new String[]{
- "Inman", "Sally", "Omar", "Teddy", "Jimmy", "Cathy", "Barney", "Fred",
- "Eddie", "Carlos"};
+ private static final String[] FIRST_NAMES = new String[] {
+ "Inman", "Sally", "Omar", "Teddy", "Jimmy", "Cathy", "Barney", "Fred",
+ "Eddie", "Carlos"};
- private static final String[] LAST_NAMES = new String[]{
- "Smith", "Jones", "Epps", "Gibbs", "Webber", "Blum", "Mendez", "Crutcher",
- "Needler", "Wilson", "Chase", "Edelstein"};
+ private static final String[] LAST_NAMES = new String[] {
+ "Smith", "Jones", "Epps", "Gibbs", "Webber", "Blum", "Mendez",
+ "Crutcher", "Needler", "Wilson", "Chase", "Edelstein"};
- private static final String[] SUBJECTS = new String[]{
- "Chemistry", "Phrenology", "Geometry", "Underwater Basket Weaving",
- "Basketball", "Computer Science", "Statistics", "Materials Engineering",
- "English Literature", "Geology"};
+ private static final String[] SUBJECTS = new String[] {
+ "Chemistry", "Phrenology", "Geometry", "Underwater Basket Weaving",
+ "Basketball", "Computer Science", "Statistics", "Materials Engineering",
+ "English Literature", "Geology"};
private static final Person[] NO_PEOPLE = new Person[0];
+ private static final int CLASS_LENGTH_MINS = 50;
+
+ private static final int MAX_SCHED_ENTRIES = 5;
+
+ private static final int MIN_SCHED_ENTRIES = 1;
+
+ private static final int MAX_PEOPLE = 100;
+
+ private static final int STUDENTS_PER_PROF = 5;
+
+ private final List people = new ArrayList();
+
+ private final Random rnd = new Random(3);
+
public SchoolCalendarServiceImpl() {
generateRandomPeople();
}
@@ -72,6 +89,15 @@
return results;
}
+ /**
+ * Write the serialized response out to stdout. This is a very unusual thing
+ * to do, but it allows us to create a static file version of the response
+ * without deploying a servlet.
+ */
+ protected void onAfterResponseSerialized(String serializedResponse) {
+ System.out.println(serializedResponse);
+ }
+
private void generateRandomPeople() {
for (int i = 0; i < MAX_PEOPLE; ++i) {
Person person = generateRandomPerson();
@@ -147,21 +173,4 @@
int i = rnd.nextInt(a.length);
return a[i];
}
-
- /**
- * Write the serialized response out to stdout. This is a very unusual thing
- * to do, but it allows us to create a static file version of the response
- * without deploying a servlet.
- */
- protected void onAfterResponseSerialized(String serializedResponse) {
- System.out.println(serializedResponse);
- }
-
- private final List people = new ArrayList();
- private final Random rnd = new Random(3);
- private static final int CLASS_LENGTH_MINS = 50;
- private static final int MAX_SCHED_ENTRIES = 5;
- private static final int MIN_SCHED_ENTRIES = 1;
- private static final int MAX_PEOPLE = 100;
- private static final int STUDENTS_PER_PROF = 5;
}
diff --git a/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java b/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java
index bb6624c..75a2275 100644
--- a/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java
+++ b/samples/i18n/src/com/google/gwt/sample/i18n/client/I18N.java
@@ -48,7 +48,7 @@
private static final String USER_TABLE_STYLE = "userTable";
private static final String MESSAGES_TABLE_STYLE = "messagesTable";
private static final String MESSAGES_ARGUMENT_TYPE_STYLE = "messagesArgumentType";
- /** Root node to start injecting code. */
+ /* Root node to start injecting code. */
private static final String ROOT = "root";
private static final int USER_TABLE_WIDTH = 1;