CompoundEdit
CompoundEdit (여러 편집을 하나로 묶는 편집)
CompoundEdit은 AbstractUndoableEdit의 구체적 서브클래스로, 작은 UndoableEdit들을 큰 하나로 묶는 데 사용돼요. UndoableEdit, Serializable을 구현해요.
본문
알려진 직접 서브클래스로는 AbstractDocument.DefaultDocumentEvent, UndoManager이 있어요.
필드
protected Vector<UndoableEdit> edits— 이CompoundEdit에 의해 일괄적으로 undo/redo되는UndoableEdit의 모음이에요.
AbstractUndoableEdit에 선언된 RedoName, UndoName 필드를 상속받아요.
생성자
CompoundEdit()—CompoundEdit을 생성해요.
메서드
boolean addEdit(UndoableEdit anEdit)— 이 편집이inProgress이면anEdit을 받아들이고true를 반환해요.boolean canRedo()—isInProgress이거나super가false를 반환하면false를 반환해요.boolean canUndo()—isInProgress이거나super가false를 반환하면false를 반환해요.void die()— 각 서브 편집에 추가된 순서의 역순으로die를 보내요.void end()—inProgress를false로 설정해요.String getPresentationName()—edits에 마지막으로 추가된UndoableEdit의getPresentationName을 반환해요.String getRedoPresentationName()—edits에 마지막으로 추가된UndoableEdit의getRedoPresentationName을 반환해요.String getUndoPresentationName()—edits에 마지막으로 추가된UndoableEdit의getUndoPresentationName을 반환해요.boolean isInProgress()— 이 편집이 진행 중이면true를 반환해요.