public interface MenuItem extends Comparable<MenuItem>
Modifier and Type | Method and Description |
---|---|
void |
addChildren(MenuItem menuItem)
Adds a children to the current
MenuItem |
default int |
compareTo(MenuItem other) |
List<MenuItem> |
getChildren()
The
MenuItem s can be cascaded (allowing a tree). |
MenuCommand |
getCommand()
Returns the command to execute if the
MenuItem is selected. |
String |
getLabel()
The Label of the menu item.
|
int |
getOrder() |
boolean |
isCheckable()
Defines if the current
MenuItem is a checkable item. |
boolean |
isChecked(List<VertexRef> targets,
OperationContext operationContext)
Defines if the current
MenuItem is checked. |
boolean |
isEnabled(List<VertexRef> targets,
OperationContext operationContext)
Defines if the current
MenuItem is enabled. |
boolean |
isVisible(List<VertexRef> targets,
OperationContext operationContext)
Defines if the current
MenuItem is visible. |
void |
setOrder(int order) |
String getLabel()
boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
MenuItem
is visible.targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.boolean isEnabled(List<VertexRef> targets, OperationContext operationContext)
MenuItem
is enabled.
If isVisible(List, OperationContext)
returns false, this is never called.targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.boolean isChecked(List<VertexRef> targets, OperationContext operationContext)
MenuItem
is checked.
If isCheckable()
returns false, this is never called.targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.void setOrder(int order)
int getOrder()
boolean isCheckable()
MenuItem
is a checkable item.MenuBar.MenuItem#isCheckable()
List<MenuItem> getChildren()
MenuItem
s can be cascaded (allowing a tree).void addChildren(MenuItem menuItem)
MenuItem
menuItem
- the child to add.MenuCommand getCommand()
MenuItem
is selected.
Please Note, that it MUST return null if getChildren()
is NOT empty.MenuItem
is selected, or null if getChildren()
is NOT empty.default int compareTo(MenuItem other)
compareTo
in interface Comparable<MenuItem>
Copyright © 2021. All rights reserved.