Package com.googlecode.gwt.test.internal.patchers

Source Code of com.googlecode.gwt.test.internal.patchers.StackPanelPatcher

package com.googlecode.gwt.test.internal.patchers;

import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.ui.StackPanel;
import com.google.gwt.user.client.ui.WidgetCollection;
import com.googlecode.gwt.test.patchers.PatchClass;
import com.googlecode.gwt.test.patchers.PatchMethod;
import com.googlecode.gwt.test.utils.GwtReflectionUtils;

@PatchClass(StackPanel.class)
class StackPanelPatcher {

   @PatchMethod
   static int findDividerIndex(StackPanel panel, Element child) {
      WidgetCollection children = GwtReflectionUtils.getPrivateFieldValue(panel, "children");

      for (int i = 0; i < children.size(); i++) {
         if (children.get(i).getElement().equals(child)) {
            return i;
         }
      }

      return -1;
   }

}
TOP

Related Classes of com.googlecode.gwt.test.internal.patchers.StackPanelPatcher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.