deps.setLength(dependencies.length);
for (int i = 0; i<deps.length(); i++)
deps.set(i, dependencies[i]);
// create progress indicator
final ProgressIndicator progress = new GlobalProgressDelayer(
globalDisplay_,
250,
progressCaption + "...").getIndicator();
// query for unsatisfied dependencies
server_.unsatisfiedDependencies(
deps, silentUpdate, new ServerRequestCallback<JsArray<Dependency>>() {
@Override
public void onResponseReceived(
final JsArray<Dependency> unsatisfiedDeps)
{
progress.onCompleted();
// if we've satisfied all dependencies then execute the command
if (unsatisfiedDeps.length() == 0)
{
command.execute();
}
// otherwise ask the user if they want to install the
// unsatisifed dependencies
else
{
Command installCommand = new Command() {
@Override
public void execute()
{
installDependencies(unsatisfiedDeps, silentUpdate, command);
}
};
if (userPrompt != null)
{
userPrompt.execute(installCommand);
}
else
{
confirmPackageInstallation(userAction,
unsatisfiedDeps,
installCommand);
}
}
}
@Override
public void onError(ServerError error)
{
progress.onError(error.getUserMessage());
}
});
}