Search in sources :

Example 1 with CommandWith2Args

use of org.rstudio.core.client.CommandWith2Args in project rstudio by rstudio.

the class DependencyManager method withShiny.

public void withShiny(final String userAction, final Command command) {
    // create user prompt command
    CommandWith2Args<String, Command> userPrompt = new CommandWith2Args<String, Command>() {

        @Override
        public void execute(final String unmetDeps, final Command yesCommand) {
            globalDisplay_.showYesNoMessage(MessageDialog.QUESTION, "Install Shiny Package", userAction + " requires installation of an updated version " + "of the shiny package.\n\nDo you want to install shiny now?", new Operation() {

                @Override
                public void execute() {
                    yesCommand.execute();
                }
            }, true);
        }
    };
    // perform dependency resolution 
    withDependencies("Checking installed packages", userPrompt, shinyDependenciesArray(), true, new CommandWithArg<Boolean>() {

        @Override
        public void execute(Boolean succeeded) {
            if (succeeded)
                command.execute();
        }
    });
}
Also used : Command(com.google.gwt.user.client.Command) CommandWith2Args(org.rstudio.core.client.CommandWith2Args) Operation(org.rstudio.core.client.widget.Operation)

Aggregations

Command (com.google.gwt.user.client.Command)1 CommandWith2Args (org.rstudio.core.client.CommandWith2Args)1 Operation (org.rstudio.core.client.widget.Operation)1