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

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

Introduction

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

Prototype

public int getWidgetCount() 

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;//from   w w  w  .  j a  v  a  2s . com
    } 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;
}