Search in sources :

Example 1 with ServerDataSource

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

the class Packages method doUpdatePackages.

private void doUpdatePackages(final PackageInstallContext installContext) {
    new CheckForUpdatesDialog(globalDisplay_, new ServerDataSource<JsArray<PackageUpdate>>() {

        public void requestData(ServerRequestCallback<JsArray<PackageUpdate>> requestCallback) {
            server_.checkForPackageUpdates(requestCallback);
        }
    }, new OperationWithInput<ArrayList<PackageUpdate>>() {

        @Override
        public void execute(ArrayList<PackageUpdate> updates) {
            InstallCommand cmd = buildUpdatePackagesCommand(updates, installContext);
            executeWithLoadedPackageCheck(cmd);
        }
    }, new Operation() {

        @Override
        public void execute() {
            // cancel emits an empty console input line to clear
            // the busy indicator
            events_.fireEvent(new SendToConsoleEvent("", true));
        }
    }).showModal();
}
Also used : ServerDataSource(org.rstudio.studio.client.server.ServerDataSource) ProgressOperationWithInput(org.rstudio.core.client.widget.ProgressOperationWithInput) OperationWithInput(org.rstudio.core.client.widget.OperationWithInput) ArrayList(java.util.ArrayList) SendToConsoleEvent(org.rstudio.studio.client.workbench.views.console.events.SendToConsoleEvent) PackageUpdate(org.rstudio.studio.client.workbench.views.packages.model.PackageUpdate) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback) ServerRequestCallback(org.rstudio.studio.client.server.ServerRequestCallback) CheckForUpdatesDialog(org.rstudio.studio.client.workbench.views.packages.ui.CheckForUpdatesDialog) Operation(org.rstudio.core.client.widget.Operation)

Aggregations

ArrayList (java.util.ArrayList)1 Operation (org.rstudio.core.client.widget.Operation)1 OperationWithInput (org.rstudio.core.client.widget.OperationWithInput)1 ProgressOperationWithInput (org.rstudio.core.client.widget.ProgressOperationWithInput)1 ServerDataSource (org.rstudio.studio.client.server.ServerDataSource)1 ServerRequestCallback (org.rstudio.studio.client.server.ServerRequestCallback)1 VoidServerRequestCallback (org.rstudio.studio.client.server.VoidServerRequestCallback)1 SendToConsoleEvent (org.rstudio.studio.client.workbench.views.console.events.SendToConsoleEvent)1 PackageUpdate (org.rstudio.studio.client.workbench.views.packages.model.PackageUpdate)1 CheckForUpdatesDialog (org.rstudio.studio.client.workbench.views.packages.ui.CheckForUpdatesDialog)1