Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.ComplexPanel


    @Test
    public void testWidget() {
        UnitBoxItem<String> ubi = new UnitBoxItem<String>("amount", "Amount", String.class);
        ubi.setUnitPropertyName("units");
        ComplexPanel widget = (ComplexPanel) ubi.asWidget();
        TextBox foundTextBox = null;
        ListBox foundListBox = null;
        for (int i=0; i < widget.getWidgetCount(); i++) {
            Widget child = widget.getWidget(i);
            if (child instanceof TextBox)
                foundTextBox = (TextBox) child;

            if (child instanceof ListBox)
                foundListBox = (ListBox) child;
View Full Code Here


      if (c.getItemCount() > 0) {
        focusWidget(forward ? c.getItem(0) : c.getItem(c.getItemCount() - 1));
      }
    } else if (w instanceof ComplexPanel) {
      if (pe != null) pe.stopEvent();
      ComplexPanel panel = (ComplexPanel) w;
      if (panel.getWidgetCount() > 0) {
        focusWidget(panel.getWidget(0));
      }
    }
  }
View Full Code Here

      DOM.setElementProperty(DOM.getChild(tr1, 0), "width", "20px");
      DOM.setElementPropertyInt(DOM.getChild(tr2, 0), "colSpan", 2);
      headerParent = tr1;
    }

    header = new ComplexPanel() {
      {
        setElement(DOM.createTD());
        DOM.setInnerHTML(getElement(), "&nbsp;");
        addStyleName(Gerrit.RESOURCES.css().complexHeader());
      }

      @Override
      public void add(Widget w) {
        add(w, getElement());
      }
    };

    initWidget(new ComplexPanel() {
      {
        final DisclosurePanel main = ComplexDisclosurePanel.this.main;
        setElement(main.getElement());
        getChildren().add(main);
        adopt(main);
View Full Code Here

    @Test
    public void testWidget() {
        UnitBoxItem<String> ubi = new UnitBoxItem<String>("amount", "Amount", String.class);
        ubi.setUnitPropertyName("units");
        ComplexPanel widget = (ComplexPanel) ubi.asWidget();
        TextBox foundTextBox = null;
        ListBox foundListBox = null;
        for (int i=0; i < widget.getWidgetCount(); i++) {
            Widget child = widget.getWidget(i);
            if (child instanceof TextBox)
                foundTextBox = (TextBox) child;

            if (child instanceof ListBox)
                foundListBox = (ListBox) child;
View Full Code Here

      if (c.getItemCount() > 0) {
        focusWidget(forward ? c.getItem(0) : c.getItem(c.getItemCount() - 1));
      }
    } else if (w instanceof ComplexPanel) {
      if (pe != null) pe.stopEvent();
      ComplexPanel panel = (ComplexPanel) w;
      if (panel.getWidgetCount() > 0) {
        focusWidget(panel.getWidget(0));
      }
    }
  }
View Full Code Here

      if (c.getItemCount() > 0) {
        focusWidget(forward ? c.getItem(0) : c.getItem(c.getItemCount() - 1));
      }
    } else if (w instanceof ComplexPanel) {
      if (pe != null) pe.stopEvent();
      ComplexPanel panel = (ComplexPanel) w;
      if (panel.getWidgetCount() > 0) {
        focusWidget(panel.getWidget(0));
      }
    }
  }
View Full Code Here

      if (c.getItemCount() > 0) {
        focusWidget(forward ? c.getItem(0) : c.getItem(c.getItemCount() - 1));
      }
    } else if (w instanceof ComplexPanel) {
      if (pe != null) pe.stopEvent();
      ComplexPanel panel = (ComplexPanel) w;
      if (panel.getWidgetCount() > 0) {
        focusWidget(panel.getWidget(0));
      }
    }
  }
View Full Code Here

      if (index == con.getItemCount()) {
        index = 0;
      }
      focusWidget(con.getItem(index));
    } else if (p instanceof ComplexPanel) {
      ComplexPanel panel = (ComplexPanel) p;
      int index = panel.getWidgetIndex(c);
      if (index != -1) {
        if (index == panel.getWidgetCount() + 1) {
          index = 0;
        } else {
          ++index;
        }
        Widget w = panel.getWidget(index);
        focusWidget(w);

      }
    }
  }
View Full Code Here

      if (c.getItemCount() > 0) {
        focusWidget(forward ? c.getItem(0) : c.getItem(c.getItemCount() - 1));
      }
    } else if (w instanceof ComplexPanel) {
      if (pe != null) pe.stopEvent();
      ComplexPanel panel = (ComplexPanel) w;
      if (panel.getWidgetCount() > 0) {
        focusWidget(panel.getWidget(0));
      }
    }
  }
View Full Code Here

public class ComplexPanelTest extends GwtTestTest {

   @Test
   public void add() {
      // Arrange
      ComplexPanel panel = new FlowPanel();
      RootPanel.get().add(panel);
      assertTrue(panel.isAttached());
      assertEquals(0, panel.getWidgetCount());
      Button b1 = new Button();
      assertFalse(b1.isAttached());
      assertNull(b1.getParent());

      // Act
      panel.add(b1);

      // Assert
      assertTrue(b1.isAttached());
      assertEquals(panel, b1.getParent());
      assertEquals(1, panel.getWidgetCount());
      assertEquals(b1, panel.getWidget(0));
      assertEquals(0, panel.getWidgetIndex(b1));
   }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.ComplexPanel

Copyright © 2018 www.massapicom. 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.