This repository has been archived on 2021-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
2020-04-10 21:52:19 +02:00
|
|
|
package envoy.client.ui;
|
|
|
|
|
2020-04-18 11:03:06 +02:00
|
|
|
import javafx.fxml.FXML;
|
|
|
|
import javafx.scene.control.*;
|
|
|
|
|
2020-04-10 21:52:19 +02:00
|
|
|
/**
|
|
|
|
* Project: <strong>envoy-client</strong><br>
|
|
|
|
* File: <strong>SettingsSceneController.java</strong><br>
|
|
|
|
* Created: <strong>10.04.2020</strong><br>
|
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since Envoy Client v0.1-beta
|
|
|
|
*/
|
2020-04-18 12:03:32 +02:00
|
|
|
public final class SettingsSceneController {
|
2020-04-10 21:52:19 +02:00
|
|
|
|
2020-04-18 11:03:06 +02:00
|
|
|
@FXML
|
|
|
|
private ListView<SettingsPane> settingsList;
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
private TitledPane titledPane;
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
private void initialize() {
|
|
|
|
settingsList.setCellFactory(listView -> new ListCell<>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void updateItem(SettingsPane item, boolean empty) { if (!empty && item != null) setGraphic(new Label(item.getTitle())); };
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
private void settingsListClicked() {
|
|
|
|
final var pane = settingsList.getSelectionModel().getSelectedItem();
|
|
|
|
titledPane.setText(pane.getTitle());
|
|
|
|
titledPane.setContent(pane);
|
|
|
|
}
|
2020-04-10 21:52:19 +02:00
|
|
|
}
|