Examples of ProgressIndicator


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

            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",
                                new ServerRequestCallback<String>() {
         @Override
         public void onResponseReceived(String templateContents)
         {
            indicator.onCompleted();
           
            // add in concordance if necessary
            final boolean hasConcordance = concordanceValue.length() > 0;
            if (hasConcordance)
            {
               String beginDoc = "\\begin{document}\n";
               templateContents = templateContents.replace(
                     beginDoc,
                     beginDoc + concordanceValue);
            }
           
            newDoc(FileTypeRegistry.SWEAVE,
                  templateContents,
                  new ResultCallback<EditingTarget, ServerError> () {
               @Override
               public void onSuccess(EditingTarget target)
               {
                  int startRow = 4 + (hasConcordance ? 1 : 0);
                  target.setCursorPosition(Position.create(startRow, 0));
               }
            });
         }

         @Override
         public void onError(ServerError error)
         {
            indicator.onError(error.getUserMessage());
         }
      });
   }
View Full Code Here

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

                       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>() {
         @Override
         public void onResponseReceived(String templateContents)
         {
            indicator.onCompleted();

            if (contentTransformer != null)
               templateContents = contentTransformer.transform(templateContents);

            newDoc(fileType,
                  templateContents,
                  new ResultCallback<EditingTarget, ServerError> () {
               @Override
               public void onSuccess(EditingTarget target)
               {
                  if (cursorPosition != null)
                     target.setCursorPosition(cursorPosition);
                 
                  if (onSuccess != null)
                     onSuccess.execute(target);
               }
            });
         }

         @Override
         public void onError(ServerError error)
         {
            indicator.onError(error.getUserMessage());
         }
      });
   }
