本文整理汇总了Java中javafx.util.converter.DefaultStringConverter类的典型用法代码示例。如果您正苦于以下问题:Java DefaultStringConverter类的具体用法?Java DefaultStringConverter怎么用?Java DefaultStringConverter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultStringConverter类属于javafx.util.converter包,在下文中一共展示了DefaultStringConverter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public TableCell<Anime, String> call(final TableColumn<Anime, String> arg0) {
final ChoiceBoxTableCell<Anime, String> cellFactory = new ChoiceBoxTableCell<Anime, String>(new DefaultStringConverter()) {
@Override
public void updateItem(final String value, final boolean empty) {
super.updateItem(value, empty);
}
};
cellFactory.getItems().clear();
for (final AnimeType element : AnimeType.values()) {
cellFactory.getItems().add(element.getValue());
}
return cellFactory;
}
示例2: SpecificationTableCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
/**
* Create a new SpecificationTableCell with a given validator.
* @param validator The validator for this cell
*/
public SpecificationTableCell(ConstraintSpecificationValidator validator) {
super(new DefaultStringConverter());
this.validator = validator;
validator.problemsProperty().addListener(observable -> this.onProblemsChanged());
emptyProperty().addListener(observable -> this.onProblemsChanged());
getStyleClass().add("spec-cell");
ViewUtils.setupClass(this);
onProblemsChanged();
}
示例3: cellFactory
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
private TableCell<FreeVariable, String> cellFactory(
TableColumn<FreeVariable, String> tableColumn) {
return new TextFieldTableCell<FreeVariable, String>(new DefaultStringConverter()) {
{
validator.problemsProperty().addListener((Observable o) -> onProblemsChanged());
getStyleClass().add("freevar");
onProblemsChanged();
}
private void configureProblematic(String tooltip) {
getStyleClass().remove("freevar-problem");
getStyleClass().add("freevar-problem");
setTooltip(new Tooltip(tooltip));
}
private void configureUnproblematic() {
getStyleClass().remove("freevar-problem");
setTooltip(null);
}
@Override
public void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
onProblemsChanged();
}
private void onProblemsChanged() {
if (!isEmpty()) {
List<FreeVariableProblem> problems = validator.problemsProperty().get()
.getOrDefault(getTableRow().getItem(), Collections.emptyList());
if (problems.isEmpty()) {
configureUnproblematic();
} else {
configureProblematic(String.join("\n\n", problems.stream()
.map(FreeVariableProblem::getGuiMessage).collect(Collectors.toList())));
}
}
}
};
}
示例4: call
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public TableCell<Anime, String> call(final TableColumn<Anime, String> column) {
return new TextFieldTableCell<Anime, String>(new DefaultStringConverter()) {
@Override
public void updateItem(final String value, final boolean empty) {
super.updateItem(value, empty);
}
};
}
示例5: ObjectCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public ObjectCell(final OwnNoteEditor ownNoteEditor,
final OwnNoteTableColumn ownNoteTableColumn,
final boolean linkCursor,
final EventHandler<MouseEvent> mouseEvent) {
super(new DefaultStringConverter());
myOwnNoteEditor = ownNoteEditor;
myOwnNoteTableColumn = ownNoteTableColumn;
if (linkCursor) {
this.setCursor(Cursor.HAND);
}
this.addEventFilter(MouseEvent.MOUSE_CLICKED, mouseEvent);
}
示例6: call
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public TableCell<ObservableList<StringProperty>,String> call(TableColumn<ObservableList<StringProperty>,String> param) {
return new TextFieldTableCell<ObservableList<StringProperty>, String>(( new DefaultStringConverter() )) {
@Override
public void updateItem(String s, boolean b) {
super.updateItem(s, b);
TableRow row = getTableRow();
if (row != null && (row.getIndex()+1 == this.getTableView().getItems().size()) || (cutoff && row != null && row.getIndex() == 0)) {
setDisable(true);
setEditable(false);
this.setStyle("-fx-text-fill: grey");
}
}
};
}
示例7: createTableCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
private TextFieldTableCell<WarningCell, String> createTableCell(TableColumn<WarningCell, String> col) {
TextFieldTableCell<WarningCell, String> cell = new TextFieldTableCell<WarningCell, String>(new DefaultStringConverter()) {
@Override
public void updateItem(String arg0, boolean empty) {
this.setEditable( true );
super.updateItem(arg0, empty);
if( !empty ) {
this.setText( arg0 );
WarningCell warnableObject = (WarningCell) this.getTableRow().getItem();
if( warnableObject != null && warnableObject.displayWarning(colIndex) ) {
this.setStyle(wrongStyle);
} else {
this.setStyle(normalStyle);
}
} else {
this.setText( null ); // clear from recycled obj
this.setStyle(normalStyle);
}
}
};
return cell;
}
示例8: call
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public FXFormNode call(Void param) {
tableView.setEditable(true);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
return new FXFormNodeWrapper(new VBox(3, tableView, new HBox(5, addButton, removeButton)), tableView.itemsProperty()) {
@Override
public void init(Element element) {
Class wrappedType = element.getWrappedType();
List<Field> fields = ReflectionUtils.listFields(wrappedType);
for (Field field : fields) {
TableColumn col = new TableColumn(field.getName());
col.setCellValueFactory(new PropertyValueFactory(field.getName()));
col.setCellFactory(list -> new TextFieldTableCell(new DefaultStringConverter()));
tableView.getColumns().add(col);
}
addButton.setOnAction(event -> {
try {
tableView.getItems().add(element.getWrappedType().newInstance());
tableView.edit(tableView.getItems().size() - 1, (TableColumn) tableView.getColumns().get(0));
} catch (Exception e) {
e.printStackTrace();
}
});
removeButton.setOnAction(event -> {
tableView.getItems().removeAll(tableView.getSelectionModel().getSelectedItems());
});
}
};
}
示例9: call
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public TableCell<T, String> call(TableColumn<T, String> param)
{
return new TextFieldTableCell<>(new DefaultStringConverter());
}
示例10: forTableColumn
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public static <S> Callback<TableColumn<S, String>, TableCell<S, String>> forTableColumn() {
return forTableColumn(new DefaultStringConverter());
}
示例11: AttributeItemCellFactory
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public AttributeItemCellFactory() {
converter = new DefaultStringConverter();
}
示例12: WrappingTextFieldTableCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public WrappingTextFieldTableCell() {
super(new DefaultStringConverter());
this.cellText = createText();
}
示例13: HighLightingTextCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public HighLightingTextCell() {
super(new DefaultStringConverter());
defaultStyle = getStyle();
}
示例14: StringCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
private StringCell() {
super(new DefaultStringConverter());
}
示例15: StringTextCell
import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public StringTextCell()
{
super(new DefaultStringConverter());
}