Package org.apache.jmeter.gui
Class UndoHistory
-
- All Implemented Interfaces:
-
java.io.Serializable
,java.util.EventListener
,javax.swing.event.TreeModelListener
public class UndoHistory implements TreeModelListener, Serializable
This class serves storing Test Tree state and navigating through it to give the undo/redo ability for test plan changes
- Since:
2.12
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
UndoHistory.HistoryListener
Interface to be implemented by components interested in UndoHistory
-
Constructor Summary
Constructors Constructor Description UndoHistory()
-
Method Summary
Modifier and Type Method Description void
clear()
Clears the undo history void
add(JMeterTreeModel treeModel, String comment)
Add tree model copy to the history This method relies on the rule that the record in history made AFTER change has been made to test plan void
undo()
void
redo()
boolean
canRedo()
boolean
canUndo()
void
treeNodesChanged(TreeModelEvent tme)
Record the changes in the node as the undo step void
treeNodesInserted(TreeModelEvent tme)
Record adding nodes as the undo step void
treeNodesRemoved(TreeModelEvent tme)
Record deleting nodes as the undo step void
treeStructureChanged(TreeModelEvent tme)
Record some other change static boolean
isEnabled()
void
registerHistoryListener(UndoHistory.HistoryListener listener)
Register HistoryListener -
-
Method Detail
-
clear
void clear()
Clears the undo history
-
add
void add(JMeterTreeModel treeModel, String comment)
Add tree model copy to the history
This method relies on the rule that the record in history made AFTER change has been made to test plan
- Parameters:
treeModel
- JMeterTreeModelcomment
- String
-
undo
void undo()
-
redo
void redo()
-
canRedo
boolean canRedo()
- Returns:
true if remaining items
-
canUndo
boolean canUndo()
- Returns:
true if not at first element
-
treeNodesChanged
void treeNodesChanged(TreeModelEvent tme)
Record the changes in the node as the undo step
- Parameters:
tme
- TreeModelEvent with event details
-
treeNodesInserted
void treeNodesInserted(TreeModelEvent tme)
Record adding nodes as the undo step
- Parameters:
tme
- TreeModelEvent with event details
-
treeNodesRemoved
void treeNodesRemoved(TreeModelEvent tme)
Record deleting nodes as the undo step
- Parameters:
tme
- TreeModelEvent with event details
-
treeStructureChanged
void treeStructureChanged(TreeModelEvent tme)
Record some other change
- Parameters:
tme
- TreeModelEvent with event details
-
isEnabled
static boolean isEnabled()
- Returns:
true if history is enabled
-
registerHistoryListener
void registerHistoryListener(UndoHistory.HistoryListener listener)
Register HistoryListener
- Parameters:
listener
- to add to our listeners
-
-
-
-