Skip to content

Remove usage of WMenu deprecated methods from examples #1789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: georgie
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,22 +430,22 @@ public void filterBeanList() {
}

List<WComponent> selectedItems = new ArrayList<>();
List<WComponent> menuSelectedItems;
List<MenuItemSelectable> menuSelectedItems;

if (firstNameFilterMenu.isVisible()) {
menuSelectedItems = firstNameFilterMenu.getSelectedItems();
menuSelectedItems = firstNameFilterMenu.getSelectedMenuItems();
if (menuSelectedItems != null && !menuSelectedItems.isEmpty()) {
selectedItems.addAll(menuSelectedItems);
}
}
if (lastNameFilterMenu.isVisible()) {
menuSelectedItems = lastNameFilterMenu.getSelectedItems();
menuSelectedItems = lastNameFilterMenu.getSelectedMenuItems();
if (menuSelectedItems != null && !menuSelectedItems.isEmpty()) {
selectedItems.addAll(menuSelectedItems);
}
}
if (dobFilterMenu.isVisible()) {
menuSelectedItems = dobFilterMenu.getSelectedItems();
menuSelectedItems = dobFilterMenu.getSelectedMenuItems();
if (menuSelectedItems != null && !menuSelectedItems.isEmpty()) {
selectedItems.addAll(menuSelectedItems);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.github.bordertech.wcomponents.Action;
import com.github.bordertech.wcomponents.ActionEvent;
import com.github.bordertech.wcomponents.HeadingLevel;
import com.github.bordertech.wcomponents.MenuItemSelectable;
import com.github.bordertech.wcomponents.Request;
import com.github.bordertech.wcomponents.WAjaxControl;
import com.github.bordertech.wcomponents.WButton;
Expand All @@ -25,6 +26,7 @@
import com.github.bordertech.wcomponents.WTabSet.TabMode;
import com.github.bordertech.wcomponents.WText;
import com.github.bordertech.wcomponents.subordinate.builder.SubordinateBuilder;

import java.util.List;

/**
Expand Down Expand Up @@ -333,9 +335,9 @@ private void createHideShowControl(final WFieldLayout layout, final WCheckBox bo
* Handle selected text.
*/
private void handleSelectedText() {
List<WComponent> list = menu.getSelectedItems();
List<MenuItemSelectable> list = menu.getSelectedMenuItems();
StringBuffer selected = new StringBuffer();
for (WComponent comp : list) {
for (MenuItemSelectable comp : list) {
if (comp instanceof WMenuItem) {
WMenuItem item = (WMenuItem) comp;
selected.append(item.getText()).append(", ");
Expand Down