ViewMenuBuilder extends BaseMenu implements MenuFactory.CustomMenuBuilder { @Override public void onDecisionTableSelectedEvent(final @Observes DecisionTableSelectedEvent event) { super.onDecisionTableSelectedEvent(event); enableZoomMenu(event.getPresenter().isPresent()); } @Inject  ViewMenuBuilder(final TranslationService ts,
                           final MenuItemFactory menuItemFactory); @PostConstruct void setup(); void setModeller(final GuidedDecisionTableModellerView.Presenter modeller); @Override void push(final MenuFactory.CustomMenuBuilder element); @Override MenuItem build(); @Override void onDecisionTableSelectedEvent(final @Observes DecisionTableSelectedEvent event); @Override void onRefreshMenusEvent(final @Observes RefreshMenusEvent event); @Override void initialise(); void onDecisionTablePinnedEvent(final @Observes DecisionTablePinnedEvent event);  }
@Test public void testOnDecisionTableSelectedEventWithNonOtherwiseColumnSelected() { builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter)); assertTrue(builder.miToggleMergeState.getMenuItem().isEnabled()); assertTrue(builder.miViewAuditLog.getMenuItem().isEnabled()); }
@Test public void testOnDecisionTableSelectedEventReadOnly() { assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled()); assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled()); dtPresenter.getAccess().setReadOnly(true); builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter)); assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled()); assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled()); }
@Test public void testOnDecisionTableSelectedEventNoTableSelected() { assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled()); assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled()); builder.onDecisionTableSelectedEvent(DecisionTableSelectedEvent.NONE); assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled()); assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled()); }