< prev index next >
modules/javafx.controls/src/main/java/javafx/scene/control/TableColumn.java
Print this page
@@ -72,11 +72,10 @@
* right-clicks the column header area
* <li>Have the contents of the table be sorted (using
* {@link #comparatorProperty() comparator}, {@link #sortable sortable} and
* {@link #sortTypeProperty() sortType})
* </ul>
- * </p>
*
* When creating a TableColumn instance, perhaps the two most important properties
* to set are the column {@link #textProperty() text} (what to show in the column
* header area), and the column {@link #cellValueFactory cell value factory}
* (which is used to populate individual cells in the column). This can be
@@ -142,10 +141,13 @@
* *
**************************************************************************/
/**
* Parent event for any TableColumn edit event.
+ * @param <S> The type of the TableView generic type
+ * @param <T> The type of the content in all cells in this TableColumn
+ * @return The any TableColumn edit event
*/
@SuppressWarnings("unchecked")
public static <S,T> EventType<CellEditEvent<S,T>> editAnyEvent() {
return (EventType<CellEditEvent<S,T>>) EDIT_ANY_EVENT;
}
@@ -154,10 +156,13 @@
/**
* Indicates that the user has performed some interaction to start an edit
* event, or alternatively the {@link TableView#edit(int, javafx.scene.control.TableColumn)}
* method has been called.
+ * @param <S> The type of the TableView generic type
+ * @param <T> The type of the content in all cells in this TableColumn
+ * @return The start an edit event
*/
@SuppressWarnings("unchecked")
public static <S,T> EventType<CellEditEvent<S,T>> editStartEvent() {
return (EventType<CellEditEvent<S,T>>) EDIT_START_EVENT;
}
@@ -165,10 +170,13 @@
new EventType<>(editAnyEvent(), "EDIT_START");
/**
* Indicates that the editing has been canceled, meaning that no change should
* be made to the backing data source.
+ * @param <S> The type of the TableView generic type
+ * @param <T> The type of the content in all cells in this TableColumn
+ * @return The cancel an edit event
*/
@SuppressWarnings("unchecked")
public static <S,T> EventType<CellEditEvent<S,T>> editCancelEvent() {
return (EventType<CellEditEvent<S,T>>) EDIT_CANCEL_EVENT;
}
@@ -177,10 +185,13 @@
/**
* Indicates that the editing has been committed by the user, meaning that
* a change should be made to the backing data source to reflect the new
* data.
+ * @param <S> The type of the TableView generic type
+ * @param <T> The type of the content in all cells in this TableColumn
+ * @return The commit an edit event
*/
@SuppressWarnings("unchecked")
public static <S,T> EventType<CellEditEvent<S,T>> editCommitEvent() {
return (EventType<CellEditEvent<S,T>>) EDIT_COMMIT_EVENT;
}
@@ -474,10 +485,11 @@
return onEditStart == null ? null : onEditStart.get();
}
/**
* This event handler will be fired when the user successfully initiates
* editing.
+ * @return the on edit start property
*/
public final ObjectProperty<EventHandler<CellEditEvent<S,T>>> onEditStartProperty() {
if (onEditStart == null) {
onEditStart = new SimpleObjectProperty<EventHandler<CellEditEvent<S,T>>>(this, "onEditStart") {
@Override protected void invalidated() {
@@ -498,10 +510,11 @@
return onEditCommit == null ? null : onEditCommit.get();
}
/**
* This event handler will be fired when the user successfully commits their
* editing.
+ * @return the on edit commit property
*/
public final ObjectProperty<EventHandler<CellEditEvent<S,T>>> onEditCommitProperty() {
if (onEditCommit == null) {
onEditCommit = new SimpleObjectProperty<EventHandler<CellEditEvent<S,T>>>(this, "onEditCommit") {
@Override protected void invalidated() {
@@ -521,10 +534,11 @@
public final EventHandler<CellEditEvent<S,T>> getOnEditCancel() {
return onEditCancel == null ? null : onEditCancel.get();
}
/**
* This event handler will be fired when the user cancels editing a cell.
+ * @return the on edit cancel property
*/
public final ObjectProperty<EventHandler<CellEditEvent<S,T>>> onEditCancelProperty() {
if (onEditCancel == null) {
onEditCancel = new SimpleObjectProperty<EventHandler<CellEditEvent<S, T>>>(this, "onEditCancel") {
@Override protected void invalidated() {
@@ -706,34 +720,39 @@
this.value = value;
}
/**
* Returns the value passed in to the constructor.
+ * @return the value passed in to the constructor
*/
public S getValue() {
return value;
}
/**
* Returns the {@link TableColumn} passed in to the constructor.
+ * @return the TableColumn passed in to the constructor
*/
public TableColumn<S,T> getTableColumn() {
return tableColumn;
}
/**
* Returns the {@link TableView} passed in to the constructor.
+ * @return the TableView passed in to the constructor
*/
public TableView<S> getTableView() {
return tableView;
}
}
/**
* An event that is fired when a user performs an edit on a table cell.
+ * @param <S> The type of the TableView generic type
+ * @param <T> The type of the content in all cells in this TableColumn
* @since JavaFX 2.0
*/
public static class CellEditEvent<S,T> extends Event {
private static final long serialVersionUID = -609964441682677579L;
@@ -829,10 +848,11 @@
/**
* Convenience method that returns the value for the row (that is, from
* the TableView {@link TableView#itemsProperty() items} list), for the
* row contained within the {@link TablePosition} returned in
* {@link #getTablePosition()}.
+ * @return the value for the row
*/
public S getRowValue() {
List<S> items = getTableView().getItems();
if (items == null) return null;
< prev index next >