org.argouml.ui.cmd
Class LastRecentlyUsedMenuList

java.lang.Object
  extended byorg.argouml.ui.cmd.LastRecentlyUsedMenuList

public class LastRecentlyUsedMenuList
extends Object

menu extension for last recently used files menu functionality: it is created with a link to the (file-)menu, if it is created it is reading its content from config information the add entry method adds a specific filename to the list, ensures that it bubbles at top of list if it is already member of list typically called by SaveFile method LRU is added at the specific position at creation time and all entries are going to be inserted or deletied

Since:
9. November 2003 (0.15.2)

Field Summary
private  ConfigurationKey[] confKeys
          Array of conf keys for accessing the stored entries
private  JMenu fileMenu
          menu where the list is bound to
private  int lruCount
          recent loaded count
private  int maxCount
          maxcount read from configuration
private  int maxCountDefault
          default value for maxcount if there is no configuration
private  int menuIndex
          index where the menu entries should be inserted -1 to be sure (adds at end)
private  JMenuItem[] menuItems
          menuitems actually created and added to menu
 
Constructor Summary
LastRecentlyUsedMenuList(JMenu filemenu)
          Creates a new instance of LastRecentlyUsedMenuList with respect to the menu where the lru is bound to
 
Method Summary
 void addEntry(String filename)
          Adds a new entry to lru list and removes the last one if if it increases maxCount
private  JMenuItem addEventHandler(String filename, int addAt)
          Adds the eventhandler to the menu and renames the entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxCountDefault

private final int maxCountDefault
default value for maxcount if there is no configuration

See Also:
Constant Field Values

fileMenu

private JMenu fileMenu
menu where the list is bound to


lruCount

private int lruCount
recent loaded count


maxCount

private int maxCount
maxcount read from configuration


menuIndex

private int menuIndex
index where the menu entries should be inserted -1 to be sure (adds at end)


menuItems

private JMenuItem[] menuItems
menuitems actually created and added to menu


confKeys

private ConfigurationKey[] confKeys
Array of conf keys for accessing the stored entries

Constructor Detail

LastRecentlyUsedMenuList

public LastRecentlyUsedMenuList(JMenu filemenu)
Creates a new instance of LastRecentlyUsedMenuList with respect to the menu where the lru is bound to

Parameters:
filemenu - at this menu the lru is bound after last entry it is added with a separator
Method Detail

addEventHandler

private JMenuItem addEventHandler(String filename,
                                  int addAt)
Adds the eventhandler to the menu and renames the entry


addEntry

public void addEntry(String filename)
Adds a new entry to lru list and removes the last one if if it increases maxCount

Parameters:
filename - name of link which is to be used to represent _and_ reopen the file


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook