diff --git a/app/src/main/java/ru/project/ui/collection/CurrentCollectionMenu.java b/app/src/main/java/ru/project/ui/collection/CurrentCollectionMenu.java index 8dad545..f6edd36 100644 --- a/app/src/main/java/ru/project/ui/collection/CurrentCollectionMenu.java +++ b/app/src/main/java/ru/project/ui/collection/CurrentCollectionMenu.java @@ -25,15 +25,15 @@ public class CurrentCollectionMenu extends BaseModalWindow { ActionListBox menu = new ActionListBox(); - menu.addItem("Показать коллекцию", this::showCurrentCollection); + menu.addItem("Показать коллекцию...", this::showCurrentCollection); - menu.addItem("Сохранить коллекцию в файл", this::saveCurrentCollection); + menu.addItem("Сохранить коллекцию в файл...", this::saveCurrentCollection); - menu.addItem("Сортировать коллекцию", sortCollectionMenu::showModal); + menu.addItem("Меню сортировки коллекции", sortCollectionMenu::showModal); - menu.addItem("Поиск элемента в коллекции", this::searchCollection); + menu.addItem("Меню поиска элемента в коллекции", this::searchCollection); - menu.addItem("Подсчёт количества вхождений элемента", this::countOccurrences); + menu.addItem("Меню подсчёта количества вхождений элемента", this::countOccurrences); menu.addItem("Выйти", this::close); diff --git a/app/src/main/java/ru/project/ui/collection/sorting/SortCollectionMenu.java b/app/src/main/java/ru/project/ui/collection/sorting/SortCollectionMenu.java index 9694764..f405e2e 100644 --- a/app/src/main/java/ru/project/ui/collection/sorting/SortCollectionMenu.java +++ b/app/src/main/java/ru/project/ui/collection/sorting/SortCollectionMenu.java @@ -36,7 +36,8 @@ public class SortCollectionMenu extends BaseModalWindow { this.sortMethodLabel = new Label("Способ сортировки: " + getSortMethodName(selectedSortMethod)); - this.sortFieldLabel = new Label("Сортировать по: " + getSortFieldName(selectedSortField)); + this.sortFieldLabel = + new Label("Сортировать по: " + getSortFieldName(selectedSortMethod, selectedSortField)); this.sortMethodSelectionWindow = new SortMethodSelectionWindow( @@ -46,6 +47,9 @@ public class SortCollectionMenu extends BaseModalWindow { sortMethodLabel.setText( "Способ сортировки: " + getSortMethodName(selectedSortMethod)); + + sortFieldLabel.setText( + "Сортировать по: " + getSortFieldName(selectedSortMethod, selectedSortField)); }); this.normalSortSettingsWindow = @@ -53,6 +57,9 @@ public class SortCollectionMenu extends BaseModalWindow { gui, sortField -> { selectedSortField = sortField; + + sortFieldLabel.setText( + "Сортировать по: " + getSortFieldName(selectedSortMethod, selectedSortField)); }); this.paritySortSettingsWindow = new ParitySortSettingsWindow(gui); @@ -116,7 +123,14 @@ public class SortCollectionMenu extends BaseModalWindow { }; } - private String getSortFieldName(SortField sortField) { + private String getSortFieldName(SortMethod sortMethod, SortField sortField) { + return switch (sortMethod) { + case NORMAL -> getNormalSortFieldName(sortField); + case PARITY -> "номеру зачётной книжки"; + }; + } + + private String getNormalSortFieldName(SortField sortField) { return switch (sortField) { case GROUP_NUMBER -> "номеру группы"; case AVERAGE_GRADE -> "среднему баллу"; diff --git a/app/src/main/java/ru/project/ui/creation/CreateCollectionMenu.java b/app/src/main/java/ru/project/ui/creation/CreateCollectionMenu.java index da542b9..76043ea 100644 --- a/app/src/main/java/ru/project/ui/creation/CreateCollectionMenu.java +++ b/app/src/main/java/ru/project/ui/creation/CreateCollectionMenu.java @@ -50,10 +50,10 @@ public class CreateCollectionMenu extends BaseModalWindow { panel.addComponent(fillMethodLabel); - panel.addComponent(new Button("Выбрать способ заполнения", this::selectFillMethod)); + panel.addComponent(new Button("Выбрать способ заполнения...", this::selectFillMethod)); panel.addComponent( - new Button("Настроить текущий способ заполнения", this::setupCurrentFillMethod)); + new Button("Настроить текущий способ заполнения...", this::setupCurrentFillMethod)); panel.addComponent(new Button("Создать новую коллекцию", this::updateMainCollection));