Class ListViewUtil

java.lang.Object
org.jhotdraw8.fxbase.control.ListViewUtil

public class ListViewUtil extends Object
Provides static utility methods for ListView.
Author:
Werner Randelshofer
  • Method Details

    • addDragAndDropSupport

      public static <T> void addDragAndDropSupport(javafx.scene.control.ListView<T> listView, ClipboardIO<T> clipboardIO)
      Adds drag and drop support to the list view
      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      clipboardIO - a reader/writer for the clipboard.
    • addDragAndDropSupport

      public static <T> void addDragAndDropSupport(javafx.scene.control.ListView<T> listView, ClipboardIO<T> clipboardIO, Consumer<UndoableEditEvent> undoableEditEventConsumer)
      Adds drag and drop support to the list view
      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      clipboardIO - a reader/writer for the clipboard.
      undoableEditEventConsumer - a consumer for undoable edits
    • addDragAndDropSupport

      public static <T> void addDragAndDropSupport(javafx.scene.control.ListView<T> listView, @Nullable javafx.util.Callback<javafx.scene.control.ListView<T>,javafx.scene.control.ListCell<T>> cellFactory, ClipboardIO<T> clipboardIO, Consumer<UndoableEditEvent> undoableEditEventConsumer)
      Adds drag and drop support to the list view

      FIXME should also add support for cut, copy and paste keys

      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      cellFactory - the cell factory of the list view
      clipboardIO - a reader/writer for the clipboard.
      undoableEditEventConsumer -
    • addReorderingSupport

      public static <T> void addReorderingSupport(javafx.scene.control.ListView<T> listView, Consumer<UndoableEditEvent> undoableEditEventConsumer)
      Adds reordering support to the list view.
      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      undoableEditEventConsumer -
    • addReorderingSupport

      public static <T> void addReorderingSupport(javafx.scene.control.ListView<T> listView, ClipboardIO<T> clipboardIO, Consumer<UndoableEditEvent> undoableEditEventConsumer)
      Adds reordering support to the list view.
      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      clipboardIO - the clipboard i/o
      undoableEditEventConsumer -
    • addReorderingSupport

      public static <T> void addReorderingSupport(javafx.scene.control.ListView<T> listView, javafx.util.Callback<javafx.scene.control.ListView<T>,javafx.scene.control.ListCell<T>> cellFactory, @Nullable ClipboardIO<T> clipboardIO, Consumer<UndoableEditEvent> undoableEditEventConsumer)
      Adds reordering support to the list view.

      FIXME should also add support for cut, copy and paste keys.

      FIXME only supports lists with single item selection (no multiple item selection yet!).

      Type Parameters:
      T - the data type of the list view
      Parameters:
      listView - the list view
      cellFactory - the cell factory of the list view
      clipboardIO - a reader/writer for the clipboard. You can provide null if you don't want cut/copy/paste functionality.
      undoableEditEventConsumer -