Class BaseMenu
- java.lang.Object
-
- org.drools.workbench.screens.scenariosimulation.client.editor.menu.BaseMenu
-
- All Implemented Interfaces:
com.google.gwt.user.client.ui.IsWidget,BaseMenuView.BaseMenuPresenter
- Direct Known Subclasses:
AbstractHeaderMenuPresenter
public abstract class BaseMenu extends Object implements com.google.gwt.user.client.ui.IsWidget, BaseMenuView.BaseMenuPresenter
Base Menu implementation for MenuItems.
-
-
Field Summary
Fields Modifier and Type Field Description protected ExecutableMenuItemPresenterexecutableMenuItemPresenterprotected MenuItemPresentermenuItemPresenterprotected BaseMenuViewview
-
Constructor Summary
Constructors Constructor Description BaseMenu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.dom.client.LIElementaddExecutableMenuItem(String id, String label, String i18n)Add an executable menu voice in form ofLIElementto the underlying view It is an overload ofBaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)to dynamically provide an event at runtimecom.google.gwt.dom.client.LIElementaddExecutableMenuItem(String id, String label, String i18n, com.google.web.bindery.event.shared.Event event)Add an executable menu voice in form ofLIElementto the underlying viewcom.google.gwt.dom.client.LIElementaddExecutableMenuItemAfter(String id, String label, String i18n, com.google.gwt.dom.client.LIElement previous)Add an executable menu voice in form ofLIElementto the underlying view after another one It is an overload ofBaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)to dynamically provide an event at runtimecom.google.gwt.dom.client.LIElementaddMenuItem(String id, String label, String i18n)Add a label menu voice in form ofLIElementto the underlying viewcom.google.gwt.user.client.ui.WidgetasWidget()voidenableElement(com.google.gwt.dom.client.Element element, boolean enabled)protected com.google.gwt.user.client.ui.RootPanelgetRootPanel()BaseMenuViewgetView()voidhide()voidinitialise()booleanisDisabled(com.google.gwt.dom.client.Element element)booleanisShown()Method to retrieve the visibility state of the viewvoidmapEvent(com.google.gwt.dom.client.LIElement executableMenuItem, com.google.web.bindery.event.shared.Event toBeMapped)Method to map anEventto a given EXECUTABLELIElement.voidonContextMenuEvent(com.google.gwt.event.dom.client.ContextMenuEvent event)voidremoveMenuItem(com.google.gwt.dom.client.LIElement toRemove)Remove a menu voice from the given menuvoidshow(int mx, int my)protected voidupdateExecutableMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)It updates the given toUpdate element with given attributes.protected voidupdateMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)It updates the given toUpdate element with given attributes.
-
-
-
Field Detail
-
menuItemPresenter
@Inject protected MenuItemPresenter menuItemPresenter
-
executableMenuItemPresenter
@Inject protected ExecutableMenuItemPresenter executableMenuItemPresenter
-
view
@Inject protected BaseMenuView view
-
-
Method Detail
-
initialise
@PostConstruct public void initialise()
- Specified by:
initialisein interfaceBaseMenuView.BaseMenuPresenter
-
addMenuItem
public com.google.gwt.dom.client.LIElement addMenuItem(String id, String label, String i18n)
Description copied from interface:BaseMenuView.BaseMenuPresenterAdd a label menu voice in form ofLIElementto the underlying view- Specified by:
addMenuItemin interfaceBaseMenuView.BaseMenuPresenter- Returns:
-
addExecutableMenuItem
public com.google.gwt.dom.client.LIElement addExecutableMenuItem(String id, String label, String i18n, com.google.web.bindery.event.shared.Event event)
Description copied from interface:BaseMenuView.BaseMenuPresenterAdd an executable menu voice in form ofLIElementto the underlying view- Specified by:
addExecutableMenuItemin interfaceBaseMenuView.BaseMenuPresenterevent- theEventto fire on click- Returns:
-
addExecutableMenuItem
public com.google.gwt.dom.client.LIElement addExecutableMenuItem(String id, String label, String i18n)
Description copied from interface:BaseMenuView.BaseMenuPresenterAdd an executable menu voice in form ofLIElementto the underlying view It is an overload ofBaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)to dynamically provide an event at runtime- Specified by:
addExecutableMenuItemin interfaceBaseMenuView.BaseMenuPresenter
-
addExecutableMenuItemAfter
public com.google.gwt.dom.client.LIElement addExecutableMenuItemAfter(String id, String label, String i18n, com.google.gwt.dom.client.LIElement previous)
Description copied from interface:BaseMenuView.BaseMenuPresenterAdd an executable menu voice in form ofLIElementto the underlying view after another one It is an overload ofBaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)to dynamically provide an event at runtime- Specified by:
addExecutableMenuItemAfterin interfaceBaseMenuView.BaseMenuPresenterprevious- theLIElementafter which append the newly created one
-
removeMenuItem
public void removeMenuItem(com.google.gwt.dom.client.LIElement toRemove)
Description copied from interface:BaseMenuView.BaseMenuPresenterRemove a menu voice from the given menu- Specified by:
removeMenuItemin interfaceBaseMenuView.BaseMenuPresenter
-
mapEvent
public void mapEvent(com.google.gwt.dom.client.LIElement executableMenuItem, com.google.web.bindery.event.shared.Event toBeMapped)Description copied from interface:BaseMenuView.BaseMenuPresenterMethod to map anEventto a given EXECUTABLELIElement. To be used whenLIElementhas been retrieved withBaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String)- Specified by:
mapEventin interfaceBaseMenuView.BaseMenuPresenter
-
asWidget
public com.google.gwt.user.client.ui.Widget asWidget()
- Specified by:
asWidgetin interfacecom.google.gwt.user.client.ui.IsWidget
-
show
public void show(int mx, int my)- Specified by:
showin interfaceBaseMenuView.BaseMenuPresenter
-
hide
public void hide()
- Specified by:
hidein interfaceBaseMenuView.BaseMenuPresenter
-
isShown
public boolean isShown()
Description copied from interface:BaseMenuView.BaseMenuPresenterMethod to retrieve the visibility state of the view- Specified by:
isShownin interfaceBaseMenuView.BaseMenuPresenter- Returns:
-
getView
public BaseMenuView getView()
- Specified by:
getViewin interfaceBaseMenuView.BaseMenuPresenter
-
enableElement
public void enableElement(com.google.gwt.dom.client.Element element, boolean enabled)- Specified by:
enableElementin interfaceBaseMenuView.BaseMenuPresenter
-
isDisabled
public boolean isDisabled(com.google.gwt.dom.client.Element element)
- Specified by:
isDisabledin interfaceBaseMenuView.BaseMenuPresenter
-
onContextMenuEvent
public void onContextMenuEvent(com.google.gwt.event.dom.client.ContextMenuEvent event)
- Specified by:
onContextMenuEventin interfaceBaseMenuView.BaseMenuPresenter
-
getRootPanel
protected com.google.gwt.user.client.ui.RootPanel getRootPanel()
-
updateMenuItemAttributes
protected void updateMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)It updates the given toUpdate element with given attributes. To be used with not executable menu items. The given label it's enriched with HTML bold tag.- Parameters:
toUpdate-id-label-i18n-
-
updateExecutableMenuItemAttributes
protected void updateExecutableMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)It updates the given toUpdate element with given attributes. To be used with executable menu items.- Parameters:
toUpdate-id-label-i18n-
-
-