本文整理汇总了Java中javafx.scene.control.TableColumn.CellDataFeatures方法的典型用法代码示例。如果您正苦于以下问题:Java TableColumn.CellDataFeatures方法的具体用法?Java TableColumn.CellDataFeatures怎么用?Java TableColumn.CellDataFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TableColumn
的用法示例。
在下文中一共展示了TableColumn.CellDataFeatures方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
@Override
public ObservableValue<Object> call(TableColumn.CellDataFeatures<Contents, Object> data) {
Object value = null;
if (data.getValue().getContentsType().equals(Contents.TYPE_IMAGE)) {
value = data.getValue().getContentsImage();
} else {
if (data.getValue().getContentsValue().length() > 25) {
value = data.getValue().getContentsValue().substring(0, 25) + " ...";
} else {
value = data.getValue().getContentsValue();
}
}
return (value instanceof ObservableValue) ? (ObservableValue) value : new ReadOnlyObjectWrapper<>(value);
}
示例2: call
import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
@Override
public ObservableValue<CheckBox> call(
TableColumn.CellDataFeatures<SelectableTableEntry<?>, CheckBox> arg0) {
SelectableTableEntry<?> entry = arg0.getValue();
CheckBox checkBox = new CheckBox();
checkBox.selectedProperty().bindBidirectional(entry.selectedProperty());
return new SimpleObjectProperty<>(checkBox);
}
示例3: senderImageProperty
import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
private ObservableValue<ImageView> senderImageProperty(TableColumn.CellDataFeatures<EntryModel, ImageView> param) {
EntryModel model = param.getValue();
ObjectProperty<ImageView> objectProperty = new SimpleObjectProperty<>(new ImageView());
// Write image now
if (model.getSender() != null) {
objectProperty.get().setImage((MVSenderIconCache.iconCache.get(model.getSender())));
}
// Rewrite if changed
model.senderProperty().addListener((observable, oldValue, newValue) ->
objectProperty.get().setImage((MVSenderIconCache.iconCache.get(newValue))));
return objectProperty;
}
示例4: call
import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Rule, String> param) {
String desc = "";
final Rule rule = param.getValue();
final String matchingText = rule.getMatchingText();
switch (rule.getType()) {
case MOVE:
desc = (matchingText != null) ? String.format("Move emails matching '%s' to '%s'", matchingText, rule.getDestFolder()) : String.format("Move emails older than %s to '%s'", rule.getOlderThan(), rule.getDestFolder());
break;
case DELETE:
desc = (matchingText != null) ? String.format("Delete emails matching '%s'", matchingText) : String.format("Delete emails older than %s", rule.getOlderThan());
break;
}
return new SimpleStringProperty(desc);
}
示例5: call
import javafx.scene.control.TableColumn; //导入方法依赖的package包/类
@Override
public ObservableValue<String> call(TableColumn.CellDataFeatures<Map<String, String>, String> param) {
return new SimpleStringProperty(param.getValue().get(key));
}