org.openide.awt 6.7.22

org.openide.awt
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.

Since:
org.openide.awt 6.5

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

Method Detail

getMenuPresenters

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.


synchMenuPresenters

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

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

org.openide.awt 6.7.22

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