Package weka.gui

# Class GenericObjectEditorHistory

java.lang.Object
weka.gui.GenericObjectEditorHistory

All Implemented Interfaces:
  `Serializable`

public class GenericObjectEditorHistory extends Object implements 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:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `GenericObjectEditorHistory.HistorySelectionEvent`
  Event that gets sent when a history item gets selected.
  `static interface`
  `GenericObjectEditorHistory.HistorySelectionListener`
  Interface for classes that listen to selections of history items.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `MAX_HISTORY_COUNT`
  the maximum entries in the history.
  `static final int`
  `MAX_HISTORY_LENGTH`
  the maximum length of a caption in the history.
  `static final int`
  `MAX_LINE_LENGTH`
  the menu max line length.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericObjectEditorHistory()`
  Initializes the history.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Object obj)`
  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.
  `Vector<Object>`
  `getHistory()`
  Returns the current history.
  `int`
  `size()`
  Returns the number of entries in the history.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### MAX_HISTORY_COUNT

    public static final int MAX_HISTORY_COUNT
    the maximum entries in the history.
    See Also:
      - Constant Field Values

  - ### MAX_HISTORY_LENGTH

    public static final int MAX_HISTORY_LENGTH
    the maximum length of a caption in the history.
    See Also:
      - Constant Field Values

  - ### MAX_LINE_LENGTH

    public static final int MAX_LINE_LENGTH
    the menu max line length.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### GenericObjectEditorHistory

    public GenericObjectEditorHistory()
    Initializes the history.

- ## Method Details

  - ### clear

    public void clear()
    Clears the history.

  - ### add

    public void add(Object obj)
    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

    public Vector<Object> 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 to
      `current` - the current object
      `listener` - the listener to attach to the menu items' ActionListener