You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
542 B
21 lines
542 B
package com.fr.design.actions; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
public abstract class UndoableAction extends UpdateAction { |
|
@Override |
|
public void actionPerformed(ActionEvent evt) { |
|
actionPerformedUndoable(); |
|
} |
|
|
|
protected void actionPerformedUndoable() { |
|
boolean executeValue = this.executeActionReturnUndoRecordNeeded(); |
|
if (executeValue) { |
|
prepare4Undo(); |
|
} |
|
} |
|
|
|
public abstract boolean executeActionReturnUndoRecordNeeded(); |
|
|
|
public abstract void prepare4Undo(); |
|
} |