results.close( ); } } else { selectValueList.removeAll( ); ExceptionHandler.openErrorMessageBox(Messages.getString("SelectValueDialog.errorRetrievinglist"), Messages.getString("SelectValueDialog.noExpressionSet")); } if(selectValueList.getItemCount() > 0) { selectValueList.select(0); this.okButton.setEnabled(true); }
if ( results != null ) { IResultIterator iter = results.getResultIterator( ); if ( iter != null ) { while ( iter.next( ) ) { String value = iter.getString( expression ); if ( value != null ) { selectValueList.add( value ); } } }  results.close( ); } } else { selectValueList.removeAll( ); ExceptionHandler.openErrorMessageBox( Messages.getString( "SelectValueDialog.errorRetrievinglist" ), Messages.getString( "SelectValueDialog.noExpressionSet" ) ); } if ( selectValueList.getItemCount( ) > 0 ) { selectValueList.select( 0 ); this.okButton.setEnabled( true ); }
	private void populateList( )	{		try		{            this.okButton.setEnabled(false);            if(getExpression() != null && getExpression().trim().length() > 0)            {                //Execute the query and populate this list                BaseQueryDefinition query = (BaseQueryDefinition) DataSetManager.getCurrentInstance( )                        .getPreparedQuery( getDataSetHandle( ), true, false)                        .getReportQueryDefn( );                ScriptExpression expression = new ScriptExpression( getExpression( ) );                GroupDefinition defn = new GroupDefinition( );                defn.setKeyExpression( getExpression( ) );                query.setUsesDetails( false );                query.addGroup( defn );                query.addExpression( expression, BaseTransform.BEFORE_FIRST_ROW );                IPreparedQuery preparedQuery = DataSetManager.getCurrentInstance( )                        .getEngine( )                        .prepare( (IQueryDefinition) query );                IQueryResults results = preparedQuery.execute( null );                selectValueList.removeAll( );                                if ( results != null )                {                    IResultIterator iter = results.getResultIterator( );                    if ( iter != null )                    {                        while ( iter.next( ) )                        {                            String value = iter.getString( expression );                            if(value != null)                            {                                selectValueList.add( value );                            }                        }                    }                    results.close( );                }            }            else            {                selectValueList.removeAll( );                ExceptionHandler.openErrorMessageBox(Messages.getString("SelectValueDialog.errorRetrievinglist"), Messages.getString("SelectValueDialog.noExpressionSet")); //$NON-NLS-1$ //$NON-NLS-2$            }            if(selectValueList.getItemCount() > 0)            {                selectValueList.select(0);                this.okButton.setEnabled(true);            }            		}		catch ( Exception e )		{			ExceptionHandler.handle( e );		}	}