Class ConsumerCommand<T>

  • All Implemented Interfaces:
    org.eclipse.core.commands.operations.IUndoableOperation

    public class ConsumerCommand<T>
    extends org.eclipse.core.commands.operations.AbstractOperation
    Command which accept Consumer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.core.runtime.IStatus execute​(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)  
      org.eclipse.core.runtime.IStatus redo​(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)  
      org.eclipse.core.runtime.IStatus undo​(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info)  
      • Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation

        addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
    • Constructor Detail

      • ConsumerCommand

        public ConsumerCommand​(T value,
                               String label,
                               Consumer<T> execute,
                               Consumer<T> undo)
        Constructor with parameters.
        Parameters:
        value - to modify, cannot be null
        label - a label, cannot be null
        execute - to run execute, cannot be null
        undo - to run undo, cannot be null
    • Method Detail

      • redo

        public org.eclipse.core.runtime.IStatus redo​(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                     org.eclipse.core.runtime.IAdaptable info)
                                              throws org.eclipse.core.commands.ExecutionException
        Specified by:
        redo in interface org.eclipse.core.commands.operations.IUndoableOperation
        Specified by:
        redo in class org.eclipse.core.commands.operations.AbstractOperation
        Throws:
        org.eclipse.core.commands.ExecutionException
      • execute

        public org.eclipse.core.runtime.IStatus execute​(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                        org.eclipse.core.runtime.IAdaptable info)
                                                 throws org.eclipse.core.commands.ExecutionException
        Specified by:
        execute in interface org.eclipse.core.commands.operations.IUndoableOperation
        Specified by:
        execute in class org.eclipse.core.commands.operations.AbstractOperation
        Throws:
        org.eclipse.core.commands.ExecutionException
      • undo

        public org.eclipse.core.runtime.IStatus undo​(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                     org.eclipse.core.runtime.IAdaptable info)
                                              throws org.eclipse.core.commands.ExecutionException
        Specified by:
        undo in interface org.eclipse.core.commands.operations.IUndoableOperation
        Specified by:
        undo in class org.eclipse.core.commands.operations.AbstractOperation
        Throws:
        org.eclipse.core.commands.ExecutionException