< prev index next >
modules/javafx.controls/src/main/java/javafx/scene/control/Cell.java
Print this page
@@ -137,11 +137,11 @@
* // background), and if the value is zero, we'll make it black.
* if (item != null) {
* double value = item.doubleValue();
* setTextFill(isSelected() ? Color.WHITE :
* value == 0 ? Color.BLACK :
- * value < 0 ? Color.RED : Color.GREEN);
+ * value < 0 ? Color.RED : Color.GREEN);
* }
* }
* }</pre>
*
* This class could then be used inside a ListView as such:
@@ -391,21 +391,24 @@
* the raw data value.
*
* <p>This value should only be set in subclasses of Cell by the virtualised
* user interface controls that know how to properly work with the Cell
* class.
+ * @return the data value associated with this cell
*/
public final ObjectProperty<T> itemProperty() { return item; }
/**
* Sets the item to the given value - should not be called directly as the
* item is managed by the virtualized control.
+ * @param value the data value to this item
*/
public final void setItem(T value) { item.set(value); }
/**
* Returns the data value associated with this Cell.
+ * @return the data value associated with this cell
*/
public final T getItem() { return item.get(); }
@@ -435,18 +438,20 @@
*
* <p>When a cell is empty, it can be styled differently via the 'empty'
* CSS pseudo class state. For example, it may not receive any
* alternate row highlighting, or it may not receive hover background
* fill when hovered.
+ * @return the representation of whether this cell has any contents
*/
public final ReadOnlyBooleanProperty emptyProperty() { return empty.getReadOnlyProperty(); }
private void setEmpty(boolean value) { empty.set(value); }
/**
* Returns a boolean representing whether the cell is considered to be empty
* or not.
+ * @return true if cell is empty, otherwise false
*/
public final boolean isEmpty() { return empty.get(); }
@@ -468,10 +473,11 @@
};
/**
* Indicates whether or not this cell has been selected. For example, a
* ListView defines zero or more cells as being the "selected" cells.
+ * @return the representation of whether this cell has been selected
*/
public final ReadOnlyBooleanProperty selectedProperty() { return selected.getReadOnlyProperty(); }
void setSelected(boolean value) { selected.set(value); }
@@ -490,17 +496,21 @@
editingPropertyImpl().set(value);
}
/**
* Represents whether the cell is currently in its editing state or not.
+ * @return true if this cell is currently in its editing state, otherwise
+ * false
*/
public final boolean isEditing() {
return editing == null ? false : editing.get();
}
/**
* Property representing whether this cell is currently in its editing state.
+ * @return the representation of whether this cell is currently in its
+ * editing state
*/
public final ReadOnlyBooleanProperty editingProperty() {
return editingPropertyImpl().getReadOnlyProperty();
}
@@ -530,10 +540,12 @@
editableProperty().set(value);
}
/**
* Returns whether this cell is allowed to be put into an editing state.
+ * @return true if this cell is allowed to be put into an editing state,
+ * otherwise false
*/
public final boolean isEditable() {
return editable == null ? true : editable.get();
}
@@ -542,10 +554,12 @@
* editing state. By default editable is set to true in Cells (although for
* a subclass of Cell to be allowed to enter its editing state, it may have
* to satisfy additional criteria. For example, ListCell requires that the
* ListView {@link ListView#editableProperty() editable} property is also
* true.
+ * @return the representation of whether this cell is allowed to be put into
+ * an editing state
*/
public final BooleanProperty editableProperty() {
if (editable == null) {
editable = new SimpleBooleanProperty(this, "editable", true);
}
@@ -671,11 +685,10 @@
*
* @param item The new item for the cell.
* @param empty whether or not this cell represents data from the list. If it
* is empty, then it does not represent any domain data, but is a cell
* being used to render an "empty" row.
- * @expert
*/
protected void updateItem(T item, boolean empty) {
setItem(item);
setEmpty(empty);
if (empty && isSelected()) {
@@ -683,11 +696,10 @@
}
}
/**
* Updates whether this cell is in a selected state or not.
- * @expert
* @param selected whether or not to select this cell.
*/
public void updateSelected(boolean selected) {
if (selected && isEmpty()) return;
boolean wasSelected = isSelected();
< prev index next >