## org.apache.batik.apps.svgbrowser
Class DropDownHistoryModel

    java.lang.Object
      org.apache.batik.apps.svgbrowser.DropDownHistoryModel

All Implemented Interfaces:
  DropDownComponent.ScrollablePopupMenuModel

Direct Known Subclasses:
  DropDownHistoryModel.RedoPopUpMenuModel, DropDownHistoryModel.UndoPopUpMenuModel

    public class DropDownHistoryModel

extends java.lang.Object
implements DropDownComponent.ScrollablePopupMenuModel

The history scrollable popup menu model. Used for undo / redo drop down components.

Nested Class Summary
`static class` `DropDownHistoryModel.RedoPopUpMenuModel` The redo pop up menu model.
`static class` `DropDownHistoryModel.UndoPopUpMenuModel` The undo pop up menu model.

Field Summary
`protected HistoryBrowserInterface` `historyBrowserInterface` The history browser interface.
`protected java.util.ArrayList` `items` Scrollable popup menu items.
`protected DropDownComponent.ScrollablePopupMenu` `parent` The parent scrollable popup menu.

Constructor Summary
`DropDownHistoryModel(DropDownComponent.ScrollablePopupMenu parent, HistoryBrowserInterface historyBrowserInterface)` Creates the history pop up menu model.

Method Summary
`protected void` `addItem(DropDownComponent.ScrollablePopupMenuItem item, java.lang.String details)` Adds the ScrollablePopupMenuItem to the item list and to the parent.
`protected void` `clearAllScrollablePopupMenuItems(java.lang.String details)` Removes all scrollable popup menu items from the items list and from the parent pop up menu.
`DropDownComponent.ScrollablePopupMenuItem` `createItem(java.lang.String itemName)` Creates the ScrollablePopupMenuItem with the specific name.
`java.lang.String` `getFooterText()` Gets the footer text.
`void` `processAfterShowed()` Processes the showing of the pop up menu.
`void` `processBeforeShowed()` Processes the showing of the pop up menu.
`void` `processItemClicked()` Processes click on the pop up menu item.
`protected boolean` `removeFirstScrollablePopupMenuItem(java.lang.String details)` Removes the first scrollable popup menu item from the items list and from the parent pop up menu.
`protected void` `removeItem(DropDownComponent.ScrollablePopupMenuItem item, java.lang.String details)` Removes the ScrollablePopupMenuItem from the item list and from the parent.
`protected boolean` `removeLastScrollablePopupMenuItem(java.lang.String details)` Removes the last scrollable popup menu item from the items list and from the parent pop up menu.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### items

    protected java.util.ArrayList items

  Scrollable popup menu items.

### historyBrowserInterface

    protected HistoryBrowserInterface historyBrowserInterface

  The history browser interface.

### parent

    protected DropDownComponent.ScrollablePopupMenu parent

  The parent scrollable popup menu.

Constructor Detail

### DropDownHistoryModel

    public DropDownHistoryModel(DropDownComponent.ScrollablePopupMenu parent,
                                HistoryBrowserInterface historyBrowserInterface)

  Creates the history pop up menu model.

  Parameters:
    `parent` - The parent ScrollablePopupMenu
    `historyBrowserInterface` - The historyBrowserInterface. Used to update the parent pop up menu when the HistoryBrowser fires the events

Method Detail

### getFooterText

    public java.lang.String getFooterText()

  Gets the footer text.

  Specified by:
    `getFooterText` in interface `DropDownComponent.ScrollablePopupMenuModel`
  Returns:
    footer text

### createItem

    public DropDownComponent.ScrollablePopupMenuItem createItem(java.lang.String itemName)

  Creates the ScrollablePopupMenuItem with the specific name.

  Parameters:
    `itemName` - the name of the item
  Returns:
    the item

### addItem

    protected void addItem(DropDownComponent.ScrollablePopupMenuItem item,
                           java.lang.String details)

  Adds the ScrollablePopupMenuItem to the item list and to the parent. Fires the event 'itemsWereAdded' on the parent pop up menu

  Parameters:
    `item` - The item to add
    `details` - The details for the 'itemsWereAdded' event

### removeItem

    protected void removeItem(DropDownComponent.ScrollablePopupMenuItem item,
                              java.lang.String details)

  Removes the ScrollablePopupMenuItem from the item list and from the parent. Fires the event 'itemsWereRemoved' on the parent pop up menu

  Parameters:
    `item` - The item to remove
    `details` - The details for the 'itemsWereRemoved' event

### removeLastScrollablePopupMenuItem

    protected boolean removeLastScrollablePopupMenuItem(java.lang.String details)

  Removes the last scrollable popup menu item from the items list and from the parent pop up menu.

  Parameters:
    `details` - The details for the 'itemsWereRemoved' event
  Returns:
    True if item was successfully removed

### removeFirstScrollablePopupMenuItem

    protected boolean removeFirstScrollablePopupMenuItem(java.lang.String details)

  Removes the first scrollable popup menu item from the items list and from the parent pop up menu.

  Parameters:
    `details` - The details for the 'itemsWereRemoved' event
  Returns:
    True if item was successfully removed

### clearAllScrollablePopupMenuItems

    protected void clearAllScrollablePopupMenuItems(java.lang.String details)

  Removes all scrollable popup menu items from the items list and from the parent pop up menu.

  Parameters:
    `details` - The details for the event

### processItemClicked

    public void processItemClicked()

  Processes click on the pop up menu item.

  Specified by:
    `processItemClicked` in interface `DropDownComponent.ScrollablePopupMenuModel`

### processBeforeShowed

    public void processBeforeShowed()

  Description copied from interface: `DropDownComponent.ScrollablePopupMenuModel`
  Processes the showing of the pop up menu. Invoked before showing the pop up menu

  Specified by:
    `processBeforeShowed` in interface `DropDownComponent.ScrollablePopupMenuModel`

### processAfterShowed

    public void processAfterShowed()

  Description copied from interface: `DropDownComponent.ScrollablePopupMenuModel`
  Processes the showing of the pop up menu. Invoked after showing the pop up menu

  Specified by:
    `processAfterShowed` in interface `DropDownComponent.ScrollablePopupMenuModel`

Copyright © 2008 Apache Software Foundation. All Rights Reserved.