当前位置: 首页>>代码示例>>Java>>正文


Java DefaultStringConverter类代码示例

本文整理汇总了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;
}
 
开发者ID:manami-project,项目名称:manami,代码行数:18,代码来源:AnimeTypeCallback.java

示例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();
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:15,代码来源:SpecificationTableCell.java

示例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())));
                }
            }
        }
    };
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:41,代码来源:VariableCollectionController.java

示例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);
        }
    };
}
 
开发者ID:manami-project,项目名称:manami,代码行数:11,代码来源:DefaultCallback.java

示例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);
}
 
开发者ID:ThomasDaheim,项目名称:ownNoteEditor,代码行数:15,代码来源:OwnNoteTableColumn.java

示例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");
	    }
	}
    };
}
 
开发者ID:epigenome,项目名称:iTagPlot,代码行数:16,代码来源:QuantityFormController.java

示例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;
    }
 
开发者ID:githublemming,项目名称:CloudTrailViewer,代码行数:31,代码来源:WarningCellFactory.java

示例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());
            });
        }
    };
}
 
开发者ID:asciidocfx,项目名称:AsciidocFX,代码行数:36,代码来源:TableFactory.java

示例9: call

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
@Override
public TableCell<T, String> call(TableColumn<T, String> param)
{
	return new TextFieldTableCell<>(new DefaultStringConverter());
}
 
开发者ID:tengai650,项目名称:SnapDup,代码行数:6,代码来源:TableDeviceLocationCellFactory.java

示例10: forTableColumn

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public static <S> Callback<TableColumn<S, String>, TableCell<S, String>> forTableColumn() {
	return forTableColumn(new DefaultStringConverter());
}
 
开发者ID:DeskChan,项目名称:DeskChan,代码行数:4,代码来源:OptionsDialog.java

示例11: AttributeItemCellFactory

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public AttributeItemCellFactory() {
  converter = new DefaultStringConverter();
}
 
开发者ID:comtel2000,项目名称:opc-ua-client,代码行数:4,代码来源:AttributeItemCellFactory.java

示例12: WrappingTextFieldTableCell

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public WrappingTextFieldTableCell() {
	super(new DefaultStringConverter());
	this.cellText = createText();
}
 
开发者ID:kayler-renslow,项目名称:arma-intellij-plugin,代码行数:5,代码来源:IndexArmaAddonsStatusDialog.java

示例13: HighLightingTextCell

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public HighLightingTextCell() {
	super(new DefaultStringConverter());
	defaultStyle = getStyle();
}
 
开发者ID:bkusche,项目名称:bktail2,代码行数:5,代码来源:HighlightingController.java

示例14: StringCell

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
private StringCell() {
	super(new DefaultStringConverter());
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:4,代码来源:StringSetControl.java

示例15: StringTextCell

import javafx.util.converter.DefaultStringConverter; //导入依赖的package包/类
public StringTextCell()
{
    super(new DefaultStringConverter());
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:5,代码来源:StringTable.java


注:本文中的javafx.util.converter.DefaultStringConverter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。