34 /**
35 * A class containing a {@link TableCell} implementation that draws a
36 * {@link ProgressBar} node inside the cell.
37 *
38 * @param <S> The type of the elements contained within the TableView.
39 * @since JavaFX 2.2
40 */
41 public class ProgressBarTableCell<S> extends TableCell<S, Double> {
42
43 /***************************************************************************
44 * *
45 * Static cell factories *
46 * *
47 **************************************************************************/
48
49 /**
50 * Provides a {@link ProgressBar} that allows easy visualisation of a Number
51 * value as it proceeds from 0.0 to 1.0. If the value is -1, the progress
52 * bar will appear indeterminate.
53 *
54 * @return A {@link Callback} that can be inserted into the
55 * {@link TableColumn#cellFactoryProperty() cell factory property} of a
56 * TableColumn, that enables visualisation of a Number as it progresses
57 * from 0.0 to 1.0.
58 */
59 public static <S> Callback<TableColumn<S,Double>, TableCell<S,Double>> forTableColumn() {
60 return param -> new ProgressBarTableCell<S>();
61 }
62
63
64
65 /***************************************************************************
66 * *
67 * Fields *
68 * *
69 **************************************************************************/
70
71 private final ProgressBar progressBar;
72
73 private ObservableValue<Double> observable;
|
34 /**
35 * A class containing a {@link TableCell} implementation that draws a
36 * {@link ProgressBar} node inside the cell.
37 *
38 * @param <S> The type of the elements contained within the TableView.
39 * @since JavaFX 2.2
40 */
41 public class ProgressBarTableCell<S> extends TableCell<S, Double> {
42
43 /***************************************************************************
44 * *
45 * Static cell factories *
46 * *
47 **************************************************************************/
48
49 /**
50 * Provides a {@link ProgressBar} that allows easy visualisation of a Number
51 * value as it proceeds from 0.0 to 1.0. If the value is -1, the progress
52 * bar will appear indeterminate.
53 *
54 * @param <S> The type of the TableView generic type
55 * @return A {@link Callback} that can be inserted into the
56 * {@link TableColumn#cellFactoryProperty() cell factory property} of a
57 * TableColumn, that enables visualisation of a Number as it progresses
58 * from 0.0 to 1.0.
59 */
60 public static <S> Callback<TableColumn<S,Double>, TableCell<S,Double>> forTableColumn() {
61 return param -> new ProgressBarTableCell<S>();
62 }
63
64
65
66 /***************************************************************************
67 * *
68 * Fields *
69 * *
70 **************************************************************************/
71
72 private final ProgressBar progressBar;
73
74 private ObservableValue<Double> observable;
|