Example usage for com.google.gwt.user.client.ui StackPanel getWidget

List of usage examples for com.google.gwt.user.client.ui StackPanel getWidget

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui StackPanel getWidget.

Prototype

public Widget getWidget(int index) 

Source Link

Usage

From source file:com.qualogy.qafe.gwt.client.component.QStack.java

License:Apache License

private int getIndexToInsertStack(StackPanel stackPanel) {
    int indexToInsert = getStackIndex();
    if (stackPanel.getWidgetCount() <= 0) {
        indexToInsert = 0;/*w  w  w.jav  a  2s  .  c  o m*/
    } else if (stackPanel.getWidgetCount() < indexToInsert) {
        indexToInsert = stackPanel.getWidgetCount();
    } else {
        for (int i = 0; i < stackPanel.getWidgetCount(); i++) {
            if (stackPanel.getWidget(i) instanceof QStack) {
                QStack stack = (QStack) stackPanel.getWidget(i);
                if (stack.getStackIndex() > indexToInsert) {
                    indexToInsert = i;
                    break;
                }
            }
        }
    }

    return indexToInsert;
}