Examples of VoidServerRequestCallback


Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                  }
                 
                  progress.onProgress(message);
                  server_.chooseFileCompleted(
                        path,
                        new VoidServerRequestCallback(
                              progress));
               }
            });
   }
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

              
               // call the server -- in all cases continue on with
               // creating the project (swallow errors updating the pref)
               projServer_.setUiPrefs(
                     session_.getSessionInfo().getUiPrefs(),
                     new VoidServerRequestCallback(indicator) {
                        @Override
                        public void onResponseReceived(Void response)
                        {
                           continuation.execute();
                        }

                        @Override
                        public void onError(ServerError error)
                        {
                           super.onError(error);
                           continuation.execute();
                        }
                     });
            }
            else
            {
               continuation.execute();
            }
         }
      }, false);

      // Next, if necessary, clone a repo
      if (newProject.getVcsCloneOptions() != null)
      {
         createProjectCmds.addCommand(new SerializedCommand()
         {
            @Override
            public void onExecute(final Command continuation)
            {
               VcsCloneOptions cloneOptions = newProject.getVcsCloneOptions();
              
               if (cloneOptions.getVcsName().equals((VCSConstants.GIT_ID)))
                  indicator.onProgress("Cloning Git repoistory...");
               else
                  indicator.onProgress("Checking out SVN repository...");
              
               gitServer_.vcsClone(
                     cloneOptions,
                     new ServerRequestCallback<ConsoleProcess>() {
                        @Override
                        public void onResponseReceived(ConsoleProcess proc)
                        {
                           final ConsoleProgressDialog consoleProgressDialog =
                                 new ConsoleProgressDialog(proc, gitServer_);
                           consoleProgressDialog.showModal();
          
                           proc.addProcessExitHandler(new ProcessExitEvent.Handler()
                           {
                              @Override
                              public void onProcessExit(ProcessExitEvent event)
                              {
                                 if (event.getExitCode() == 0)
                                 {
                                    consoleProgressDialog.hide();
                                    continuation.execute();
                                 }
                                 else
                                 {
                                    indicator.onCompleted();
                                 }
                              }
                           });
                        }

                        @Override
                        public void onError(ServerError error)
                        {
                           Debug.logError(error);
                           indicator.onError(error.getUserMessage());
                        }
                     });
            }
         }, false);
      }

      // Next, create the project file
      createProjectCmds.addCommand(new SerializedCommand()
      {
         @Override
         public void onExecute(final Command continuation)
         {
            indicator.onProgress("Creating project...");

            projServer_.createProject(
                  newProject.getProjectFile(),
                  newProject.getNewPackageOptions(),
                  newProject.getNewShinyAppOptions(),
                  new VoidServerRequestCallback(indicator)
                  {
                     @Override
                     public void onSuccess()
                     {
                        continuation.execute();
                     }
                  });
         }
      }, false);
     
      // Next, initialize a git repo if requested
      if (newProject.getCreateGitRepo())
      {
         createProjectCmds.addCommand(new SerializedCommand()
         {
            @Override
            public void onExecute(final Command continuation)
            {
               indicator.onProgress("Initializing git repository...");

               String projDir = FileSystemItem.createFile(
                     newProject.getProjectFile()).getParentPathString();
              
               gitServer_.gitInitRepo(
                     projDir,
                     new VoidServerRequestCallback(indicator)
                     {
                        @Override
                        public void onSuccess()
                        {
                           continuation.execute();
                        }
                       
                        @Override
                        public void onFailure()
                        {
                           continuation.execute();
                        }
                     });
            }
         }, false);
      }
     
      // Generate a new packrat project
      if (newProject.getUsePackrat()) {
         createProjectCmds.addCommand(new SerializedCommand()
         {
           
            @Override
            public void onExecute(final Command continuation) {
              
               indicator.onProgress("Initializing packrat project...");
              
               String projDir = FileSystemItem.createFile(
                  newProject.getProjectFile()
               ).getParentPathString();
              
               packratServer_.packratBootstrap(
                  projDir,
                  false,
                  new VoidServerRequestCallback(indicator) {
                     @Override
                     public void onSuccess()
                     {
                        continuation.execute();
                     }
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                                  ProgressIndicator indicator)
         {
            server_.copyFile(source,
                             destination,
                             true,
                             new VoidServerRequestCallback(indicator));
         }
        
      };
     
      initWidget(panel_);
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                                
                                 // showOnOutput dialog that has exited
                                 // and has no output -- reap it
                                 else if (proc.getExitCode() != null)
                                 {
                                    cproc.reap(new VoidServerRequestCallback());
                                 }
                                
                                 // showOnOutput dialog with no output that is
                                 // still running -- crate but don't show yet
                                 else
                                 {
                                    createDialog = true;
                                 }
                                 
                                 // take indicated actions
                                 if (createDialog)
                                 {
                                    ConsoleProgressDialog dlg = new ConsoleProgressDialog(
                                       proc.getCaption(),
                                       cproc,
                                       proc.getBufferedOutput(),
                                       proc.getExitCode(),
                                       cryptoServer);
                                   
                                    if (showDialog)
                                       dlg.showModal();
                                    else
                                       dlg.showOnOutput();
                                 }
                              }
                              else
                              {
                                 cproc.addProcessExitHandler(new ProcessExitEvent.Handler()
                                 {
                                    @Override
                                    public void onProcessExit(ProcessExitEvent event)
                                    {
                                       cproc.reap(new VoidServerRequestCallback());
                                    }
                                 });
                              }
                           }
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

         if (defaultUncaughtExceptionHandler_ != null)
            defaultUncaughtExceptionHandler_.onUncaughtException(e);
        
         // log uncaught exception
         server_.logException(ClientException.create(unwrap(e)),
                              new VoidServerRequestCallback());

      }
      catch(Throwable throwable)
      {
         // make sure exceptions never escape the uncaught handler
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

               showInterruptUnresponsiveDialog();
            }
         };
         interruptUnresponsiveTimer_.schedule(10000);
        
         server_.interrupt(new VoidServerRequestCallback() {
            @Override
            public void onSuccess()
            {
               finishInterrupt(handler);
            }
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                  if (nextProj == null)
                     nextProj = Projects.NONE;
                 
                  // force the abort
                  server_.abort(nextProj,
                                new VoidServerRequestCallback(indicator) {
                     @Override
                     protected void onSuccess()
                     {
                        if (!Desktop.isDesktop())
                           eventBus_.fireEvent(new ReloadEvent());
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                        DesktopFrame.PENDING_QUIT_AND_EXIT);
            }
           
            server_.handleUnsavedChangesCompleted(
                                          handled_,
                                          new VoidServerRequestCallback())
         }
        
         private final boolean handled_;
      };
     
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

                                      
      // perform the suspend and restart
      eventBus_.fireEvent(
                  new RestartStatusEvent(RestartStatusEvent.RESTART_INITIATED));
      server_.suspendForRestart(event.getSuspendOptions(),
                                new VoidServerRequestCallback(progress) {
         @Override
         protected void onSuccess()
         {
            // send pings until the server restarts
            sendPing(event.getAfterRestartCommand(), 200, 25, new Command() {
View Full Code Here

Examples of org.rstudio.studio.client.server.VoidServerRequestCallback

               return false;
           
            if (!pingInFlight_)
            {
               pingInFlight_ = true;
               server_.ping(new VoidServerRequestCallback() {
                  @Override
                  protected void onSuccess()
                  {
                     pingInFlight_ = false;
                    
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.