|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.ui.swt.MenuBuildUtils
public class MenuBuildUtils
A class which helps generate build SWT menus. It provides two main functions. The first provides the ability to create regenerateable menus (it will dispose old items when not displayed and invoke a callback method to regenerate it). The second provides the ability to create SWT menus based on the plugin API for menu creation - this allows internal code that generates menus to include plugins to append to their own internal menus.
Nested Class Summary | |
---|---|
static interface |
MenuBuildUtils.ChatKeyResolver
|
static interface |
MenuBuildUtils.MenuBuilder
An interface to be used for addMaintenanceListenerForMenu. |
static class |
MenuBuildUtils.MenuItemPluginMenuControllerImpl
This is an implementation of the PluginMenuController interface for use with MenuItemImpl classes - note that this is not intended for use by subclasses of MenuItemImpl (like TableContextMenuItemImpl). |
static interface |
MenuBuildUtils.PluginMenuController
This is an interface used by addPluginMenuItems. |
Field Summary | |
---|---|
static MenuBuildUtils.PluginMenuController |
BASIC_MENU_ITEM_CONTROLLER
An instance of MenuItemPluginMenuControllerImpl with a default value of null - this will be the value passed when notifying selection and fill listeners. |
Constructor Summary | |
---|---|
MenuBuildUtils()
|
Method Summary | |
---|---|
static MenuItem |
addChatMenu(MenuManager menu_manager,
MenuItem chat_item,
MenuBuildUtils.ChatKeyResolver chat_key_resolver)
|
static void |
addChatMenu(org.eclipse.swt.widgets.Menu menu,
java.lang.String menu_resource_key,
java.lang.String chat_key)
|
static void |
addMaintenanceListenerForMenu(org.eclipse.swt.widgets.Menu menu,
MenuBuildUtils.MenuBuilder builder)
Creates and adds a listener object to implement regeneratable menus. |
static void |
addPluginMenuItems(MenuItem[] items,
org.eclipse.swt.widgets.Menu parent,
boolean prev_was_separator,
boolean enable_items,
MenuBuildUtils.PluginMenuController controller)
Creates menu items inside the given menu based on the plugin API MenuItem instances provided. |
static java.util.List<java.lang.Object> |
splitLongMenuListIntoHierarchy(java.util.List<java.lang.String> flat_entries,
int split_after)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MenuBuildUtils.PluginMenuController BASIC_MENU_ITEM_CONTROLLER
Constructor Detail |
---|
public MenuBuildUtils()
Method Detail |
---|
public static void addMaintenanceListenerForMenu(org.eclipse.swt.widgets.Menu menu, MenuBuildUtils.MenuBuilder builder)
public static void addPluginMenuItems(MenuItem[] items, org.eclipse.swt.widgets.Menu parent, boolean prev_was_separator, boolean enable_items, MenuBuildUtils.PluginMenuController controller)
items
- The list of plugin MenuItem to addparent
- The SWT Menu to add to.prev_was_separator
- Indicates if the previous item in the menu is
a separator or notenable_items
- Indicates whether you want generated items to be
enabled or not. If false, all items will be disabled. If true,
then the items *may* be enabled, depending on how each MenuItem
is configured.controller
- The callback object used by this method when creating the
SWT menus (used for invoking fill and selection listeners).public static java.util.List<java.lang.Object> splitLongMenuListIntoHierarchy(java.util.List<java.lang.String> flat_entries, int split_after)
flat_entries
- Overall list of menu entry namessplit_after
- Split if more than this
public static void addChatMenu(org.eclipse.swt.widgets.Menu menu, java.lang.String menu_resource_key, java.lang.String chat_key)
public static MenuItem addChatMenu(MenuManager menu_manager, MenuItem chat_item, MenuBuildUtils.ChatKeyResolver chat_key_resolver)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |