function update(h)

%% Listener to changes in the viewNode due to selecting a different
%% view target node

if isempty(h.ViewNode) || ~ishandle(h.ViewNode)
    return % All views deleted
end

I = find(h.ViewNode==get(h.Handles.COMBOselectView,'Userdata'));
if ~isempty(I)
    % Select the combo
    set(h.Handles.COMBOselectView,'Value',I(1)) 
    
    % Update the timeseries table with the member time series of the 
    % selected View
    if ~isempty(h.ViewNode.Plot)
        memberts = h.ViewNode.Plot.getTimeSeries;
    else
        memberts = {};
    end
    tstabledata = cell(length(memberts),2);
    for k=1:length(memberts)
        tstabledata{k,1} = true;
        tstabledata{k,2} = memberts{k}.Name;
        tstabledata{k,3} = ['1:' sprintf('%d',size(memberts{k}.Data,2))];
    end
    h.Handles.tsTable.setData(tstabledata);
    h.Handles.tsTable.setColumnWidth(205);
end 