Exemplo n.º 1
0
 public CustomerIndexViewer(MochaEventBus eventBus) {
   super();
   this.eventBus = eventBus;
   this.user = eventBus.getUser();
   eventBus.register(this);
   build();
 }
Exemplo n.º 2
0
 public void changeShotCutStyle(String action) {
   if (action == null) {
     return;
   }
   ChangeShotCutEvent event = new ChangeShotCutEvent();
   event.setAction(action);
   eventBus.post(event);
 }
Exemplo n.º 3
0
 @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);
 }
Exemplo n.º 4
0
 public ShotcutPanel(MochaEventBus eventBus, List<Shotcut> shotcuts) {
   this.eventBus = eventBus;
   this.shotcuts = shotcuts;
   eventBus.register(this);
 }
Exemplo n.º 5
0
 public void changeToHomeMenuStyle() {
   ChangeHeadMenuStyleEvent event = new ChangeHeadMenuStyleEvent();
   event.setSelectedMenu(PresenterProperty.HOME);
   eventBus.post(event);
 }
Exemplo n.º 6
0
 @Override
 public void detach() {
   eventBus.unregister(this);
 }