Class Undo
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.feature.Undo
-
- All Implemented Interfaces:
ActionListener
,EventListener
,UndoableEditListener
,DocumentPanelListener
public final class Undo extends ViewerFeature implements ActionListener, UndoableEditListener, DocumentPanelListener
This features adds an "Undo" and "Redo" entry to the Edit menu, which interfaces with theDocumentPanel.fireUndoableEditEvent(javax.swing.event.UndoableEditEvent)
method to provide undo/redo across the Document. The name of this feature is UndoThis code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
- Since:
- 2.11.19
-
-
Field Summary
Fields Modifier and Type Field Description static UndoableEdit
DISCARD
An UndableEdit which can be passed intoDocumentPanel.fireUndoableEditEvent(javax.swing.event.UndoableEditEvent)
to clear the list.
-
Constructor Summary
Constructors Constructor Description Undo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
documentUpdated(DocumentPanelEvent event)
Called when anDocumentPanelEvent
is raisedvoid
initialize(PDFViewer viewer)
Called when the feature is first added to a viewervoid
redo(DocumentPanel panel)
Perform a redo action on the specified panelvoid
undo(DocumentPanel panel)
Perform an undo action on the specified panelvoid
undoableEditHappened(UndoableEditEvent event)
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown, toString
-
-
-
-
Field Detail
-
DISCARD
public static final UndoableEdit DISCARD
An UndableEdit which can be passed intoDocumentPanel.fireUndoableEditEvent(javax.swing.event.UndoableEditEvent)
to clear the list. This should be done when the list needs to be cleared, due to an action on the Document that permanently changes the state of the PDF.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
-
undo
public void undo(DocumentPanel panel)
Perform an undo action on the specified panel
-
redo
public void redo(DocumentPanel panel)
Perform a redo action on the specified panel
-
initialize
public void initialize(PDFViewer viewer)
Description copied from class:ViewerFeature
Called when the feature is first added to a viewer- Overrides:
initialize
in classViewerFeature
-
documentUpdated
public void documentUpdated(DocumentPanelEvent event)
Description copied from interface:DocumentPanelListener
Called when anDocumentPanelEvent
is raised- Specified by:
documentUpdated
in interfaceDocumentPanelListener
-
undoableEditHappened
public void undoableEditHappened(UndoableEditEvent event)
- Specified by:
undoableEditHappened
in interfaceUndoableEditListener
-
-