Class MenuItemFactory
- java.lang.Object
-
- org.uberfire.ext.widgets.common.client.menu.MenuItemFactory
-
@ApplicationScoped public class MenuItemFactory extends Object
Factory for differentMenuCustomand associatedMenuItemView.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMenuItemFactory.MenuItemViewHolder<T extends MenuItemView>Container for @{link MenuCustom} andMenuItemView
-
Constructor Summary
Constructors Constructor Description MenuItemFactory(org.jboss.errai.ioc.client.api.ManagedInstance<MenuItemView> menuItemViewProducer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends MenuItemDividerView>
MenuItemFactory.MenuItemViewHolder<T>makeMenuItemDivider()Makes aMenuCustomand associatedMenuItemDividerViewthat can be used as a "divider" in a menu.<T extends MenuItemHeaderView>
MenuItemFactory.MenuItemViewHolder<T>makeMenuItemHeader(String caption)Makes aMenuCustomand associatedMenuItemHeaderViewthat can be used as a "header" in a menu.<T extends MenuItemWithIconView>
MenuItemFactory.MenuItemViewHolder<T>makeMenuItemWithIcon(String caption, org.uberfire.mvp.Command cmd)Makes aMenuCustomand associatedMenuItemWithIconViewthat can be used to replace the default Views created byListBarWidgetImplif an icon is also required.
-
-
-
Constructor Detail
-
MenuItemFactory
@Inject public MenuItemFactory(@Any org.jboss.errai.ioc.client.api.ManagedInstance<MenuItemView> menuItemViewProducer)
-
-
Method Detail
-
makeMenuItemWithIcon
public <T extends MenuItemWithIconView> MenuItemFactory.MenuItemViewHolder<T> makeMenuItemWithIcon(String caption, org.uberfire.mvp.Command cmd)
Makes aMenuCustomand associatedMenuItemWithIconViewthat can be used to replace the default Views created byListBarWidgetImplif an icon is also required. If an icon is not required the caption is indented to the position that it would adopt if an icon had been specified. It is not possible to use BS3'sAnchorListItemas this only indents the caption IF an icon is specified.- Type Parameters:
T-MenuItemWithIconView- Parameters:
caption- Caption to be shown for the menu item.cmd- Command to execute when the menu item is clicked.- Returns:
- A
MenuItemFactory.MenuItemViewHolderwith both aMenuItemandMenuItemView
-
makeMenuItemHeader
public <T extends MenuItemHeaderView> MenuItemFactory.MenuItemViewHolder<T> makeMenuItemHeader(String caption)
Makes aMenuCustomand associatedMenuItemHeaderViewthat can be used as a "header" in a menu. See http://getbootstrap.com/components/#dropdowns-headers- Type Parameters:
T-MenuItemHeaderView- Parameters:
caption- Caption to be shown for the menu header.- Returns:
- A
MenuItemFactory.MenuItemViewHolderwith both aMenuItemandMenuItemView
-
makeMenuItemDivider
public <T extends MenuItemDividerView> MenuItemFactory.MenuItemViewHolder<T> makeMenuItemDivider()
Makes aMenuCustomand associatedMenuItemDividerViewthat can be used as a "divider" in a menu. See http://getbootstrap.com/components/#dropdowns-divider- Type Parameters:
T- MenuItemDividerView}- Returns:
- A
MenuItemFactory.MenuItemViewHolderwith both aMenuItemandMenuItemView
-
-