public abstract class BaseMenu extends Object implements com.google.gwt.user.client.ui.IsWidget, BaseMenuView.BaseMenuPresenter
Modifier and Type | Field and Description |
---|---|
protected ExecutableMenuItemPresenter |
executableMenuItemPresenter |
protected MenuItemPresenter |
menuItemPresenter |
protected BaseMenuView |
view |
Constructor and Description |
---|
BaseMenu() |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.dom.client.LIElement |
addExecutableMenuItem(String id,
String label,
String i18n)
Add an executable menu voice in form of
LIElement to the underlying view
It is an overload of BaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event) to dynamically provide
an event at runtime |
com.google.gwt.dom.client.LIElement |
addExecutableMenuItem(String id,
String label,
String i18n,
com.google.web.bindery.event.shared.Event event)
Add an executable menu voice in form of
LIElement to the underlying view |
com.google.gwt.dom.client.LIElement |
addExecutableMenuItemAfter(String id,
String label,
String i18n,
com.google.gwt.dom.client.LIElement previous)
Add an executable menu voice in form of
LIElement to the underlying view after another one
It is an overload of BaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event) to dynamically provide
an event at runtime |
com.google.gwt.dom.client.LIElement |
addMenuItem(String id,
String label,
String i18n)
Add a label menu voice in form of
LIElement to the underlying view |
com.google.gwt.user.client.ui.Widget |
asWidget() |
void |
enableElement(com.google.gwt.dom.client.Element element,
boolean enabled) |
protected com.google.gwt.user.client.ui.RootPanel |
getRootPanel() |
BaseMenuView |
getView() |
void |
hide() |
void |
initialise() |
boolean |
isDisabled(com.google.gwt.dom.client.Element element) |
boolean |
isShown()
Method to retrieve the visibility state of the view
|
void |
mapEvent(com.google.gwt.dom.client.LIElement executableMenuItem,
com.google.web.bindery.event.shared.Event toBeMapped)
Method to map an
Event to a given EXECUTABLE LIElement . |
void |
onContextMenuEvent(com.google.gwt.event.dom.client.ContextMenuEvent event) |
void |
removeMenuItem(com.google.gwt.dom.client.LIElement toRemove)
Remove a menu voice from the given menu
|
void |
show(int mx,
int my) |
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.
|
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.
|
@Inject protected MenuItemPresenter menuItemPresenter
@Inject protected ExecutableMenuItemPresenter executableMenuItemPresenter
@Inject protected BaseMenuView view
@PostConstruct public void initialise()
initialise
in interface BaseMenuView.BaseMenuPresenter
public com.google.gwt.dom.client.LIElement addMenuItem(String id, String label, String i18n)
BaseMenuView.BaseMenuPresenter
LIElement
to the underlying viewaddMenuItem
in interface BaseMenuView.BaseMenuPresenter
public com.google.gwt.dom.client.LIElement addExecutableMenuItem(String id, String label, String i18n, com.google.web.bindery.event.shared.Event event)
BaseMenuView.BaseMenuPresenter
LIElement
to the underlying viewaddExecutableMenuItem
in interface BaseMenuView.BaseMenuPresenter
event
- the Event
to fire on clickpublic com.google.gwt.dom.client.LIElement addExecutableMenuItem(String id, String label, String i18n)
BaseMenuView.BaseMenuPresenter
LIElement
to the underlying view
It is an overload of BaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)
to dynamically provide
an event at runtimeaddExecutableMenuItem
in interface BaseMenuView.BaseMenuPresenter
public com.google.gwt.dom.client.LIElement addExecutableMenuItemAfter(String id, String label, String i18n, com.google.gwt.dom.client.LIElement previous)
BaseMenuView.BaseMenuPresenter
LIElement
to the underlying view after another one
It is an overload of BaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String, Event)
to dynamically provide
an event at runtimeaddExecutableMenuItemAfter
in interface BaseMenuView.BaseMenuPresenter
previous
- the LIElement
after which append the newly created onepublic void removeMenuItem(com.google.gwt.dom.client.LIElement toRemove)
BaseMenuView.BaseMenuPresenter
removeMenuItem
in interface BaseMenuView.BaseMenuPresenter
public void mapEvent(com.google.gwt.dom.client.LIElement executableMenuItem, com.google.web.bindery.event.shared.Event toBeMapped)
BaseMenuView.BaseMenuPresenter
Event
to a given EXECUTABLE LIElement
.
To be used when LIElement
has been retrieved with BaseMenuView.BaseMenuPresenter.addExecutableMenuItem(String, String, String)
mapEvent
in interface BaseMenuView.BaseMenuPresenter
public com.google.gwt.user.client.ui.Widget asWidget()
asWidget
in interface com.google.gwt.user.client.ui.IsWidget
public void show(int mx, int my)
show
in interface BaseMenuView.BaseMenuPresenter
public void hide()
hide
in interface BaseMenuView.BaseMenuPresenter
public boolean isShown()
BaseMenuView.BaseMenuPresenter
isShown
in interface BaseMenuView.BaseMenuPresenter
public BaseMenuView getView()
getView
in interface BaseMenuView.BaseMenuPresenter
public void enableElement(com.google.gwt.dom.client.Element element, boolean enabled)
enableElement
in interface BaseMenuView.BaseMenuPresenter
public boolean isDisabled(com.google.gwt.dom.client.Element element)
isDisabled
in interface BaseMenuView.BaseMenuPresenter
public void onContextMenuEvent(com.google.gwt.event.dom.client.ContextMenuEvent event)
onContextMenuEvent
in interface BaseMenuView.BaseMenuPresenter
protected com.google.gwt.user.client.ui.RootPanel getRootPanel()
protected void updateMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)
toUpdate
- id
- label
- i18n
- protected void updateExecutableMenuItemAttributes(com.google.gwt.dom.client.LIElement toUpdate, String id, String label, String i18n)
toUpdate
- id
- label
- i18n
- Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.