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

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


      // Arrange
      final Anchor a0 = new Anchor();
      a0.setText("a0");
      final Anchor a1 = new Anchor();
      a1.setText("a1");
      final StackPanel panel = new StackPanel() {

         @Override
         public void onBrowserEvent(com.google.gwt.user.client.Event event) {
            super.onBrowserEvent(event);

            if (DOM.eventGetType(event) == Event.ONCLICK) {
               tested = !tested;
               assertNull(event.getRelatedEventTarget());
            }

            assertEquals(a1.getElement(), event.getEventTarget());
         };
      };

      panel.add(a0);
      panel.insert(a1, 1);

      // Act
      Browser.click(panel, 1);

      // Assert
      assertThat(tested).isTrue();
      assertThat(panel.getSelectedIndex()).isEqualTo(1);
   }
View Full Code Here


   @Test
   public void click() {
      // Arrange
      index = -1;
      StackPanel panel = new StackPanel() {

         @Override
         public void showStack(int index) {
            StackPanelTest.this.index = index;
         };
      };

      panel.add(new Anchor());
      panel.add(new Anchor());

      // Act
      Browser.click(panel, 1);

      // Assert
View Full Code Here

   }

   @Test
   public void stackPanel() {
      // Arrange
      StackPanel panel = new StackPanel();

      // Act
      panel.add(new Label("Foo"), "foo");
      Label label = new Label("Bar");
      panel.add(label, "bar");
      panel.add(new Label("Baz"), "baz");

      // Assert
      assertEquals(3, panel.getWidgetCount());
      assertEquals(label, panel.getWidget(1));
      assertEquals(1, panel.getWidgetIndex(label));
   }
View Full Code Here

   }

   @Test
   public void title() {
      // Arrange
      StackPanel sp = new StackPanel();
      // Pre-Assert
      assertEquals("", sp.getTitle());

      // Act
      sp.setTitle("title");

      // Assert
      assertEquals("title", sp.getTitle());
   }
View Full Code Here

   }

   @Test
   public void visible() {
      // Arrange
      StackPanel sp = new StackPanel();
      // Pre-Assert
      assertEquals(true, sp.isVisible());

      // Act
      sp.setVisible(false);

      // Assert
      assertEquals(false, sp.isVisible());
   }
View Full Code Here

    invokeAllAccessibleMethods(new RenderablePanel("") {});
    invokeAllAccessibleMethods(new ResizeLayoutPanel() {});
    invokeAllAccessibleMethods(new SimpleLayoutPanel() {});
    invokeAllAccessibleMethods(new SimplePanel() {});
    invokeAllAccessibleMethods(new SplitLayoutPanel() {});
    invokeAllAccessibleMethods(new StackPanel() {});
    invokeAllAccessibleMethods(new VerticalPanel() {});
  }
View Full Code Here

TOP

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

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.