Library: GWT SDK 2.0.3
Class: SplitLayoutPanel
Method:getAssociatedSplitter()
Error: Unable to resize the last Widget on panel
Steps to Reproduce Error:
public class ReproduceError implements EntryPoint {
@Override
public void onModuleLoad() {
SplitLayoutPanel panel = new SplitLayoutPanel();
Label greet = new Label("Hello World");
panel.addNorth(greet, 100);
panel.setWidgetMinSize(greet, 200);
}
}
public class WorkAround implements EntryPoint {
@Override
public void onModuleLoad() {
SplitLayoutPanel panel = new SplitLayoutPanel();
Label greet = new Label("Hello World");
panel.addNorth(greet, 100);
panel.addNorth(new HTML(""), 0);
panel.setWidgetMinSize(greet, 200);
}
}
Cause of Error: "idx < getWidgetCount() - 2"
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;
}
Fix of Error: idx <= getWidgetCount() - 2
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors