Package org.apache.jmeter.gui
Class UndoHistory
java.lang.Object
org.apache.jmeter.gui.UndoHistory
- All Implemented Interfaces:
- Serializable,- EventListener,- TreeModelListener
This class serves storing Test Tree state and navigating through it
 to give the undo/redo ability for test plan changes
- Since:
- 2.12
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to be implemented by components interested in UndoHistory
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(JMeterTreeModel treeModel, String comment) Add tree model copy to the historybooleancanRedo()booleancanUndo()voidclear()Clears the undo historystatic booleanvoidredo()voidRegister HistoryListenervoidRecord the changes in the node as the undo stepvoidRecord adding nodes as the undo stepvoidRecord deleting nodes as the undo stepvoidRecord some other changevoidundo()
- 
Constructor Details- 
UndoHistorypublic UndoHistory()
 
- 
- 
Method Details- 
clearpublic void clear()Clears the undo history
- 
addAdd tree model copy to the historyThis method relies on the rule that the record in history made AFTER change has been made to test plan - Parameters:
- treeModel- JMeterTreeModel
- comment- String
 
- 
undopublic void undo()
- 
redopublic void redo()
- 
canRedopublic boolean canRedo()- Returns:
- true if remaining items
 
- 
canUndopublic boolean canUndo()- Returns:
- true if not at first element
 
- 
treeNodesChangedRecord the changes in the node as the undo step- Specified by:
- treeNodesChangedin interface- TreeModelListener
- Parameters:
- tme-- TreeModelEventwith event details
 
- 
treeNodesInsertedRecord adding nodes as the undo step- Specified by:
- treeNodesInsertedin interface- TreeModelListener
- Parameters:
- tme-- TreeModelEventwith event details
 
- 
treeNodesRemovedRecord deleting nodes as the undo step- Specified by:
- treeNodesRemovedin interface- TreeModelListener
- Parameters:
- tme-- TreeModelEventwith event details
 
- 
treeStructureChangedRecord some other change- Specified by:
- treeStructureChangedin interface- TreeModelListener
- Parameters:
- tme-- TreeModelEventwith event details
 
- 
isEnabledpublic static boolean isEnabled()- Returns:
- true if history is enabled
 
- 
registerHistoryListenerRegister HistoryListener- Parameters:
- listener- to add to our listeners
 
 
-