event.stopPropagation();
event.preventDefault();
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
if (DOM.eventGetButton(event) == Event.BUTTON_LEFT) {
ClickEvent evt = new ClickEvent() {
@Override
public Object getSource() {
return CustomMenuItem.this;
}
};
evt.setNativeEvent(event);
fireEvent(evt);
super.onBrowserEvent(event);
} else if (DOM.eventGetButton(event) == Event.BUTTON_RIGHT) {
final CommandPopupPanel removePanel = new CommandPopupPanel(true);
MenuItem removeItem = new MenuItem(FormBuilderGlobals.getInstance().getI18n().RemoveMenuItem(), new Command() {