Package org.eclipse.glsp.server.emf
Interface EMFOperationHandler<O extends Operation>
-
- All Superinterfaces:
OperationHandler
- All Known Implementing Classes:
AbstractEMFCreateEdgeOperationHandler,AbstractEMFCreateNodeOperationHandler,AbstractEMFCreateOperationHandler,AbstractEMFOperationHandler,EMFChangeBoundsOperationHandler,EMFCompoundOperationHandler
public interface EMFOperationHandler<O extends Operation> extends OperationHandler
OperationHandlerfor EMF source models that creates commands to be executed on the command stack.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<org.eclipse.emf.common.command.Command>createCommand(O operation)Creates a command that performs the operation in the EMF source model(s).default voidexecute(Operation operation)default java.util.Optional<org.eclipse.emf.common.command.Command>getCommand(Operation operation)static java.util.Optional<org.eclipse.emf.common.command.Command>getCommand(OperationHandlerRegistry registry, Operation operation)Returns the matching EMF command for the given operation.java.lang.Class<O>getHandledOperationType()static <O extends Operation>
java.util.Optional<EMFOperationHandler<O>>getOperationHandler(OperationHandlerRegistry registry, O operation)Returns the EMF operation handler for the given operation from the given operation handler registry.-
Methods inherited from interface org.eclipse.glsp.server.operations.OperationHandler
getLabel, handles
-
-
-
-
Method Detail
-
getHandledOperationType
java.lang.Class<O> getHandledOperationType()
- Specified by:
getHandledOperationTypein interfaceOperationHandler
-
getCommand
default java.util.Optional<org.eclipse.emf.common.command.Command> getCommand(Operation operation)
- Returns:
- the command to be applied to the EMF source model on the command stack for the given operation.
-
createCommand
java.util.Optional<org.eclipse.emf.common.command.Command> createCommand(O operation)
Creates a command that performs the operation in the EMF source model(s).- Parameters:
operation- The operation to process.- Returns:
- The created command to be executed on the command stack.
-
execute
default void execute(Operation operation)
- Specified by:
executein interfaceOperationHandler
-
getOperationHandler
static <O extends Operation> java.util.Optional<EMFOperationHandler<O>> getOperationHandler(OperationHandlerRegistry registry, O operation)
Returns the EMF operation handler for the given operation from the given operation handler registry.- Type Parameters:
O- operation type- Parameters:
registry- operation handler registryoperation- operation- Returns:
- the matching EMF operation handler from the registry or empty if no such handler is found
-
getCommand
static java.util.Optional<org.eclipse.emf.common.command.Command> getCommand(OperationHandlerRegistry registry, Operation operation)
Returns the matching EMF command for the given operation.- Parameters:
registry- operation handler registryoperation- operation- Returns:
- the matching EMF command for the given operation
-
-