當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。