Class QMenu
java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.menus.QMenu
- All Implemented Interfaces:
QMenuItemContainerInterface,QMetaDataObject,Serializable,Cloneable
- Direct Known Subclasses:
QMenuDefaultViewScreenActionsMenu
public class QMenu
extends Object
implements QMetaDataObject, Cloneable, QMenuItemContainerInterface
A list of items that can be selected by a user of a qqq application.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a deep copy of this menu.getIcon()Getter for icongetItems()Getter for itemsgetLabel()Getter for labelgetSlot()Getter for slotvoidSetter for iconvoidsetItems(List<QMenuItemInterface> items) Setter for itemsvoidSetter for labelvoidsetSlot(QMenuSlotInterface slot) Setter for slotvoidvalidate(QInstanceValidator validator, QInstance qInstance, QMetaDataObject parentObject) As part of QInstanceValidation, verify that the meta-data in this object is all fully valid.Fluent setter for iconwithItem(QMenuItemInterface item) Fluently add a single itemwithItems(List<QMenuItemInterface> items) Fluent setter for itemsFluent setter for labelwithSlot(QMenuSlotInterface slot) Fluent setter for slot
-
Constructor Details
-
QMenu
public QMenu()
-
-
Method Details
-
getLabel
-
setLabel
-
withLabel
-
getIcon
-
setIcon
-
withIcon
-
getSlot
-
getItems
Getter for items- Specified by:
getItemsin interfaceQMenuItemContainerInterface- Returns:
- the list of menu items, which may be empty but should not be null
- See Also:
-
setItems
-
withItems
Fluent setter for items- Parameters:
items- Contents of the menu.- Returns:
- this
-
validate
public void validate(QInstanceValidator validator, QInstance qInstance, QMetaDataObject parentObject) As part of QInstanceValidation, verify that the meta-data in this object is all fully valid.Subclasses should generally include a call to super.validate
-
clone
Creates and returns a deep copy of this menu.The cloned menu will have its own copy of the items list, with each item also being cloned. This ensures that modifications to the cloned menu or its items will not affect the original.
- Overrides:
clonein classObject- Returns:
- a deep clone of this menu
- Throws:
RuntimeException- if cloning is not supported (should not occur)
-