% DISPLAYRESULTS displays the results from a query of an LTPDA repository.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: DISPLAYRESULTS displays the results from a query of an LTPDA
%              repository.
%
% CALL:        utils.jmysql.displayResults(results_cell, query);
%
% INPUTS:
%              results_cell - a cell array of results like that returned
%                             from utils.jmysql.query
%              query        - the query string that yielded the results
%                             (for display purposes only)
%
%
% VERSION:     $Id: displayResults.m,v 1.2 2009/09/22 14:40:07 ingo Exp $
%
% HISTORY:     24-05-2007 M Hewitson
%                 Creation
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



function  displayResults(varargin)
  
  if ~isa(varargin{1}, 'java.sql.ResultSet')
    error('### The first argument should be a ResultSet');
  end
  
  if ~ischar(varargin{2})
    error('### The second argument should be a string.');
  end
  
  % Inputs
  results  = varargin{1};
  query    = varargin{2};
  
  warning('off', 'MATLAB:JavaEDTAutoDelegation');
  qrd = mpipeline.repository.QueryResultsTableDialog([], false, results, query, false);
  qrd.setTitle('Query Results'); 
  qrd.setVisible(true)
  warning('on', 'MATLAB:JavaEDTAutoDelegation');
  
end

