def toggle_row_selection
      node = @list[@current_index]
      previous_node = nil
      previous_node = @list[@selected_index] if @selected_index
      if @selected_index == @current_index
        @selected_index = nil
      else
        @selected_index = @current_index
      end
      state = @selected_index.nil? ? :DESELECTED : :SELECTED
      #TreeSelectionEvent = Struct.new(:node, :tree, :state, :previous_node, :row_first)
      @tree_selection_event = TreeSelectionEvent.new(node, self, state, previous_node, @current_index) #if @item_event.nil?
      fire_handler :TREE_SELECTION_EVENT, @tree_selection_event # should the event itself be ITEM_EVENT
      $log.debug " XXX tree selected #{@selected_index}/ #{@current_index} , #{state} "
      @repaint_required = true
    end
def toggle_row_selection
      node = @list[@current_index]
      previous_node = nil
      previous_node = @list[@selected_index] if @selected_index
      if @selected_index == @current_index
        @selected_index = nil
      else
        @selected_index = @current_index
      end
      state = @selected_index.nil? ? :DESELECTED : :SELECTED
      #TreeSelectionEvent = Struct.new(:node, :tree, :state, :previous_node, :row_first)
      @tree_selection_event = TreeSelectionEvent.new(node, self, state, previous_node, @current_index) #if @item_event.nil?
      fire_handler :TREE_SELECTION_EVENT, @tree_selection_event # should the event itself be ITEM_EVENT
      $log.debug " XXX tree selected #{@selected_index}/ #{@current_index} , #{state} "
      @repaint_required = true
    end
An event is thrown when a row is selected or deselected.
 Please note that when a row is selected, another one is automatically deselected.
 An event is not thrown for that since your may not want to collapse that.
 Only clicking on a selected row, will send a DESELECT on it since you may want to collapse it.
 However, the previous selection is also present in the event object, so you can act upon it.
 This is not used for expanding or collapsing, only for application to show some data in another
 window or pane based on selection. Maybe there should not be a deselect for current row ?