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


Java TextFieldTableCell类代码示例

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


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

示例1: initializeParameterTable

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
public final void initializeParameterTable(){
    parameterTable.setEditable(true);
    TableColumn keyColumn = new TableColumn("Parameter");
    keyColumn.setMinWidth(Main.columnWidthRIGHT/2-1);
    keyColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
    TableColumn valueColumn = new TableColumn("Value");
    valueColumn.setMinWidth(Main.columnWidthRIGHT/2-1);
    valueColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    valueColumn.setCellValueFactory(new PropertyValueFactory<>("value")); 
    valueColumn.setOnEditCommit(
        new EventHandler<CellEditEvent<Parameter, String>>() {
            @Override
            public void handle(CellEditEvent<Parameter, String> t) {
                ((Parameter) t.getTableView().getItems().get(t.getTablePosition().getRow())).setValue(t.getNewValue());
            }
        }
    );
    parameterTable.getColumns().addAll(keyColumn,valueColumn);
}
 
开发者ID:AdrienGuille,项目名称:SONDY,代码行数:20,代码来源:EventDetectionUI.java

示例2: initialize

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {
    this.resources = resources;
    tableRangedWeapons.setItems(rangedWeapons);
    tableRangedWeapons.getSelectionModel().selectedIndexProperty()
        .addListener((observable, oldValue, newValue) -> selectedRowIndex.setValue(newValue));

    columnImage.setCellValueFactory(new PropertyValueFactory<>("image"));
    columnImage.setCellFactory(param -> CellUtils.forImage());
    columnName.setCellValueFactory(new PropertyValueFactory<>("name"));
    columnAuthor.setCellValueFactory(new PropertyValueFactory<>("author"));
    columnStrength.setCellValueFactory(new PropertyValueFactory<>("strength"));
    columnRampancy.setCellValueFactory(new PropertyValueFactory<>("rampancy"));
    columnType.setCellValueFactory(new PropertyValueFactory<>("weaponType"));
    columnRangeLow.setCellValueFactory(new PropertyValueFactory<>("rangeLow"));
    columnRangeMedium.setCellValueFactory(new PropertyValueFactory<>("rangeMedium"));
    columnRangeLong.setCellValueFactory(new PropertyValueFactory<>("rangeLong"));
    columnType.setCellFactory(
        TextFieldTableCell.forTableColumn(StringConvertors.forRangedWeaponType(translator)));
    columnWeight.setCellValueFactory(new PropertyValueFactory<>("weight"));
    columnPrice.setCellValueFactory(new PropertyValueFactory<>("price"));
    columnAmmount.setCellValueFactory(new PropertyValueFactory<>("ammount"));
    columnAmmount.setCellFactory(param -> CellUtils.forMaxActValue());

    ObservableMergers.mergeList(RangedWeaponEntry::new, rangedWeapons, manager.selectAll());
}
 
开发者ID:stechy1,项目名称:drd,代码行数:27,代码来源:ShopWeaponRangedController.java

示例3: integerCell

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private <T> Callback<TableColumn<T, Number>, TableCell<T, Number>> integerCell(
        Predicate<Integer> validator, int defaultValue) {
    return TextFieldTableCell.forTableColumn(new StringConverter<Number>() {
        @Override
        public String toString(Number object) {
            if (object == null) {
                return null;
            }
            return object.toString();
        }

        @Override
        public Number fromString(String string) {
            try {
                int value = Integer.parseInt(string);
                if (validator.test(value)) {
                    return value;
                } else {
                    return defaultValue;
                }
            } catch (NumberFormatException e) {
                return defaultValue;
            }
        }
    });
}
 
开发者ID:yuriy-budiyev,项目名称:population,代码行数:27,代码来源:PrimaryController.java

