📄 undomanager.html
字号:
</DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/UndoManager.html#canUndoOrRedo()"><CODE>canUndoOrRedo()</CODE></A>, <A HREF="../../../javax/swing/undo/UndoManager.html#getUndoOrRedoPresentationName()"><CODE>getUndoOrRedoPresentationName()</CODE></A></DL></DD></DL><HR><A NAME="canUndoOrRedo()"><!-- --></A><H3>canUndoOrRedo</H3><PRE>public boolean <B>canUndoOrRedo</B>()</PRE><DL><DD>Return true if calling undoOrRedo will undo or redo. Suitable for deciding to enable a command that toggles between the two functions, which only makes sense to use if limit == 1.<DD><DL></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/UndoManager.html#undoOrRedo()"><CODE>undoOrRedo()</CODE></A></DL></DD></DL><HR><A NAME="undo()"><!-- --></A><H3>undo</H3><PRE>public void <B>undo</B>() throws <A HREF="../../../javax/swing/undo/CannotUndoException.html">CannotUndoException</A></PRE><DL><DD>If this UndoManager is inProgress, undo the last significant UndoableEdit before indexOfNextAdd, and all insignificant edits back to it. Updates indexOfNextAdd accordingly. <p>If not inProgress, indexOfNextAdd is ignored and super's routine is called.</p><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#undo()">undo</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#end()"><CODE>CompoundEdit.end()</CODE></A></DL></DD></DL><HR><A NAME="canUndo()"><!-- --></A><H3>canUndo</H3><PRE>public boolean <B>canUndo</B>()</PRE><DL><DD>Overridden to preserve usual semantics: returns true if an undo operation would be successful now, false otherwise<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#canUndo()">canUndo</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD>Following copied from class: <CODE>javax.swing.undo.CompoundEdit</CODE></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#isInProgress()"><CODE>CompoundEdit.isInProgress()</CODE></A></DL></DD></DL><HR><A NAME="redo()"><!-- --></A><H3>redo</H3><PRE>public void <B>redo</B>() throws <A HREF="../../../javax/swing/undo/CannotRedoException.html">CannotRedoException</A></PRE><DL><DD>If this UndoManager is inProgress, redoes the last significant UndoableEdit at indexOfNextAdd or after, and all insignificant edits up to it. Updates indexOfNextAdd accordingly. <p>If not inProgress, indexOfNextAdd is ignored and super's routine is called.</p><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#redo()">redo</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#end()"><CODE>CompoundEdit.end()</CODE></A></DL></DD></DL><HR><A NAME="canRedo()"><!-- --></A><H3>canRedo</H3><PRE>public boolean <B>canRedo</B>()</PRE><DL><DD>Overridden to preserve usual semantics: returns true if a redo operation would be successful now, false otherwise<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#canRedo()">canRedo</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD>Following copied from class: <CODE>javax.swing.undo.CompoundEdit</CODE></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#isInProgress()"><CODE>CompoundEdit.isInProgress()</CODE></A></DL></DD></DL><HR><A NAME="addEdit(javax.swing.undo.UndoableEdit)"><!-- --></A><H3>addEdit</H3><PRE>public boolean <B>addEdit</B>(<A HREF="../../../javax/swing/undo/UndoableEdit.html">UndoableEdit</A> anEdit)</PRE><DL><DD>If inProgress, inserts anEdit at indexOfNextAdd, and removes any old edits that were at indexOfNextAdd or later. The die method is called on each edit that is removed is sent, in the reverse of the order the edits were added. Updates indexOfNextAdd. <p>If not inProgress, acts as a CompoundEdit</p><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#addEdit(javax.swing.undo.UndoableEdit)">addEdit</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#end()"><CODE>CompoundEdit.end()</CODE></A>, <A HREF="../../../javax/swing/undo/CompoundEdit.html#addEdit(javax.swing.undo.UndoableEdit)"><CODE>CompoundEdit.addEdit(javax.swing.undo.UndoableEdit)</CODE></A></DL></DD></DL><HR><A NAME="end()"><!-- --></A><H3>end</H3><PRE>public void <B>end</B>()</PRE><DL><DD>Sending end() to an UndoManager turns it into a plain old (ended) CompoundEdit. <p> Calls super's end() method (making inProgress false), then sends die() to the unreachable edits at indexOfNextAdd and beyond, in the reverse of the order in which they were added.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#end()">end</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/CompoundEdit.html#end()"><CODE>CompoundEdit.end()</CODE></A></DL></DD></DL><HR><A NAME="getUndoOrRedoPresentationName()"><!-- --></A><H3>getUndoOrRedoPresentationName</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>getUndoOrRedoPresentationName</B>()</PRE><DL><DD>Return the appropriate name for a command that toggles between undo and redo. Only makes sense to use such a command if limit == 1 and we're not in progress.<DD><DL></DL></DD></DL><HR><A NAME="getUndoPresentationName()"><!-- --></A><H3>getUndoPresentationName</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>getUndoPresentationName</B>()</PRE><DL><DD>If inProgress, returns getUndoPresentationName of the significant edit that will be undone when undo() is invoked. If there is none, returns AbstractUndoableEdit.UndoName</p> <p>If not inProgress, acts as a CompoundEdit</p><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#getUndoPresentationName()">getUndoPresentationName</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/UndoManager.html#undo()"><CODE>undo()</CODE></A>, <A HREF="../../../javax/swing/undo/CompoundEdit.html#getUndoPresentationName()"><CODE>CompoundEdit.getUndoPresentationName()</CODE></A></DL></DD></DL><HR><A NAME="getRedoPresentationName()"><!-- --></A><H3>getRedoPresentationName</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>getRedoPresentationName</B>()</PRE><DL><DD>If inProgress, returns getRedoPresentationName of the significant edit that will be redone when redo() is invoked. If there is none, returns AbstractUndoableEdit.RedoName <p>If not inProgress, acts as a CompoundEdit</p><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#getRedoPresentationName()">getRedoPresentationName</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/UndoManager.html#redo()"><CODE>redo()</CODE></A>, <A HREF="../../../javax/swing/undo/CompoundEdit.html#getUndoPresentationName()"><CODE>CompoundEdit.getUndoPresentationName()</CODE></A></DL></DD></DL><HR><A NAME="undoableEditHappened(javax.swing.event.UndoableEditEvent)"><!-- --></A><H3>undoableEditHappened</H3><PRE>public void <B>undoableEditHappened</B>(<A HREF="../../../javax/swing/event/UndoableEditEvent.html">UndoableEditEvent</A> e)</PRE><DL><DD>Called by the UndoabledEdit sources this UndoManager listens to. Calls addEdit with e.getEdit().<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/event/UndoableEditListener.html#undoableEditHappened(javax.swing.event.UndoableEditEvent)">undoableEditHappened</A></CODE> in interface <CODE><A HREF="../../../javax/swing/event/UndoableEditListener.html">UndoableEditListener</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/undo/UndoManager.html#addEdit(javax.swing.undo.UndoableEdit)"><CODE>addEdit(javax.swing.undo.UndoableEdit)</CODE></A></DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string that displays and identifies this object's properties.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../../javax/swing/undo/CompoundEdit.html">CompoundEdit</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a String representation of this object</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/UndoManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/swing/undo/UndoableEditSupport.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="UndoManager.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#fields_inherited_from_class_javax.swing.undo.CompoundEdit">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -