public class OperationMenuItem extends Object implements MenuItem
Constructor and Description |
---|
OperationMenuItem(OperationServiceWrapper operationServiceWrapper) |
Modifier and Type | Method and Description |
---|---|
void |
addChildren(MenuItem menuItem)
Adds a children to the current
MenuItem |
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) |
public OperationMenuItem(OperationServiceWrapper operationServiceWrapper)
public String getLabel()
MenuItem
public boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
MenuItem
MenuItem
is visible.isVisible
in interface MenuItem
targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.public boolean isEnabled(List<VertexRef> targets, OperationContext operationContext)
MenuItem
MenuItem
is enabled.
If MenuItem.isVisible(List, OperationContext)
returns false, this is never called.isEnabled
in interface MenuItem
targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.public List<MenuItem> getChildren()
MenuItem
MenuItem
s can be cascaded (allowing a tree).getChildren
in interface MenuItem
public void addChildren(MenuItem menuItem)
MenuItem
MenuItem
addChildren
in interface MenuItem
menuItem
- the child to add.public MenuCommand getCommand()
MenuItem
MenuItem
is selected.
Please Note, that it MUST return null if MenuItem.getChildren()
is NOT empty.getCommand
in interface MenuItem
MenuItem
is selected, or null if MenuItem.getChildren()
is NOT empty.public boolean isCheckable()
MenuItem
MenuItem
is a checkable item.isCheckable
in interface MenuItem
MenuBar.MenuItem#isCheckable()
public boolean isChecked(List<VertexRef> targets, OperationContext operationContext)
MenuItem
MenuItem
is checked.
If MenuItem.isCheckable()
returns false, this is never called.isChecked
in interface MenuItem
targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.Copyright © 2021. All rights reserved.