< prev index next >

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

Print this page

        

@@ -207,10 +207,11 @@
     /**
      * An EventType that indicates some edit event has occurred. It is the parent
      * type of all other edit events: {@link #editStartEvent},
      *  {@link #editCommitEvent} and {@link #editCancelEvent}.
      *
+     * @param <T> the type of edit event
      * @return An EventType that indicates some edit event has occurred.
      */
     @SuppressWarnings("unchecked")
     public static <T> EventType<EditEvent<T>> editAnyEvent() {
         return (EventType<EditEvent<T>>) EDIT_ANY_EVENT;

@@ -220,10 +221,11 @@
 
     /**
      * An EventType used to indicate that an edit event has started within the
      * TreeView upon which the event was fired.
      *
+     * @param <T> the type of edit event
      * @return An EventType used to indicate that an edit event has started.
      */
     @SuppressWarnings("unchecked")
     public static <T> EventType<EditEvent<T>> editStartEvent() {
         return (EventType<EditEvent<T>>) EDIT_START_EVENT;

@@ -233,10 +235,11 @@
 
     /**
      * An EventType used to indicate that an edit event has just been canceled
      * within the TreeView upon which the event was fired.
      *
+     * @param <T> the type of edit event
      * @return An EventType used to indicate that an edit event has just been
      *      canceled.
      */
     @SuppressWarnings("unchecked")
     public static <T> EventType<EditEvent<T>> editCancelEvent() {

@@ -248,10 +251,11 @@
     /**
      * An EventType that is used to indicate that an edit in a TreeView has been
      * committed. This means that user has made changes to the data of a
      * TreeItem, and that the UI should be updated.
      *
+     * @param <T> the type of edit event
      * @return An EventType that is used to indicate that an edit in a TreeView
      *      has been committed.
      */
     @SuppressWarnings("unchecked")
     public static <T> EventType<EditEvent<T>> editCommitEvent() {

@@ -414,18 +418,20 @@
 
     /**
      * <p>Returns the cell factory that will be used for creating TreeCells,
      * which are used to represent items in the TreeView, or null if no custom
      * cell factory has been set.
+     * @return the cell factory
      */
     public final Callback<TreeView<T>, TreeCell<T>> getCellFactory() {
         return cellFactory == null ? null : cellFactory.get();
     }
 
     /**
      * Represents the cell factory that will be used for creating TreeCells,
      * which are used to represent items in the TreeView.
+     * @return the cell factory property
      */
     public final ObjectProperty<Callback<TreeView<T>, TreeCell<T>>> cellFactoryProperty() {
         if (cellFactory == null) {
             cellFactory = new SimpleObjectProperty<Callback<TreeView<T>, TreeCell<T>>>(this, "cellFactory");
         }

@@ -478,10 +484,11 @@
         return root == null ? null : root.get();
     }
 
     /**
      * Property representing the root node of the TreeView.
+     * @return the root node property
      */
     public final ObjectProperty<TreeItem<T>> rootProperty() {
         return root;
     }
 

@@ -502,17 +509,19 @@
     }
 
     /**
      * Returns true if the root of the TreeView should be shown, and false if
      * it should not. By default, the root TreeItem is visible in the TreeView.
+     * @return true if the root of the TreeView should be shown
      */
     public final boolean isShowRoot() {
         return showRoot == null ? true : showRoot.get();
     }
 
     /**
      * Property that represents whether or not the TreeView root node is visible.
+     * @return the show root property
      */
     public final BooleanProperty showRootProperty() {
         if (showRoot == null) {
             showRoot = new SimpleBooleanProperty(this, "showRoot", true) {
                 @Override protected void invalidated() {

@@ -532,27 +541,30 @@
      * Sets the {@link MultipleSelectionModel} to be used in the TreeView.
      * Despite a TreeView requiring a <code><b>Multiple</b>SelectionModel</code>,
      * 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 {@link MultipleSelectionModel} to be used
      */
     public final void setSelectionModel(MultipleSelectionModel<TreeItem<T>> value) {
         selectionModelProperty().set(value);
     }
 
     /**
      * Returns the currently installed selection model.
+     * @return the currently installed selection model
      */
     public final MultipleSelectionModel<TreeItem<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 TreeView, as  well as inspect
      * which rows have been selected by the user. Note that it has a generic
      * type that must match the type of the TreeView itself.
+     * @return the selection model property
      */
     public final ObjectProperty<MultipleSelectionModel<TreeItem<T>>> selectionModelProperty() {
         if (selectionModel == null) {
             selectionModel = new SimpleObjectProperty<MultipleSelectionModel<TreeItem<T>>>(this, "selectionModel");
         }

@@ -563,26 +575,29 @@
     // --- Focus Model
     private ObjectProperty<FocusModel<TreeItem<T>>> focusModel;
 
     /**
      * Sets the {@link FocusModel} to be used in the TreeView.
+     * @param value the {@link FocusModel} to be used
      */
     public final void setFocusModel(FocusModel<TreeItem<T>> value) {
         focusModelProperty().set(value);
     }
 
     /**
      * Returns the currently installed {@link FocusModel}.
+     * @return the currently installed {@link FocusModel}
      */
     public final FocusModel<TreeItem<T>> getFocusModel() {
         return focusModel == null ? null : focusModel.get();
     }
 
     /**
      * The FocusModel provides the API through which it is possible
      * to control focus on zero or one rows of the TreeView. Generally the
      * default implementation should be more than sufficient.
+     * @return the focus model property
      */
     public final ObjectProperty<FocusModel<TreeItem<T>>> focusModelProperty() {
         if (focusModel == null) {
             focusModel = new SimpleObjectProperty<FocusModel<TreeItem<T>>>(this, "focusModel");
         }

@@ -662,10 +677,11 @@
      * 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) {

@@ -696,10 +712,11 @@
     }
     /**
      * Specifies whether this TreeView is editable - only if the TreeView and
      * the TreeCells within it are both editable will a TreeCell 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);
         }

@@ -715,10 +732,11 @@
     }
 
     /**
      * Returns the TreeItem that is currently being edited in the TreeView,
      * or null if no item is being edited.
+     * @return the TreeItem that is currently being edited in the TreeView
      */
     public final TreeItem<T> getEditingItem() {
         return editingItem == null ? null : editingItem.get();
     }
 

@@ -726,10 +744,11 @@
      * <p>A property used to represent the TreeItem currently being edited
      * in the TreeView, if editing is taking place, or null if no item is being edited.
      *
      * <p>It is not possible to set the editing item, instead it is required that
      * you call {@link #edit(javafx.scene.control.TreeItem)}.
+     * @return the editing item property
      */
     public final ReadOnlyObjectProperty<TreeItem<T>> editingItemProperty() {
         return editingItemPropertyImpl().getReadOnlyProperty();
     }
 

@@ -745,26 +764,30 @@
     private ObjectProperty<EventHandler<EditEvent<T>>> onEditStart;
 
     /**
      * Sets the {@link EventHandler} that will be called when the user begins
      * an edit.
+     * @param value the {@link EventHandler} that will be called when the user
+     * begins an edit
      */
     public final void setOnEditStart(EventHandler<EditEvent<T>> value) {
         onEditStartProperty().set(value);
     }
 
     /**
      * Returns the {@link EventHandler} that will be called when the user begins
      * an edit.
+     * @return the {@link EventHandler} when the user begins an edit
      */
     public final EventHandler<EditEvent<T>> getOnEditStart() {
         return onEditStart == null ? null : onEditStart.get();
     }
 
     /**
      * This event handler will be fired when the user successfully initiates
      * editing.
+     * @return the event handler when the user successfully initiates editing
      */
     public final ObjectProperty<EventHandler<EditEvent<T>>> onEditStartProperty() {
         if (onEditStart == null) {
             onEditStart = new SimpleObjectProperty<EventHandler<EditEvent<T>>>(this, "onEditStart") {
                 @Override protected void invalidated() {

@@ -780,18 +803,22 @@
     private ObjectProperty<EventHandler<EditEvent<T>>> onEditCommit;
 
     /**
      * Sets the {@link EventHandler} that will be called when the user commits
      * an edit.
+     * @param value the {@link EventHandler} that will be called when the user
+     * commits an edit
      */
     public final void setOnEditCommit(EventHandler<EditEvent<T>> value) {
         onEditCommitProperty().set(value);
     }
 
     /**
      * Returns the {@link EventHandler} that will be called when the user commits
      * an edit.
+     * @return the {@link EventHandler} that will be called when the user commits
+     * an edit
      */
     public final EventHandler<EditEvent<T>> getOnEditCommit() {
         return onEditCommit == null ? null : onEditCommit.get();
     }
 

@@ -801,10 +828,12 @@
      *
      * <p>The EventHandler in this property should not be called directly -
      * instead call {@link TreeCell#commitEdit(java.lang.Object)} from within
      * your custom TreeCell. This will handle firing this event, updating the
      * view, and switching out of the editing state.</p>
+     * @return the event handler when the user performs an action that result in
+     * their editing input being persisted
      */
     public final ObjectProperty<EventHandler<EditEvent<T>>> onEditCommitProperty() {
         if (onEditCommit == null) {
             onEditCommit = new SimpleObjectProperty<EventHandler<EditEvent<T>>>(this, "onEditCommit") {
                 @Override protected void invalidated() {

@@ -820,25 +849,31 @@
     private ObjectProperty<EventHandler<EditEvent<T>>> onEditCancel;
 
     /**
      * Sets the {@link EventHandler} that will be called when the user cancels
      * an edit.
+     * @param value the {@link EventHandler} that will be called when the user
+     * cancels an edit
      */
     public final void setOnEditCancel(EventHandler<EditEvent<T>> value) {
         onEditCancelProperty().set(value);
     }
 
     /**
      * Returns the {@link EventHandler} that will be called when the user cancels
      * an edit.
+     * @return the {@link EventHandler} that will be called when the user cancels
+     * an edit
      */
     public final EventHandler<EditEvent<T>> getOnEditCancel() {
         return onEditCancel == null ? null : onEditCancel.get();
     }
 
     /**
      * This event handler will be fired when the user cancels editing a cell.
+     * @return the event handler will be fired when the user cancels editing a
+     * cell
      */
     public final ObjectProperty<EventHandler<EditEvent<T>>> onEditCancelProperty() {
         if (onEditCancel == null) {
             onEditCancel = new SimpleObjectProperty<EventHandler<EditEvent<T>>>(this, "onEditCancel") {
                 @Override protected void invalidated() {

@@ -1176,10 +1211,15 @@
 
         /**
          * 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 eventType
+         * @param treeItem the treeItem
+         * @param oldValue the oldValue
+         * @param newValue the newValue
          */
         public EditEvent(TreeView<T> source,
                          EventType<? extends EditEvent> eventType,
                          TreeItem<T> treeItem, T oldValue, T newValue) {
             super(source, Event.NULL_SOURCE_TARGET, eventType);

@@ -1196,25 +1236,29 @@
             return source;
         }
 
         /**
          * Returns the {@link TreeItem} upon which the edit took place.
+         * @return the {@link TreeItem} upon which the edit took place
          */
         public TreeItem<T> getTreeItem() {
             return treeItem;
         }
 
         /**
          * Returns the new value input into the TreeItem by the end user.
+         * @return the new value input into the TreeItem by the end user
          */
         public T getNewValue() {
             return newValue;
         }
 
         /**
          * Returns the old value that existed in the TreeItem prior to the current
          * edit event.
+         * @return the old value that existed in the TreeItem prior to the current
+         * edit event
          */
         public T getOldValue() {
             return oldValue;
         }
     }
< prev index next >