Search in sources :

Example 1 with CreateRecordUndo

use of com.revolsys.swing.undo.CreateRecordUndo in project com.revolsys.open by revolsys.

the class MergeRecordsDialog method finish.

public void finish() {
    final MultipleUndo multipleUndo = new MultipleUndo();
    for (final Record mergedRecord : this.mergedRecords.keySet()) {
        final CreateRecordUndo createRecordUndo = new CreateRecordUndo(this.layer, mergedRecord);
        multipleUndo.addEdit(createRecordUndo);
    }
    for (final LayerRecord record : this.replacedOriginalRecords) {
        final DeleteLayerRecordUndo deleteRecordUndo = new DeleteLayerRecordUndo(record);
        multipleUndo.addEdit(deleteRecordUndo);
    }
    if (this.undoManager == null) {
        multipleUndo.redo();
    } else {
        this.undoManager.addEdit(multipleUndo);
    }
    setVisible(false);
}
Also used : CreateRecordUndo(com.revolsys.swing.undo.CreateRecordUndo) DeleteLayerRecordUndo(com.revolsys.swing.undo.DeleteLayerRecordUndo) Record(com.revolsys.record.Record) ArrayRecord(com.revolsys.record.ArrayRecord) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) MultipleUndo(com.revolsys.swing.undo.MultipleUndo)

Aggregations

ArrayRecord (com.revolsys.record.ArrayRecord)1 Record (com.revolsys.record.Record)1 LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)1 CreateRecordUndo (com.revolsys.swing.undo.CreateRecordUndo)1 DeleteLayerRecordUndo (com.revolsys.swing.undo.DeleteLayerRecordUndo)1 MultipleUndo (com.revolsys.swing.undo.MultipleUndo)1