@@ -0,0 +1,2698 @@
+package com.annimon.jmr.views;%0A%0Aimport com.annimon.jmr.models.Method;%0Aimport java.util.function.Predicate;%0Aimport javafx.collections.ObservableList;%0Aimport javafx.scene.control.ListCell;%0Aimport javafx.scene.input.ClipboardContent;%0Aimport javafx.scene.input.DataFormat;%0Aimport javafx.scene.input.DragEvent;%0Aimport javafx.scene.input.Dragboard;%0Aimport javafx.scene.input.TransferMode;%0A%0Apublic final class MethodCell extends ListCell%3CMethod%3E %7B%0A%0A    private static final DataFormat INDEX_DATAFORMAT = new DataFormat(Integer.class.getName());%0A%0A    public MethodCell() %7B%0A        init();%0A    %7D%0A%0A    private void init() %7B%0A        final Predicate%3CDragEvent%3E hasItemInDragBoard = event -%3E%0A                event.getGestureSource() != this && event.getDragboard().hasContent(INDEX_DATAFORMAT);%0A        %0A        setOnDragDetected(event -%3E %7B%0A            if (getItem() == null) return;%0A%0A            final Dragboard dragboard = startDragAndDrop(TransferMode.MOVE);%0A            final ClipboardContent content = new ClipboardContent();%0A            final int index = getListView().getItems().indexOf(getItem());%0A            content.put(INDEX_DATAFORMAT, index);%0A            dragboard.setContent(content);%0A%0A            event.consume();%0A        %7D);%0A        setOnDragOver(event -%3E %7B%0A            if (hasItemInDragBoard.test(event)) %7B%0A                event.acceptTransferModes(TransferMode.MOVE);%0A            %7D%0A            event.consume();%0A        %7D);%0A        setOnDragEntered(event -%3E %7B%0A            if (hasItemInDragBoard.test(event)) %7B%0A                setOpacity(0.3);%0A            %7D%0A        %7D);%0A        setOnDragExited(event -%3E %7B%0A            if (hasItemInDragBoard.test(event)) %7B%0A                setOpacity(1);%0A            %7D%0A        %7D);%0A        setOnDragDropped(event -%3E %7B%0A            if (getItem() == null) return;%0A%0A            final Dragboard db = event.getDragboard();%0A            boolean success = false;%0A            if (db.hasContent(INDEX_DATAFORMAT)) %7B%0A                final ObservableList%3CMethod%3E items = getListView().getItems();%0A                final int fromIndex = (int) db.getContent(INDEX_DATAFORMAT);%0A                int toIndex = items.indexOf(getItem());%0A                final Method method = items.remove(fromIndex);%0A                items.add(toIndex, method);%0A                success = true;%0A            %7D%0A            event.setDropCompleted(success);%0A            event.consume();%0A        %7D);%0A        setOnDragDone(DragEvent::consume);%0A    %7D%0A%0A    @Override%0A    protected void updateItem(Method item, boolean empty) %7B%0A        super.updateItem(item, empty);%0A        if (empty %7C%7C item == null) %7B%0A            setGraphic(null);%0A        %7D else %7B%0A            setText(item.getDeclaration());%0A        %7D%0A    %7D%0A%7D%0A

Add list item view with ordering support