View Full Code Here

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

      view_.getCommitDetail().addViewFileRevisionHandler(
                                          new ViewFileRevisionHandler() {
         @Override
         public void onViewFileRevision(final ViewFileRevisionEvent event)
         {
            final ProgressIndicator indicator =
                  new GlobalProgressDelayer(globalDisplay,
                                            500,
                                            "Reading file...").getIndicator();
           
            strategy_.showFile(
                  event.getRevision(),
                  event.getFilename(),
                  new ServerRequestCallback<String>()
                  {

                     @Override
                     public void onResponseReceived(String contents)
                     {
                        indicator.onCompleted();

                        final ViewFilePanel viewFilePanel = pViewFilePanel.get();
                       
                        viewFilePanel.setSaveFileAsHandler(
                                          new ViewFilePanel.SaveFileAsHandler()
                        {
                          
                           @Override
                           public void onSaveFileAs(FileSystemItem source,
                                                    FileSystemItem destination,
                                                    ProgressIndicator indicator)
                           {
                              strategy_.saveFileAs(event.getRevision(),
                                                   source.getPath(),
                                                   destination.getPath(),
                                                   indicator);
                           }
                        });
                       
                        viewFilePanel.getToolbar().addRightWidget(
                                                         new ToolbarButton(
                              "Show History",
                              commands.goToWorkingDir().getImageResource(),
                              new ClickHandler() {

                               @Override
                               public void onClick(ClickEvent event)
                               {
                                  view_.getFileFilter().setValue(
                                              viewFilePanel.getTargetFile());
                                  viewFilePanel.close();
                                
                               }
                                
                              }));
                       
                        viewFilePanel.showFile(
                              event.getFilename() + " @ " + event.getRevision(),
                              FileSystemItem.createFile(event.getFilename()),
                              contents);
                     }

                     @Override
                     public void onError(ServerError error)
                     {
                        if (strategy_.getShowHistoryErrors())
                        {
                           indicator.onError(error.getUserMessage());
                        }
                        else
                        {
                           indicator.onCompleted();
                           Debug.logError(error);
                        }
                     }

                  });
View Full Code Here

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

                 new Operation() // Yes operation
                 {
                    @Override
                    public void execute()
                    {
                       ProgressIndicator indicator =
                             globalDisplay_.getProgressIndicator(
                                                  "Error Creating Library");
                        server_.initDefaultUserLibrary(
                              new VoidServerRequestCallback(indicator) {
                                 @Override
View Full Code Here

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

   }
  
   private void withPackageInstallContext(
         final OperationWithInput<PackageInstallContext> operation)
   {
      final ProgressIndicator indicator =
         globalDisplay_.getProgressIndicator("Error");
      indicator.onProgress("Retrieving package installation context...");

      server_.getPackageInstallContext(
         new SimpleRequestCallback<PackageInstallContext>() {

            @Override
            public void onResponseReceived(PackageInstallContext context)
            {
               indicator.onCompleted();
               operation.execute(context);
            }

            @Override
            public void onError(ServerError error)
            {
               indicator.onError(error.getUserMessage());
            }          
         });    
   }
View Full Code Here

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

     
   }
 
   private void verifyPrerequisites()
   {
      final ProgressIndicator indicator = getProgressIndicator();
     
      indicator.onProgress("Verifying prequisites...");
     
      server_.getPackratPrerequisites(
        new ServerRequestCallback<PackratPrerequisites>() {
           @Override
           public void onResponseReceived(PackratPrerequisites prereqs)
           {
              indicator.onCompleted();
             
              if (prereqs.getBuildToolsAvailable())
              {
                 if (prereqs.getPackageAvailable())
                 {
                    setUsePackrat(true);
                 }
                 else
                 {
                    indicator.onProgress("Installing Packrat...");

                    server_.installPackrat(new ServerRequestCallback<Boolean>() {

                       @Override
                       public void onResponseReceived(Boolean success)
                       {
                          setUsePackrat(success);
                         
                          indicator.onCompleted();
                       }
  
                       @Override
                       public void onError(ServerError error)
                       {
                          setUsePackrat(false);
                         
                          indicator.onError(error.getUserMessage());
                       }
                    });
                 }
              }
              else
              {      
                 setUsePackrat(false);
                
                 // install build tools (with short delay to allow
                 // the progress indicator to clear)
                 new Timer() {
                  @Override
                  public void run()
                  {
                     server_.installBuildTools(
                           "Managing packages with Packrat",
                           new SimpleRequestCallback<Boolean>() {})
                  }  
                 }.schedule(250);
              }
           }

         @Override
         public void onError(ServerError error)
         {
            setUsePackrat(false);
           
            indicator.onError(error.getUserMessage());
         }
        })
   }
View Full Code Here

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

   }
  
  
   private void confirmGitRepo(final Command onConfirmed)
   {
      final ProgressIndicator indicator = getProgressIndicator();
      indicator.onProgress("Checking for git repository...");
     
      final String projDir =
               session_.getSessionInfo().getActiveProjectDir().getPath();
     
      server_.gitHasRepo(projDir, new ServerRequestCallback<Boolean>() {

         @Override
         public void onResponseReceived(Boolean result)
         {
            indicator.onCompleted();
           
            if (result)
            {
               onConfirmed.execute();
            }
            else
            {
               globalDisplay_.showYesNoMessage(
                  MessageDialog.QUESTION,
                  "Confirm New Git Repository",
                  "Do you want to initialize a new git repository " +
                  "for this project?",
                  false,
                  new Operation() {
                     @Override
                     public void execute()
                     {
                        server_.gitInitRepo(
                          projDir,
                          new VoidServerRequestCallback(indicator) {
                             @Override
                             public void onSuccess()
                             {
                                onConfirmed.execute();
                             }
                             @Override
                             public void onFailure()
                             {
                                setVcsSelection(VCSConstants.NO_ID);
                             }
                          });
                       
                     }
                  },
                  new Operation() {
                     @Override
                     public void execute()
                     {
                        setVcsSelection(VCSConstants.NO_ID);
                        indicator.onCompleted();
                     }
                    
                  },
                  true);
            }
         }
        
         @Override
         public void onError(ServerError error)
         {
            setVcsSelection(VCSConstants.NO_ID);
            indicator.onError(error.getUserMessage())
         }
        
      });
     
   }
View Full Code Here

Examples of ro.isdc.wro.maven.plugin.support.ProgressIndicator

  /**
   * {@inheritDoc}
   */
  @Override
  protected void onBeforeExecute() {
    progressIndicator = new ProgressIndicator(getLog());
    getLog().info("failNever: " + failNever);
    progressIndicator.reset();

    // validate report format before actual plugin execution (fail fast).
    validateReportFormat();
View Full Code Here

Examples of statechum.ProgressIndicator

                  learnerRunner.setOnlyUsePositives(onlyPositives);learnerRunner.setLengthMultiplier(lengthMultiplier);
                  learnerRunner.setSelectionID(selection+"_states"+states+"_sample"+sample);
                  runner.submit(learnerRunner);
                  ++numberOfTasks;
                }
              ProgressIndicator progress = new ProgressIndicator(new Date()+" evaluating "+numberOfTasks+" tasks for "+selection, numberOfTasks);
              for(int count=0;count < numberOfTasks;++count)
              {
                ThreadResult result = runner.take().get();// this will throw an exception if any of the tasks failed.
                if (gr_NewToOrig != null)
                {
                  for(SampleData sample:result.samples)
                    gr_NewToOrig.add(sample.referenceLearner.getValue(),sample.actualLearner.getValue());
                }
               
                for(SampleData sample:result.samples)
                  if (sample.referenceLearner.getValue() > 0)
                    gr_QualityForNumberOfTraces.add(traceQuantity+"",sample.actualLearner.getValue()/sample.referenceLearner.getValue());
                progress.next();
              }
              if (gr_PairQuality != null)
              {
                synchronized(pairQualityCounter)
                {
View Full Code Here

Examples of statechum.analysis.learning.rpnicore.TestGD.ProgressIndicator

      int alphabet = states/2;
     
      MachineGenerator mg = new MachineGenerator(states, 40, states/10);
      int mutationsPerStage = (states/2) / 2;
      //System.out.print("\n"+states+": ");
      TestGD.ProgressIndicator progress = new ProgressIndicator(""+states, mutationStages*experimentsPerMutationCategory);
      for(int mutationStage = 0;mutationStage<mutationStages;mutationStage++)
      {
        for(int experiment=0;experiment<experimentsPerMutationCategory;experiment++)
        {
          ExperimentResult outcome = new ExperimentResult();
          while(!outcome.experimentValid)
          {
            int mutations = mutationsPerStage * (mutationStage+1);
            LearnerGraphND origGraph = mg.nextMachine(alphabet, experiment);
            GraphMutator<List<CmpVertex>,LearnerGraphNDCachedData> mutator = new GraphMutator<List<CmpVertex>,LearnerGraphNDCachedData>(origGraph,r);
            mutator.mutate(mutations);
            LearnerGraphND origAfterRenaming = new LearnerGraphND(origGraph.config);
            Map<CmpVertex,CmpVertex> origToNew = copyStatesAndTransitions(origGraph,origAfterRenaming);
            LearnerGraphND mutated = (LearnerGraphND)mutator.getMutated();
            Set<Transition> appliedMutations = new HashSet<Transition>();
            for(Transition tr:mutator.getDiff())
            {
              CmpVertex renamedFrom = origToNew.get(tr.getFrom());if (renamedFrom == null) renamedFrom = tr.getFrom();
              CmpVertex renamedTo = origToNew.get(tr.getTo());if (renamedTo == null) renamedTo = tr.getTo();
              appliedMutations.add(new Transition(renamedFrom,renamedTo,tr.getLabel()));
            }
           
            final double perfectLowToHigh=0.7,perfectThreshold=0.5;
           
            // These experiments are only run for the maximal number of states
            if (graphComplexity == graphComplexityMax-1)
            {
              for(double k:new double[]{0,.2,.4,.6,.8,.95})
              {
                config.setAttenuationK(k);
                config.setGdKeyPairThreshold(0.5);
                config.setGdLowToHighRatio(perfectLowToHigh);
                config.setGdPropagateDet(false);// this is to ensure that if we removed a transition 0 from to a state and then added one from that state to a different one, det-propagation will not force the two very different states into a key-pair relation.
                linearDiff(origAfterRenaming,mutated, appliedMutations,outcome);
               
                gr_Diff_k.add(k, outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
               
              }
             
              for(double threshold:new double[]{0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95})
              {
                config.setGdKeyPairThreshold(threshold);
                config.setGdLowToHighRatio(perfectLowToHigh);
                config.setGdPropagateDet(false);// this is to ensure that if we removed a transition 0 from to a state and then added one from that state to a different one, det-propagation will not force the two very different states into a key-pair relation.
                linearDiff(origAfterRenaming,mutated, appliedMutations,outcome);
               
                gr_Diff_threshold.add(threshold, outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
              }
             
             
             
              for(double lowtohigh:new double[]{0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.95})
              {
                config.setGdKeyPairThreshold(perfectThreshold);
                config.setGdLowToHighRatio(lowtohigh);
                config.setGdPropagateDet(false);// this is to ensure that if we removed a transition 0 from to a state and then added one from that state to a different one, det-propagation will not force the two very different states into a key-pair relation.
                linearDiff(origAfterRenaming,mutated, appliedMutations,outcome);
               
                gr_Diff_lowtohigh.add(lowtohigh, outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
              }
             
             
              for(int i=0;i<pairThreshold.length;++i)
                for(double ratio:lowToHigh)
                {
                  config.setGdKeyPairThreshold(pairThreshold[i]);
                  config.setGdLowToHighRatio(ratio);
                  config.setGdPropagateDet(false);// this is to ensure that if we removed a transition 0 from to a state and then added one from that state to a different one, det-propagation will not force the two very different states into a key-pair relation.
                  linearDiff(origAfterRenaming,mutated, appliedMutations,outcome);
                 
                  gr_Diff_thresholdslowhigh.add(new Pair<Double,Double>(ratio,pairThreshold[i]), outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
                }
            }
            config.setAttenuationK(0.5);
            config.setGdKeyPairThreshold(perfectThreshold);
            config.setGdLowToHighRatio(perfectLowToHigh);
            config.setGdPropagateDet(false);// this is to ensure that if we removed a transition 0 from to a state and then added one from that state to a different one, det-propagation will not force the two very different states into a key-pair relation.
            linearDiff(origAfterRenaming,mutated, appliedMutations,outcome);
           
            if (!skip)
            {
              LearnerGraph fromDet = null, toDet = null;
              try {
                fromDet = mergeAndDeterminize(origAfterRenaming);
                toDet = mergeAndDeterminize(mutated);
              } catch (IncompatibleStatesException e) {
                Helper.throwUnchecked("failed to build a deterministic graph from a nondet one", e);
              }
              languageDiff(fromDet,toDet,states, graphComplexity,outcome);
            }
            outcome.experimentValid = true;
            progress.next();
            gr_Diff_States.add(states, outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
            gr_W_States.add(states,outcome.getValue(DOUBLE_V.ACCURACY_W));
            Pair<Integer,Integer> mutations_states = new Pair<Integer,Integer>(mutationStage+1,states);
            Pair<Integer,Integer> states_mutations = new Pair<Integer,Integer>(states,mutationStage+1);
            gr_DiffGD_StatesLevel.add(mutations_states, outcome.getValue(DOUBLE_V.OBTAINED_TO_EXPECTED));
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.