站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

UndoRedo (NetBeans UI Utilities API) - NetBeans API Javadoc 5.5.1

org.openide.awt 6.7.31

org.openide.awt
Interface UndoRedo

All Known Implementing Classes:
UndoRedo.Empty, UndoRedo.Manager

public interface UndoRedo

Undo and Redo manager for top components and workspace elements. It allows UndoAction and RedoAction to listen to editing changes of active components and to changes in their ability to do undo and redo.

Related links:


Nested Class Summary
static class UndoRedo.Empty
          Deprecated. Use NONE rather than instantiating this.
static class UndoRedo.Manager
          An undo manager which fires a change event each time it consumes a new undoable edit.
 
Field Summary
static UndoRedo NONE
          Empty implementation that does not allow any undo or redo actions.
 
Method Summary
 void addChangeListener(ChangeListener l)
          Add a change listener.
 boolean canRedo()
          Test whether the component currently has undone edits which may be redone.
 boolean canUndo()
          Test whether the component currently has edits which may be undone.
 String getRedoPresentationName()
          Get a human-presentable name describing the redo operation.
 String getUndoPresentationName()
          Get a human-presentable name describing the undo operation.
 void redo()
          Redo a previously undone edit.
 void removeChangeListener(ChangeListener l)
          Remove a change listener.
 void undo()
          Undo an edit.
 

Field Detail

NONE

static final UndoRedo NONE
Empty implementation that does not allow any undo or redo actions.

Method Detail

canUndo

boolean canUndo()
Test whether the component currently has edits which may be undone.

Returns:
true if undo is allowed

canRedo

boolean canRedo()
Test whether the component currently has undone edits which may be redone.

Returns:
true if redo is allowed

undo

void undo()
          throws CannotUndoException
Undo an edit.

Throws:
CannotUndoException - if it fails

redo

void redo()
          throws CannotRedoException
Redo a previously undone edit.

Throws:
CannotRedoException - if it fails

addChangeListener

void addChangeListener(ChangeListener l)
Add a change listener. The listener will be notified every time the undo/redo ability of this object changes.

Parameters:
l - the listener to add

removeChangeListener

void removeChangeListener(ChangeListener l)
Remove a change listener.

Parameters:
l - the listener to remove
See Also:
addChangeListener(javax.swing.event.ChangeListener)

getUndoPresentationName

String getUndoPresentationName()
Get a human-presentable name describing the undo operation.

Returns:
the name

getRedoPresentationName

String getRedoPresentationName()
Get a human-presentable name describing the redo operation.

Returns:
the name

org.openide.awt 6.7.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.