Summary
Fix inconsistencies in the naming of methods and properties in TreeTableCell
by deprecating getTreeTableRow
, adding getTableRow
, and renaming the (private) property object fields from treeTableRow
and treeTableColumn
to tableRow
and tableColumn
, including the name of the bean to match the public property names.
Problem
In the TreeTableCell
class there is a mismatch between name of the following property method vs the getter:
public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty()
public final TreeTableRow<S> getTreeTableRow()
The get method has "Tree" in the name while the property method does not.
By contrast, the corresponding methods for column are self-consistent, and are named without "Tree" in the name:
public final ReadOnlyObjectProperty<TreeTableColumn<S,T>> tableColumnProperty()
public final TreeTableColumn<S,T> getTableColumn()
Additionally, the docs for each property is on a private property field that does have tree in the name, which results in no docs being generated for either the tableRow
or tableColumn
property.
Finally, the update methods (effectively expert-mode setters) for the tableRow
and columnRow
properties also have "Tree" in their name, which is inconsistent.
Solution
The following changes are made to TreeTableCell
:
- Deprecate the
getTreeTableRow
method. - Add a
getTableRow
method. - Rename the (private) property object fields from
treeTableRow
andtreeTableColumn
totableRow
andtableColumn
, including the name of the bean, so that they match the public property method names. This will allow API docs to be generated. - Deprecate the
updateTreeTableColumn
andupdateTreeTableRow
methods. - Add
updateTableColumn
andupdateTableRow
methods.
Specification
javafx.scene.control.TreeTableCell
:
/**
* The {@code TreeTableColumn} instance that backs this {@code TreeTableCell}.
*/
- private ReadOnlyObjectWrapper<TreeTableColumn<S,T>> treeTableColumn =
- new ReadOnlyObjectWrapper<TreeTableColumn<S,T>>(this, "treeTableColumn") {
+ private ReadOnlyObjectWrapper<TreeTableColumn<S,T>> tableColumn =
+ new ReadOnlyObjectWrapper<TreeTableColumn<S,T>>(this, "tableColumn") {
...
/**
* The {@code TreeTableRow} that this {@code TreeTableCell} currently finds itself placed within.
*/
- private ReadOnlyObjectWrapper<TreeTableRow<S>> treeTableRow =
- new ReadOnlyObjectWrapper<TreeTableRow<S>>(this, "treeTableRow");
- private void setTreeTableRow(TreeTableRow<S> value)
+ private ReadOnlyObjectWrapper<TreeTableRow<S>> tableRow =
+ new ReadOnlyObjectWrapper<TreeTableRow<S>>(this, "tableRow");
+ private void setTableRow(TreeTableRow<S> value)
...
- public final TreeTableRow<S> getTreeTableRow()
+ /**
+ * Gets the value of the property {@code tableRow}.
+ * @return the value of the property {@code tableRow}
+ * @since 17
+ */
+ public final TreeTableRow<S> getTableRow()
...
+ /**
+ * @deprecated Use {@link getTableRow} instead.
+ * @return the {@code TreeTableRow}
+ */
+ @Deprecated(since = "17")
+ public final TreeTableRow<S> getTreeTableRow()
...
/**
* Updates the {@code TreeTableRow} associated with this {@code TreeTableCell}.
* <p>
* Note: This function is intended to be used by experts, primarily
* by those implementing new Skins. It is not common
* for developers or designers to access this function directly.
* @param row the {@code TreeTableRow} associated with this {@code TreeTableCell}
+ * @since 17
*/
- public final void updateTreeTableRow(TreeTableRow<S> treeTableRow) {
+ public final void updateTableRow(TreeTableRow<S> row) {
...
/**
* Updates the {@code TreeTableColumn} associated with this {@code TreeTableCell}.
* <p>
* Note: This function is intended to be used by experts, primarily
* by those implementing new Skins. It is not common
* for developers or designers to access this function directly.
* @param column the {@code TreeTableColumn} associated with this {@code TreeTableCell}
+ * @since 17
*/
- public final void updateTreeTableColumn(TreeTableColumn<S,T> col) {
+ public final void updateTableColumn(TreeTableColumn<S,T> column) {
...
+ /**
+ * @deprecated Use {@link updateTableRow} instead.
+ * @param row the {@code TreeTableRow}
+ */
+ @Deprecated(since = "17")
+ public final void updateTreeTableRow(TreeTableRow<S> row) {
+ updateTableRow(row);
+ }
+
+ /**
+ * @deprecated Use {@link updateTableColumn} instead.
+ * @param column the {@code TreeTableColumn}
+ */
+ @Deprecated(since = "17")
+ public final void updateTreeTableColumn(TreeTableColumn<S,T> column) {
+ updateTableColumn(column);
+ }
- csr of
-
JDK-8270314 TreeTableCell: inconsistent naming for tableRow and tableColumn property methods
-
- Resolved
-