/** Update the filtered officials list */ public void updateOfficialFiltersResult() { for (Official official : officialFilteredList) { official.getSkillLevels().removeListener(mapChangeListener); } officialFilteredList.clear(); for (Official official : gameData.getOfficials()) { if (overallFilterMatcher.test(official)) { officialFilteredList.add(official); official.getSkillLevels().addListener(mapChangeListener); } } updateSkills(); }
// TODO try to use a binding private void updateSkills() { skillsTableView.getItems().clear(); Official selectedMember = officialsFilteredTableView.getSelectionModel().getSelectedItem(); if (selectedMember != null) { skillsTableView.getItems().addAll(selectedMember.getSkillLevels().values()); Collections.sort( skillsTableView.getItems(), new Comparator<SkillLevel>() { @Override public int compare(SkillLevel arg0, SkillLevel arg1) { return arg0.getSkill().getName().compareTo(arg1.getSkill().getName()); } }); } }