Class MenuItemImpl
java.lang.Object
com.biglybt.pifimpl.local.ui.menus.MenuItemImpl
- All Implemented Interfaces:
MenuItem
- Direct Known Subclasses:
TableContextMenuItemImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MenuBuilderprivate CopyOnWriteListprivate Objectprivate Stringprivate booleanprivate CopyOnWriteListprivate Graphicprivate Stringprivate CopyOnWriteList<MenuItemListener> private CopyOnWriteListprivate MenuContextImplprivate intprivate MenuItemImplprivate PluginInterfaceprivate Stringprivate Stringprivate intprivate Stringprivate booleanFields inherited from interface MenuItem
HEADER_CONTENT, HEADER_CONTROL, HEADER_ORGANIZE, HEADER_OTHER, HEADER_SOCIAL, STYLE_CHECK, STYLE_MENU, STYLE_PUSH, STYLE_RADIO, STYLE_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionMenuItemImpl(PluginInterface _pi, String menuID, String key) MenuItemImpl(MenuItemImpl ti, String key) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddChildMenuItem(MenuItem child) voidaddFillListener(MenuItemFillListener listener) Adds a listener to be notified when the menu item is about to be displayed.voidAdds a selection listener for this menu item.voidAdds a selection listener for this menu item.getData()Get the current data value associated with the menu: Boolean for CHECK styleget the menu's graphicThe header that a top menu item will be placed under for the fancy menuGet the child item with the given resource key.intReturns the number of menu itemsMenuItem[]getItems()Get all child items currently associated with this MenuItem.Retrieve the menu ID that the menu item belongs tointRetrieve the parent MenuItem.Retrieve the resource key ("name") of this menu itemintgetStyle()Get the type of the menu itemgetText()Gets the text to display for this menu item.voidinvokeListenersMulti(Object[] rows) protected voidinvokeListenersOnList(CopyOnWriteList<MenuItemListener> listeners_to_notify, Object target) private voidvoidinvokeMenuWillBeShownListeners(Object target) booleanWhether or not this item is enabled or notbooleanReturns whether the menu item is selected or not.booleanReturns whether the menu item is visible or not.voidremove()Removes the menu item.voidRemoves all child menu items from this menu (if any exist).voidremoveFillListener(MenuItemFillListener listener) voidRemoves a selection listener from this menu item.voidRemoves a selection listener from this menu item.protected voidvoidsetContext(MenuContextImpl context) voidSet the current data value associated with the menu: Boolean for CHECK stylevoidsetDisposeWithUIDetach(String uiType) Auto-dispose of MenuItem when a specific UI is detached (See} for typesinvalid @link
{@link com.biglybt.pif.ui.UIInstance#UIT_*voidsetEnabled(boolean _enabled) Set the enabled status of the menu itemvoidsetGraphic(Graphic _graphic) set the menu item's iconvoidsetHeaderCategory(String header) Sets which header to place the menu item under for top level fancy menuvoidsetMinUserMode(int minUserMode) voidsetStyle(int _style) Set the style of the menu item (see STYLE_ constants)voidsetSubmenuBuilder(MenuBuilder builder) ForMenuItem.STYLE_MENU, builder is called when user wants to see the submenu items.voidSets the text to display for this menu item.voidsetVisible(boolean visible) Sets whether the menu item is visible or not.
-
Field Details
-
pi
-
sMenuID
-
sName
-
style
private int style -
enabled
private boolean enabled -
data
-
graphic
-
listeners
-
m_listeners
-
fill_listeners
-
children
-
parent
-
display_text
-
visible
private boolean visible -
builder
-
headerCategory
-
minUserMode
private int minUserMode -
uiType
-
-
Constructor Details
-
MenuItemImpl
-
-
Method Details
-
getResourceKey
Description copied from interface:MenuItemRetrieve the resource key ("name") of this menu item- Specified by:
getResourceKeyin interfaceMenuItem- Returns:
- resource key for this menu
-
getMenuID
Description copied from interface:MenuItemRetrieve the menu ID that the menu item belongs to- Specified by:
getMenuIDin interfaceMenuItem- Returns:
MenuManager.MENU_ constant.
-
getStyle
-
setStyle
-
getData
-
setData
-
isEnabled
-
setEnabled
public void setEnabled(boolean _enabled) Description copied from interface:MenuItemSet the enabled status of the menu item- Specified by:
setEnabledin interfaceMenuItem- Parameters:
_enabled-
-
setGraphic
Description copied from interface:MenuItemset the menu item's icon- Specified by:
setGraphicin interfaceMenuItem- Parameters:
_graphic-
-
getGraphic
Description copied from interface:MenuItemget the menu's graphic- Specified by:
getGraphicin interfaceMenuItem- Returns:
-
invokeMenuWillBeShownListeners
-
invokeListenersMulti
-
invokeListenersSingle
-
getParent
-
getItems
-
getItemCount
public int getItemCount()Description copied from interface:MenuItemReturns the number of menu items- Specified by:
getItemCountin interfaceMenuItem
-
getItem
-
getText
-
setText
-
invokeListenersOnList
protected void invokeListenersOnList(CopyOnWriteList<MenuItemListener> listeners_to_notify, Object target) -
remove
public void remove()Description copied from interface:MenuItemRemoves the menu item. Calling this will remove the item from the menus, as well as removing all listeners and removing all child menu items (if any exist). The behaviour of this object is undefined after this method has been called. If you need to interact with this object when you are about to destroy it, you should do it before you call the remove method. -
removeSelf
protected void removeSelf() -
removeAllChildItems
public void removeAllChildItems()Description copied from interface:MenuItemRemoves all child menu items from this menu (if any exist).- Specified by:
removeAllChildItemsin interfaceMenuItem
-
isVisible
-
setVisible
public void setVisible(boolean visible) Description copied from interface:MenuItemSets whether the menu item is visible or not.- Specified by:
setVisiblein interfaceMenuItem
-
isSelected
public boolean isSelected()Description copied from interface:MenuItemReturns whether the menu item is selected or not. This method should only be called if the menu is of type STYLE_RADIO or type STYLE_CHECK and if the menu item has already had a selected or deselected state assigned to it.- Specified by:
isSelectedin interfaceMenuItem
-
setHeaderCategory
Description copied from interface:MenuItemSets which header to place the menu item under for top level fancy menu- Specified by:
setHeaderCategoryin interfaceMenuItem
-
getHeaderCategory
Description copied from interface:MenuItemThe header that a top menu item will be placed under for the fancy menu- Specified by:
getHeaderCategoryin interfaceMenuItem
-
setMinUserMode
public void setMinUserMode(int minUserMode) - Specified by:
setMinUserModein interfaceMenuItem
-
setDisposeWithUIDetach
Description copied from interface:MenuItemAuto-dispose of MenuItem when a specific UI is detached (See} for typesinvalid @link
{@link com.biglybt.pif.ui.UIInstance#UIT_*- Specified by:
setDisposeWithUIDetachin interfaceMenuItem- Parameters:
uiType-
-
getDisposeWithUIDetach
- Specified by:
getDisposeWithUIDetachin interfaceMenuItem
-
getMinUserMode
public int getMinUserMode()- Specified by:
getMinUserModein interfaceMenuItem
-