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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface to be implemented by components interested in UndoHistory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(JMeterTreeModel treeModel, String comment) Add tree model copy to the historyboolean
canRedo()
boolean
canUndo()
void
clear()
Clears the undo historyvoid
moveInHistory
(int offset, JMeterTreeModel acceptorModel) Goes through undo history, changing GUIvoid
Register HistoryListenervoid
Record the changes in the node as the undo stepvoid
Record adding nodes as the undo stepvoid
Record deleting nodes as the undo stepvoid
Record some other change
-
Constructor Details
-
UndoHistory
public UndoHistory()
-
-
Method Details
-
clear
public void clear()Clears the undo history -
add
Add 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
- JMeterTreeModelcomment
- String
-
moveInHistory
Goes through undo history, changing GUI- Parameters:
offset
- the direction to go to, usually -1 for undo or 1 for redoacceptorModel
- TreeModel to accept the changes
-
canRedo
public boolean canRedo()- Returns:
- true if remaing items
-
canUndo
public boolean canUndo()- Returns:
- true if not at first element
-
treeNodesChanged
Record the changes in the node as the undo step- Specified by:
treeNodesChanged
in interfaceTreeModelListener
- Parameters:
tme
-TreeModelEvent
with event details
-
treeNodesInserted
Record adding nodes as the undo step- Specified by:
treeNodesInserted
in interfaceTreeModelListener
- Parameters:
tme
-TreeModelEvent
with event details
-
treeNodesRemoved
Record deleting nodes as the undo step- Specified by:
treeNodesRemoved
in interfaceTreeModelListener
- Parameters:
tme
-TreeModelEvent
with event details
-
treeStructureChanged
Record some other change- Specified by:
treeStructureChanged
in interfaceTreeModelListener
- Parameters:
tme
-TreeModelEvent
with event details
-
registerHistoryListener
Register HistoryListener- Parameters:
listener
- to add to our listeners
-