use of javafx.beans.property.ReadOnlyStringWrapper in project Smartcity-Smarthouse by TechnionYP5777.
the class SensorConfigurationController method initialize.
@Override
public void initialize(final URL location, final ResourceBundle __) {
nameColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getName()));
typeColumn.setCellValueFactory(cellData -> new ReadOnlyStringWrapper(cellData.getValue().getType().getFieldDescription()));
deleteColumn.setCellValueFactory(param -> new SimpleBooleanProperty(param.getValue() != null));
deleteColumn.setCellFactory(p -> {
final ButtonCell $ = new ButtonCell();
$.setAlignment(Pos.CENTER);
return $;
});
backButton.setOnAction(__1 -> mainController.loadSensorList());
HBox.setHgrow(addNameField, Priority.ALWAYS);
HBox.setHgrow(addTypeField, Priority.ALWAYS);
HBox.setHgrow(saveButton, Priority.ALWAYS);
addTypeField.setPromptText("Sensor Type");
addTypeField.getItems().addAll(Types.values());
final int btnCount = buttonBox.getChildren().size();
addNameField.prefWidthProperty().bind(buttonBox.widthProperty().divide(btnCount));
addTypeField.prefWidthProperty().bind(buttonBox.widthProperty().divide(btnCount));
saveButton.prefWidthProperty().bind(buttonBox.widthProperty().divide(btnCount));
saveButton.setOnAction(__1 -> addField());
deleteButton.setOnAction(__1 -> {
mainController.removeSensor(currentSensor);
mainController.loadSensorList();
});
messageButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(final ActionEvent __1) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("message_ui.fxml"));
final Parent root1 = (Parent) fxmlLoader.load();
((MessageViewController) fxmlLoader.getController()).setCurrentSensor(currentSensor);
final Stage stage = new Stage();
stage.setScene(new Scene(root1));
stage.show();
} catch (final Exception $) {
System.out.println($);
}
}
});
}
use of javafx.beans.property.ReadOnlyStringWrapper in project org.csstudio.display.builder by kasemir.
the class WidgetInfoDialog method createMacros.
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);
}
use of javafx.beans.property.ReadOnlyStringWrapper in project loinc2hpo by monarch-initiative.
the class AnnotateTabController method initadvancedAnnotationTable.
private void initadvancedAnnotationTable() {
advancedAnnotationSystem.setSortable(true);
advancedAnnotationSystem.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getSystem()));
advancedAnnotationCode.setSortable(true);
advancedAnnotationCode.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getCode().getCode()));
advancedAnnotationHpo.setSortable(true);
advancedAnnotationHpo.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getHpo_term()));
advancedAnnotationTable.setItems(tempAdvancedAnnotations);
}
use of javafx.beans.property.ReadOnlyStringWrapper in project loinc2hpo by monarch-initiative.
the class AnnotateTabController method initTableStructure.
private void initTableStructure() {
loincIdTableColumn.setSortable(true);
loincIdTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getLOINC_Number().toString()));
componentTableColumn.setSortable(true);
componentTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getComponent()));
propertyTableColumn.setSortable(true);
propertyTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getProperty()));
timeAspectTableColumn.setSortable(true);
timeAspectTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getTimeAspect()));
methodTableColumn.setSortable(true);
methodTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getMethod()));
scaleTableColumn.setSortable(true);
scaleTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getScale()));
systemTableColumn.setSortable(true);
systemTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getSystem()));
nameTableColumn.setSortable(true);
nameTableColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getLongName()));
// hpoListView.setOrientation(Orientation.HORIZONTAL);
accordion.setExpandedPane(loincTableTitledpane);
}
use of javafx.beans.property.ReadOnlyStringWrapper in project loinc2hpo by monarch-initiative.
the class Loinc2HpoAnnotationsTabController method initialize.
@FXML
private void initialize() {
logger.trace("Calling initialize");
loincAnnotationTableView.setEditable(false);
loincNumberColumn.setSortable(true);
loincNumberColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getLoincId().toString()));
loincScaleColumn.setSortable(true);
loincScaleColumn.setCellValueFactory(cdf -> new ReadOnlyStringWrapper(cdf.getValue().getLoincScale().toString()));
belowNormalHpoColumn.setSortable(true);
belowNormalHpoColumn.setCellValueFactory(cdf -> cdf.getValue() == null ? new ReadOnlyStringWrapper("\" \"") : new ReadOnlyStringWrapper(model.termId2HpoName(cdf.getValue().getBelowNormalHpoTermId())));
notAbnormalHpoColumn.setSortable(true);
notAbnormalHpoColumn.setCellValueFactory(cdf -> cdf.getValue() == null ? new ReadOnlyStringWrapper("\" \"") : new ReadOnlyStringWrapper(model.termId2HpoName(cdf.getValue().getNotAbnormalHpoTermName())));
aboveNormalHpoColumn.setSortable(true);
aboveNormalHpoColumn.setCellValueFactory(cdf -> cdf.getValue() == null ? new ReadOnlyStringWrapper("\" \"") : new ReadOnlyStringWrapper(model.termId2HpoName(cdf.getValue().getAboveNormalHpoTermName())));
loincFlagColumn.setSortable(true);
loincFlagColumn.setCellValueFactory(cdf -> cdf.getValue() != null && cdf.getValue().getFlag() ? new ReadOnlyStringWrapper("Y") : new ReadOnlyStringWrapper(""));
noteColumn.setSortable(true);
noteColumn.setCellValueFactory(cdf -> cdf.getValue() == null ? new ReadOnlyStringWrapper("") : new ReadOnlyStringWrapper(cdf.getValue().getNote()));
updateSummary();
}
Aggregations