use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method click.
@Test
public void click() {
// Given
MenuBar bar = new MenuBar();
MenuItem item = bar.addItem("item", cmd);
// Preconditions
assertThat(called).isEqualTo(false);
// When
Browser.click(bar, item);
// Then
assertThat(called).isEqualTo(true);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method visible.
@Test
public void visible() {
// Given
MenuBar bar = new MenuBar();
// Preconditions
assertThat(bar.isVisible()).isEqualTo(true);
// When
bar.setVisible(false);
// Then
assertThat(bar.isVisible()).isEqualTo(false);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method autoOpen.
@Test
public void autoOpen() {
// Given
MenuBar bar = new MenuBar();
// When
bar.setAutoOpen(false);
// Then
assertThat(bar.getAutoOpen()).isEqualTo(false);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method animationEnabled.
@Test
public void animationEnabled() {
// Given
MenuBar bar = new MenuBar();
// When
bar.setAnimationEnabled(true);
// Then
assertThat(bar.isAnimationEnabled()).isEqualTo(true);
}
use of com.google.gwt.user.client.ui.MenuBar in project rstudio by rstudio.
the class BaseMenuBar method onLoad.
@Override
protected void onLoad() {
if (vertical_ && glass++ == 0)
eventBus_.fireEvent(new GlassVisibilityEvent(true));
super.onLoad();
for (MenuItem child : getItems()) {
if (child instanceof AppMenuItem)
((AppMenuItem) child).onShow();
else {
// if this is a submenu that consists entirely of hidden commands,
// hide the submenu and its flyout icon
MenuBar submenu = child.getSubMenu();
if (submenu != null && submenu instanceof AppMenuBar) {
boolean visible = child.isVisible();
boolean newVisible = !((AppMenuBar) submenu).allInvisibleCmds();
if (visible != newVisible) {
child.setVisible(newVisible);
updateSubmenuIcon(child);
}
}
}
}
if (autoHideRedundantSeparators_)
manageSeparators();
}
Aggregations