Package com.taobao.zeus.web.platform.client.util.place

Examples of com.taobao.zeus.web.platform.client.util.place.PlatformPlaceChangeEvent$Handler


 
  public PlatformBus(){
    History.addValueChangeHandler(new ValueChangeHandler<String>() {
      public void onValueChange(ValueChangeEvent<String> event) {
        String token = event.getValue();
        eventBus.fireEvent(new PlatformPlaceChangeEvent(new PlatformPlace(token)));
      }
    });
    eventBus.addHandler(PlatformPlaceChangeEvent.TYPE, new PlatformPlaceChangeEvent.Handler() {
      public void onPlaceChange(PlatformPlaceChangeEvent event) {
        PlatformPlace pp=event.getNewPlace();
        if(pp.getCurrent()!=null){
          if(event.isLogHistory() && pp.isOriginal()){
            event.setLogHistory(false);
            History.newItem(pp.getToken(), false);
          }
          String key=pp.getCurrent().key;
          PlaceHandler handler=handlerMap.get(key);
          if(handler!=null){
            handler.handle(event);
          }
          if(!event.isAsyncCall()){
            if(pp.next()){
              onPlaceChange(event);
            }
          }
        }
      }
    });
    eventBus.addHandler(StartEvent.TYPE, new StartEvent.StartEventHandler() {
      public void start() {
        if(History.getToken()!=null && !"".equals(History.getToken().trim())){
          eventBus.fireEvent(new PlatformPlaceChangeEvent(new PlatformPlace(History.getToken())));
        }else{
          eventBus.fireEvent(new PlatformPlaceChangeEvent(new PlacePath().toApp(App.Home).create(),true));
        }
      }
    });
  }
View Full Code Here


      app.getShortcut().addSelectHandler(new SelectHandler() {
        public void onSelect(SelectEvent event) {
          if(screen.getActiveWidget()!=null && screen.getActiveWidget().equals(apps.get(app))){
            return;
          }
          getPlatformContext().getPlatformBus().fireEvent(new PlatformPlaceChangeEvent(app.getPlace(),true));
        }
      });
      shortcuts.add(app.getShortcut());
     
      shortcutBar.add(app.getShortcut(),new BoxLayoutData(new Margins(2,0,5,0)));
View Full Code Here

TOP

Related Classes of com.taobao.zeus.web.platform.client.util.place.PlatformPlaceChangeEvent$Handler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.