Package org.rstudio.core.client.widget

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


   private void showDialog(final String initialPath,
                           String ignores,
                           final Strategy strategy)
   {
      final Display display = pDisplay_.get();
      final ProgressIndicator indicator = display.progressIndicator();
     
      display.setDialogCaption(strategy.getDialogCaption());
      display.setIgnoresCaption(strategy.getIgnoresCaption());
      display.setHelpLinkName(strategy.getHelpLinkName());
      display.setCurrentPath(initialPath);
      display.setIgnored(ignores);
      display.scrollToBottom();
     
      display.addPathChangedHandler(new ValueChangeHandler<String>() {
         @Override
         public void onValueChange(ValueChangeEvent<String> event)
         { 
            display.setIgnored("");
           
            indicator.onProgress("Getting ignored files for path...");
           
            strategy.getIgnores(display.getCurrentPath(),
                  new ServerRequestCallback<ProcessResult>() {

               @Override
               public void onResponseReceived(final ProcessResult result)
               {
                  indicator.clearProgress();

                  if (checkForProcessError(strategy.getDialogCaption(), result))
                     return;

                  display.setIgnored(result.getOutput());
                  display.focusIgnored();
               }

               @Override
               public void onError(ServerError error)
               {
                  indicator.onError(error.getUserMessage());
               }});
            }
      });
     
      display.saveButton().addClickHandler(new ClickHandler() {

         @Override
         public void onClick(ClickEvent event)
         {
            indicator.onProgress("Setting ignored files for path...");
           
            strategy.setIgnores(
                  display.getCurrentPath(),
                  display.getIgnored(),
                  new ServerRequestCallback<ProcessResult>() {

               @Override
               public void onResponseReceived(ProcessResult result)
               {
                  indicator.onCompleted();
                  checkForProcessError(strategy.getDialogCaption(), result);
               }
                    
               @Override
               public void onError(ServerError error)
               {
                  indicator.onError(error.getUserMessage());
               }  
            });
           
         }  
      });
View Full Code Here

TOP

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

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.