changeset 31:a26669b59d7e database-connection-manager

Update LTPDAworkbench
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents 317b5f447f3e
children e22b091498e4
files m-toolbox/classes/@LTPDAworkbench/LTPDAworkbench.m m-toolbox/classes/@LTPDAworkbench/cb_launchRepogui.m m-toolbox/classes/@LTPDAworkbench/cb_openRepoManagerGUI.m m-toolbox/classes/@LTPDAworkbench/cb_queryRepository.m m-toolbox/classes/@LTPDAworkbench/cb_submitObjects.m
diffstat 5 files changed, 22 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/m-toolbox/classes/@LTPDAworkbench/LTPDAworkbench.m	Mon Dec 05 16:20:06 2011 +0100
+++ b/m-toolbox/classes/@LTPDAworkbench/LTPDAworkbench.m	Mon Dec 05 16:20:06 2011 +0100
@@ -80,13 +80,7 @@
               pause(0.1);
               save(libfile, 'lib')
             end
-            
-            % Set the repository manager to the workbench
-            rm = LTPDARepositoryManager();
-            awtinvoke(wb.mp, 'setRepositoryManager', rm.manager);
-%             javaMethodEDT('setRepositoryManager', wb.mp, rm.manager);
-            pause(0.1);
-            
+                        
             % refresh library tree
             awtinvoke(wb.mp, 'refreshLibraryTree');
 %             javaMethodEDT('refreshLibraryTree', wb.mp);
@@ -184,8 +178,8 @@
         set(h, 'ActionPerformedCallback', {@wb.cb_launchLTPDApreferences});
         
         %---- 'LTPDA Repository GUI' menu item
-        h = handle(wb.mp.getLtpdaRepoGuiMenuItem, 'callbackproperties');
-        set(h, 'ActionPerformedCallback', {@wb.cb_launchRepogui});
+        %h = handle(wb.mp.getLtpdaRepoGuiMenuItem, 'callbackproperties');
+        %set(h, 'ActionPerformedCallback', {@wb.cb_launchRepogui});
         
         %---- 'Spectral Window Viewer' menu item
         h = handle(wb.mp.getLtpdaSpecwinViewerMenuItem, 'callbackproperties');
@@ -244,8 +238,8 @@
         set(h, 'ActionPerformedCallback', {@wb.cb_submitObjects});
         
         %----Open repository manager
-        h = handle(wb.mp.getRepoConnectTBB, 'callbackproperties');
-        set(h, 'ActionPerformedCallback', {@wb.cb_openRepoManagerGUI});
+        h = handle(wb.mp.getRepoSearchTBB, 'callbackproperties');
+        set(h, 'ActionPerformedCallback', {@wb.cb_queryRepository});
         
         %%%%%%%%%%   other    %%%%%%%%%%
         
@@ -382,7 +376,7 @@
     
     % Repository Buttons
     varargout = cb_submitObjects(varargin)
-    varargout = cb_openRepoManagerGUI(varargin)
+    varargout = cb_queryRepository(varargin)
     
     % other
     varargout = cb_guiClosed(varargin)
--- a/m-toolbox/classes/@LTPDAworkbench/cb_launchRepogui.m	Mon Dec 05 16:20:06 2011 +0100
+++ b/m-toolbox/classes/@LTPDAworkbench/cb_launchRepogui.m	Mon Dec 05 16:20:06 2011 +0100
@@ -6,7 +6,6 @@
 %
 function cb_launchRepogui(varargin)
   
-  rm = LTPDARepositoryManager();
-  rm.showGui();
+  LTPDADatabaseConnectionManager().connect();
   
 end
--- a/m-toolbox/classes/@LTPDAworkbench/cb_openRepoManagerGUI.m	Mon Dec 05 16:20:06 2011 +0100
+++ b/m-toolbox/classes/@LTPDAworkbench/cb_openRepoManagerGUI.m	Mon Dec 05 16:20:06 2011 +0100
@@ -8,9 +8,7 @@
 %
 function cb_openRepoManagerGUI(varargin)
   
-  rm = LTPDARepositoryManager();
-  rm.showGui();
-  rm.gui.toFront();
+  LTPDADatabaseConnectionManager().connect();
   
 end
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@LTPDAworkbench/cb_queryRepository.m	Mon Dec 05 16:20:06 2011 +0100
@@ -0,0 +1,9 @@
+function varargout = cb_queryRepository(varargin)
+  
+  wb = varargin{1};
+  conn = LTPDADatabaseConnectionManager().connect();
+  
+  rqd = javaObjectEDT('mpipeline.repository.RepositoryQueryDialog', wb.mp, false, conn, true);
+  rqd.setVisible(true);
+  
+end
--- a/m-toolbox/classes/@LTPDAworkbench/cb_submitObjects.m	Mon Dec 05 16:20:06 2011 +0100
+++ b/m-toolbox/classes/@LTPDAworkbench/cb_submitObjects.m	Mon Dec 05 16:20:06 2011 +0100
@@ -10,6 +10,8 @@
   
   wb = varargin{1};
   
+  wb
+  
   % Get all selected blocks
   sbs = awtinvoke(wb.mp, 'getSelectedBlocks');
   
@@ -49,6 +51,9 @@
   end
   
   cmd = [cmd 'sinfo, plist(''hostname'', ''''));'];
+
+  disp(sinfo)
+  disp(cmd)
   
   assignin('base', 'sinfo', sinfo);
   try