Search in sources :

Example 6 with Void

use of org.rstudio.studio.client.server.Void in project rstudio by rstudio.

the class Projects method onShowDiagnosticsProject.

@Handler
public void onShowDiagnosticsProject() {
    final ProgressIndicator indicator = globalDisplay_.getProgressIndicator("Lint");
    indicator.onProgress("Analyzing project sources...");
    projServer_.analyzeProject(new ServerRequestCallback<Void>() {

        @Override
        public void onResponseReceived(Void response) {
            indicator.onCompleted();
        }

        @Override
        public void onError(ServerError error) {
            Debug.logError(error);
            indicator.onCompleted();
        }
    });
}
Also used : ProgressIndicator(org.rstudio.core.client.widget.ProgressIndicator) ServerError(org.rstudio.studio.client.server.ServerError) Void(org.rstudio.studio.client.server.Void) OpenProjectErrorHandler(org.rstudio.studio.client.projects.events.OpenProjectErrorHandler) SessionInitHandler(org.rstudio.studio.client.workbench.events.SessionInitHandler) Handler(org.rstudio.core.client.command.Handler) SwitchToProjectHandler(org.rstudio.studio.client.projects.events.SwitchToProjectHandler) OpenProjectFileHandler(org.rstudio.studio.client.projects.events.OpenProjectFileHandler) OpenProjectNewWindowHandler(org.rstudio.studio.client.projects.events.OpenProjectNewWindowHandler)

Example 7 with Void

use of org.rstudio.studio.client.server.Void in project rstudio by rstudio.

the class CodeBrowserEditingTarget method showFunction.

public void showFunction(SearchPathFunctionDefinition functionDef) {
    // set the current function
    currentFunction_ = functionDef;
    view_.showFunction(functionDef);
    view_.scrollToLeft();
    name_.setValue(functionDef.getName(), true);
    // we only show the warning bar (for debug line matching) once per 
    // function; don't keep showing it if the user dismisses
    shownWarningBar_ = false;
    // update document properties if necessary
    final CodeBrowserContents contents = CodeBrowserContents.create(getContext());
    if (!contents.equalTo(getContents())) {
        HashMap<String, String> props = new HashMap<String, String>();
        contents.fillProperties(props);
        server_.modifyDocumentProperties(doc_.getId(), props, new SimpleRequestCallback<Void>("Error") {

            @Override
            public void onResponseReceived(Void response) {
                contents.fillProperties(doc_.getProperties());
            }
        });
    }
}
Also used : CodeBrowserContents(org.rstudio.studio.client.workbench.views.source.model.CodeBrowserContents) HashMap(java.util.HashMap) Void(org.rstudio.studio.client.server.Void)

Example 8 with Void

use of org.rstudio.studio.client.server.Void in project rstudio by rstudio.

the class Presentation method confirmClose.

public void confirmClose(Command onConfirmed) {
    // don't allow close if this is a tutorial
    if (currentState_.isTutorial()) {
        globalDisplay_.showMessage(MessageDisplay.MSG_WARNING, "Unable to Close", "Tutorials cannot be closed");
        return;
    }
    final ProgressIndicator progress = new GlobalProgressDelayer(globalDisplay_, 0, "Closing Presentation...").getIndicator();
    server_.closePresentationPane(new ServerRequestCallback<Void>() {

        @Override
        public void onResponseReceived(Void resp) {
            reloadWorkbench();
        }

        @Override
        public void onError(ServerError error) {
            progress.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) Void(org.rstudio.studio.client.server.Void)

Example 9 with Void

use of org.rstudio.studio.client.server.Void in project rstudio by rstudio.

the class PreferencesDialog method doSaveChanges.

@Override
protected void doSaveChanges(final RPrefs rPrefs, final Operation onCompleted, final ProgressIndicator progressIndicator, final boolean reload) {
    // save changes
    server_.setPrefs(rPrefs, session_.getSessionInfo().getUiPrefs(), new SimpleRequestCallback<Void>() {

        @Override
        public void onResponseReceived(Void response) {
            progressIndicator.onCompleted();
            if (onCompleted != null)
                onCompleted.execute();
            if (reload)
                reload();
        }

        @Override
        public void onError(ServerError error) {
            progressIndicator.onError(error.getUserMessage());
        }
    });
    // broadcast UI pref changes to satellites
    RStudioGinjector.INSTANCE.getSatelliteManager().dispatchCrossWindowEvent(new UiPrefsChangedEvent(UiPrefsChangedEvent.Data.create(UiPrefsChangedEvent.GLOBAL_TYPE, session_.getSessionInfo().getUiPrefs())));
}
Also used : UiPrefsChangedEvent(org.rstudio.studio.client.workbench.prefs.events.UiPrefsChangedEvent) ServerError(org.rstudio.studio.client.server.ServerError) Void(org.rstudio.studio.client.server.Void)

Example 10 with Void

use of org.rstudio.studio.client.server.Void in project rstudio by rstudio.

the class TextEditingTargetSpelling method checkSpelling.

public void checkSpelling() {
    if (isSpellChecking_)
        return;
    isSpellChecking_ = true;
    new CheckSpelling(spellChecker_, docDisplay_, new SpellingDialog(), new InitialProgressDialog(1000), new ResultCallback<Void, Exception>() {

        @Override
        public void onSuccess(Void result) {
            isSpellChecking_ = false;
        }

        @Override
        public void onFailure(Exception e) {
            isSpellChecking_ = false;
        }

        @Override
        public void onCancelled() {
            isSpellChecking_ = false;
        }
    });
}
Also used : CheckSpelling(org.rstudio.studio.client.workbench.views.source.editors.text.spelling.CheckSpelling) InitialProgressDialog(org.rstudio.studio.client.workbench.views.source.editors.text.spelling.InitialProgressDialog) Void(org.rstudio.studio.client.server.Void) SpellingDialog(org.rstudio.studio.client.workbench.views.source.editors.text.spelling.SpellingDialog)

Aggregations

Void (org.rstudio.studio.client.server.Void)22 ServerError (org.rstudio.studio.client.server.ServerError)16 ServerRequestCallback (org.rstudio.studio.client.server.ServerRequestCallback)5 VoidServerRequestCallback (org.rstudio.studio.client.server.VoidServerRequestCallback)5 ProgressIndicator (org.rstudio.core.client.widget.ProgressIndicator)4 JsArrayString (com.google.gwt.core.client.JsArrayString)3 Command (com.google.gwt.user.client.Command)3 HashMap (java.util.HashMap)3 Operation (org.rstudio.core.client.widget.Operation)3 Breakpoint (org.rstudio.studio.client.common.debugging.model.Breakpoint)3 RepeatingCommand (com.google.gwt.core.client.Scheduler.RepeatingCommand)2 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)2 Timer (com.google.gwt.user.client.Timer)2 Handler (org.rstudio.core.client.command.Handler)2 FileSystemItem (org.rstudio.core.client.files.FileSystemItem)2 Style (com.google.gwt.dom.client.Style)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1