use of com.faforever.client.fx.StringListCell in project downlords-faf-client by FAForever.
the class SettingsController method configureLanguageSelection.
private void configureLanguageSelection(Preferences preferences) {
languageComboBox.setButtonCell(new StringListCell<>(languageInfo -> i18n.get(languageInfo.getDisplayNameKey())));
languageComboBox.setCellFactory(param -> new StringListCell<>(languageInfo -> i18n.get(languageInfo.getDisplayNameKey())));
languageComboBox.setItems(FXCollections.observableArrayList(LanguageInfo.values()));
LanguageInfo languageInfo = preferences.getLocalization().getLanguage();
languageComboBox.getSelectionModel().select(languageInfo.ordinal());
}
use of com.faforever.client.fx.StringListCell in project downlords-faf-client by FAForever.
the class CoopController method missionListCell.
private ListCell<CoopMission> missionListCell() {
return new StringListCell<>(CoopMission::getName, mission -> {
Text text = new Text();
text.getStyleClass().add(UiService.CSS_CLASS_ICON);
switch(mission.getCategory()) {
case AEON:
text.setText("\uE900");
break;
case CYBRAN:
text.setText("\uE902");
break;
case UEF:
text.setText("\uE904");
break;
default:
return null;
}
return text;
}, Pos.CENTER_LEFT, "coop-mission");
}
Aggregations