Search in sources :

Example 51 with ProgressIndicator

use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.

the class ViewFilePanel method showFile.

public void showFile(final FileSystemItem file, String encoding) {
    final ProgressIndicator indicator = new GlobalProgressDelayer(globalDisplay_, 300, "Loading file contents").getIndicator();
    server_.getFileContents(file.getPath(), encoding, new ServerRequestCallback<String>() {

        @Override
        public void onResponseReceived(String contents) {
            indicator.onCompleted();
            showFile(file.getPath(), file, contents);
        }

        @Override
        public void onError(ServerError error) {
            indicator.onError(error.getUserMessage());
        }
    });
}
Also used : ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) ServerError(org.rstudio.studio.client.server.ServerError) GlobalProgressDelayer(org.rstudio.studio.client.common.GlobalProgressDelayer)

Aggregations

ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)51 ServerError (org.rstudio.studio.client.server.ServerError)26 FileSystemItem (org.rstudio.core.client.files.FileSystemItem)16 VoidServerRequestCallback (org.rstudio.studio.client.server.VoidServerRequestCallback)15 Handler (org.rstudio.core.client.command.Handler)12 GlobalProgressDelayer (org.rstudio.studio.client.common.GlobalProgressDelayer)8 ProgressOperation (org.rstudio.core.client.widget.ProgressOperation)7 Command (com.google.gwt.user.client.Command)6 JsArrayString (com.google.gwt.core.client.JsArrayString)5 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)5 ProgressOperationWithInput (org.rstudio.core.client.widget.ProgressOperationWithInput)5 ServerRequestCallback (org.rstudio.studio.client.server.ServerRequestCallback)5 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)4 Operation (org.rstudio.core.client.widget.Operation)4 SourceLocation (org.rstudio.studio.client.common.synctex.model.SourceLocation)4 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3 CloseHandler (com.google.gwt.event.logical.shared.CloseHandler)3 JSONString (com.google.gwt.json.client.JSONString)3 NativePreviewHandler (com.google.gwt.user.client.Event.NativePreviewHandler)3