本文整理汇总了Java中javafx.scene.control.cell.CheckBoxTableCell类的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxTableCell类的具体用法?Java CheckBoxTableCell怎么用?Java CheckBoxTableCell使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckBoxTableCell类属于javafx.scene.control.cell包,在下文中一共展示了CheckBoxTableCell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpActiveColumn
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
/**
* <p>
* Create the active column, which holds the activity state and also creates a callback to the string property
* behind it.
* </p>
*/
private void setUpActiveColumn(TableView<FilterInput> tableView) {
// Set up active column
final TableColumn<FilterInput, Boolean> activeColumn = new TableColumn<>("Active");
activeColumn.setMinWidth(50);
activeColumn.setPrefWidth(50);
tableView.getColumns().add(activeColumn);
activeColumn.setSortable(false);
activeColumn.setCellFactory(CheckBoxTableCell.forTableColumn((Callback<Integer, ObservableValue<Boolean>>) param -> {
final FilterInput input = tableView.getItems().get(param);
input.getActiveProperty().addListener(l -> {
notifyUpdateCommand(input);
});
return input.getActiveProperty();
}));
}
示例2: initializeColumnsTable
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的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();
}
示例3: initialiseColumns
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
/**
* Method to initialise the {@link TableColumn}s and their associated constraints.
*/
private void initialiseColumns(){
TableColumn< JenkinsConnectionTableRow, String > locationColumn = new TableColumn<>( COLUMN_TITLE_LOCATION );
locationColumn.prefWidthProperty().bind( widthProperty().divide( LOCATION_PROPORTION_WIDTH ) );
locationColumn.setCellValueFactory( object -> new SimpleObjectProperty<>( object.getValue().getLocation() ) );
getColumns().add( locationColumn );
TableColumn< JenkinsConnectionTableRow, String > userColumn = new TableColumn<>( COLUMN_TITLE_USER );
userColumn.prefWidthProperty().bind( widthProperty().divide( USER_PROPORTION_WIDTH ) );
userColumn.setCellValueFactory( object -> new SimpleStringProperty( object.getValue().getUser() ) );
getColumns().add( userColumn );
TableColumn< JenkinsConnectionTableRow, Boolean > connectedColumn = new TableColumn<>( COLUMN_TITLE_CONNECTED );
connectedColumn.prefWidthProperty().bind( widthProperty().divide( CONNECTED_PROPORTION_WIDTH ) );
connectedColumn.setCellValueFactory( object -> object.getValue().connected() );
connectedColumn.setCellFactory( tc -> new CheckBoxTableCell<>() );
getColumns().add( connectedColumn );
}
示例4: setupStage
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@Override
protected void setupStage(Stage stage) {
stage.getIcons().addAll(PlatformHelper.stageIcons(Images.NEWCERT32, Images.NEWCERT16));
stage.setTitle(CertOptionsI18N.formatSTR_STAGE_TITLE());
this.ctlAliasInput.textProperty().addListener((p, o, n) -> onAliasChanged(o, n));
this.ctlKeyAlgOption.valueProperty().addListener((p, o, n) -> onKeyAlgChanged(n));
this.ctlKeySizeOption.setConverter(new IntegerStringConverter());
this.ctlGeneratorOption.valueProperty().addListener((p, o, n) -> onGeneratorChanged(n));
this.ctlIssuerInput.valueProperty().addListener((p, o, n) -> onIssuerChanged(n));
this.cmdAddBasicConstraints.disableProperty().bind(this.basicConstraintsExtension.isNotNull());
this.cmdAddKeyUsage.disableProperty().bind(this.keyUsageExtension.isNotNull());
this.cmdAddExtendedKeyUsage.disableProperty().bind(this.extendedKeyUsageExtension.isNotNull());
this.cmdAddSubjectAlternativeName.disableProperty().bind(this.subjectAlternativeExtension.isNotNull());
this.cmdAddCRLDistributionPoints.disableProperty().bind(this.crlDistributionPointsExtension.isNotNull());
this.cmdEditExtension.disableProperty()
.bind(this.ctlExtensionData.getSelectionModel().selectedItemProperty().isNull());
this.cmdDeleteExtension.disableProperty()
.bind(this.ctlExtensionData.getSelectionModel().selectedItemProperty().isNull());
this.ctlExtensionDataCritical.setCellFactory(CheckBoxTableCell.forTableColumn(this.ctlExtensionDataCritical));
this.ctlExtensionDataCritical.setCellValueFactory(new PropertyValueFactory<>("critical"));
this.ctlExtensionDataName.setCellValueFactory(new PropertyValueFactory<>("name"));
this.ctlExtensionDataValue.setCellValueFactory(new PropertyValueFactory<>("value"));
}
示例5: initialize
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
public void initialize() {
solverTable.setItems(viewModel.solverTableItems());
activeColumn.setCellValueFactory(new PropertyValueFactory<>("active"));
activeColumn.setCellFactory(CheckBoxTableCell.forTableColumn(activeColumn));
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
averageColumn.setCellValueFactory(new PropertyValueFactory<>("average"));
medianColumn.setCellValueFactory(new PropertyValueFactory<>("median"));
maxColumn.setCellValueFactory(new PropertyValueFactory<>("max"));
minColumn.setCellValueFactory(new PropertyValueFactory<>("min"));
progressColumn.setCellValueFactory(new PropertyValueFactory<>("progress"));
progressColumn.setCellFactory(ProgressBarTableCell.forTableColumn());
sampleSpinner.setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(viewModel.getMinSampleSize(), viewModel.getMaxSampleSize(), viewModel.getDefaultSampleSize(), viewModel.getStepSize()));
viewModel.sampleSize().bind(sampleSpinner.valueProperty());
}
示例6: getTableColumn
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@Override
public TableColumn<SelectionTableRowData, Boolean> getTableColumn() {
TableColumn<SelectionTableRowData, Boolean> tableColumn = new TableColumn<>(getColumnTitle());
tableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(tableColumn));
tableColumn.setCellValueFactory(
new Callback<CellDataFeatures<SelectionTableRowData, Boolean>, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(CellDataFeatures<SelectionTableRowData, Boolean> param) {
if (param.getValue() != null) {
return param.getValue().reverse;
}
return null;
}
});
return tableColumn;
}
示例7: setupContentLayersTable
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
private void setupContentLayersTable() {
log.log(Level.FINER, "Setting content layer table list.");
contentLayersTable.setItems(contentLayers);
contentLayersTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
log.log(Level.FINER, "Setting content layer table selection listener.");
EventStreams.changesOf(contentLayers).subscribe(change -> {
log.log(Level.FINE, "contentLayers changed");
List<NamedSelection> selectedContentLayers = contentLayers.stream()
.filter(NamedSelection::isSelected)
.collect(Collectors.toList());
String[] newContentLayers = new String[selectedContentLayers.size()];
for (int i = 0; i < selectedContentLayers.size(); i++)
newContentLayers[i] = selectedContentLayers.get(i).getName();
neuralStyle.setContentLayers(newContentLayers);
toggleStyleButtons();
});
log.log(Level.FINER, "Setting style layer table shortcut listener");
EventStreams.eventsOf(contentLayersTable, KeyEvent.KEY_RELEASED).filter(spaceBar::match).subscribe(keyEvent -> {
ObservableList<NamedSelection> selectedStyleLayers =
contentLayersTable.getSelectionModel().getSelectedItems();
for (NamedSelection neuralLayer : selectedStyleLayers)
neuralLayer.setSelected(!neuralLayer.isSelected());
});
log.log(Level.FINER, "Setting content layer table column factories.");
contentLayersTableSelected.setCellValueFactory(new PropertyValueFactory<>("selected"));
contentLayersTableSelected.setCellFactory(CheckBoxTableCell.forTableColumn(contentLayersTableSelected));
contentLayersTableName.setCellValueFactory(new PropertyValueFactory<>("name"));
contentLayersTableName.setCellFactory(TextFieldTableCell.forTableColumn());
}
示例8: initialize
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@Override
public void initialize(final URL location, final ResourceBundle resources) {
nameColumn.setCellValueFactory(cell -> {
if (cell.getValue().getName() == null) {
return new SimpleStringProperty("[unknown genome]");
} else {
return new SimpleStringProperty(cell.getValue().getName());
}
});
colorColumn.setCellValueFactory(cell -> cell.getValue().getColor());
colorColumn.setCellFactory(cell -> new TableCell<GenomePath, Color>() {
@Override
protected void updateItem(final Color color, final boolean empty) {
super.updateItem(color, empty);
if (color == null) {
setBackground(Background.EMPTY);
} else {
setBackground(new Background(new BackgroundFill(color, CornerRadii.EMPTY, Insets.EMPTY)));
}
}
});
selectedColumn.setCellValueFactory(cell -> cell.getValue().selectedProperty());
selectedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(selectedColumn));
final FilteredList<GenomePath> filteredList = new FilteredList<>(graphVisualizer.getGenomePathsProperty(),
s -> s.getName().contains(searchField.textProperty().get()));
pathTable.setItems(filteredList);
pathTable.setEditable(true);
addListeners();
}
示例9: reset
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
public static void reset() {
add(Node.class, JavaFXElement.class);
add(TextInputControl.class, JavaFXTextInputControlElement.class);
add(HTMLEditor.class, JavaFXHTMLEditor.class);
add(CheckBox.class, JavaFXCheckBoxElement.class);
add(ToggleButton.class, JavaFXToggleButtonElement.class);
add(Slider.class, JavaFXSliderElement.class);
add(Spinner.class, JavaFXSpinnerElement.class);
add(SplitPane.class, JavaFXSplitPaneElement.class);
add(ProgressBar.class, JavaFXProgressBarElement.class);
add(ChoiceBox.class, JavaFXChoiceBoxElement.class);
add(ColorPicker.class, JavaFXColorPickerElement.class);
add(ComboBox.class, JavaFXComboBoxElement.class);
add(DatePicker.class, JavaFXDatePickerElement.class);
add(TabPane.class, JavaFXTabPaneElement.class);
add(ListView.class, JavaFXListViewElement.class);
add(TreeView.class, JavaFXTreeViewElement.class);
add(TableView.class, JavaFXTableViewElement.class);
add(TreeTableView.class, JavaFXTreeTableViewElement.class);
add(CheckBoxListCell.class, JavaFXCheckBoxListCellElement.class);
add(ChoiceBoxListCell.class, JavaFXChoiceBoxListCellElement.class);
add(ComboBoxListCell.class, JavaFXComboBoxListCellElemnt.class);
add(CheckBoxTreeCell.class, JavaFXCheckBoxTreeCellElement.class);
add(ChoiceBoxTreeCell.class, JavaFXChoiceBoxTreeCellElement.class);
add(ComboBoxTreeCell.class, JavaFXComboBoxTreeCellElement.class);
add(TableCell.class, JavaFXTableViewCellElement.class);
add(CheckBoxTableCell.class, JavaFXCheckBoxTableCellElement.class);
add(ChoiceBoxTableCell.class, JavaFXChoiceBoxTableCellElement.class);
add(ComboBoxTableCell.class, JavaFXComboBoxTableCellElemnt.class);
add(TreeTableCell.class, JavaFXTreeTableCellElement.class);
add(CheckBoxTreeTableCell.class, JavaFXCheckBoxTreeTableCell.class);
add(ChoiceBoxTreeTableCell.class, JavaFXChoiceBoxTreeTableCell.class);
add(ComboBoxTreeTableCell.class, JavaFXComboBoxTreeTableCell.class);
}
示例10: _getValue
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
JavaFXElement comp = (JavaFXElement) JavaFXElementFactory.createElement(cb, driver, window);
cbText = comp._getValue();
}
String cellText = cell.getText();
if (cellText == null) {
cellText = "";
}
String text = cellText + ":" + cbText;
return text;
}
示例11: _getValue
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public String _getValue() {
CheckBoxTableCell cell = (CheckBoxTableCell) node;
Callback selectedStateCallback = cell.getSelectedStateCallback();
String cbText;
if (selectedStateCallback != null) {
ObservableValue<Boolean> call = (ObservableValue<Boolean>) selectedStateCallback.call(cell.getItem());
int selection = call.getValue() ? 2 : 0;
cbText = JavaFXCheckBoxElement.states[selection];
} else {
Node cb = cell.getGraphic();
RFXComponent comp = getFinder().findRawRComponent(cb, null, null);
cbText = comp._getValue();
}
return cbText;
}
示例12: call
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
@Override
public TableCell<T, Boolean> call(TableColumn<T, Boolean> column)
{
CheckBoxTableCell<T, Boolean> cell = new CheckBoxTableCell<>();
cell.setSelectedStateCallback(callback);
return cell;
}
示例13: initTable
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
/**
* Inicializuje tabulku pro přidávání konstant k hodu kostkou
*/
private void initTable() {
columnAdditionType.setCellValueFactory(new PropertyValueFactory<>("additionType"));
columnAdditionType.setCellFactory(ComboBoxTableCell
.forTableColumn(StringConvertors.forAdditionType(translator), AdditionType.values()));
columnAdditionType.setOnEditCommit(
event -> tableAdditions.getItems().get(event.getTablePosition().getRow())
.setAdditionType(event.getNewValue()));
columnUseRepair.setCellValueFactory(new PropertyValueFactory<>("useRepair"));
columnUseRepair.setCellFactory(CheckBoxTableCell.forTableColumn(columnUseRepair));
columnUseRepair.setOnEditCommit(
event -> tableAdditions.getItems().get(event.getTablePosition().getRow())
.setUseRepair(event.getNewValue()));
columnUseSubtract.setCellValueFactory(new PropertyValueFactory<>("useSubtract"));
columnUseSubtract.setCellFactory(CheckBoxTableCell.forTableColumn(columnUseSubtract));
columnUseSubtract.setOnEditCommit(
event -> tableAdditions.getItems().get(event.getTablePosition().getRow())
.setUseSubtract(event.getNewValue()));
}
示例14: initialize
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
/**
* Called by JavaFX.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
staffAccountsList = FXCollections.observableArrayList();
staffAccountsTableView.setItems(staffAccountsList);
employeeIdColumn.setCellValueFactory((param) -> {
return new SimpleStringProperty(
String.valueOf(param.getValue().getId())
);
});
employeeNameColumn.setCellValueFactory((param) -> {
return new SimpleStringProperty(
param.getValue().getLastName() + ", " + param.getValue().getFirstName()
);
});
isManagerColumn.setCellValueFactory((param) -> {
return new SimpleBooleanProperty(param.getValue().isManager());
});
// Display the boolean column using checkboxes instead of strings
isManagerColumn.setCellFactory(
(param) -> {
return new CheckBoxTableCell<>();
}
);
staffAccountsTableView.setPlaceholder(
new Label("We fired everyone")
);
fetchTableData();
}
示例15: initialize
import javafx.scene.control.cell.CheckBoxTableCell; //导入依赖的package包/类
/**
* Initializes the FXML controller class.
*
* Called by JavaFX.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// Prepare to display the data
bookings = FXCollections.observableArrayList();
registryTable.setItems(bookings);
guestNameColumn.setCellValueFactory(
(param) -> {
return new SimpleStringProperty(
String.valueOf(param.getValue().getGuest().getLastName() + " , "
+ param.getValue().getGuest().getFirstName())
);
}
);
checkedInColumn.setCellValueFactory((param) -> {
return new SimpleBooleanProperty(param.getValue().isCheckedIn());
});
// Use a check box to display booleans rather than a string
checkedInColumn.setCellFactory(
(param) -> {
return new CheckBoxTableCell<>();
}
);
bookingNumberColumn.setCellValueFactory(
(param) -> {
return new SimpleLongProperty(
param.getValue().getId()
).asObject();
}
);
// Load the registry data from the database
BookingService bookingService = new BookingService();
bookings.addAll(bookingService.getDailyRegistry());
}