< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/ListView.java

Print this page

        

*** 238,247 **** --- 238,249 ---- /** * An EventType that indicates some edit event has occurred. It is the parent * type of all other edit events: {@link #EDIT_START_EVENT}, * {@link #EDIT_COMMIT_EVENT} and {@link #EDIT_CANCEL_EVENT}. + * @param <T> the type of the objects stored in this ListView + * @return the event type */ @SuppressWarnings("unchecked") public static <T> EventType<ListView.EditEvent<T>> editAnyEvent() { return (EventType<ListView.EditEvent<T>>) EDIT_ANY_EVENT; }
*** 249,258 **** --- 251,262 ---- new EventType<>(Event.ANY, "LIST_VIEW_EDIT"); /** * An EventType used to indicate that an edit event has started within the * ListView upon which the event was fired. + * @param <T> the type of the objects stored in this ListView + * @return the event type */ @SuppressWarnings("unchecked") public static <T> EventType<ListView.EditEvent<T>> editStartEvent() { return (EventType<ListView.EditEvent<T>>) EDIT_START_EVENT; }
*** 260,269 **** --- 264,275 ---- new EventType<>(editAnyEvent(), "EDIT_START"); /** * An EventType used to indicate that an edit event has just been canceled * within the ListView upon which the event was fired. + * @param <T> the type of the objects stored in this ListView + * @return the event type */ @SuppressWarnings("unchecked") public static <T> EventType<ListView.EditEvent<T>> editCancelEvent() { return (EventType<ListView.EditEvent<T>>) EDIT_CANCEL_EVENT; }
*** 271,280 **** --- 277,288 ---- new EventType<>(editAnyEvent(), "EDIT_CANCEL"); /** * An EventType used to indicate that an edit event has been committed * within the ListView upon which the event was fired. + * @param <T> the type of the objects stored in this ListView + * @return the event type */ @SuppressWarnings("unchecked") public static <T> EventType<ListView.EditEvent<T>> editCommitEvent() { return (EventType<ListView.EditEvent<T>>) EDIT_COMMIT_EVENT; }
*** 324,333 **** --- 332,342 ---- * <p>Attempts to add a listener to the {@link ObservableList}, such that all * subsequent changes inside the list will be shown to the user. * * <p>Refer to the {@link ListView} class documentation for details on the * default state of other properties. + * @param items the list of items */ public ListView(ObservableList<T> items) { getStyleClass().setAll(DEFAULT_STYLE_CLASS); setAccessibleRole(AccessibleRole.LIST_VIEW);
*** 383,392 **** --- 392,402 ---- private ObjectProperty<ObservableList<T>> items; /** * Sets the underlying data model for the ListView. Note that it has a generic * type that must match the type of the ListView itself. + * @param value the list of items for this ListView */ public final void setItems(ObservableList<T> value) { itemsProperty().set(value); }
*** 404,413 **** --- 414,424 ---- } /** * The underlying data model for the ListView. Note that it has a generic * type that must match the type of the ListView itself. + * @return the items property for this ListView */ public final ObjectProperty<ObservableList<T>> itemsProperty() { if (items == null) { items = new SimpleObjectProperty<>(this, "items"); }
*** 420,429 **** --- 431,441 ---- /** * This Node is shown to the user when the listview has no content to show. * This may be the case because the table model has no data in the first * place or that a filter has been applied to the list model, resulting * in there being nothing to show the user.. + * @return the placeholder property for this ListView * @since JavaFX 8.0 */ public final ObjectProperty<Node> placeholderProperty() { if (placeholder == null) { placeholder = new SimpleObjectProperty<Node>(this, "placeholder");
*** 445,471 **** --- 457,486 ---- * Sets the {@link MultipleSelectionModel} to be used in the ListView. * Despite a ListView requiring a <b>Multiple</b>SelectionModel, it is possible * to configure it to only allow single selection (see * {@link MultipleSelectionModel#setSelectionMode(javafx.scene.control.SelectionMode)} * for more information). + * @param value the MultipleSelectionModel to be used in this ListView */ public final void setSelectionModel(MultipleSelectionModel<T> value) { selectionModelProperty().set(value); } /** * Returns the currently installed selection model. + * @return the currently installed selection model */ public final MultipleSelectionModel<T> getSelectionModel() { return selectionModel == null ? null : selectionModel.get(); } /** * The SelectionModel provides the API through which it is possible * to select single or multiple items within a ListView, as well as inspect * which items have been selected by the user. Note that it has a generic * type that must match the type of the ListView itself. + * @return the selectionModel property */ public final ObjectProperty<MultipleSelectionModel<T>> selectionModelProperty() { return selectionModel; }
*** 473,498 **** --- 488,516 ---- // --- Focus Model private ObjectProperty<FocusModel<T>> focusModel; /** * Sets the {@link FocusModel} to be used in the ListView. + * @param value the FocusModel to be used in the ListView */ public final void setFocusModel(FocusModel<T> value) { focusModelProperty().set(value); } /** * Returns the currently installed {@link FocusModel}. + * @return the currently installed FocusModel */ public final FocusModel<T> getFocusModel() { return focusModel == null ? null : focusModel.get(); } /** * The FocusModel provides the API through which it is possible * to both get and set the focus on a single item within a ListView. Note * that it has a generic type that must match the type of the ListView itself. + * @return the FocusModel property */ public final ObjectProperty<FocusModel<T>> focusModelProperty() { if (focusModel == null) { focusModel = new SimpleObjectProperty<FocusModel<T>>(this, "focusModel"); }
*** 504,529 **** --- 522,550 ---- private ObjectProperty<Orientation> orientation; /** * Sets the orientation of the ListView, which dictates whether * it scrolls vertically or horizontally. + * @param value the orientation of the ListView */ public final void setOrientation(Orientation value) { orientationProperty().set(value); }; /** * Returns the current orientation of the ListView, which dictates whether * it scrolls vertically or horizontally. + * @return the current orientation of the ListView */ public final Orientation getOrientation() { return orientation == null ? Orientation.VERTICAL : orientation.get(); } /** * The orientation of the {@code ListView} - this can either be horizontal * or vertical. + * @return the orientation property of this ListView */ public final ObjectProperty<Orientation> orientationProperty() { if (orientation == null) { orientation = new StyleableObjectProperty<Orientation>(Orientation.VERTICAL) { @Override public void invalidated() {
*** 559,575 **** --- 580,598 ---- /** * Sets a new cell factory to use in the ListView. This forces all old * {@link ListCell}'s to be thrown away, and new ListCell's created with * the new cell factory. + * @param value ell factory to use in this ListView */ public final void setCellFactory(Callback<ListView<T>, ListCell<T>> value) { cellFactoryProperty().set(value); } /** * Returns the current cell factory. + * @return the current cell factory */ public final Callback<ListView<T>, ListCell<T>> getCellFactory() { return cellFactory == null ? null : cellFactory.get(); }
*** 579,588 **** --- 602,612 ---- * ListView is responsible for reusing ListCells - all that is necessary * is for the custom cell factory to return from this function a ListCell * which might be usable for representing any item in the ListView. * * <p>Refer to the {@link Cell} class documentation for more detail. + * @return the cell factory property */ public final ObjectProperty<Callback<ListView<T>, ListCell<T>>> cellFactoryProperty() { if (cellFactory == null) { cellFactory = new SimpleObjectProperty<Callback<ListView<T>, ListCell<T>>>(this, "cellFactory"); }
*** 636,645 **** --- 660,670 ---- * only size (thus allowing for variable cell sizes, and preventing the * performance gains from being possible). Therefore, when performance matters * use -fx-fixed-cell-size, instead of -fx-cell-size. If both properties are * specified in CSS, -fx-fixed-cell-size takes precedence.</p> * + * @return the fixed cell size property * @since JavaFX 8.0 */ public final DoubleProperty fixedCellSizeProperty() { if (fixedCellSize == null) { fixedCellSize = new StyleableDoubleProperty(Region.USE_COMPUTED_SIZE) {
*** 670,679 **** --- 695,705 ---- } /** * Specifies whether this ListView is editable - only if the ListView and * the ListCells within it are both editable will a ListCell be able to go * into their editing state. + * @return the editable property */ public final BooleanProperty editableProperty() { if (editable == null) { editable = new SimpleBooleanProperty(this, "editable", false); }
*** 689,698 **** --- 715,725 ---- } /** * Returns the index of the item currently being edited in the ListView, * or -1 if no item is being edited. + * @return the index of the item currently being edited */ public final int getEditingIndex() { return editingIndex == null ? -1 : editingIndex.get(); }
*** 700,709 **** --- 727,737 ---- * <p>A property used to represent the index of the item currently being edited * in the ListView, if editing is taking place, or -1 if no item is being edited. * * <p>It is not possible to set the editing index, instead it is required that * you call {@link #edit(int)}. + * @return the editing index property */ public final ReadOnlyIntegerProperty editingIndexProperty() { return editingIndexPropertyImpl().getReadOnlyProperty(); }
*** 723,748 **** --- 751,780 ---- * an edit. * * <p>This is a convenience method - the same result can be * achieved by calling * <code>addEventHandler(ListView.EDIT_START_EVENT, eventHandler)</code>. + * @param value the EventHandler that will be called when the user begins + * an edit */ public final void setOnEditStart(EventHandler<ListView.EditEvent<T>> value) { onEditStartProperty().set(value); } /** * Returns the {@link EventHandler} that will be called when the user begins * an edit. + * @return the EventHandler that will be called when the user begins an edit */ public final EventHandler<ListView.EditEvent<T>> getOnEditStart() { return onEditStart == null ? null : onEditStart.get(); } /** * This event handler will be fired when the user successfully initiates * editing. + * @return the onEditStart event handler property */ public final ObjectProperty<EventHandler<ListView.EditEvent<T>>> onEditStartProperty() { if (onEditStart == null) { onEditStart = new ObjectPropertyBase<EventHandler<ListView.EditEvent<T>>>() { @Override protected void invalidated() {
*** 773,790 **** --- 805,825 ---- * {@link ListCell#commitEdit(java.lang.Object)} method. * * <p>This is a convenience method - the same result can be * achieved by calling * <code>addEventHandler(ListView.EDIT_START_EVENT, eventHandler)</code>. + * @param value the EventHandler that will be called when the user has + * completed their editing */ public final void setOnEditCommit(EventHandler<ListView.EditEvent<T>> value) { onEditCommitProperty().set(value); } /** * Returns the {@link EventHandler} that will be called when the user commits * an edit. + * @return the EventHandler that will be called when the user commits an edit */ public final EventHandler<ListView.EditEvent<T>> getOnEditCommit() { return onEditCommit == null ? null : onEditCommit.get(); }
*** 794,803 **** --- 829,839 ---- * * <p>The EventHandler in this property should not be called directly - * instead call {@link ListCell#commitEdit(java.lang.Object)} from within * your custom ListCell. This will handle firing this event, updating the * view, and switching out of the editing state.</p> + * @return the onEditCommit event handler property */ public final ObjectProperty<EventHandler<ListView.EditEvent<T>>> onEditCommitProperty() { if (onEditCommit == null) { onEditCommit = new ObjectPropertyBase<EventHandler<ListView.EditEvent<T>>>() { @Override protected void invalidated() {
*** 823,847 **** --- 859,887 ---- private ObjectProperty<EventHandler<ListView.EditEvent<T>>> onEditCancel; /** * Sets the {@link EventHandler} that will be called when the user cancels * an edit. + * @param value the EventHandler that will be called when the user cancels + * an edit */ public final void setOnEditCancel(EventHandler<ListView.EditEvent<T>> value) { onEditCancelProperty().set(value); } /** * Returns the {@link EventHandler} that will be called when the user cancels * an edit. + * @return the EventHandler that will be called when the user cancels an edit */ public final EventHandler<ListView.EditEvent<T>> getOnEditCancel() { return onEditCancel == null ? null : onEditCancel.get(); } /** * This event handler will be fired when the user cancels editing a cell. + * @return the onEditCancel event handler property */ public final ObjectProperty<EventHandler<ListView.EditEvent<T>>> onEditCancelProperty() { if (onEditCancel == null) { onEditCancel = new ObjectPropertyBase<EventHandler<ListView.EditEvent<T>>>() { @Override protected void invalidated() {
*** 1119,1128 **** --- 1159,1172 ---- /** * Creates a new EditEvent instance to represent an edit event. This * event is used for {@link #EDIT_START_EVENT}, * {@link #EDIT_COMMIT_EVENT} and {@link #EDIT_CANCEL_EVENT} types. + * @param source the source + * @param eventType the event type + * @param newValue the new value + * @param editIndex the edit index */ public EditEvent(ListView<T> source, EventType<? extends ListView.EditEvent<T>> eventType, T newValue, int editIndex) {
*** 1139,1155 **** --- 1183,1201 ---- return source; } /** * Returns the index in which the edit took place. + * @return the index in which the edit took place */ public int getIndex() { return editIndex; } /** * Returns the value of the new input provided by the end user. + * @return the value of the new input provided by the end user */ public T getNewValue() { return newValue; }
< prev index next >