diff m-toolbox/classes/+utils/@jmysql/displayResults.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@jmysql/displayResults.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,46 @@
+% 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
+