Serializable
, EventListener
, TreeModelListener
public class UndoHistory extends Object implements TreeModelListener, Serializable
Modifier and Type | Class | Description |
---|---|---|
static interface |
UndoHistory.HistoryListener |
Interface to be implemented by components interested in UndoHistory
|
Constructor | Description |
---|---|
UndoHistory() |
Modifier and Type | Method | Description |
---|---|---|
void |
add(JMeterTreeModel treeModel,
String comment) |
Add tree model copy to the history
|
boolean |
canRedo() |
|
boolean |
canUndo() |
|
void |
clear() |
Clears the undo history
|
void |
moveInHistory(int offset,
JMeterTreeModel acceptorModel) |
Goes through undo history, changing GUI
|
void |
registerHistoryListener(UndoHistory.HistoryListener listener) |
Register HistoryListener
|
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
|
public void clear()
public void add(JMeterTreeModel treeModel, String comment)
This method relies on the rule that the record in history made AFTER change has been made to test plan
treeModel
- JMeterTreeModelcomment
- Stringpublic void moveInHistory(int offset, JMeterTreeModel acceptorModel)
offset
- the direction to go to, usually -1 for undo or 1 for redoacceptorModel
- TreeModel to accept the changespublic boolean canRedo()
public boolean canUndo()
public void treeNodesChanged(TreeModelEvent tme)
treeNodesChanged
in interface TreeModelListener
tme
- TreeModelEvent
with event detailspublic void treeNodesInserted(TreeModelEvent tme)
treeNodesInserted
in interface TreeModelListener
tme
- TreeModelEvent
with event detailspublic void treeNodesRemoved(TreeModelEvent tme)
treeNodesRemoved
in interface TreeModelListener
tme
- TreeModelEvent
with event detailspublic void treeStructureChanged(TreeModelEvent tme)
treeStructureChanged
in interface TreeModelListener
tme
- TreeModelEvent
with event detailspublic void registerHistoryListener(UndoHistory.HistoryListener listener)
listener
- to add to our listenersCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.