Well, since I have not received an answer, this is what worked for me. Google does not make it easy to extend existing panels to add or change functionality, so I downloaded the source code, copied it StackPanel.java, DecoratorPanel.javaand DecoratedStackPanel.javainto the package in my gwt project.
The main change I really needed to make was to change the behavior showStack(int index)in the class StackPanel.javafrom
public void showStack(int index) {
if ((index >= getWidgetCount()) || (index < 0) || (index == visibleStack)) {
return;
}
if (visibleStack >= 0) {
setStackVisible(visibleStack, false);
}
visibleStack = index;
setStackVisible(visibleStack, true); }
like that:
public void showStack(int index) {
if ((index >= getWidgetCount()) || index < 0) {
return;
}
visibleStack = index;
setStackVisible(visibleStack, !getWidget(visibleStack).isVisible());
}
I'm sure it can be cleaned a bit, but it did the trick. The reason other classes must be copied to the same package is because it StackPanel.javarefers to some of its methods that have only package visibility.
source
share