public CustomerIndexViewer(MochaEventBus eventBus) { super(); this.eventBus = eventBus; this.user = eventBus.getUser(); eventBus.register(this); build(); }
public void changeShotCutStyle(String action) { if (action == null) { return; } ChangeShotCutEvent event = new ChangeShotCutEvent(); event.setAction(action); eventBus.post(event); }
@Override public void buttonClick(ClickEvent event) { Button btn = event.getButton(); ShotcutItem item = (ShotcutItem) btn.getData(); String action = item.getAction(); if (SystemProperty.PAGE_TYPE.equals(item.getType())) { PageChangeEvent pageChangeEvent = new PageChangeEvent(action); eventBus.post(pageChangeEvent); } else { ContentChangeEvent changeEvent = new ContentChangeEvent(); changeEvent.setPresenterName(action); eventBus.post(changeEvent); } // change the head menu to home page. changeToHomeMenuStyle(); // change shotcut menu style. changeShotCutStyle(action); }
public ShotcutPanel(MochaEventBus eventBus, List<Shotcut> shotcuts) { this.eventBus = eventBus; this.shotcuts = shotcuts; eventBus.register(this); }
public void changeToHomeMenuStyle() { ChangeHeadMenuStyleEvent event = new ChangeHeadMenuStyleEvent(); event.setSelectedMenu(PresenterProperty.HOME); eventBus.post(event); }
@Override public void detach() { eventBus.unregister(this); }