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

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


   }

   @Test
   public void animationEnabled() {
      // Arrange
      MenuBar bar = new MenuBar();

      // Act
      bar.setAnimationEnabled(true);

      // Assert
      assertEquals(true, bar.isAnimationEnabled());
   }
View Full Code Here


   }

   @Test
   public void autoOpen() {
      // Arrange
      MenuBar bar = new MenuBar();

      // Act
      bar.setAutoOpen(false);

      // Assert
      assertEquals(false, bar.getAutoOpen());
   }
View Full Code Here

   }

   @Test
   public void click() {
      // Arrange
      MenuBar bar = new MenuBar();
      MenuItem item = bar.addItem("item", cmd);
      // Pre-Assert
      assertEquals(false, called);

      // Act
      Browser.click(bar, item);
View Full Code Here

   }

   @Test
   public void constructor_Complex() {
      // Arrange
      MenuBar bar = new MenuBar();
      MenuBar subMenuBar = new MenuBar();
      MenuItem item = new MenuItem("item", false, subMenuBar);
      bar.addItem(item);
      item.setCommand(cmd);
      // Pre-Assert
      assertEquals(false, called);
View Full Code Here

   }

   @Test
   public void removeItem() {
      // Arrange
      MenuBar bar = new MenuBar();
      MenuItem item0 = bar.addItem("test0", cmd);
      MenuItem item1 = bar.addItem("test1", cmd);

      // Act
      bar.removeItem(item0);

      // Assert
      assertEquals(0, bar.getItemIndex(item1));
   }
View Full Code Here

   }

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

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

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

   }

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

      // Act
      bar.setVisible(false);

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

      assertEquals(expected, actual);
   }

   @Test
   public void itemIsNotVisibleWhenParentIsNotVisible() {
      MenuBar bar = new MenuBar();
      bar.setVisible(false);
      MenuItem item0 = bar.addItem("test0", (Command) null);
      item0.setVisible(true);

      // Act
      Boolean isVisible = WidgetUtils.isWidgetVisible(item0);
View Full Code Here

   }

   @Test
   public void menuBarItems() {
      // Arrange
      MenuBar bar = new MenuBar();

      Command cmd = new Command() {
         public void execute() {
         }

      };

      MenuItem item0 = bar.addItem("item0", cmd);
      MenuItem item1 = bar.addItem("item1", cmd);

      // Act
      List<MenuItem> items = WidgetUtils.getMenuItems(bar);

      // Assert
View Full Code Here

   @Test
   public void suggestBoxItems() {
      // Arrange
      SuggestBox box = new SuggestBox();
      SuggestionDisplay display = GwtReflectionUtils.getPrivateFieldValue(box, "display");
      MenuBar bar = GwtReflectionUtils.getPrivateFieldValue(display, "suggestionMenu");

      Command cmd = new Command() {
         public void execute() {
         }

      };

      MenuItem item0 = bar.addItem("item0", cmd);
      MenuItem item1 = bar.addItem("item1", cmd);

      // Act
      List<MenuItem> items = WidgetUtils.getMenuItems(box);

      // Assert
View Full Code Here

TOP

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

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.