Interface DynamicMenuContent

All Known Implementing Classes:
Actions.MenuItem, Actions.SubMenu, JInlineMenu

public interface DynamicMenuContent

Dynamic result of a Presenter.Menu or Presenter.Popup. If the presenters return an instance of DynamicMenuContent, then the framework code will use it's methods to populate the menu and keep it uptodate.

org.openide.awt 6.5

Method Summary
 JComponent[] getMenuPresenters()
          Create main menu/popup menuitems.
 JComponent[] synchMenuPresenters(JComponent[] items)
          update main menu presenters.

Method Detail


public JComponent[] getMenuPresenters()
Create main menu/popup menuitems. Null values will be later replaced by JSeparators. This method is called for popups and for menus. It's called each time a popup menu is contructed and just once for the main menu. Main menu updates happen through the synchMenuPresenters() method. If you want different behaviour for menu and popup, use a different implementation returned by Presenter.Popup and Presenter.Menu.


public JComponent[] synchMenuPresenters(JComponent[] items)
update main menu presenters. This method is called only by the main menu processing.

items - the previously used menuitems returned by previous call to getMenuPresenters() or synchMenuPresenters()
a new set of items to show in menu. Can be either an updated old set of instances or a completely new one.


Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.