下面列出了javafx.scene.control.cell.CheckBoxTableCell#getGraphic ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
JavaFXElement comp = (JavaFXElement) JavaFXElementFactory.createElement(cb, driver, window);
cbText = comp._getValue();
}
String cellText = cell.getText();
if (cellText == null) {
cellText = "";
}
String text = cellText + ":" + cbText;
return text;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
cbText = comp._getValue();
}
return cbText;
}