Package org.rstudio.core.client

Examples of org.rstudio.core.client.HandlerRegistrations


                   final Session session)
   {
      eventBus_ = eventBus;
      globalDisplay_ = globalDisplay;
      session_ = session;
      final HandlerRegistrations registrations = new HandlerRegistrations();
      registrations.add(eventBus_.addHandler(VcsRefreshEvent.TYPE, new VcsRefreshHandler()
      {
         @Override
         public void onVcsRefresh(VcsRefreshEvent event)
         {
            if (!session.getSessionInfo().isVcsEnabled())
               registrations.removeHandler();

            if (event.getDelayMs() > 0)
            {
               Scheduler.get().scheduleFixedDelay(new RepeatingCommand()
               {
                  @Override
                  public boolean execute()
                  {
                     refresh(false);

                     return false;
                  }
               }, event.getDelayMs());
            }
            else
            {
               Scheduler.get().scheduleDeferred(new ScheduledCommand()
               {
                  @Override
                  public void execute()
                  {
                     refresh(false);
                  }
               });
            }
         }
      }));
      registrations.add(eventBus_.addHandler(FileChangeEvent.TYPE, new FileChangeHandler()
      {
         @Override
         public void onFileChange(FileChangeEvent event)
         {
            if (!session.getSessionInfo().isVcsEnabled())
               registrations.removeHandler();

            FileChange fileChange = event.getFileChange();
            FileSystemItem file = fileChange.getFile();

            StatusAndPath status = StatusAndPath.fromInfo(
View Full Code Here


   }

   @Override
   public HandlerRegistration addClickHandler(ClickHandler handler)
   {
      return new HandlerRegistrations(
            icon_.addClickHandler(handler),
            anchor_.addClickHandler(handler));
   }
View Full Code Here

  
   public void discoverTemplates(
         OperationWithInput<RmdDiscoveredTemplate> onTemplateDiscovered,
         Operation onCompleted)
   {
      registrations_ = new HandlerRegistrations(
         events_.addHandler(RmdTemplateDiscoveredEvent.TYPE, this),
         events_.addHandler(RmdTemplateDiscoveryCompletedEvent.TYPE, this));

      onTemplateDiscovered_ = onTemplateDiscovered;
      onCompleted_ = onCompleted;
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.HandlerRegistrations

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.