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


Java TextFieldTreeTableCell类代码示例

本文整理汇总了Java中javafx.scene.control.cell.TextFieldTreeTableCell的典型用法代码示例。如果您正苦于以下问题:Java TextFieldTreeTableCell类的具体用法?Java TextFieldTreeTableCell怎么用?Java TextFieldTreeTableCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TextFieldTreeTableCell类属于javafx.scene.control.cell包,在下文中一共展示了TextFieldTreeTableCell类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _getValue

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
@SuppressWarnings("unchecked") @Override public String _getValue() {
    TextFieldTreeTableCell<?, ?> cell = (TextFieldTreeTableCell<?, ?>) node;
    @SuppressWarnings("rawtypes")
    StringConverter converter = cell.getConverter();
    if (converter != null) {
        return converter.toString(cell.getItem());
    }
    return cell.getItem().toString();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:10,代码来源:RFXTextFieldTreeTableCell.java

示例2: setTextFieldCellEditor

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
private void setTextFieldCellEditor(boolean isCustom) {
    for (Iterator it = testedControl.getColumns().iterator(); it.hasNext();) {
        TreeTableColumn col = (TreeTableColumn) it.next();
        if (!isCustom) {
            col.setCellFactory(TextFieldTreeTableCell.forTreeTableColumn());
        } else {
            col.setCellFactory(new Callback() {
                public Object call(Object p) {
                    return new EditingTextFieldCell();
                }
            });
        }
    }
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:15,代码来源:TreeTableNewApp.java

示例3: createCellFactory

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
private Callback<TreeTableColumn<Page,Object>,TreeTableCell<Page,Object>> createCellFactory(FxTreeTableColumn<Page> tc, Page.Field f)
{
	switch(f)
	{
	case STATUS:
		return (x) -> new StatusCell();
	default:
		return (x) -> new TextFieldTreeTableCell(tc.getConverter());
	}
}
 
开发者ID:andy-goryachev,项目名称:ReqTraq,代码行数:11,代码来源:TreeTablePane.java

示例4: testGetTextFieldTreeTableCellAdjuster

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
@Test
public void testGetTextFieldTreeTableCellAdjuster() {
	Adjuster adjuster = Adjuster.getAdjuster(TextFieldTreeTableCell.class);
	
	assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
	assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
 
开发者ID:yumix,项目名称:javafx-dpi-scaling,代码行数:8,代码来源:AdjusterTest.java

示例5: editClipAction

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
public void editClipAction(ActionEvent actionEvent)
{
    MenuItem item = (MenuItem) actionEvent.getSource();
    ContextMenu menu = item.getParentPopup();
    TextFieldTreeTableCell cell = (TextFieldTreeTableCell) menu.getOwnerNode();
    logger.debug("owner node " + cell);
    cell.startEdit();
}
 
开发者ID:finanzer,项目名称:epubfx,代码行数:9,代码来源:ClipEditorController.java

示例6: start

import javafx.scene.control.cell.TextFieldTreeTableCell; //导入依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US);

    TreeTableColumn<Person, String> numberCol = new TreeTableColumn<>("#");
    numberCol.setCellValueFactory(p -> p.getValue().getValue().hierarchyProperty());
    numberCol.setPrefWidth(100);
    numberCol.setCellFactory(TextFieldTreeTableCell.<Person>forTreeTableColumn());

    TreeTableColumn<Person, String> firstNameCol = new TreeTableColumn<>("First Name");
    firstNameCol.setPrefWidth(150);
    firstNameCol.setEditable(true);
    firstNameCol.setCellValueFactory(p -> p.getValue().getValue().firstNameProperty());
    firstNameCol.setCellFactory(TextFieldTreeTableCell.<Person>forTreeTableColumn());

    TreeTableColumn<Person, String> lastNameCol = new TreeTableColumn<>("Last Name");
    lastNameCol.setPrefWidth(150);
    lastNameCol.setEditable(true);
    lastNameCol.setCellValueFactory(p -> p.getValue().getValue().lastNameProperty());
    lastNameCol.setCellFactory(TextFieldTreeTableCell.<Person>forTreeTableColumn());

    TreeTableColumn<Person, Date> birthdayCol = new TreeTableColumn<>("Birthday");
    birthdayCol.setPrefWidth(250);
    birthdayCol.setCellValueFactory(p -> p.getValue().getValue().birthdayProperty());
    birthdayCol.setEditable(false);
    birthdayCol.setCellFactory(TextFieldTreeTableCell.<Person, Date>forTreeTableColumn(new StringConverter<Date>() {
        @Override
        public String toString(Date t) {
            return df.format(t);
        }

        @Override
        public Date fromString(String string) {
            try {
                return df.parse(string);
            } catch (ParseException ex) {
                return null;
            }
        }
    }));

    final TreeTableView<Person> treeTableView = new TreeTableView<Person>();
    treeTableView.setEditable(true);
    treeTableView.setId(TREE_TABLE_VIEW_ID);
    treeTableView.setRoot(new TreeItem(new Person("0", "Root", "Root", new Date(r.nextLong() % 946080000000L))));
    addContent(treeTableView.getRoot(), 2, 4, "0");
    treeTableView.getColumns().setAll(numberCol, firstNameCol, lastNameCol, birthdayCol);
    treeTableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    treeTableView.getSelectionModel().setCellSelectionEnabled(true);
    treeTableView.getSelectionModel().select(5, numberCol);

    VBox vBox = new VBox();
    vBox.getChildren().setAll(treeTableView);

    Scene scene = new Scene(vBox, 800, 500);

    stage.setScene(scene);
    stage.show();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:60,代码来源:TreeTableViewApp.java


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