public interface IReparentNodeHandler
Implementations of this interface are queried from the IInputModeContext
by code that wants to reparent a node.
Specifically this is used by default to reparent nodes during the dragging of nodes
.
Modifier and Type | Method and Description |
---|---|
boolean |
isReparentGesture(IInputModeContext context,
INode node)
Determines whether the current gesture that can be determined through the context is a reparent gesture.
|
boolean |
isValidParent(IInputModeContext context,
INode node,
INode newParent)
Determines whether the provided node may be reparented to a
newParent . |
void |
reparent(IInputModeContext context,
INode node,
INode newParent)
Performs the actual reparenting after the reparent gesture has been finalized.
|
boolean |
shouldReparent(IInputModeContext context,
INode node)
Determines whether the user may detach the given node from its current parent in order to reparent it.
|
boolean isReparentGesture(IInputModeContext context, INode node)
context
- The context that provides information about the user input.node
- The node that will possibly be reparented.boolean isValidParent(IInputModeContext context, INode node, INode newParent)
newParent
.context
- The context that provides information about the user input.node
- The node that will be reparented.newParent
- The potential new parent or null
. Can be a group or a non-group node.newParent
is a valid new parent for node
.void reparent(IInputModeContext context, INode node, INode newParent)
Implementations should set the parent
of node
to
newParent
.
context
- The context that provides information about the user input.node
- The node that will be reparented.newParent
- The potential new parent or null
. Can be a group or a non-group node.boolean shouldReparent(IInputModeContext context, INode node)
context
- The context that provides information about the user input.node
- The node that is about to be detached from its current parent.