NetworkInfo[] networks = core.getNetworkInfoMap().getNetworks(); for ( int i = 0; i < networks.length; i++ ) { NetworkInfo network = networks[ i ]; if ( network.isEnabled() && network.isSearchable() ) { combo.add( network.getNetworkName() ); combo.setData( network.getNetworkName(), network ); } } if ( combo.getItemCount() > 1 ) { combo.add( G2GuiResources.getString( "S_ALL" ) ); combo.setData( G2GuiResources.getString( "S_ALL" ), null ); combo.select( combo.indexOf( G2GuiResources.getString( "S_ALL" ) ) ); combo.setEnabled( true ); } else { combo.select( 0 ); combo.setEnabled( false ); }
fillCombo();
	protected void createNetworkBox( Group group, String aString ) {		gridData = new GridData( GridData.FILL_HORIZONTAL );		gridData.horizontalSpan = 2;		label = new Label( group, SWT.NONE );		label.setLayoutData( gridData );		label.setText( aString );						gridData = new GridData( GridData.FILL_HORIZONTAL );		gridData.horizontalSpan = 2;		combo = new Combo( group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );		combo.setLayoutData( gridData );			/* get all activated networks and display them in the combo */		NetworkInfo[] networks = core.getNetworkInfoMap().getNetworks();		for ( int i = 0; i < networks.length; i++ ) {			NetworkInfo network = networks[ i ];			if ( network.isEnabled() && network.isSearchable() ) {				combo.add( network.getNetworkName() );				combo.setData( network.getNetworkName(), network );			}			}		if ( combo.getItemCount() > 1 ) {			combo.add( G2GuiResources.getString( "S_ALL" ) );			combo.setData( G2GuiResources.getString( "S_ALL" ), null );			combo.select( combo.indexOf( G2GuiResources.getString( "S_ALL" ) ) );			combo.setEnabled( true );		}		else {			combo.select( 0 );			combo.setEnabled( false );		}	}