Class QMenuAdjuster
java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.menus.adjusters.QMenuAdjuster
Utility class for programmatically modifying menu structures.
This class provides static methods to adjust menus and menu items after they have been created. Common operations include:
- Removing items (first match or all matches)
- Adding items (before, after, first, or last position)
- Replacing items
All operations use QMenuItemMatcher to locate target items
within the menu structure. Operations recursively search through nested
sub-menus and sub-lists.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddAfter(QMenuItemContainerInterface menuItemContainer, QMenuItemInterface newItem, QMenuItemMatcher matcher) Adds a new menu item immediately after the first item that matches the matcher.static voidaddAtIndex(QMenuItemContainerInterface menuItemContainer, int index, QMenuItemInterface newItem) Adds a new menu item at the specified index of a menu item container.static booleanaddBefore(QMenuItemContainerInterface menuItemContainer, QMenuItemInterface newItem, QMenuItemMatcher matcher) Adds a new menu item immediately before the first item that matches the matcher.static voidaddFirst(QMenuItemContainerInterface menuItemContainer, QMenuItemInterface newItem) Adds a new menu item at the start of a menu item container.static voidaddLast(QMenuItemContainerInterface menuItemContainer, QMenuItemInterface newItem) Adds a new menu item at the end of a menu item container.static intremoveAll(QMenuItemContainerInterface menuItemContainer, QMenuItemMatcher matcher) Removes all menu items that match the given matcher.static booleanremoveFirst(QMenuItemContainerInterface menuItemContainer, QMenuItemMatcher matcher) Removes the first menu item that matches the given matcher.static booleanreplaceItem(QMenuItemContainerInterface menuItemContainer, QMenuItemInterface replacementItem, QMenuItemMatcher matcher) Replace the first menu that matches the given matcher with a replacement item.
-
Constructor Details
-
QMenuAdjuster
public QMenuAdjuster()
-
-
Method Details