public class SimpleMenuItem extends AbstractMenuItem
MenuItem
which always returns
true for isVisible(List, OperationContext)
and isEnabled(List, OperationContext)
,
but false for AbstractMenuItem.isCheckable()
and isChecked(List, OperationContext)
Constructor and Description |
---|
SimpleMenuItem(String label) |
Modifier and Type | Method and Description |
---|---|
MenuCommand |
getCommand()
Returns the command to execute if the
MenuItem is selected. |
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 |
setCommand(MenuCommand command) |
addChildren, getChildren, getLabel, getOrder, isCheckable, setCheckable, setLabel, setOrder
public SimpleMenuItem(String label)
public boolean isVisible(List<VertexRef> targets, OperationContext operationContext)
MenuItem
MenuItem
is visible.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.targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.public boolean isChecked(List<VertexRef> targets, OperationContext operationContext)
MenuItem
MenuItem
is checked.
If MenuItem.isCheckable()
returns false, this is never called.targets
- The current targets (e.g. the selection)operationContext
- The current OperationContext
.public MenuCommand getCommand()
MenuItem
MenuItem
is selected.
Please Note, that it MUST return null if MenuItem.getChildren()
is NOT empty.MenuItem
is selected, or null if MenuItem.getChildren()
is NOT empty.public void setCommand(MenuCommand command)
Copyright © 2021. All rights reserved.