JavaTM Platform
Standard Ed. 6

javax.swing.undo
クラス CompoundEdit

java.lang.Object
  上位を拡張 javax.swing.undo.AbstractUndoableEdit
      上位を拡張 javax.swing.undo.CompoundEdit
すべての実装されたインタフェース:
Serializable, UndoableEdit
直系の既知のサブクラス:
AbstractDocument.DefaultDocumentEvent, UndoManager

public class CompoundEdit
extends AbstractUndoableEdit

複数の小規模な UndoableEdit を大きな編集結果にまとめるために使用する、AbstractUndoableEdit の具象サブクラスです。


フィールドの概要
protected  Vector<UndoableEdit> edits
          この CompoundEdit によりまとめて元に戻す/再実行する処理を施された UndoableEdit のコレクションです。
 
クラス javax.swing.undo.AbstractUndoableEdit から継承されたフィールド
RedoName, UndoName
 
コンストラクタの概要
CompoundEdit()
           
 
メソッドの概要
 boolean addEdit(UndoableEdit anEdit)
          この編集結果が inProgress である場合、anEdit を受け付けて true を返します。
 boolean canRedo()
          isInProgress が false である場合、またはスーパークラスが false を返す場合は false を返します。
 boolean canUndo()
          isInProgress が false である場合、またはスーパークラスが false を返す場合は false を返します。
 void die()
          各編集結果に対して、それが追加されたときと逆の順序で die を送ります。
 void end()
          inProgress を false に設定します。
 String getPresentationName()
          edit に最後に追加された UndoableEdit から、getPresentationName を返します。
 String getRedoPresentationName()
          edit に最後に追加された UndoableEdit から、getRedoPresentationName を返します。
 String getUndoPresentationName()
          edit に最後に追加された UndoableEdit から、getUndoPresentationName を返します。
 boolean isInProgress()
          この編集結果が進行中の場合、つまり、まだ終了指示を受け取っていない場合に、true を返します。
 boolean isSignificant()
          複数の edit のうちいずれかの UndoableEdit が true を返す場合に true を返します。
protected  UndoableEdit lastEdit()
          複数の edit のうち最後の UndoableEdit を返します。
 void redo()
          格納されているすべての UndoableEdit に、追加したときと同じ順序で redo を送ります。
 String toString()
          このオブジェクトのプロパティーを表示および識別する文字列を返します。
 void undo()
          格納されているすべての UndoableEdit に、追加したときと逆の順序で undo を送ります。
 
クラス javax.swing.undo.AbstractUndoableEdit から継承されたメソッド
replaceEdit
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

edits

protected Vector<UndoableEdit> edits
この CompoundEdit によりまとめて元に戻す/再実行する処理を施された UndoableEdit のコレクションです。

コンストラクタの詳細

CompoundEdit

public CompoundEdit()
メソッドの詳細

undo

public void undo()
          throws CannotUndoException
格納されているすべての UndoableEdit に、追加したときと逆の順序で undo を送ります。

定義:
インタフェース UndoableEdit 内の undo
オーバーライド:
クラス AbstractUndoableEdit 内の undo
例外:
CannotUndoException - canUndofalse を返す場合
関連項目:
AbstractUndoableEdit.canUndo()

redo

public void redo()
          throws CannotRedoException
格納されているすべての UndoableEdit に、追加したときと同じ順序で redo を送ります。

定義:
インタフェース UndoableEdit 内の redo
オーバーライド:
クラス AbstractUndoableEdit 内の redo
例外:
CannotRedoException - canRedofalse を返す場合
関連項目:
AbstractUndoableEdit.canRedo()

lastEdit

protected UndoableEdit lastEdit()
複数の edit のうち最後の UndoableEdit を返します。edit が空の場合は null を返します。


die

public void die()
各編集結果に対して、それが追加されたときと逆の順序で die を送ります。

定義:
インタフェース UndoableEdit 内の die
オーバーライド:
クラス AbstractUndoableEdit 内の die
関連項目:
die()

addEdit

public boolean addEdit(UndoableEdit anEdit)
この編集結果が inProgress である場合、anEdit を受け付けて true を返します。  