示例4: initialize

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@FXML
public void initialize() {
	tbhHeaders.setEditable(true);
	colHeaderKey.setEditable(true);
	colHeaderValue.setEditable(true);

	colHeaderKey.setCellFactory(TextFieldTableCell.forTableColumn());
	colHeaderKey.setCellValueFactory(val -> {
		return val.getValue().keyProperty();
	});
	colHeaderValue.setCellFactory(TextFieldTableCell.forTableColumn());
	colHeaderValue.setCellValueFactory(val -> {
		return val.getValue().valueProperty();
	});

	// CodeAreaHelper : 기본 텍스트 기능 지원.
	new CodeAreaHelper(txtRequest);
	new CodeAreaHelper(txtResponse);

	// 클립보드 기능
	FxUtil.installClipboardKeyEvent(tbhHeaders);
	// 컨텍스트 기능
	FxUtil.installContextMenu(contextMenu());
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:25,代码来源:HttpActionComposite.java

示例5: addCol

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private void addCol() {
    TableColumn tc = new TableColumn();
    tc.setEditable(true);
    tc.setCellValueFactory(param -> {
        CellDataFeatures<ZRow, String> dtf = (CellDataFeatures<ZRow, String>) param;
        return new SimpleStringProperty(dtf.getValue().getRow().get(0));
    });

    tc.setCellFactory(TextFieldTableCell.forTableColumn());
    tc.setOnEditCommit(t -> {
        CellEditEvent<ZRow, String> evt = (CellEditEvent<ZRow, String>) t;
        List<String> row = evt.getTableView().getItems().get(evt.getTablePosition().getRow()).getRow();
        row.set(evt.getTablePosition().getColumn(), evt.getNewValue());
    });
    tc.setPrefWidth(150);
    TextField txf = new TextField();
    txf.setPrefWidth(150);
    txf.setPromptText(Configuration.getBundle().getString("ui.dialog.table_editor.colon") +
            (tableView.getColumns().size()+1));
    tc.setGraphic(txf);
    tableView.getColumns().addAll(tc);
    postAddColumn();
}
 
开发者ID:firm1,项目名称:zest-writer,代码行数:24,代码来源:TableController.java

示例6: initializeColumnsTable

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private void initializeColumnsTable() {
    columnsTable.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    newColumnHeaderField.setMaxWidth(headerColumn.getPrefWidth());
    newColumnGroupField.setMaxWidth(capturingGroupColumn.getPrefWidth());

    ListBinding<ColumnDefinition> columnDefinitions =
            UIUtils.selectList(columnizersPane.selectedItemProperty(), Columnizer::getColumnDefinitions);

    visibleColumn.setCellFactory(
            CheckBoxTableCell.forTableColumn(index -> columnDefinitions.get(index).visibleProperty()));
    visibleColumn.setCellValueFactory(data -> data.getValue().headerLabelProperty());

    headerColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    headerColumn.setCellValueFactory(data -> data.getValue().headerLabelProperty());

    capturingGroupColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    capturingGroupColumn.setCellValueFactory(data -> data.getValue().capturingGroupNameProperty());

    descriptionColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    descriptionColumn.setCellValueFactory(data -> data.getValue().descriptionProperty());

    columnsTable.itemsProperty().bind(columnDefinitions);

    initializeDeleteButtons();
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:26,代码来源:ColumnizersController.java

示例7: initializeTable

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initializeTable () {
    this.setEditable(true);
    this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    TableColumn<IVariable, String> nameColumn = new TableColumn<IVariable, String>("Name");
    TableColumn<IVariable, Double> valueColumn = new TableColumn<IVariable, Double>("Value");
    
    // set where to read values from
    nameColumn.setCellValueFactory(new PropertyValueFactory<IVariable, String>("name"));
    valueColumn.setCellValueFactory(new PropertyValueFactory<IVariable, Double>("value"));
    
    // set editable column (valueColumn)
    valueColumn.setCellFactory(TextFieldTableCell
            .<IVariable, Double> forTableColumn(new DoubleStringConverter()));
    
    // Set listener to execute when on edit commit runs
    valueColumn.setOnEditCommit( (CellEditEvent<IVariable, Double> event) -> setVariableValue(event));
    valueColumn.setEditable(true);

    this.getColumns().addAll(nameColumn, valueColumn);
}
 
开发者ID:adisrini,项目名称:slogo,代码行数:23,代码来源:Variables.java

示例8: initializeTable

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initializeTable () {
    this.setEditable(true);
    this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    
    TableColumn<Object, String> nameColumn = new TableColumn<Object, String>("Name");
    TableColumn<Object, Double> valueColumn = new TableColumn<Object, Double>("Value");
    
    // set where to read values from
    nameColumn.setCellValueFactory(new PropertyValueFactory<Object, String>("name"));
    valueColumn.setCellValueFactory(new PropertyValueFactory<Object, Double>("value"));
    
    // set editable column (valueColumn)
    valueColumn.setCellFactory(TextFieldTableCell.<Object, Double> forTableColumn(new DoubleStringConverter()));
    
    // Set listener to execute when on edit commit runs
    valueColumn.setOnEditCommit( (CellEditEvent<Object, Double> event) -> setVariableValue(event));
    valueColumn.setEditable(true);

    this.getColumns().addAll(nameColumn, valueColumn);
}
 
开发者ID:adisrini,项目名称:slogo,代码行数:22,代码来源:TableWindow.java

示例9: initialize

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@Override
public void initialize(URL location, ResourceBundle resources) {

    nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
    nameColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    nameColumn.setOnEditCommit(event -> {
        event.getTableView().getItems().get(event.getTablePosition().getRow()).setName(event.getNewValue());
    });

    valueColumn.setCellValueFactory(new PropertyValueFactory<>("value"));
    valueColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    valueColumn.setOnEditCommit(event -> {
        event.getTableView().getItems().get(event.getTablePosition().getRow()).setValue(event.getNewValue());
    });

    propertyTable.getItems().addAll(
            new PropertyValue("id", ""),
            new PropertyValue("port", ""),
            new PropertyValue("managed_by", "user")
    );
}
 
开发者ID:PlayPen,项目名称:PVI,代码行数:22,代码来源:ProvisionDialogController.java

示例10: call

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
@Override
public TableCell<Anime, InfoLink> call(final TableColumn<Anime, InfoLink> arg0) {
    return new TextFieldTableCell<>(new StringConverter<InfoLink>() {

        @Override
        public String toString(final InfoLink infoLink) {
            if (infoLink == null) {
                return EMPTY;
            }

            return infoLink.getUrl();
        }


        @Override
        public InfoLink fromString(final String url) {
            return new InfoLink(url);
        }
    });
}
 
开发者ID:manami-project,项目名称:manami,代码行数:21,代码来源:AnimeInfoLinkCallback.java

示例11: createMacros

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private Tab createMacros(Macros orig_macros)
{
    final Macros macros = (orig_macros == null) ? new Macros() : orig_macros;
    // Use text field to allow copying the name and value
    // Table uses list of macro names as input
    // Name column just displays the macro name,..
    final TableColumn<String, String> name = new TableColumn<>(Messages.WidgetInfoDialog_Name);
    name.setCellFactory(TextFieldTableCell.forTableColumn());
    name.setCellValueFactory(param -> new ReadOnlyStringWrapper(param.getValue()));

    // .. value column fetches the macro value
    final TableColumn<String, String> value = new TableColumn<>(Messages.WidgetInfoDialog_Value);
    value.setCellFactory(TextFieldTableCell.forTableColumn());
    value.setCellValueFactory(param -> new ReadOnlyStringWrapper(macros.getValue(param.getValue())));

    final TableView<String> table =
        new TableView<>(FXCollections.observableArrayList(macros.getNames()));
    table.getColumns().add(name);
    table.getColumns().add(value);
    table.setEditable(true);
    table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);

    return new Tab(Messages.WidgetInfoDialog_TabMacros, table);
}
 
开发者ID:kasemir,项目名称:org.csstudio.display.builder,代码行数:25,代码来源:WidgetInfoDialog.java

示例12: ServerPane

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
public ServerPane(final Server server) {
		this.server = assertNotNull(server, "server");
		loadDynamicComponentFxml(ServerPane.class, this);
		tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
		tableView.getSelectionModel().getSelectedItems().addListener(selectionListener);
		for (final TableColumn<ServerRepoListItem, ?> tableColumn : tableView.getColumns()) {
			if ("nameColumn".equals(tableColumn.getId())) {
				final TableColumn<ServerRepoListItem, String> tc = cast(tableColumn);
				tc.setCellFactory(cast(TextFieldTableCell.forTableColumn()));
//				tc.setOnEditCommit(new EventHandler<CellEditEvent<ServerRepoListItem, String>>() { // not needed, anymore, because we use a StringProperty, now - only needed with plain getters+setters.
//					@Override
//					public void handle(CellEditEvent<ServerRepoListItem, String> event) {
//						event.getRowValue().setName(event.getNewValue());
//						getServerRepoRegistry().writeIfNeeded();
//					}
//				});
			}
		}
		populateTableViewAsync();
		updateEnabled();
	}
 
开发者ID:subshare,项目名称:subshare,代码行数:22,代码来源:ServerPane.java

示例13: initializeParameterTable

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
public final void initializeParameterTable(){
    parameterTable.setEditable(true);
    TableColumn keyColumn = new TableColumn("Parameter");
    keyColumn.setMinWidth(Main.columnWidthRIGHT/2-1);
    keyColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
    TableColumn valueColumn = new TableColumn("Value");
    valueColumn.setMinWidth(Main.columnWidthRIGHT/2-1);
    valueColumn.setCellFactory(TextFieldTableCell.forTableColumn());
    valueColumn.setCellValueFactory(new PropertyValueFactory<>("value")); 
    valueColumn.setOnEditCommit(
        new EventHandler<TableColumn.CellEditEvent<Parameter, String>>() {
            @Override
            public void handle(TableColumn.CellEditEvent<Parameter, String> t) {
                ((Parameter) t.getTableView().getItems().get(t.getTablePosition().getRow())).setValue(t.getNewValue());
            }
        }
    );
    parameterTable.getColumns().addAll(keyColumn,valueColumn);
}
 
开发者ID:AdrienGuille,项目名称:SONDY,代码行数:20,代码来源:InfluenceAnalysisUI.java

示例14: unsignedIntegerTextFieldTableCell

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private TextFieldTableCell<ParkingTableViewRow, Integer> unsignedIntegerTextFieldTableCell() {
    TextFieldTableCell<ParkingTableViewRow, Integer> field = new TextFieldTableCell<>();
    field.setConverter(new IntegerStringConverter() {
        @Override
        public Integer fromString(String value) {
            try {
                Integer intValue = Math.max(1, Math.min(99, super.fromString(value)));
                return intValue > 0 ? intValue : 1;
            } catch (NumberFormatException e) {
                field.cancelEdit();
            }
            return Integer.MAX_VALUE;
        }
    });

    return field;
}
 
开发者ID:SKNZ,项目名称:LesPatternsDuSwag,代码行数:18,代码来源:ParkingFloorTableView.java

示例15: initTownZipCol

import javafx.scene.control.cell.TextFieldTableCell; //导入依赖的package包/类
private void initTownZipCol() {
	townZipCode.setCellFactory(TextFieldTableCell.forTableColumn(new StringConverter<Town>() {

		@Override
		public String toString(Town object) {
			if (object == null) {
				return DEFAULT_FILL;
			}
			return String.valueOf(object.getZipCode());
		}

		@Override
		public Town fromString(String string) {
			try {
				return townService.getTownForZip(Integer.parseInt(string));
			} catch (NumberFormatException e) {
				return null;
			}

		}
	}));
	townZipCode.setCellValueFactory(cellDataFeature -> cellDataFeature.getValue().townProperty());

}
 
开发者ID:sialcasa,项目名称:jfxtables,代码行数:25,代码来源:PersonTable.java


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