Package weka.gui
Class GenericObjectEditorHistory
java.lang.Object
weka.gui.GenericObjectEditorHistory
- All Implemented Interfaces:
Serializable
A helper class for maintaining a history of objects selected in the GOE.
- Version:
- $Revision: 10216 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Event that gets sent when a history item gets selected.static interface
Interface for classes that listen to selections of history items. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
the maximum entries in the history.static final int
the maximum length of a caption in the history.static final int
the menu max line length. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the object to the history.void
clear()
Clears the history.void
customizePopupMenu
(JPopupMenu menu, Object current, GenericObjectEditorHistory.HistorySelectionListener listener) Adds a menu item with the history to the popup menu.Returns the current history.int
size()
Returns the number of entries in the history.
-
Field Details
-
MAX_HISTORY_COUNT
public static final int MAX_HISTORY_COUNTthe maximum entries in the history.- See Also:
-
MAX_HISTORY_LENGTH
public static final int MAX_HISTORY_LENGTHthe maximum length of a caption in the history.- See Also:
-
MAX_LINE_LENGTH
public static final int MAX_LINE_LENGTHthe menu max line length.- See Also:
-
-
Constructor Details
-
GenericObjectEditorHistory
public GenericObjectEditorHistory()Initializes the history.
-
-
Method Details
-
clear
public void clear()Clears the history. -
add
Adds the object to the history.- Parameters:
obj
- the object to add
-
size
public int size()Returns the number of entries in the history.- Returns:
- the size of the history
-
getHistory
Returns the current history.- Returns:
- the history
-
customizePopupMenu
public void customizePopupMenu(JPopupMenu menu, Object current, GenericObjectEditorHistory.HistorySelectionListener listener) Adds a menu item with the history to the popup menu.- Parameters:
menu
- the menu to add the history tocurrent
- the current objectlistener
- the listener to attach to the menu items' ActionListener
-