|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.glazedlists.UndoSupport<E>
public final class UndoSupport<E>
This class adapts the generic UndoRedoSupport
provided by Glazed
Lists for specific use with Swing's native UndoManager
. Each
UndoRedoSupport.Edit
produced by Glazed List's
UndoRedoSupport
is adapted to Swing's UndoableEdit
interface
and then added
into the given UndoManager.
Fine grain control of the UndoableEdit
that is ultimately added
to the UndoableEdit
can be achieved by using
this
install
method and specifying a custom Function.
Method Summary | ||
---|---|---|
static
|
install(UndoManager undoManager,
EventList<E> source)
Installs support for undoing/redoing edits on the given source . |
|
static
|
install(UndoManager undoManager,
EventList<E> source,
FunctionList.Function<UndoRedoSupport.Edit,UndoableEdit> editAdapter)
Installs support for undoing/redoing edits on the given source . |
|
void |
uninstall()
This method removes undo/redo support from the EventList it was
installed on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <E> UndoSupport install(UndoManager undoManager, EventList<E> source)
source
. Specifically, UndoableEdit
s are added to the
undoManager
each time the source
changes.
Undoing
and redoing
these edits will unapply/reapply the corresponding changes to the
source
.
This method uses a default strategy for mapping the GL-style edits
to UndoableEdit
s.
undoManager
- the manager of all undoable edits for the entire Swing applicationsource
- the EventList to watch for undoable edits
IllegalStateException
- if this method is called from any Thread
other than the Swing Event Dispatch Threadpublic static <E> UndoSupport install(UndoManager undoManager, EventList<E> source, FunctionList.Function<UndoRedoSupport.Edit,UndoableEdit> editAdapter)
source
. Specifically, UndoableEdit
s are added to the
undoManager
each time the source
changes.
Undoing
and redoing
these edits will unapply/reapply the corresponding changes to the
source
.
This method uses the given editAdapter
for mapping the
GL-style edits to UndoableEdit
s.
undoManager
- the manager of all undoable edits for the entire Swing applicationsource
- the EventList to watch for undoable editseditAdapter
- the function that converts GL-style edits into Swing-style edits
IllegalStateException
- if this method is called from any Thread
other than the Swing Event Dispatch Threadpublic void uninstall()
EventList
it was
installed on. This method is useful when the EventList
must
outlive the undo/redo support itself. Calling this method will make
this support object available for garbage collection independently of
the EventList
of items.
IllegalStateException
- if this method is called from any Thread
other than the Swing Event Dispatch Thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |