use of javafx.beans.property.SimpleBooleanProperty in project bitsquare by bitsquare.
the class TorNetworkNode method shutDownTimerTriggered.
private BooleanProperty shutDownTimerTriggered() {
final BooleanProperty done = new SimpleBooleanProperty();
shutDownTimeoutTimer = UserThread.runAfter(() -> {
log.error("A timeout occurred at shutDown");
done.set(true);
}, SHUT_DOWN_TIMEOUT_SEC);
return done;
}
use of javafx.beans.property.SimpleBooleanProperty in project jgnash by ccavanaugh.
the class Options method createBooleanProperty.
private static SimpleBooleanProperty createBooleanProperty(final String name, final boolean defaultValue) {
final SimpleBooleanProperty property = new SimpleBooleanProperty(null, name, p.getBoolean(name, defaultValue));
property.addListener(booleanChangeListener);
return property;
}
use of javafx.beans.property.SimpleBooleanProperty in project jgnash by ccavanaugh.
the class NotificationDialog method initialize.
@FXML
private void initialize() {
final TableColumn<PendingReminder, Boolean> enabledColumn = new TableColumn<>(resources.getString("Column.Approve"));
enabledColumn.setCellValueFactory(param -> new SimpleBooleanProperty(param.getValue().isApproved()));
enabledColumn.setCellFactory(CheckBoxTableCell.forTableColumn(enabledColumn));
tableView.getColumns().add(enabledColumn);
final TableColumn<PendingReminder, LocalDate> dateColumn = new TableColumn<>(resources.getString("Column.Date"));
dateColumn.setCellValueFactory(param -> new SimpleObjectProperty<>(param.getValue().getCommitDate()));
dateColumn.setCellFactory(cell -> new DateTableCell());
tableView.getColumns().add(dateColumn);
final TableColumn<PendingReminder, String> descriptionColumn = new TableColumn<>(resources.getString("Column.Description"));
descriptionColumn.setCellValueFactory(param -> new SimpleObjectProperty<>(param.getValue().getReminder().getDescription()));
tableView.getColumns().add(descriptionColumn);
tableView.setItems(observableReminderList);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
// Toggle the selection
tableView.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
newValue.setApproved(!newValue.isApproved());
tableView.refresh();
Platform.runLater(() -> tableView.getSelectionModel().clearSelection());
}
});
okButton.onActionProperty().set(event -> handleOkayAction());
cancelButton.onActionProperty().set(event -> handleCancelAction());
selectAllButton.onActionProperty().set(event -> handleSelectAllAction());
clearAllButton.onActionProperty().set(event -> handleClearAllAction());
invertButton.onActionProperty().set(event -> handleInvertSelectionAction());
snoozeComboBox.setSelectedPeriod(Options.reminderSnoozePeriodProperty().get());
// Bind options to the snooze period property
Options.reminderSnoozePeriodProperty().bind(snoozeComboBox.periodProperty());
MessageBus.getInstance().registerListener(this, MessageChannel.SYSTEM);
}
use of javafx.beans.property.SimpleBooleanProperty 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.SimpleBooleanProperty in project bitsquare by bitsquare.
the class TorNetworkNode method torNetworkNodeShutDown.
private BooleanProperty torNetworkNodeShutDown() {
final BooleanProperty done = new SimpleBooleanProperty();
executorService.submit(() -> {
Utilities.setThreadName("torNetworkNodeShutDown");
long ts = System.currentTimeMillis();
log.debug("Shutdown torNetworkNode");
try {
if (torNetworkNode != null)
torNetworkNode.shutdown();
log.debug("Shutdown torNetworkNode done after " + (System.currentTimeMillis() - ts) + " ms.");
} catch (Throwable e) {
log.error("Shutdown torNetworkNode failed with exception: " + e.getMessage());
e.printStackTrace();
} finally {
UserThread.execute(() -> done.set(true));
}
});
return done;
}
Aggregations