42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
package envoy.client.ui.controller;
|
|
|
|
import javafx.fxml.FXML;
|
|
import javafx.scene.control.*;
|
|
|
|
import envoy.client.data.Context;
|
|
import envoy.client.ui.listcell.ListCellFactory;
|
|
import envoy.client.ui.settings.*;
|
|
|
|
/**
|
|
* Controller for the settings scene.
|
|
*
|
|
* @author Kai S. K. Engelbart
|
|
* @since Envoy Client v0.1-beta
|
|
*/
|
|
public final class SettingsScene {
|
|
|
|
@FXML
|
|
private ListView<SettingsPane> settingsList;
|
|
|
|
@FXML
|
|
private TitledPane titledPane;
|
|
|
|
@FXML
|
|
private void initialize() {
|
|
settingsList.setCellFactory(new ListCellFactory<>(pane -> new Label(pane.getTitle())));
|
|
settingsList.getItems().addAll(new GeneralSettingsPane(), new UserSettingsPane(), new DownloadSettingsPane(), new BugReportPane());
|
|
}
|
|
|
|
@FXML
|
|
private void settingsListClicked() {
|
|
final var pane = settingsList.getSelectionModel().getSelectedItem();
|
|
if (pane != null) {
|
|
titledPane.setText(pane.getTitle());
|
|
titledPane.setContent(pane);
|
|
}
|
|
}
|
|
|
|
@FXML
|
|
private void backButtonClicked() { Context.getInstance().getSceneContext().pop(); }
|
|
}
|