Fixing checkstyle errors.
Patch by: jlabanca
Review by: rjrjr (TBR)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6196 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/javadoc/com/google/gwt/examples/SplitLayoutPanelExample.java b/user/javadoc/com/google/gwt/examples/SplitLayoutPanelExample.java
index e12b1b3..ba71d4e 100644
--- a/user/javadoc/com/google/gwt/examples/SplitLayoutPanelExample.java
+++ b/user/javadoc/com/google/gwt/examples/SplitLayoutPanelExample.java
@@ -19,16 +19,15 @@
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
-import com.google.gwt.user.client.ui.DockLayoutPanel.Direction;
public class SplitLayoutPanelExample implements EntryPoint {
public void onModuleLoad() {
// Create a three-pane layout with splitters.
SplitLayoutPanel p = new SplitLayoutPanel();
- p.add(new HTML("navigation"), Direction.WEST, 128);
- p.add(new HTML("list"), Direction.NORTH, 384);
- p.add(new HTML("details"), Direction.CENTER, 0);
+ p.addWest(new HTML("navigation"), 128);
+ p.addNorth(new HTML("list"), 384);
+ p.add(new HTML("details"));
// Note the explicit call to layout(). This is required for the layout to
// take effect.
diff --git a/user/src/com/google/gwt/uibinder/parsers/DockLayoutPanelParser.java b/user/src/com/google/gwt/uibinder/parsers/DockLayoutPanelParser.java
index d3c1a66..c336ee8 100644
--- a/user/src/com/google/gwt/uibinder/parsers/DockLayoutPanelParser.java
+++ b/user/src/com/google/gwt/uibinder/parsers/DockLayoutPanelParser.java
@@ -70,8 +70,8 @@
// (Don't generate a ctor for the SplitLayoutPanel; it's implicitly PX).
if (type != getSplitLayoutPanelType(writer)) {
Unit unit = elem.consumeEnumAttribute("unit", Unit.class);
- writer.setFieldInitializerAsConstructor(fieldName, writer.getOracle()
- .findType(DockLayoutPanel.class.getName()),
+ writer.setFieldInitializerAsConstructor(fieldName,
+ writer.getOracle().findType(DockLayoutPanel.class.getName()),
getFullyQualifiedEnumName(unit));
}
@@ -79,7 +79,9 @@
for (XMLElement child : elem.consumeChildElements()) {
// Make sure the element is one of the fixed set of valid directions.
if (!isValidChildElement(elem, child)) {
- writer.die("In %s, child must be one of {north, south, east, west, center}", elem);
+ writer.die(
+ "In %s, child must be one of {north, south, east, west, center}",
+ elem);
}
// Consume the single widget element.
diff --git a/user/src/com/google/gwt/uibinder/parsers/StackLayoutPanelParser.java b/user/src/com/google/gwt/uibinder/parsers/StackLayoutPanelParser.java
index ca773de..58feb85 100644
--- a/user/src/com/google/gwt/uibinder/parsers/StackLayoutPanelParser.java
+++ b/user/src/com/google/gwt/uibinder/parsers/StackLayoutPanelParser.java
@@ -34,9 +34,9 @@
UiBinderWriter writer) throws UnableToCompleteException {
// StackLayoutPanel requires a unit ctor.
Unit unit = elem.consumeEnumAttribute("unit", Unit.class);
- writer.setFieldInitializerAsConstructor(fieldName, writer.getOracle()
- .findType(StackLayoutPanel.class.getName()), DockLayoutPanelParser
- .getFullyQualifiedEnumName(unit));
+ writer.setFieldInitializerAsConstructor(fieldName,
+ writer.getOracle().findType(StackLayoutPanel.class.getName()),
+ DockLayoutPanelParser.getFullyQualifiedEnumName(unit));
// Parse children.
for (XMLElement child : elem.consumeChildElements()) {
diff --git a/user/src/com/google/gwt/uibinder/rebind/model/OwnerClass.java b/user/src/com/google/gwt/uibinder/rebind/model/OwnerClass.java
index ac982f7..460c998 100644
--- a/user/src/com/google/gwt/uibinder/rebind/model/OwnerClass.java
+++ b/user/src/com/google/gwt/uibinder/rebind/model/OwnerClass.java
@@ -26,8 +26,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
diff --git a/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java b/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java
index 9c2883f..f34524b 100644
--- a/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/DockLayoutPanel.java
@@ -17,7 +17,6 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.layout.client.Layout;
import com.google.gwt.layout.client.Layout.Layer;
@@ -55,8 +54,8 @@
RequiresResize, ProvidesResize {
/**
- * Used in {@link DockLayoutPanel#add(Widget, Direction, double)} to specify
- * the direction in which a child widget will be added.
+ * Used in {@link DockLayoutPanel#addEast(Widget, double)} et al to
+ * specify the direction in which a child widget will be added.
*/
public enum Direction {
NORTH, EAST, SOUTH, WEST, CENTER, LINE_START, LINE_END
@@ -151,8 +150,9 @@
*
* <p>
* The container element is created by the {@link Layout} class. This should
- * be used with certain styles, such as {@link Style#setZIndex(int)}, that
- * must be applied to the container, rather than directly to the child widget.
+ * be used with certain styles, such as
+ * {@link com.google.gwt.dom.client.Style#setZIndex(int)}, that must be
+ * applied to the container, rather than directly to the child widget.
* </p>
*
* TODO(jgw): Is this really the best way to do this?
diff --git a/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java b/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
index db42600..7f6f3d8 100644
--- a/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/SplitLayoutPanel.java
@@ -251,6 +251,19 @@
splitter.setMinSize(minSize);
}
+ private Splitter getAssociatedSplitter(Widget child) {
+ // If a widget has a next sibling, it must be a splitter, because the only
+ // widget that *isn't* followed by a splitter must be the CENTER, which has
+ // no associated splitter.
+ int idx = getWidgetIndex(child);
+ if (idx < getWidgetCount() - 2) {
+ Widget splitter = getWidget(idx + 1);
+ assert splitter instanceof Splitter : "Expected child widget to be splitter";
+ return (Splitter) splitter;
+ }
+ return null;
+ }
+
private void insertSplitter(Widget before) {
assert getChildren().size() > 0 : "Can't add a splitter before any children";
assert getCenter() == null : "Can't add a splitter after the CENTER widget";
@@ -277,17 +290,4 @@
super.insert(splitter, lastChildLayout.direction, SPLITTER_SIZE, before);
}
-
- private Splitter getAssociatedSplitter(Widget child) {
- // If a widget has a next sibling, it must be a splitter, because the only
- // widget that *isn't* followed by a splitter must be the CENTER, which has
- // no associated splitter.
- int idx = getWidgetIndex(child);
- if (idx < getWidgetCount() - 2) {
- Widget splitter = getWidget(idx + 1);
- assert splitter instanceof Splitter : "Expected child widget to be splitter";
- return (Splitter) splitter;
- }
- return null;
- }
}