Java 类javafx.scene.control.cell.CheckBoxTableCell 实例源码
项目:truffle-hog
文件:FilterOverlayView.java
/**
* <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();
}));
}
项目:fx-log
文件:ColumnizersController.java
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();
}
项目:JttDesktop
文件:JenkinsConnectionTable.java
/**
* 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 );
}
项目:certmgr
文件:CertOptionsController.java
@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"));
}
项目:ColorPuzzleFX
文件:BenchmarkView.java
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());
}
项目:pdfsam
文件:ReverseColumn.java
@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;
}
项目:hygene
文件:PathController.java
@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();
}
项目:marathonv5
文件:JavaFXElementFactory.java
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);
}
项目:marathonv5
文件:JavaFXCheckBoxTableCellElement.java
@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;
}
项目:marathonv5
文件:RFXCheckBoxTableCell.java
@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;
}
项目:SnapDup
文件:TableCheckBoxCellFactory.java
@Override
public TableCell<T, Boolean> call(TableColumn<T, Boolean> column)
{
CheckBoxTableCell<T, Boolean> cell = new CheckBoxTableCell<>();
cell.setSelectedStateCallback(callback);
return cell;
}
项目:SnapDup
文件:TableCheckBoxCellFactory.java
@Override
public TableCell<T, Boolean> call(TableColumn<T, Boolean> column)
{
CheckBoxTableCell<T, Boolean> cell = new CheckBoxTableCell<>();
cell.setSelectedStateCallback(callback);
return cell;
}
项目:drd
文件:DiceController.java
/**
* 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()));
}
项目:git-rekt
文件:StaffAccountsScreenController.java
/**
* 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();
}
项目:git-rekt
文件:GuestRegistryScreenController.java
/**
* 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());
}
项目:xbrowser
文件:TableView.java
private TableColumn processCheckBoxColumnName(String name){
TableColumn column = new TableColumn(name);
column.setCellValueFactory( p -> ((TableColumn.CellDataFeatures<Item, Boolean>)p).getValue().getBooleanProperty(name));
column.setCellFactory(CheckBoxTableCell.forTableColumn(column));
column.setOnEditCommit( t -> {
int index = ((TableColumn.CellEditEvent<Item, Boolean>) t).getTablePosition().getRow();
Item item = ((TableColumn.CellEditEvent<Item, Boolean>) t).getTableView().getItems().get(index);
item.setProperty(name,((TableColumn.CellEditEvent<Item, Boolean>) t).getNewValue());
});
columnMap.put(name, column);
return column;
}
项目:Gargoyle
文件:CrudBaseColumnMapper.java
private CheckBoxTableCell<T, Object> checkBox(TableColumn<T, ?> column) {
CheckBox columnheaderCheckbox = new CheckBox();
// columnheaderCheckbox.setStyle("-fx-background-color:white;
// -fx-border-color :black; -fx-border-width:1;");
column.setGraphic(columnheaderCheckbox);
column.setSortable(false);
columnheaderCheckbox.addEventHandler(ActionEvent.ACTION, event -> {
if (columnheaderCheckbox.isSelected()) {
setSelectAll(column, true);
} else {
setSelectAll(column, false);
}
});
return new CheckBoxTableCell<T, Object>() {
@Override
public void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
}
@Override
public void startEdit() {
//TODO 추가 작업 예상됨. 현재는 기본컬럼으로 CheckBox형태가 나올것같지않음.
super.startEdit();
}
};
}
项目:neural-style-gui
文件:MainController.java
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());
}
项目:gitember
文件:WorkingCopyController.java
/**
* Add file to stage.
*
* @param event event
*/
@SuppressWarnings("unused")
public void addItemToStageEventHandler(Event event) {
if (event.getTarget() instanceof CheckBoxTableCell) {
CheckBoxTableCell cell = (CheckBoxTableCell) event.getTarget();
if (cell.getTableColumn() == this.selectTableColumn) {
ScmItem item = (ScmItem) workingCopyTableView.getSelectionModel().getSelectedItem();
stageItem(item);
workingCopyTableView.refresh();
}
//TODO V2 unstage changes
}
}
项目:minc-launcher
文件:Controller.java
private void setupDownloadableModsTable() {
tableDownloadableMods.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
tableColModsName.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, String>("name"));
tableColModsVersion.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, String>("version"));
tableColModsForgeVersion.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, String>("forgeVersion"));
tableColModsViaWeb.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, Boolean>("viaWeb"));
tableColModsViaWeb.setCellFactory(CheckBoxTableCell.forTableColumn(tableColModsViaWeb));
tableColModsFileName.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, String>("fileName"));
tableColModsUrl.setCellValueFactory(new PropertyValueFactory<DownloadableModRow, String>("url"));
updateDownloadableMods();
}
项目:trex-stateless-gui
文件:ImportedPacketTableView.java
/**
* Initialize table rows and columns
*/
private void initTableRowsColumns() {
selectedColumn.setCellValueFactory(new PropertyValueFactory<>("selected"));
selectedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(selectedColumn));
selectAll = new CheckBox();
selectAll.getStyleClass().add("selectAll");
selectAll.setSelected(true);
selectAll.selectedProperty().addListener((ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) -> {
selectAllRows();
});
selectedColumn.setGraphic(selectAll);
nameColumn.setCellValueFactory(new PropertyValueFactory<>("name"));
nameColumn.setCellFactory(new TextFieldTableViewCell());
packetNumColumn.setCellValueFactory(new PropertyValueFactory<>("index"));
lengthColumn.setCellValueFactory(new PropertyValueFactory<>("length"));
macSrcColumn.setCellValueFactory(new PropertyValueFactory<>("macSrc"));
macDstColumn.setCellValueFactory(new PropertyValueFactory<>("macDst"));
ipSrcColumn.setCellValueFactory(new PropertyValueFactory<>("ipSrc"));
ipDstColumn.setCellValueFactory(new PropertyValueFactory<>("ipDst"));
packetTypeColumn.setCellValueFactory(new PropertyValueFactory<>("packetType"));
importedStreamTable.setRowFactory(highlightedRowFactory);
}
项目:certmgr
文件:CRLOptionsController.java
@Override
protected void setupStage(Stage stage) {
stage.setTitle(CRLOptionsI18N.formatSTR_STAGE_TITLE());
this.ctlEntryOptionRevoked.setCellFactory(CheckBoxTableCell.forTableColumn(this.ctlEntryOptionRevoked));
this.ctlEntryOptionRevoked.setCellValueFactory(new PropertyValueFactory<>("revoked"));
this.ctlEntryOptionName.setCellValueFactory(new PropertyValueFactory<>("name"));
this.ctlEntryOptionSerial.setCellValueFactory(new PropertyValueFactory<>("serial"));
ObservableList<ReasonFlag> reasons = FXCollections.observableArrayList(ReasonFlag.instances());
reasons.sort((o1, o2) -> o1.name().compareTo(o2.name()));
this.ctlEntryOptionReason.setCellFactory(ChoiceBoxTableCell.forTableColumn(reasons));
this.ctlEntryOptionReason.setCellValueFactory(new PropertyValueFactory<>("reason"));
this.ctlEntryOptionDate.setCellValueFactory(new PropertyValueFactory<>("date"));
}
项目:rpmjukebox
文件:ExportController.java
@FXML
public void initialize() {
log.info("Initialising ExportController");
observablePlaylists = FXCollections.observableArrayList();
playlistTableView.setPlaceholder(new Label(""));
playlistTableView.setItems(observablePlaylists);
playlistTableView.setEditable(true);
playlistTableView.setSelectionModel(null);
// Hide the table header
playlistTableView.widthProperty().addListener((observable, oldValue, newValue) -> {
Pane header = (Pane)playlistTableView.lookup("TableHeaderRow");
header.setMaxHeight(0);
header.setMinHeight(0);
header.setPrefHeight(0);
header.setVisible(false);
header.setManaged(false);
});
// Cell factories
selectColumn.setCellFactory(CheckBoxTableCell.forTableColumn(selectColumn));
playlistColumn.setCellFactory(tableColumn -> {
return new PlaylistTableCell<>();
});
// Cell value factories
selectColumn.setCellValueFactory(cellData -> cellData.getValue().getSelected());
playlistColumn.setCellValueFactory(cellData -> cellData.getValue().getName());
// Set the select column to be editable
selectColumn.setEditable(true);
playlistsToExport = new HashSet<>();
playlistExtensionFilter = "*." + playlistFileExtension;
}
项目:binjr
文件:WorksheetController.java
private void initTableViewPane() {
seriesTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
visibleColumn.setCellFactory(CheckBoxTableCell.forTableColumn(visibleColumn));
pathColumn.setCellValueFactory(p -> new SimpleStringProperty(p.getValue().getBinding().getTreeHierarchy()));
colorColumn.setCellFactory(param -> new ColorTableCell<>(colorColumn));
colorColumn.setCellValueFactory(p -> p.getValue().displayColorProperty());
avgColumn.setCellValueFactory(p -> Bindings.createStringBinding(
() -> p.getValue().getProcessor() == null ? "NaN" : prefixFormatter.format(p.getValue().getProcessor().getAverageValue()),
p.getValue().processorProperty()));
minColumn.setCellValueFactory(p -> Bindings.createStringBinding(
() -> p.getValue().getProcessor() == null ? "NaN" : prefixFormatter.format(p.getValue().getProcessor().getMinValue()),
p.getValue().processorProperty()));
maxColumn.setCellValueFactory(p -> Bindings.createStringBinding(
() -> p.getValue().getProcessor() == null ? "NaN" : prefixFormatter.format(p.getValue().getProcessor().getMaxValue()),
p.getValue().processorProperty()));
currentColumn.setCellValueFactory(p -> Bindings.createStringBinding(
() -> {
if (p.getValue().getProcessor() == null) {
return "NaN";
}
return prefixFormatter.format(p.getValue().getProcessor().tryGetNearestValue(crossHair.getCurrentXValue()).orElse(Double.NaN));
}, crossHair.currentXValueProperty()));
seriesTable.setRowFactory(this::seriesTableRowFactory);
seriesTable.setOnKeyReleased(event -> {
if (event.getCode().equals(KeyCode.DELETE)) {
removeSelectedBinding();
}
});
seriesTable.setItems(worksheet.getSeries());
}
项目:HlaListener
文件:RegionListController.java
public void setFddObjectModel(FddObjectModel fddObjectModel) {
logger.entry();
if (fddObjectModel != null){
regionHandles.forEach((regionHandle -> regions.add(new RegionState(regionHandle))));
RegionTableView.setItems(regions);
regions.forEach(regionState -> regionState.onProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue) {
cb.setSelected(false);
} else if (regions.stream().allMatch(regionState1 -> regionState1.isOn())) {
cb.setSelected(true);
}
}));
RegionTableColumn.setCellValueFactory(new PropertyValueFactory<>("regionName"));
CheckTableColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<RegionState, Boolean>, ObservableValue<Boolean>>() {
@Override
public ObservableValue call(TableColumn.CellDataFeatures<RegionState, Boolean> param) {
return param.getValue().onProperty();
}
});
CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn));
cb.setUserData(CheckTableColumn);
cb.setOnAction(event -> {
CheckBox cb1 = (CheckBox) event.getSource();
TableColumn tc = (TableColumn) cb1.getUserData();
RegionTableView.getItems().stream().forEach((item) -> item.setOn(cb1.isSelected()));
});
CheckTableColumn.setGraphic(cb);
}
logger.exit();
}
项目:HlaListener
文件:ObjectInstanceAttributesController.java
public ObjectInstanceAttributesController() {
logger.entry();
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/customcontrol/ObjectInstanceAttributes.fxml"));
fxmlLoader.setController(this);
fxmlLoader.setRoot(this);
try {
fxmlLoader.load();
Label label = new Label("Select Object class instance to display its attributes");
label.setBackground(new Background(new BackgroundFill(Color.YELLOW, CornerRadii.EMPTY, Insets.EMPTY)));
AttributeTableView.setPlaceholder(label);
attributeName.setCellValueFactory(new PropertyValueFactory<AttributeState, String>("attributeName"));
checked.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<AttributeState, Boolean>, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(TableColumn.CellDataFeatures<AttributeState, Boolean> param) {
return param.getValue().onProperty();
}
});
checked.setCellFactory(CheckBoxTableCell.forTableColumn(checked));
cb.setOnAction(event -> {
CheckBox cb1 = (CheckBox) event.getSource();
AttributeTableView.getItems().stream().forEach((item) -> item.setOn(cb1.isSelected()));
});
checked.setGraphic(cb);
} catch (IOException ex) {
logger.log(Level.FATAL, ex.getMessage(), ex);
}
logger.exit();
}
项目:HlaListener
文件:DimensionsListController.java
public void setFddObjectModel(FddObjectModel fddObjectModel) {
logger.entry();
if (fddObjectModel != null) {
fddObjectModel.getDimensions().values().stream().forEach((value) -> dimensions.add(new DimensionState(value)));
DimensionTableView.setItems(dimensions);
dimensions.forEach((interaction) -> interaction.onProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue) {
cb.setSelected(false);
} else if (dimensions.stream().allMatch(a -> a.isOn())) {
cb.setSelected(true);
}
}));
DimensionTableColumn.setCellValueFactory(new PropertyValueFactory<>("DimensionName"));
CheckTableColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<DimensionState, Boolean>, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(TableColumn.CellDataFeatures<DimensionState, Boolean> param) {
return param.getValue().onProperty();
}
});
CheckTableColumn.setCellFactory(CheckBoxTableCell.forTableColumn(CheckTableColumn));
cb.setUserData(CheckTableColumn);
cb.setOnAction((ActionEvent event) -> {
CheckBox cb1 = (CheckBox) event.getSource();
TableColumn tc = (TableColumn) cb1.getUserData();
DimensionTableView.getItems().stream().forEach((item) -> item.setOn(cb1.isSelected()));
});
CheckTableColumn.setGraphic(cb);
}
logger.exit();
}
项目:LifeTiles
文件:SequenceController.java
/**
* Initialize the table.
*/
private void initializeTable() {
sequenceTable.setEditable(true);
visibleColumn.setCellFactory(CheckBoxTableCell
.forTableColumn(visibleColumn));
visibleColumn.setEditable(true);
referenceColumn.setCellFactory(CheckBoxTableCell
.forTableColumn(referenceColumn));
referenceColumn.setEditable(true);
}
项目:mzmine3
文件:MsSpectrumLayersDialogController.java
public void initialize() {
final ObservableList<MsSpectrumType> renderingChoices =
FXCollections.observableArrayList(MsSpectrumType.CENTROIDED, MsSpectrumType.PROFILE);
renderingTypeColumn.setCellFactory(ChoiceBoxTableCell.forTableColumn(renderingChoices));
colorColumn.setCellFactory(column -> new ColorTableCell<MsSpectrumDataSet>(column));
lineThicknessColumn
.setCellFactory(column -> new SpinnerTableCell<MsSpectrumDataSet>(column, 1, 5));
intensityScaleColumn.setCellFactory(TextFieldTableCell.forTableColumn(
new NumberStringConverter(MZmineCore.getConfiguration().getIntensityFormat())));
showDataPointsColumn
.setCellFactory(column -> new CheckBoxTableCell<MsSpectrumDataSet, Boolean>() {
{
tableRowProperty().addListener(e -> {
TableRow<?> row = getTableRow();
if (row == null)
return;
MsSpectrumDataSet dataSet = (MsSpectrumDataSet) row.getItem();
if (dataSet == null)
return;
disableProperty()
.bind(dataSet.renderingTypeProperty().isEqualTo(MsSpectrumType.CENTROIDED));
});
}
});
}
项目:Tourney
文件:PdfOutputSelectionDialog.java
@FXML
private void initialize() {
TableColumn<TournamentEntry, String> tournamentNameColumn = new TableColumn<>(
PreferencesManager.getInstance().localizeString(
"dialogs.pdfoutputselection.table.tournamentname"));
tournamentNameColumn.setCellValueFactory(cellValue -> {
return cellValue.getValue().getTournamentProperty().getValue()
.nameProperty();
});
tournamentNameColumn.setEditable(false);
TableColumn<TournamentEntry, Boolean> exportColumn = new TableColumn<>(
PreferencesManager.getInstance().localizeString(
"dialogs.pdfoutputselection.table.export"));
exportColumn.setCellValueFactory(cellValue -> {
return cellValue.getValue().getExportedProperty();
});
exportColumn.setCellFactory(CheckBoxTableCell
.forTableColumn(exportColumn));
exportColumn.setEditable(true);
this.tableTournaments.getColumns().add(tournamentNameColumn);
this.tableTournaments.getColumns().add(exportColumn);
this.tableTournaments.setEditable(true);
this.tableTournaments
.setPlaceholder(new Text(PreferencesManager.getInstance()
.localizeString("tableplaceholder.notournaments")));
}
项目:javafx-dpi-scaling
文件:AdjusterTest.java
@Test
public void testGetCheckBoxTableCellAdjuster() {
Adjuster adjuster = Adjuster.getAdjuster(CheckBoxTableCell.class);
assertThat(adjuster, is(instanceOf(ControlAdjuster.class)));
assertThat(adjuster.getNodeClass(), is(sameInstance(Control.class)));
}
项目:SIF-Resource-Explorer
文件:AssetsBoxBuilder.java
private void buildTable() {
assetsTable.setRowFactory(tv -> {
TableRow row = new TableRow();
row.setOnMouseClicked(event -> {
if (event.getClickCount() == 2 && (!row.isEmpty())) {
AssetLine rowData = (AssetLine) row.getItem();
System.out.println(rowData.getImagePath());
try {
new AssetPreviewStage(ApplicationContext.stageStack.peek().getStage(),
rowData.getImagePath());
} catch (Exception e) {
e.printStackTrace();
}
}
});
return row;
});
// "#" column
checkboxCol.setCellValueFactory(new PropertyValueFactory("selected"));
checkboxCol
.setCellFactory(new Callback<TableColumn<AssetLine, Boolean>, TableCell<AssetLine, Boolean>>() {
public TableCell<AssetLine, Boolean> call(TableColumn<AssetLine, Boolean> p) {
return new CheckBoxTableCell<AssetLine, Boolean>();
}
});
// "Image" column
imageNameCol.setCellValueFactory(new PropertyValueFactory("imagePath"));
imageNameCol.setEditable(false);
// "Texture" column
textureNameCol.setCellValueFactory(new PropertyValueFactory("texturePath"));
textureNameCol.setEditable(false);
assetsTable.setEditable(true);
}
项目:VStriker
文件:APIValidationController.java
private void populateApiTable() {
try {
ObservableList<Api> accountApis = FXCollections
.observableArrayList(apis);
List<BooleanProperty> listofcheckboxes = setupCheckboxColumn(accountApis);
apiDetail.setItems(accountApis);
SelectColumn
.setCellFactory(CheckBoxTableCell
.forTableColumn(new Callback<Integer, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(
Integer index) {
return listofcheckboxes.get(index);
}
}));
APIColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getApiType().getApiTypeName()));
KeyColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getSecretKey()));
EndPointColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl()));
ProtocolColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl().contains("https") ? "https"
: "http"));
PortColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl().contains("https") ? cellData
.getValue().getHttpsAddressPort()
: cellData.getValue().getHttpAddressPort()));
SelectColumn.setEditable(true);
apiDetail.setEditable(true);
} catch (Exception e) {
System.out.println("Unable to populate table");
e.printStackTrace();
}
}
项目:VStriker
文件:APIValidationController.java
private void populateApiTable() {
try {
ObservableList<Api> accountApis = FXCollections
.observableArrayList(apis);
List<BooleanProperty> listofcheckboxes = setupCheckboxColumn(accountApis);
apiDetail.setItems(accountApis);
SelectColumn
.setCellFactory(CheckBoxTableCell
.forTableColumn(new Callback<Integer, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(
Integer index) {
return listofcheckboxes.get(index);
}
}));
APIColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getApiType().getApiTypeName()));
KeyColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getSecretKey()));
EndPointColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl()));
ProtocolColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl().contains("https") ? "https"
: "http"));
PortColumn
.setCellValueFactory(cellData -> new ReadOnlyObjectWrapper(
cellData.getValue().getUrl().contains("https") ? cellData
.getValue().getHttpsAddressPort()
: cellData.getValue().getHttpAddressPort()));
SelectColumn.setEditable(true);
apiDetail.setEditable(true);
} catch (Exception e) {
System.out.println("Unable to populate table");
e.printStackTrace();
}
}
项目:dwoss
文件:ReportController.java
private List<TableColumn<ReportLine, ?>> getColumnModel() {
List<TableColumn<ReportLine, ?>> columns = new ArrayList<>();
TableColumn<ReportLine, Boolean> column = new TableColumn("Report");
column.setCellValueFactory(p -> {
p.getValue().addedToReportProperty().addListener((o, ov, nv) -> buildSummary(column.getTableView()));
return p.getValue().addedToReportProperty();
});
column.setCellFactory(p -> new CheckBoxTableCell<>());
columns.add(column);
columns.addAll(
Arrays.asList(
toTableLineColumn("Datum", cell -> new ReadOnlyStringWrapper(DateFormats.ISO.format(cell.getValue().getReportingDate())).getReadOnlyProperty()),
toTableLineColumn("SopoNr.", cell -> new ReadOnlyStringWrapper(cell.getValue().getRefurbishId()).getReadOnlyProperty()),
toTableLineColumn("ArtikelNr.", cell -> new ReadOnlyStringWrapper(cell.getValue().getPartNo()).getReadOnlyProperty()),
toTableLineColumn("Bezeichnung", cell -> new ReadOnlyStringWrapper(cell.getValue().getName()).getReadOnlyProperty()),
toTableLineColumn("Seriennummer", cell -> new ReadOnlyStringWrapper(cell.getValue().getSerial()).getReadOnlyProperty()),
toTableLineColumn("MFGDate", cell -> new ReadOnlyStringWrapper(cell.getValue().getMfgDate() == null ? "" : DateFormats.ISO.format(cell.getValue().getMfgDate())).getReadOnlyProperty()),
toCurrencyColumn("Manufacturer CP", cell -> cell.getValue().manufacturerCostPriceProperty()),
toCurrencyColumn("Contractor RP", cell -> cell.getValue().contractorReferencePriceProperty()),
toCurrencyColumn("VK", cell -> cell.getValue().priceProperty()),
toCurrencyColumn("EK", cell -> cell.getValue().purchasePriceProperty()),
toCurrencyColumn("Marge", cell -> new ReadOnlyDoubleWrapper(cell.getValue().getPrice() - cell.getValue().getPurchasePrice()).getReadOnlyProperty()),
toTableLineColumn("Rechnungsaddresse", cell -> new ReadOnlyStringWrapper(cell.getValue().getInvoiceAddress()).getReadOnlyProperty()),
toTableLineColumn("DocumentType", cell -> new ReadOnlyStringWrapper(
cell.getValue().getDocumentTypeName() + cell.getValue().getWorkflowStatus().getSign()).getReadOnlyProperty()),
toTableLineColumn("Lieferanten ArtikelNr.", cell -> new ReadOnlyStringWrapper(cell.getValue().getContractorPartNo()).getReadOnlyProperty())
));
return columns;
}
项目:erlyberly
文件:ConnectionView.java
private TableColumn<KnownNode, Boolean> newNodeRunningColumn(String colText, String colPropertyName, double colWidth) {
TableColumn<KnownNode, Boolean> column;
column = new TableColumn<>(colText);
column.setCellValueFactory( node -> { return node.getValue().runningProperty(); });
column.setCellFactory( tc -> new CheckBoxTableCell<>());
column.setPrefWidth(colWidth);
return column;
}
项目:ProDisFuzz-Main
文件:CollectPage.java
/**
* Constructs a new collect page.
*
* @param navigation the navigation controls
*/
public CollectPage(Navigation navigation) {
super();
//noinspection HardCodedStringLiteral
FxmlConnection.connect(getClass().getResource("/fxml/collectPage.fxml"), this);
Model.INSTANCE.getCollectProcess().addObserver(this);
this.navigation = navigation;
filesTableView.setEditable(true);
//noinspection HardCodedStringLiteral
columnUse.setCellValueFactory(new PropertyValueFactory<>("selected"));
columnUse.setCellFactory(CheckBoxTableCell.forTableColumn(columnUse));
columnUse.setEditable(true);
columnUse.prefWidthProperty().bind(filesTableView.widthProperty().multiply(0.04));
//noinspection HardCodedStringLiteral
columnFileName.setCellValueFactory(new PropertyValueFactory<>("name"));
columnFileName.prefWidthProperty().bind(filesTableView.widthProperty().multiply(0.22));
// noinspection HardCodedStringLiteral
columnSize.setCellValueFactory(new PropertyValueFactory<>("size"));
columnSize.prefWidthProperty().bind(filesTableView.widthProperty().multiply(0.09));
columnSize.setCellFactory(p -> new NumericTableCell());
//noinspection HardCodedStringLiteral
columnLastModified.setCellValueFactory(new PropertyValueFactory<>("lastModified"));
columnLastModified.prefWidthProperty().bind(filesTableView.widthProperty().multiply(0.12));
//noinspection HardCodedStringLiteral
columnSHA256.setCellValueFactory(new PropertyValueFactory<>("sha256"));
columnSHA256.prefWidthProperty().bind(filesTableView.widthProperty().multiply(0.51));
}
项目:ReqMan
文件:RequirementTableView.java
private TableView<ObservableRequirement> initTable() {
table = new TableView<>();
table.setEditable(false);
TableColumn<ObservableRequirement, String> nameColumn = new TableColumn<>("Name");
nameColumn.setCellValueFactory(c -> c.getValue().nameProperty()); // For unknown reason new PropertyValueFactory is not working.
nameColumn.setCellFactory(TextFieldTableCell.forTableColumn());
TableColumn<ObservableRequirement, Number> pointsColumn = new TableColumn<>("Points");
pointsColumn.setCellValueFactory(c -> c.getValue().pointsProperty());
pointsColumn.setCellFactory(TextFieldTableCell.forTableColumn(new StringConverter<Number>() {
@Override
public String toString(Number object) {
return StringUtils.prettyPrint(object.doubleValue());
}
@Override
public Number fromString(String string) {
return Double.valueOf(string);
}
}));
TableColumn<ObservableRequirement, String> minMSColumn = new TableColumn<>("Min MS");
minMSColumn.setCellValueFactory(c -> c.getValue().minMSNameProperty() );
minMSColumn.setCellFactory(TextFieldTableCell.forTableColumn() );
TableColumn<ObservableRequirement, String> maxMSColumn = new TableColumn<>("Max MS");
maxMSColumn.setCellValueFactory(c -> c.getValue().maxMSNameProperty() );
maxMSColumn.setCellFactory(TextFieldTableCell.forTableColumn() );
TableColumn<ObservableRequirement, Boolean> binaryColumn = new TableColumn<>("Binary");
binaryColumn.setCellValueFactory(c -> c.getValue().binaryProperty());
/*
//Not Working
binaryColumn.setCellFactory(new Callback<TableColumn<ObservableRequirement, Boolean>, TableCell<ObservableRequirement, Boolean>>() {
@Override
public TableCell<ObservableRequirement, Boolean> call(TableColumn<ObservableRequirement, Boolean> param) {
Callback<TableColumn<ObservableRequirement, Boolean>, TableCell<ObservableRequirement, Boolean>> factory = CheckBoxTableCell.forTableColumn(param);
TableCell<ObservableRequirement, Boolean> cell = factory.call(param);
cell.getStyleClass().add("silent");
return cell;
}
});
*/
binaryColumn.setCellFactory(CheckBoxTableCell.forTableColumn(binaryColumn));
TableColumn<ObservableRequirement, Boolean> mandatoryColumn = new TableColumn<>("Mandatory");
mandatoryColumn.setCellValueFactory(c -> c.getValue().mandatoryProperty());
mandatoryColumn.setCellFactory(CheckBoxTableCell.forTableColumn(mandatoryColumn));
TableColumn<ObservableRequirement, Boolean> malusColumn = new TableColumn<>("Malus");
malusColumn.setCellValueFactory(c -> c.getValue().malusProperty());
malusColumn.setCellFactory(CheckBoxTableCell.forTableColumn(malusColumn));
table.getColumns().addAll(nameColumn, pointsColumn, minMSColumn, maxMSColumn, binaryColumn, mandatoryColumn, malusColumn);
table.setItems(tableData);
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
// DEBUG
return table;
}
项目:wall-t
文件:ConfigurationView.java
private TableView<BuildTypeViewModel> buildBuildTypesListTableView( ) {
final TableView<BuildTypeViewModel> tableview = new TableView<>( _model.getBuildTypes( ) );
tableview.setMinHeight( 300 );
tableview.setEditable( true );
tableview.setColumnResizePolicy( TableView.CONSTRAINED_RESIZE_POLICY );
final TableColumn<BuildTypeViewModel, Boolean> selectedColumn = new TableColumn<>( "" );
selectedColumn.setSortable( false );
selectedColumn.setEditable( true );
selectedColumn.setMinWidth( 40 );
selectedColumn.setMaxWidth( 40 );
selectedColumn.setCellValueFactory( param -> param.getValue( ).selectedProperty( ) );
selectedColumn.setCellFactory( CheckBoxTableCell.forTableColumn( selectedColumn ) );
final TableColumn<BuildTypeViewModel, IPositionable> moveColumn = new TableColumn<>( "" );
moveColumn.setSortable( false );
moveColumn.setMinWidth( 50 );
moveColumn.setMaxWidth( 50 );
moveColumn.setCellValueFactory( param -> new SimpleObjectProperty<IPositionable>( param.getValue( ) ) );
moveColumn.setCellFactory( param -> positionMoveButtonsTableCell( BuildTypeViewModel.class ) );
final TableColumn<BuildTypeViewModel, String> idColumn = new TableColumn<>( "id" );
idColumn.setSortable( false );
idColumn.setCellValueFactory( param -> param.getValue( ).idProperty( ) );
final TableColumn<BuildTypeViewModel, String> projectColumn = new TableColumn<>( "Project" );
projectColumn.setSortable( false );
projectColumn.setCellValueFactory( param -> param.getValue( ).projectNameProperty( ) );
final TableColumn<BuildTypeViewModel, String> nameColumn = new TableColumn<>( "Name" );
nameColumn.setSortable( false );
nameColumn.setCellValueFactory( param -> param.getValue( ).nameProperty( ) );
final TableColumn<BuildTypeViewModel, String> aliasColumns = new TableColumn<>( "Alias" );
aliasColumns.setSortable( false );
aliasColumns.setEditable( true );
aliasColumns.setCellValueFactory( param -> param.getValue( ).aliasNameProperty( ) );
aliasColumns.setCellFactory( TextFieldTableCell.forTableColumn( ) );
aliasColumns.setOnEditCommit(
event -> {
final BuildTypeViewModel buildTypeData = event.getTableView( ).getItems( ).get( event.getTablePosition( ).getRow( ) );
buildTypeData.setAliasName( event.getNewValue( ) );
}
);
tableview.getColumns( ).addAll( selectedColumn, moveColumn, idColumn, projectColumn, nameColumn, aliasColumns );
return tableview;
}
项目:wall-t
文件:ConfigurationView.java
private TableView<ProjectViewModel> buildProjectListTableView( ) {
final TableView<ProjectViewModel> tableview = new TableView<>( _model.getProject( ) );
tableview.setMinHeight( 200 );
tableview.setEditable( true );
tableview.setColumnResizePolicy( TableView.CONSTRAINED_RESIZE_POLICY );
final TableColumn<ProjectViewModel, Boolean> selectedColumn = new TableColumn<>( "" );
selectedColumn.setSortable( false );
selectedColumn.setEditable( true );
selectedColumn.setMinWidth( 40 );
selectedColumn.setMaxWidth( 40 );
selectedColumn.setCellValueFactory( param -> param.getValue( ).selectedProperty( ) );
selectedColumn.setCellFactory( CheckBoxTableCell.forTableColumn( selectedColumn ) );
final TableColumn<ProjectViewModel, IPositionable> moveColumn = new TableColumn<>( "" );
moveColumn.setSortable( false );
moveColumn.setMinWidth( 50 );
moveColumn.setMaxWidth( 50 );
moveColumn.setCellValueFactory( param -> new SimpleObjectProperty<IPositionable>( param.getValue( ) ) );
moveColumn.setCellFactory( param -> positionMoveButtonsTableCell( ProjectViewModel.class ) );
final TableColumn<ProjectViewModel, String> idColumn = new TableColumn<>( "id" );
idColumn.setSortable( false );
idColumn.setCellValueFactory( param -> param.getValue( ).idProperty( ) );
final TableColumn<ProjectViewModel, String> nameColumn = new TableColumn<>( "Name" );
nameColumn.setSortable( false );
nameColumn.setCellValueFactory( param -> param.getValue( ).nameProperty( ) );
final TableColumn<ProjectViewModel, String> aliasColumns = new TableColumn<>( "Alias" );
aliasColumns.setSortable( false );
aliasColumns.setEditable( true );
aliasColumns.setCellValueFactory( param -> param.getValue( ).aliasNameProperty( ) );
aliasColumns.setCellFactory( TextFieldTableCell.forTableColumn( ) );
aliasColumns.setOnEditCommit(
event -> {
final ProjectViewModel buildTypeData = event.getTableView( ).getItems( ).get( event.getTablePosition( ).getRow( ) );
buildTypeData.setAliasName( event.getNewValue( ) );
}
);
tableview.getColumns( ).addAll( selectedColumn, moveColumn, idColumn, nameColumn, aliasColumns );
return tableview;
}