この CompoundEdit に追加された最後の編集結果は、addEdit(anEdit) を実行する機会を与えられます。その編集結果が拒否する (false を返す) と、anEdit が最後の編集結果に対して replaceEdit を実行する機会を与えられます。ここで anEdit が false を返すと、edit に追加されます。

定義:
インタフェース UndoableEdit 内の addEdit
オーバーライド:
クラス AbstractUndoableEdit 内の addEdit
パラメータ:
anEdit - 追加される編集結果
戻り値:
編集結果が inProgress の場合は true、そうでない場合は false を返す
関連項目:
UndoableEdit.addEdit(javax.swing.undo.UndoableEdit)

end

public void end()
inProgress を false に設定します。

関連項目:
canUndo(), canRedo()

canUndo

public boolean canUndo()
isInProgress が false である場合、またはスーパークラスが false を返す場合は false を返します。

定義:
インタフェース UndoableEdit 内の canUndo
オーバーライド:
クラス AbstractUndoableEdit 内の canUndo
戻り値:
この編集結果が alive で、 hasBeenDonetrue である場合は true
関連項目:
isInProgress()

canRedo

public boolean canRedo()
isInProgress が false である場合、またはスーパークラスが false を返す場合は false を返します。

定義:
インタフェース UndoableEdit 内の canRedo
オーバーライド:
クラス AbstractUndoableEdit 内の canRedo
戻り値:
この編集結果が alive で、hasBeenDonefalse である場合は true
関連項目:
isInProgress()

isInProgress

public boolean isInProgress()
この編集結果が進行中の場合、つまり、まだ終了指示を受け取っていない場合に、true を返します。これは通常、edits がまだ追加中であることを意味します。

関連項目:
end()

isSignificant

public boolean isSignificant()
複数の edit のうちいずれかの UndoableEdit が true を返す場合に true を返します。すべてが false を返す場合は false を返します。

定義:
インタフェース UndoableEdit 内の isSignificant
オーバーライド:
クラス AbstractUndoableEdit 内の isSignificant
戻り値:
true
関連項目:
UndoableEdit.isSignificant()

getPresentationName

public String getPresentationName()
edit に最後に追加された UndoableEdit から、getPresentationName を返します。edits が空の場合、スーパークラスを呼び出します。

定義:
インタフェース UndoableEdit 内の getPresentationName
オーバーライド:
クラス AbstractUndoableEdit 内の getPresentationName
戻り値:
空の文字列 ""
関連項目:
AbstractUndoableEdit.getUndoPresentationName(), AbstractUndoableEdit.getRedoPresentationName()

getUndoPresentationName

public String getUndoPresentationName()
edit に最後に追加された UndoableEdit から、getUndoPresentationName を返します。edits が空の場合、スーパークラスを呼び出します。

定義:
インタフェース UndoableEdit 内の getUndoPresentationName
オーバーライド:
クラス AbstractUndoableEdit 内の getUndoPresentationName
戻り値:
getPresentationName が "" でない場合は、 キー AbstractUndoableEdit.undoText を使って デフォルトテーブルから取得した値に、空白文字と getPresentationName を 追加した値。そうでない場合は デフォルトの値だけが返される
関連項目:
AbstractUndoableEdit.getPresentationName()

getRedoPresentationName

public String getRedoPresentationName()
edit に最後に追加された UndoableEdit から、getRedoPresentationName を返します。edits が空の場合、スーパークラスを呼び出します。

定義:
インタフェース UndoableEdit 内の getRedoPresentationName
オーバーライド:
クラス AbstractUndoableEdit 内の getRedoPresentationName
戻り値:
getPresentationName が "" でない場合は、 キー AbstractUndoableEdit.redoText を使って デフォルトテーブルから取得した値に、空白文字と getPresentationName を 追加した値。そうでない場合は デフォルトの値だけが返される
関連項目:
AbstractUndoableEdit.getPresentationName()

toString

public String toString()
このオブジェクトのプロパティーを表示および識別する文字列を返します。

オーバーライド:
クラス AbstractUndoableEdit 内の toString
戻り値:
このオブジェクトの文字列表現

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2009 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。