Package org.rstudio.core.client.widget

Examples of org.rstudio.core.client.widget.Operation


         globalDisplay_.showYesNoMessage(
               GlobalDisplay.MSG_QUESTION,
               caption,
               prompt,
               true,
               new Operation() { public void execute()
               {
                  quitContext.onReadyToQuit(true);     
               }},
               new Operation() { public void execute()
               {
                  quitContext.onReadyToQuit(false);
               }},
               new Operation() { public void execute()
               {
               }},
               "Save",
               "Don't Save",
               true);       
View Full Code Here


      ThemedButton copyButton = new ThemedButton("Copy Plot",
            new ClickHandler() {
         public void onClick(ClickEvent event)
         {
            // do the copy
            performCopy(new Operation() {

               @Override
               public void execute()
               {
                  // save options
View Full Code Here

      WindowEx window = doOpenWindow(absUrl, finalName, features, focus);
      if (window == null)
      {
         if (showPopupBlockedMessage())
         {
            globalDisplay.showPopupBlockedMessage(new Operation()
            {
               public void execute()
               {
                  WindowEx window = doOpenWindow(absUrl,
                                                 finalName,
View Full Code Here

      // when the PDF is finished rendering, optionally navigate to the desired
      // location, or set and restore the current location
      final PdfLocation pdfLocation = result.getPdfLocation();
      if (pdfLocation != null)
      {
         executeOnPdfLoad_ = new Operation()
         {
            @Override
            public void execute()
            {
               PdfJsWindow.navigateTo(pdfJsWindow_, pdfLocation);
View Full Code Here

  
   public void viewPdfUrl(final String url, final Integer initialPage)
   {
      if (initialPage != null)
      {
         executeOnPdfLoad_ = new Operation()
         {
            @Override
            public void execute()
            {
               pdfJsWindow_.goToPage(initialPage.intValue());
View Full Code Here

         executeOnPdfLoad_ = createRestorePositionOperation();
      }
     
      // create the operation to load the PDF--we'll call this when the window
      // is finished opening, or immediately if there's already a window open
      Operation loadPdf = new Operation()
      {
         @Override
         public void execute()
         {
            pdfJsWindow_.openPdf(server_.getApplicationURL(url), 0, synctex);
            lastSuccessfulPdfUrl_ = url;
         }
      };

      // in the browser we need to close and reopen the window
      if (haveActivePdfJsWindow() && !Desktop.isDesktop())
      {
         width = pdfJsWindow_.getOuterWidth();
         height = pdfJsWindow_.getOuterHeight();
         pos = new Point(pdfJsWindow_.getLeft(), pdfJsWindow_.getTop());
         pdfJsWindow_.close();
         pdfJsWindow_ = null;
      }
     
      lastSuccessfulPdfUrl_ = null;
      if (!haveActivePdfJsWindow())
      {
          // open the window and continue
          String viewerUrl =
                server_.getApplicationURL("pdf_js/web/viewer.html?file=");
          NewWindowOptions options = new NewWindowOptions();
          options.setName(WINDOW_NAME);
          if (pos != null)
             options.setPosition(pos);
          options.setCallback(new OperationWithInput<WindowEx>()
          {
             @Override
             public void execute(WindowEx win)
             {
                initializePdfJsWindow(win);
             }
          });
          executeOnPdfJsLoad_ = loadPdf;
          display_.openMinimalWindow(viewerUrl, false, width, height, options);
      }
      else
      {
         // we already have an open window, activate it
         if (Desktop.isDesktop())
            Desktop.getFrame().activateMinimalWindow(WINDOW_NAME);
        
         loadPdf.execute();
      }
   }
View Full Code Here

                                                fromClick));
   }
  
   private Operation createRestorePositionOperation()
   {
      return new Operation()
      {
         @Override
         public void execute()
         {
            pdfJsWindow_.applyLocationHash(locationHash_);
View Full Code Here

            "Confirm Remove Account",
            "Are you sure you want to disconnect the '" +
              account +
            "' account? This won't delete the account on ShinyApps.",
            false,
            new Operation()
            {
               @Override
               public void execute()
               {
                  onConfirmDisconnect(account);
View Full Code Here

                 userPrompt.getYesIsDefault());
   }
  
   private Operation userPromptResponse(final int response)
   {
      return new Operation() {
         public void execute()
         {
            server_.userPromptCompleted(response,
                                        new SimpleRequestCallback<Void>());
           
View Full Code Here

      el.setAttribute("mozallowfullscreen", "");
      el.setAttribute("allowfullscreen", "");
     
      frame.navigate(url);
     
      final Operation initSlides = new Operation()
      {
         @Override
         public void execute()
         {
            if (getNavigationMenu().isVisible())
            { 
               fireSlideIndexChanged();
               slideChangeMonitor_.scheduleRepeating(100);
            }
         }
      };

      if (isShiny_)
      {
         shinyFrame_.initialize(url, new Operation()
         {
            @Override
            public void execute()
            {
               shinyFrame_.setScrollPosition(scrollPosition_);
               initSlides.execute();
            }
         });
      }
      else
      {
         // poll for document availability then perform initialization
         // tasks once it's available (addLoadHandler wasn't always
         // getting called at least under Cocoa WebKit)
         Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

            @Override
            public boolean execute()
            {
               // see if the document is ready
               AnchorableFrame frame = getFrame();
               if (frame == null)
                  return true;
              
               IFrameElementEx iframe = frame.getIFrame();
               if (iframe == null)
                  return true;
              
               Document doc = iframe.getContentDocument();
               if (doc == null)
                  return true;

               initSlides.execute();
              
               // Even though the document exists, it may not have rendered all
               // its content yet
               ScrollUtil.setScrollPositionOnLoad(frame, scrollPosition_);
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.widget.Operation

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.