<commit_before>package org.jtalks.poulpe.web.controller.section;

import java.util.List;

import org.jtalks.poulpe.model.entity.Branch;
import org.jtalks.poulpe.model.entity.Section;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.GenericEventListener;
import org.zkoss.zul.Treeitem;

/**
 * Listener for Drag'n'Drop event.
 */
class BranchDragAndDropEventListener extends GenericEventListener<Event> {

    private static final long serialVersionUID = 1L;
    private final SectionPresenter presenter;

    public BranchDragAndDropEventListener(SectionPresenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public void onEvent(Event evt) throws Exception {
        DropEvent dropevent = (DropEvent) evt;
        Treeitem dragged = (Treeitem) dropevent.getDragged().getParent();
        Treeitem target = (Treeitem) dropevent.getTarget().getParent();

        int draggedIndex = dragged.getIndex();
        int targetIndex = target.getIndex();<commit_msg>#POULPE-82 Added the author annotation.<commit_after>package org.jtalks.poulpe.web.controller.section;

import java.util.List;

import org.jtalks.poulpe.model.entity.Branch;
import org.jtalks.poulpe.model.entity.Section;
import org.zkoss.zk.ui.event.DropEvent;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.GenericEventListener;
import org.zkoss.zul.Treeitem;

/**
 * Listener for Drag'n'Drop event.
 * 
 * @author <NAME>
 */
class BranchDragAndDropEventListener extends GenericEventListener<Event> {

    private static final long serialVersionUID = 1L;
    private final SectionPresenter presenter;

    public BranchDragAndDropEventListener(SectionPresenter presenter) {
        this.presenter = presenter;
    }

    @Override
    public void onEvent(Event evt) throws Exception {
        DropEvent dropevent = (DropEvent) evt;
        Treeitem dragged = (Treeitem) dropevent.getDragged().getParent();
        Treeitem target = (Treeitem) dropevent.getTarget().getParent();

        int draggedIndex = dragged.getIndex();
        int targetIndex = target.getIndex();
{'fraction_non_alphanumeric': 0.10328638497652583, 'fraction_numerical': 0.0018779342723004694, 'mean_word_length': 4.0738095238095235, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2150527', 'n_tokens_mistral': 649, 'n_tokens_neox': 641, 'n_words': 133}