this.bus.addHandler(MenuItemAddedEvent.TYPE, new MenuItemAddedHandler() {
@Override
public void onEvent(MenuItemAddedEvent event) {
String group = event.getGroupName();
FBMenuItem item = event.getMenuItem();
if (RoleUtils.getInstance().hasDesignPrivileges()) {
view.addItem(group, item);
} else if (RoleUtils.getInstance().hasOnlyUserPrivileges()) {
if (item instanceof CustomMenuItem) {
view.addItem(group, item);
}
}
}
});
this.bus.addHandler(MenuItemRemoveEvent.TYPE, new MenuItemRemoveHandler() {
@Override
public void onEvent(MenuItemRemoveEvent event) {
String group = event.getGroupName();
FBMenuItem item = event.getMenuItem();
view.removeItem(group, item);
}
});
this.bus.addHandler(MenuItemFromServerEvent.TYPE, new MenuItemFromServerHandler() {
@Override
public void onEvent(MenuItemFromServerEvent event) {
String group = event.getGroupName();
FBMenuItem item = event.getMenuItem();
if (RoleUtils.getInstance().hasDesignPrivileges()) {
view.addItem(group, item);
} else if (RoleUtils.getInstance().hasOnlyUserPrivileges()) {
if (item instanceof CustomMenuItem) {
view.addItem(group, item);