Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.service.align.internal
Class AlignmentServiceUndoSupport

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.service.align.internal.AlignmentServiceDecorator
      extended by eu.esdihumboldt.hale.ui.service.align.internal.AlignmentServiceUndoSupport
All Implemented Interfaces:
AlignmentService

public class AlignmentServiceUndoSupport
extends AlignmentServiceDecorator

Decorator that adds undo/redo support to an alignment service.

Author:
Simon Templer

Nested Class Summary
 class AlignmentServiceUndoSupport.AddCellOperation
          Operation that adds a cell to the alignment service.
 class AlignmentServiceUndoSupport.CleanOperation
          Operation that cleans the alignment.
 class AlignmentServiceUndoSupport.RemoveCellOperation
          Operations that removes a cell from the alignment service.
 class AlignmentServiceUndoSupport.ReplaceOperation
          Operation that replaces a cell in the alignment.
 
Field Summary
 
Fields inherited from class eu.esdihumboldt.hale.ui.service.align.internal.AlignmentServiceDecorator
alignmentService
 
Constructor Summary
AlignmentServiceUndoSupport(AlignmentService alignmentService)
          Create undo/redo support for the given alignment service.
 
Method Summary
 void addCell(MutableCell cell)
          Adds the given cell to the current alignment.
 void addOrUpdateAlignment(MutableAlignment alignment)
          Adds the cells contained in the given alignment to the current alignment.
 void clean()
          Invoke this operation if you want to clear out all alignments stored.
protected  void executeOperation(org.eclipse.core.commands.operations.IUndoableOperation operation)
          Execute an operation.
 void removeCells(Cell... cells)
          Removes the given cells
 void replaceCell(Cell oldCell, MutableCell newCell)
          Replace a cell with a new cell.
 
Methods inherited from class eu.esdihumboldt.hale.ui.service.align.internal.AlignmentServiceDecorator
addListener, getAlignment, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignmentServiceUndoSupport

public AlignmentServiceUndoSupport(AlignmentService alignmentService)
Create undo/redo support for the given alignment service.

Parameters:
alignmentService - the alignment service
Method Detail

executeOperation

protected void executeOperation(org.eclipse.core.commands.operations.IUndoableOperation operation)
Execute an operation.

Parameters:
operation - the operation to execute

addOrUpdateAlignment

public void addOrUpdateAlignment(MutableAlignment alignment)
Description copied from interface: AlignmentService
Adds the cells contained in the given alignment to the current alignment. If cells with the same entities and transformations already exist they will be replaced.

Specified by:
addOrUpdateAlignment in interface AlignmentService
Overrides:
addOrUpdateAlignment in class AlignmentServiceDecorator
Parameters:
alignment - the alignment to add
See Also:
AlignmentServiceDecorator.addOrUpdateAlignment(MutableAlignment)

addCell

public void addCell(MutableCell cell)
Description copied from interface: AlignmentService
Adds the given cell to the current alignment.

Specified by:
addCell in interface AlignmentService
Overrides:
addCell in class AlignmentServiceDecorator
Parameters:
cell - the cell to add
See Also:
AlignmentServiceDecorator.addCell(MutableCell)

removeCells

public void removeCells(Cell... cells)
Description copied from interface: AlignmentService
Removes the given cells

Specified by:
removeCells in interface AlignmentService
Overrides:
removeCells in class AlignmentServiceDecorator
Parameters:
cells - the cells to remove
See Also:
AlignmentServiceDecorator.removeCells(Cell[])

clean

public void clean()
Description copied from interface: AlignmentService
Invoke this operation if you want to clear out all alignments stored. This method is required when one wants to start working on a new alignment.

Specified by:
clean in interface AlignmentService
Overrides:
clean in class AlignmentServiceDecorator
See Also:
AlignmentServiceDecorator.clean()

replaceCell

public void replaceCell(Cell oldCell,
                        MutableCell newCell)
Description copied from interface: AlignmentService
Replace a cell with a new cell.

Specified by:
replaceCell in interface AlignmentService
Overrides:
replaceCell in class AlignmentServiceDecorator
Parameters:
oldCell - the old cell that should be removed from the alignment
newCell - the new cell that should be added to the alignment
See Also:
AlignmentServiceDecorator.replaceCell(Cell, MutableCell)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d