Package org.rstudio.studio.client.common

Examples of org.rstudio.studio.client.common.GlobalProgressDelayer


               "Unable to Close",
               "Tutorials cannot be closed");
         return;
      }
     
      final ProgressIndicator progress = new GlobalProgressDelayer(
            globalDisplay_,
            0,
            "Closing Presentation...").getIndicator();
     
      server_.closePresentationPane(new ServerRequestCallback<Void>(){
View Full Code Here


      public FunctionSearchRequestCallback(boolean searchLocally)
      {
         searchLocally_ = searchLocally;
        
         // delayed progress indicator
         progress_ = new GlobalProgressDelayer(
               globalDisplay_, 1000, "Searching for function definition...");

      }
View Full Code Here

   }
  
   private void createDraftFromTemplate(final RmdChosenTemplate template,
                                        final String target)
   {
      final ProgressIndicator progress = new GlobalProgressDelayer(
            globalDisplay_,
            250,
            "Creating R Markdown Document...").getIndicator();

      server_.createRmdFromTemplate(target,
View Full Code Here

            concordance = "\\SweaveOpts{concordance=TRUE}\n";
      }
      final String concordanceValue = concordance;
    
      // show progress
      final ProgressIndicator indicator = new GlobalProgressDelayer(
            globalDisplay_, 500, "Creating new document...").getIndicator();

      // get the template
      server_.getSourceTemplate("",
                                "sweave.Rnw",
View Full Code Here

                       String template,
                       final Position cursorPosition,
                       final CommandWithArg<EditingTarget> onSuccess,
                       final TransformerCommand<String> contentTransformer)
   {
      final ProgressIndicator indicator = new GlobalProgressDelayer(
            globalDisplay_, 500, "Creating new document...").getIndicator();

      server_.getSourceTemplate(name,
                                template,
                                new ServerRequestCallback<String>() {
View Full Code Here

                                          new ViewFileRevisionHandler() {
         @Override
         public void onViewFileRevision(final ViewFileRevisionEvent event)
         {
            final ProgressIndicator indicator =
                  new GlobalProgressDelayer(globalDisplay,
                                            500,
                                            "Reading file...").getIndicator();
           
            strategy_.showFile(
                  event.getRevision(),
View Full Code Here

                      InputEditorUtil.getLineWithCursorPosition(input_);
     
      // lookup function definition at this location
     
      // delayed progress indicator
      final GlobalProgressDelayer progress = new GlobalProgressDelayer(
            globalDisplay_, 1000, "Searching for function definition...");
     
      server_.getFunctionDefinition(
         lineWithPos.getLine(),
         lineWithPos.getPosition(),
         new ServerRequestCallback<FunctionDefinition>() {
            @Override
            public void onResponseReceived(FunctionDefinition def)
            {
                // dismiss progress
                progress.dismiss();
                   
                // if we got a hit
                if (def.getFunctionName() != null)
                {  
                   // search locally if a function navigator was provided
                   if (navigableSourceEditor_ != null)
                   {
                      // try to search for the function locally
                      SourcePosition position =
                         navigableSourceEditor_.findFunctionPositionFromCursor(
                                                         def.getFunctionName());
                      if (position != null)
                      {
                         navigableSourceEditor_.navigateToPosition(position,
                                                                   true);
                         return; // we're done
                      }

                   }
                  
                   // if we didn't satisfy the request using a function
                   // navigator and we got a file back from the server then
                   // navigate to the file/loc
                   if (def.getFile() != null)
                   { 
                      fileTypeRegistry_.editFile(def.getFile(),
                                                 def.getPosition());
                   }
                  
                   // if we didn't get a file back see if we got a
                   // search path definition
                   else if (def.getSearchPathFunctionDefinition() != null)
                   {
                      eventBus_.fireEvent(new CodeBrowserNavigationEvent(
                                     def.getSearchPathFunctionDefinition()));
                     
                   }
               }
            }

            @Override
            public void onError(ServerError error)
            {
               progress.dismiss();
              
               globalDisplay_.showErrorMessage("Error Searching for Function",
                                               error.getUserMessage());
            }
         });
View Full Code Here

      saveFileAsHandler_ = handler;
   }
  
   public void showFile(final FileSystemItem file, String encoding)
   {
      final ProgressIndicator indicator = new GlobalProgressDelayer(
            globalDisplay_, 300, "Loading file contents").getIndicator();
                                              
     
      server_.getFileContents(file.getPath(),
                              encoding,
View Full Code Here

   public void onSuspendAndRestart(final SuspendAndRestartEvent event)
   {
      // set restart pending for desktop
      setPendinqQuit(DesktopFrame.PENDING_QUIT_AND_RESTART);
     
      ProgressIndicator progress = new GlobalProgressDelayer(
                                             globalDisplay_,
                                             200,
                                             "Restarting R...").getIndicator();
                                      
      // perform the suspend and restart
View Full Code Here

         {
            msg = switchToProject_ != null ?
                                    buildSwitchMessage(switchToProject_) :
                                    "Quitting R Session...";
         }
         final GlobalProgressDelayer progress = new GlobalProgressDelayer(
                                                               globalDisplay_,
                                                               250,
                                                               msg);

         // Use a barrier and LastChanceSaveEvent to allow source documents
         // and client state to be synchronized before quitting.
         Barrier barrier = new Barrier();
         barrier.addBarrierReleasedHandler(new BarrierReleasedHandler()
         {
            public void onBarrierReleased(BarrierReleasedEvent event)
            {
               // All last chance save operations have completed (or possibly
               // failed). Now do the real quit.

               // notify the desktop frame that we are about to quit
               if (Desktop.isDesktop())
               {
                  Desktop.getFrame().setPendingQuit(switchToProject_ != null ?
                           DesktopFrame.PENDING_QUIT_RESTART_AND_RELOAD :
                           DesktopFrame.PENDING_QUIT_AND_EXIT);  
               }
              
               server_.quitSession(
                  saveChanges_,
                  switchToProject_,
                  new ServerRequestCallback<Boolean>()
                  {
                     @Override
                     public void onResponseReceived(Boolean response)
                     {
                        if (response)
                        {
                           // clear progress only if we aren't switching projects
                           // (otherwise we want to leave progress up until
                           // the app reloads)
                           if (switchToProject_ == null)
                              progress.dismiss();
                          
                           // fire onQuitAcknowledged
                           if (onQuitAcknowledged_ != null)
                              onQuitAcknowledged_.execute();
                        }
                        else
                        {
                           onFailedToQuit();
                        }
                     }

                     @Override
                     public void onError(ServerError error)
                     {
                        onFailedToQuit();
                     }
                    
                     private void onFailedToQuit()
                     {
                        progress.dismiss();

                        if (Desktop.isDesktop())
                        {
                           Desktop.getFrame().setPendingQuit(
                                         DesktopFrame.PENDING_QUIT_NONE);
View Full Code Here

TOP

Related Classes of org.rstudio.studio.client.common.GlobalProgressDelayer

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.