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();
}
});
}
Aggregations