Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@jmysql/queryDialog.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % QUERYDIALOG a visual query builder for querying an LTPDA repository. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: QUERYDIALOG a visual query builder for querying an LTPDA | |
5 % repository. | |
6 % | |
7 % CALL: utils.jmysql.queryDialog(); | |
8 % utils.jmysql.queryDialog(conn); | |
9 % | |
10 % INPUTS: | |
11 % conn - a connection object like that returned from | |
12 % utils.jmysql.connect. | |
13 % | |
14 % | |
15 % VERSION: $Id: queryDialog.m,v 1.2 2009/09/22 14:40:07 ingo Exp $ | |
16 % | |
17 % HISTORY: 24-05-2007 M Hewitson | |
18 % Creation | |
19 % | |
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
21 | |
22 | |
23 | |
24 function queryDialog(varargin) | |
25 | |
26 if nargin == 1 && ~isa(varargin{1}, 'mpipeline.repository.RepositoryConnection') | |
27 error('### The first argument should be empty or a RepositoryConnection'); | |
28 end | |
29 | |
30 | |
31 % Inputs | |
32 conn = []; | |
33 if nargin > 0 | |
34 conn = varargin{1}; | |
35 end | |
36 | |
37 if isempty(conn) | |
38 conn = utils.jmysql.connect(); | |
39 end | |
40 | |
41 if ~conn.isConnected | |
42 conn.openConnection | |
43 end | |
44 | |
45 if ~conn.isConnected | |
46 error('### Failed to connect to repository.'); | |
47 end | |
48 | |
49 % open a query dialog | |
50 if nargin == 0 | |
51 closeConnectionOnExit = true; | |
52 else | |
53 closeConnectionOnExit = false; | |
54 end | |
55 warning('off', 'MATLAB:JavaEDTAutoDelegation'); | |
56 qrd = mpipeline.repository.RepositoryQueryDialog([], false, conn, false, closeConnectionOnExit); | |
57 qrd.setVisible(true) | |
58 warning('off', 'MATLAB:JavaEDTAutoDelegation'); | |
59 | |
60 | |
61 | |
62 end | |
63 |