view m-toolbox/classes/@repogui2/cb_workspaceObjsList.m @ 39:11e3ed9d2115 database-connection-manager

Implement databases listing in database connection dialog
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

% CB_WORKSPACEOBJSLIST callback for workspace object list.
% 
% M Hewitson 22-09-08
% 
% $Id: cb_workspaceObjsList.m,v 1.1 2008/09/22 14:28:56 hewitson Exp $
% 
function cb_workspaceObjsList(varargin)

  % Handles
  myh     = varargin{1};
  mainfig = varargin{end};
  
  % get the selected line
  val = get(myh, 'Value');
  if length(val) == 1
    lines = get(myh, 'String');
    objname = deblank(strtok(lines{val}));

    cmd = sprintf('obj = evalin(''base'', ''%s'');', objname);
    eval(cmd);

    obj
    objtxt = display(obj);
  else
    objtxt = '';
  end

  st = '';
  for j=1:length(objtxt)
    st = [st sprintf('%s\n', objtxt{j})];
  end

  % set objDisplay Txt
  set(myh, 'TooltipString', st);
end