@Test public void addItemsWithNullClickListener_doesNotThrow() { GridContextMenu<Object> gridContextMenu = new GridContextMenu<>(); GridMenuItem<Object> foo = gridContextMenu.addItem("foo", null); gridContextMenu.addItem(new NativeButton(), null); foo.getSubMenu().addItem("bar", null); foo.getSubMenu().addItem(new NativeButton(), null); }
@Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = getMenuManager().addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; }
GridContextMenu extends
        ContextMenuBase<GridContextMenu<T>, GridMenuItem<T>, GridSubMenu<T>> implements HasGridMenuItems<T> { @Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = getMenuManager().addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; } }
GridContextMenu extends
        ContextMenuBase<GridContextMenu<T>, GridMenuItem<T>, GridSubMenu<T>> implements HasGridMenuItems<T> { @Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = getMenuManager().addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; } GridContextMenu();  GridContextMenu(Grid<T> target); }
GridContextMenu extends
        ContextMenuBase<GridContextMenu<T>, GridMenuItem<T>, GridSubMenu<T>> implements HasGridMenuItems<T> { @Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = getMenuManager().addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; } GridContextMenu();  GridContextMenu(Grid<T> target); @Override void setTarget(Component target); @Override GridMenuItem<T> addItem(String text,
            ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener); @Override GridMenuItem<T> addItem(Component component,
            ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener); Registration addGridContextMenuOpenedListener(
            ComponentEventListener<GridContextMenuOpenedEvent<T>> listener); SerializablePredicate<T> getDynamicContentHandler(); void setDynamicContentHandler(
            SerializablePredicate<T> dynamicContentHandler); }
GridContextMenu extends
        ContextMenuBase<GridContextMenu<T>, GridMenuItem<T>, GridSubMenu<T>> implements HasGridMenuItems<T> { @Override public GridMenuItem<T> addItem(String text, ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener) { GridMenuItem<T> menuItem = getMenuManager().addItem(text); if (clickListener != null) { menuItem.addMenuItemClickListener(clickListener); } return menuItem; } GridContextMenu();  GridContextMenu(Grid<T> target); @Override void setTarget(Component target); @Override GridMenuItem<T> addItem(String text,
            ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener); @Override GridMenuItem<T> addItem(Component component,
            ComponentEventListener<GridContextMenuItemClickEvent<T>> clickListener); Registration addGridContextMenuOpenedListener(
            ComponentEventListener<GridContextMenuOpenedEvent<T>> listener); SerializablePredicate<T> getDynamicContentHandler(); void setDynamicContentHandler(
            SerializablePredicate<T> dynamicContentHandler);  }