private WMenuItem createImageMenuItem ( final String resource , final String desc , final String cacheKey , final WText selectedMenuText ) { WImage image = new WImage ( resource , desc ) ; image . setCacheKey ( cacheKey ) ; WDecoratedLabel label = new WDecoratedLabel ( image , new WText ( desc ) , null ) ; WMenuItem menuItem = new WMenuItem ( label , new ExampleMenuAction ( selectedMenuText ) ) ; menuItem . setActionObject ( desc ) ; return menuItem ; }
Creates an example menu item using an image .