Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-27 11:20:04 +01:00
Added Javadocs to ChangeSetExecutor.
Dieser Commit ist enthalten in:
Ursprung
1667fa5c79
Commit
9b564a460e
@ -28,6 +28,9 @@ import java.util.Iterator;
|
|||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs an undo or redo from a given {@link ChangeSet}.
|
||||||
|
*/
|
||||||
public class ChangeSetExecutor implements Operation {
|
public class ChangeSetExecutor implements Operation {
|
||||||
|
|
||||||
public enum Type {UNDO, REDO}
|
public enum Type {UNDO, REDO}
|
||||||
@ -36,6 +39,13 @@ public class ChangeSetExecutor implements Operation {
|
|||||||
private final Type type;
|
private final Type type;
|
||||||
private final UndoContext context;
|
private final UndoContext context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance.
|
||||||
|
*
|
||||||
|
* @param changeSet the change set
|
||||||
|
* @param type type of change
|
||||||
|
* @param context the undo context
|
||||||
|
*/
|
||||||
private ChangeSetExecutor(ChangeSet changeSet, Type type, UndoContext context) {
|
private ChangeSetExecutor(ChangeSet changeSet, Type type, UndoContext context) {
|
||||||
checkNotNull(changeSet);
|
checkNotNull(changeSet);
|
||||||
checkNotNull(type);
|
checkNotNull(type);
|
||||||
@ -69,10 +79,24 @@ public class ChangeSetExecutor implements Operation {
|
|||||||
public void cancel() {
|
public void cancel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new undo operation.
|
||||||
|
*
|
||||||
|
* @param changeSet the change set
|
||||||
|
* @param context an undo context
|
||||||
|
* @return an operation
|
||||||
|
*/
|
||||||
public static ChangeSetExecutor createUndo(ChangeSet changeSet, UndoContext context) {
|
public static ChangeSetExecutor createUndo(ChangeSet changeSet, UndoContext context) {
|
||||||
return new ChangeSetExecutor(changeSet, Type.UNDO, context);
|
return new ChangeSetExecutor(changeSet, Type.UNDO, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new redo operation.
|
||||||
|
*
|
||||||
|
* @param changeSet the change set
|
||||||
|
* @param context an undo context
|
||||||
|
* @return an operation
|
||||||
|
*/
|
||||||
public static ChangeSetExecutor createRedo(ChangeSet changeSet, UndoContext context) {
|
public static ChangeSetExecutor createRedo(ChangeSet changeSet, UndoContext context) {
|
||||||
return new ChangeSetExecutor(changeSet, Type.REDO, context);
|
return new ChangeSetExecutor(changeSet, Type.REDO, context);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren