Package com.taobao.zeus.web.platform.client.app

Examples of com.taobao.zeus.web.platform.client.app.PlatformPlace$KV


 
  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


      public void onSelection(SelectionEvent<Widget> event) {
        if (event.getSelectedItem() instanceof Word) {
          Word word=(Word) event.getSelectedItem();
          String token=History.getToken();
          if(token!=null){
            PlatformPlace pp=new PlatformPlace(token);
            Queue<KV> queue=new LinkedList<PlatformPlace.KV>();
            for(KV kv:pp.getSource()){
              if(!kv.key.equals(WordPresenter.TAG)){
                queue.offer(kv);
              }
            }
            queue.offer(new KV(WordPresenter.TAG, word.getFileModel().getId()));
            History.newItem(new PlatformPlace(queue).getToken(), false);
          }
          // 更新打开的文档状态
          presenter.updateLastOpen();
          toolBarContainer.onDocChange(word);
        }
View Full Code Here

TOP

Related Classes of com.taobao.zeus.web.platform.client.app.PlatformPlace$KV

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.