org.apache.batik.apps.svgbrowser

Class DropDownHistoryModel

public class DropDownHistoryModel extends Object implements DropDownComponent.ScrollablePopupMenuModel

The history scrollable popup menu model. Used for undo / redo drop down components.
Nested Class Summary
static classDropDownHistoryModel.RedoPopUpMenuModel
The redo pop up menu model.
static classDropDownHistoryModel.UndoPopUpMenuModel
The undo pop up menu model.
Field Summary
protected HistoryBrowserInterfacehistoryBrowserInterface
The history browser interface.
protected ArrayListitems
Scrollable popup menu items.
protected DropDownComponent.ScrollablePopupMenuparent
The parent scrollable popup menu.
Constructor Summary
DropDownHistoryModel(DropDownComponent.ScrollablePopupMenu parent, HistoryBrowserInterface historyBrowserInterface)
Creates the history pop up menu model.
Method Summary
protected voidaddItem(DropDownComponent.ScrollablePopupMenuItem item, String details)
Adds the ScrollablePopupMenuItem to the item list and to the parent.
protected voidclearAllScrollablePopupMenuItems(String details)
Removes all scrollable popup menu items from the items list and from the parent pop up menu.
DropDownComponent.ScrollablePopupMenuItemcreateItem(String itemName)
Creates the ScrollablePopupMenuItem with the specific name.
StringgetFooterText()
Gets the footer text.
voidprocessAfterShowed()
voidprocessBeforeShowed()
voidprocessItemClicked()
Processes click on the pop up menu item.
protected booleanremoveFirstScrollablePopupMenuItem(String details)
Removes the first scrollable popup menu item from the items list and from the parent pop up menu.
protected voidremoveItem(DropDownComponent.ScrollablePopupMenuItem item, String details)
Removes the ScrollablePopupMenuItem from the item list and from the parent.
protected booleanremoveLastScrollablePopupMenuItem(String details)
Removes the last scrollable popup menu item from the items list and from the parent pop up menu.

Field Detail

historyBrowserInterface

protected HistoryBrowserInterface historyBrowserInterface
The history browser interface.

items

protected ArrayList items
Scrollable popup menu items.

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

addItem

protected void addItem(DropDownComponent.ScrollablePopupMenuItem item, 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

clearAllScrollablePopupMenuItems

protected void clearAllScrollablePopupMenuItems(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

createItem

public DropDownComponent.ScrollablePopupMenuItem createItem(String itemName)
Creates the ScrollablePopupMenuItem with the specific name.

Parameters: itemName the name of the item

Returns: the item

getFooterText

public String getFooterText()
Gets the footer text.

Returns: footer text

processAfterShowed

public void processAfterShowed()

processBeforeShowed

public void processBeforeShowed()

processItemClicked

public void processItemClicked()
Processes click on the pop up menu item.

removeFirstScrollablePopupMenuItem

protected boolean removeFirstScrollablePopupMenuItem(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

removeItem

protected void removeItem(DropDownComponent.ScrollablePopupMenuItem item, 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(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

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.