SwingMenuList extends AbstractSwingContainer implements XulMenuList<T> { public void setSelectedItem( T t ) { SwingMenupopup popup = getPopupElement(); for ( XulComponent item : popup.getChildNodes() ) { SwingMenuitem tempItem = (SwingMenuitem) item; if ( tempItem.getLabel().equals( extractLabel( t ) ) ) { this.combobox.setSelectedItem( tempItem ); } } } SwingMenuList( Element self, XulComponent parent, XulDomContainer domContainer, String tagName ); void layout(); void onDomReady(); SwingMenupopup getPopupElement(); @Deprecated void replaceAllItems( Collection<T> tees ); String getSelectedItem(); void setSelectedItem( T t ); void setOncommand( final String command ); Collection<T> getElements(); String getBinding(); void setBinding( String binding ); void setElements( Collection<T> tees ); int getSelectedIndex(); void setSelectedIndex( int idx ); @Override void setWidth( int width ); void setEditable( boolean editable ); boolean getEditable(); String getValue(); void setValue( String value );  }
@Test public void testSetSelectedItem() throws Exception { XulMenuitem item = (XulMenuitem) doc.getElementById( "sales" ); list.setSelectedItem( item ); assertEquals( list.getSelectedItem().toString(), item.getLabel() ); }