ListView. The control allows the user to rearrange the items in each
ListView and also to drag and drop items from one column to another.
| Modifier and Type | Class and Description |
|---|---|
| public static class | MultiColumnListView.
the type of items in the list T>A special list cell to be used in combination with the |
| public static class | MultiColumnListView.
the type of items shown by the column T>The model object representing a single column. |
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectProperty | |
| private final ListProperty | |
| private final BooleanProperty | |
| private final ObjectProperty | |
| private final ObservableList | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final ObjectProperty | |
| private final BooleanProperty |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | Returns: the cell factoryThe cell factory that will be used for each one of the |
| public final ListProperty | Returns: the list of columnsA list of columns that define how many columns will be shown inside the view. |
| protected Skin | createDefaultSkin()
Overrides javafx. Create a new instance of the default skin for this control. |
| public final BooleanProperty | Returns: "true" if the control allows rearranging items via drag and dropControls whether the user can rearrange items via drag and drop or not. |
| public final ObjectProperty | |
| public final Callback | |
| public final ObservableList | |
| public final T | |
| public final ObservableList | |
| public final Callback | |
| public final LoadingPane. | |
| public LoadingPane. | |
| public final T | |
| public final T | |
| public final ProgressIndicator | |
| public final Callback | |
| public String | getUserAgentStylesheet()
Overrides javafx. An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. |
| public final boolean | |
| public final boolean | |
| public final ObjectProperty | Returns: the factory for creating the required list views, one for each columnStores the callback that will be invoked to produce new |
| public final ObjectProperty | |
| public ObjectProperty | |
| public final ObjectProperty | Returns: the placeholder model item for the "from" locationA model item that represents the "from" location during drag and drop operations. |
| public final ObjectProperty | Returns: the placeholder model item for the "to" locationA model item that represents the "to" location during drag and drop operations. |
| public final ObjectProperty | Returns: the progress indicatorThe progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress. |
| public final ObjectProperty | Returns: a separator nodeAn optional factory for creating separators that will be placed between columns. |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final BooleanProperty | Returns: true if the headers should be shownDetermines whether the headers will be shown or not. |
| cellFactory | back to summary |
|---|---|
| private final ObjectProperty<Callback<MultiColumnListView<T>, MultiColumnListView. | |
| columns | back to summary |
|---|---|
| private final ListProperty<MultiColumnListView. | |
| disableDragAndDrop | back to summary |
|---|---|
| private final BooleanProperty disableDragAndDrop | |
| draggedItem | back to summary |
|---|---|
| private final ObjectProperty<T> draggedItem | |
| draggedItems | back to summary |
|---|---|
| private final ObservableList<T> draggedItems | |
| listViewFactory | back to summary |
|---|---|
| private final ObjectProperty<Callback<MultiColumnListView<T>, ListView<T>>> listViewFactory | |
| loadingStatus | back to summary |
|---|---|
| private final ObjectProperty<LoadingPane. | |
| loadingStatusSize | back to summary |
|---|---|
| private final ObjectProperty<LoadingPane. | |
| placeholderFrom | back to summary |
|---|---|
| private final ObjectProperty<T> placeholderFrom | |
| placeholderTo | back to summary |
|---|---|
| private final ObjectProperty<T> placeholderTo | |
| progressIndicator | back to summary |
|---|---|
| private final ObjectProperty<ProgressIndicator> progressIndicator | |
| separatorFactory | back to summary |
|---|---|
| private final ObjectProperty<Callback<Integer, Node>> separatorFactory | |
| showHeaders | back to summary |
|---|---|
| private final BooleanProperty showHeaders | |
| MultiColumnListView | back to summary |
|---|---|
| public MultiColumnListView() Constructs a new view. | |
| cellFactoryProperty | back to summary |
|---|---|
| public final ObjectProperty The cell factory that will be used for each one of the
| |
| columnsProperty | back to summary |
|---|---|
| public final ListProperty A list of columns that define how many columns will be shown inside the view. The model objects in this list also store the header and the data for each column.
| |
| createDefaultSkin | back to summary |
|---|---|
| protected Skin Overrides javafx. Doc from javafx. Create a new instance of the default skin for this control. This is called to create a skin for the control if
no skin is provided via CSS
| |
| disableDragAndDropProperty | back to summary |
|---|---|
| public final BooleanProperty disableDragAndDropProperty() Controls whether the user can rearrange items via drag and drop or not.
| |
| draggedItemProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| getCellFactory | back to summary |
|---|---|
| public final Callback | |
| getColumns | back to summary |
|---|---|
| public final ObservableList | |
| getDraggedItem | back to summary |
|---|---|
| public final T getDraggedItem() | |
| getDraggedItems | back to summary |
|---|---|
| public final ObservableList | |
| getListViewFactory | back to summary |
|---|---|
| public final Callback | |
| getLoadingStatus | back to summary |
|---|---|
| public final LoadingPane. | |
| getLoadingStatusSize | back to summary |
|---|---|
| public LoadingPane. | |
| getPlaceholderFrom | back to summary |
|---|---|
| public final T getPlaceholderFrom() | |
| getPlaceholderTo | back to summary |
|---|---|
| public final T getPlaceholderTo() | |
| getProgressIndicator | back to summary |
|---|---|
| public final ProgressIndicator getProgressIndicator() | |
| getSeparatorFactory | back to summary |
|---|---|
| public final Callback | |
| getUserAgentStylesheet | back to summary |
|---|---|
| public String getUserAgentStylesheet() Overrides javafx. Doc from javafx. An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls. The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath. Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.
For additional information about using CSS with the scene graph,
see the CSS Reference Guide.
| |
| isDisableDragAndDrop | back to summary |
|---|---|
| public final boolean isDisableDragAndDrop() | |
| isShowHeaders | back to summary |
|---|---|
| public final boolean isShowHeaders() | |
| listViewFactoryProperty | back to summary |
|---|---|
| public final ObjectProperty Stores the callback that will be invoked to produce new
| |
| loadingStatusProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| loadingStatusSizeProperty | back to summary |
|---|---|
| public ObjectProperty | |
| placeholderFromProperty | back to summary |
|---|---|
| public final ObjectProperty A model item that represents the "from" location during drag and drop operations.
| |
| placeholderToProperty | back to summary |
|---|---|
| public final ObjectProperty A model item that represents the "to" location during drag and drop operations.
| |
| progressIndicatorProperty | back to summary |
|---|---|
| public final ObjectProperty The progress indicator that will be used to display percentage progress or the indeterminate state of the loading progress.
| |
| separatorFactoryProperty | back to summary |
|---|---|
| public final ObjectProperty An optional factory for creating separators that will be placed between columns. The default implementation creates a region and adds the style class "column-separator". No separators will be added to the view when the factory is being set to null.
| |
| setCellFactory | back to summary |
|---|---|
| public final void setCellFactory(Callback<MultiColumnListView<T>, MultiColumnListView. | |
| setColumns | back to summary |
|---|---|
| public final void setColumns(ObservableList<MultiColumnListView. | |
| setDisableDragAndDrop | back to summary |
|---|---|
| public final void setDisableDragAndDrop(boolean disableDragAndDrop) | |
| setDraggedItem | back to summary |
|---|---|
| public final void setDraggedItem(T draggedItem) | |
| setListViewFactory | back to summary |
|---|---|
| public final void setListViewFactory(Callback<MultiColumnListView<T>, ListView<T>> listViewFactory) | |
| setLoadingStatus | back to summary |
|---|---|
| public final void setLoadingStatus(LoadingPane. | |
| setLoadingStatusSize | back to summary |
|---|---|
| public void setLoadingStatusSize(LoadingPane. | |
| setPlaceholderFrom | back to summary |
|---|---|
| public final void setPlaceholderFrom(T placeholderFrom) | |
| setPlaceholderTo | back to summary |
|---|---|
| public final void setPlaceholderTo(T placeholderTo) | |
| setProgressIndicator | back to summary |
|---|---|
| public final void setProgressIndicator(ProgressIndicator progressIndicator) | |
| setSeparatorFactory | back to summary |
|---|---|
| public final void setSeparatorFactory(Callback<Integer, Node> separatorFactory) | |
| setShowHeaders | back to summary |
|---|---|
| public final void setShowHeaders(boolean showHeaders) | |
| showHeadersProperty | back to summary |
|---|---|
| public final BooleanProperty showHeadersProperty() Determines whether the headers will be shown or not. Toggling this property will trigger a rebuild of the view.
| |
MultiColumnListView control.
The cell adds drag and drop support for re-arranging list cells and for dragging them from
one column to another.
| Modifier and Type | Field and Description |
|---|---|
| private final ReadOnlyBooleanWrapper | |
| private final MultiColumnListView | |
| private final ReadOnlyBooleanWrapper | |
| private final ReadOnlyBooleanWrapper |
| Access | Constructor and Description |
|---|---|
| public | ColumnListCell(MultiColumnListView<T>
reference to the multiColumnListView)MultiColumnListView control where the cell is being usedCreates a new list cell. |
| Modifier and Type | Method and Description |
|---|---|
| public final ReadOnlyBooleanProperty | Returns: true if the currently shown item is the "from" placeholder objectA read-only property that is being set to true if the item in the cell is currently
the "from" placeholder item (see |
| public final MultiColumnListView | Returns: the parent controlReturns the |
| protected Node | Returns: the snapshot nodeRetrieves the node that will be used to create a drag image via the |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| private void | |
| private boolean | |
| public final ReadOnlyBooleanWrapper | Returns: true if the currently shown item is either the "from" or the "to" placeholder objectA read-only property that is being set to true if the item in the cell is currently
either one of the two placeholder items (see |
| public final ReadOnlyBooleanProperty | Returns: true if the currently shown item is the "to" placeholder objectA read-only property that is being set to true if the item in the cell is currently
the "to" placeholder item (see |
| private void | |
| protected void | updateItem(T item, boolean empty)
Overrides javafx. The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell. |
| private void |
| fromPlaceholder | back to summary |
|---|---|
| private final ReadOnlyBooleanWrapper fromPlaceholder | |
| multiColumnListView | back to summary |
|---|---|
| private final MultiColumnListView<T> multiColumnListView | |
| placeholder | back to summary |
|---|---|
| private final ReadOnlyBooleanWrapper placeholder | |
| toPlaceholder | back to summary |
|---|---|
| private final ReadOnlyBooleanWrapper toPlaceholder | |
| ColumnListCell | back to summary |
|---|---|
| public ColumnListCell(MultiColumnListView<T> multiColumnListView) Creates a new list cell.
| |
| fromPlaceholderProperty | back to summary |
|---|---|
| public final ReadOnlyBooleanProperty fromPlaceholderProperty() A read-only property that is being set to true if the item in the cell is currently
the "from" placeholder item (see
| |
| getMultiColumnListView | back to summary |
|---|---|
| public final MultiColumnListView Returns the
| |
| getSnapshotNode | back to summary |
|---|---|
| protected Node getSnapshotNode() Retrieves the node that will be used to create a drag image via the
| |
| isFromPlaceholder | back to summary |
|---|---|
| public final boolean isFromPlaceholder() | |
| isPlaceholder | back to summary |
|---|---|
| public final boolean isPlaceholder() | |
| isToPlaceholder | back to summary |
|---|---|
| public final boolean isToPlaceholder() | |
| log | back to summary |
|---|---|
| private void log(String text) | |
| notNextToEachOther | back to summary |
|---|---|
| private boolean notNextToEachOther(int fromIndex, int toIndex) | |
| placeholderProperty | back to summary |
|---|---|
| public final ReadOnlyBooleanWrapper placeholderProperty() A read-only property that is being set to true if the item in the cell is currently
either one of the two placeholder items (see
| |
| toPlaceholderProperty | back to summary |
|---|---|
| public final ReadOnlyBooleanProperty toPlaceholderProperty() A read-only property that is being set to true if the item in the cell is currently
the "to" placeholder item (see
| |
| updateDraggedPseudoState | back to summary |
|---|---|
| private void updateDraggedPseudoState() | |
| updateItem | back to summary |
|---|---|
| protected void updateItem(T item, boolean empty) Overrides javafx. Doc from javafx. The updateItem method should not be called by developers, but it is the
best method for developers to override to allow for them to customise the
visuals of the cell. To clarify, developers should never call this method
in their code (they should leave it up to the UI control, such as the
It is very important that subclasses of Cell override the updateItem method properly, as failure to do so will lead to issues such as blank cells or cells with unexpected content appearing within them. Here is an example of how to properly override the updateItem method:
protected void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null) {
setText(null);
setGraphic(null);
} else {
setText(item.toString());
}
}
Note in this code sample two important points:
| |
| updateItems | back to summary |
|---|---|
| private void updateItems(DragEvent event) | |
| Modifier and Type | Field and Description |
|---|---|
| private final ObjectProperty | |
| private final ListProperty |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final Node | |
| public final ObservableList | |
| public final ObjectProperty | Returns: the header node / header UIAn optional node that will serve as the column's header. |
| public final ListProperty | |
| public final void | |
| public final void |
| header | back to summary |
|---|---|
| private final ObjectProperty<Node> header | |
| items | back to summary |
|---|---|
| private final ListProperty<T> items | |
| ListViewColumn | back to summary |
|---|---|
| public ListViewColumn() | |
| getHeader | back to summary |
|---|---|
| public final Node getHeader() | |
| getItems | back to summary |
|---|---|
| public final ObservableList | |
| headerProperty | back to summary |
|---|---|
| public final ObjectProperty An optional node that will serve as the column's header. It will be shown above the column.
| |
| itemsProperty | back to summary |
|---|---|
| public final ListProperty The data shown in the column.
| |
| setHeader | back to summary |
|---|---|
| public final void setHeader(Node header) | |
| setItems | back to summary |
|---|---|
| public final void setItems(ObservableList<T> items) | |