You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reorderableListbox.m
    path of file: ./repos/ciatah/_external_programs/_file_exchange/reorderableListbox_1.1.1
    
    the code of the file until where you have to start completion: function [ hListbox jListbox jScrollPane jDND ] = reorderableListbox( ...
    varargin )
%REORDERABLELISTBOX Create reorderable listbox.
%   REORDERABLELISTBOX, by itself, creates a listbox in the current figure
%   whose contents can be reordered by clicking and dragging items, and
%   returns a handle to it.
%
%   REORDERABLELISTBOX
    
function mousePressed( jListbox, jEventData )
        %MOUSEPRESSED   JList 'MousedPressedCallback'.
        %   MOUSEPRESSED executes when the mouse is clicked on the listbox.
        %   The mouse's position is recorded and the listbox gains focus.
        
        % Find the index of the clicked item, store it for future reference
        startInd = jListbox.locationToIndex( jEventData.getPoint ) + 1;
        
        % Make sure the listbox gains focus when it's clicked
        jListbox.requestFocus();
        
        % Call the user-defined MousePressedCallback, if given
        doCallback( userCallback{1}, jListbox, jEventData );
        
    end

    function mouseReleased( jListbox, jEventData )
        %MOUSERELEASED  JList 'MousedReleasedCallback'.
        %   MOUSERELEASED executes when the mouse is released after a
        %   listbox click (but not after a drag). The drag-tracking
        %   variable STARTIND is cleared.
        %
        %   This function, with DROP, tries to prevent drags from other
        %   objects from triggering the reorder behaviour. However, if an
        %   item is dragged from the listbox to another object, neither
        %   function gets called, and the listbox can still be reordered by
        %   other drags.

        % Clear the drag-tracking variable
        startInd = [];
        
        % Call the user-defined MouseReleasedCallback, if given
        doCallback( userCallback{2}, jListbox, jEventData );
        
    end

    function drop( jDND, jEventData )
        %DROP   DropTarget 'DropCallback'.
        %   DROP executes after a mouse drag to the listbox. The
        %   drag-tracking variable STARTIND is cleared.
        %
        %   This function, with MOUSERELEASED, tries to prevent drags from
        %   other objects from triggering the reorder behaviour. However,
        %   if an item is dragged from the listbox to another object,
        %   neither function gets called, and the listbox can still be
        %   reordered by other drags.

        % Clear the drag-tracking variable
        startInd = [];
        
        % Call the user-defined DropCallback, if given
        doCallback( userCallback{4}, jDND, jEventData );
        
    end

    function permOrder = dragOver( jDND, jEventData )
        %DRAGOVER   DropTarget 'DragOverCallback'.
        %   DRAGOVER executes when the mouse is dragged over the listbox.
        %   The mouse's movement is tracked, and if it has moved by at
        %   least one item, the list is reordered by calling SHIFTLIST.
        
        % Find the index of the mouse position, compute the distance moved
        mouseInd = jListbox.locationToIndex( jEventData.getLocation ) + 1;
        moveInd = mouseInd - startInd;
        
        % Only proceed if the mouse has moved at least one item
        if moveInd
            % Retrieve the list contents and selection
            str = get( hListbox, 'String' );
            val = get( hListbox, 'Value' );
            
            % Update the selection (the click isn't always registered)
            if ~ismember( startInd, val )
                val = startInd;
            end