blob: 16930c8bd1b25dd388d8a4e3a4d4c7453373077a [file] [log] [blame]
package org.eclipse.epp.installer.internal.console.steps;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.epp.installer.core.model.IInstallStep;
import org.eclipse.epp.installer.core.steps.ScrollablePromptUserStep;
import org.eclipse.epp.installer.internal.console.Console;
import org.eclipse.epp.installer.internal.console.ConsoleStep;
/**
* <p>
* Copyright (c) 2006, Instantiations, Inc.<br>
* All Rights Reserved
*/
public class ScrollablePromptUserConsoleStep extends ConsoleStep {
public ScrollablePromptUserConsoleStep(IInstallStep step) {
super(step);
}
/**
* Display step's text and prompt user to continue installation.
*
* @param console
* the console used to interact with the user.
* @return <code>OK_STATUS</code> if "Yes",
* <code>CANCEL_STATUS</code> if "No", or
* throw an exception if a problem has occurred.
*/
public IStatus prompt(Console console) throws Exception {
ScrollablePromptUserStep step = (ScrollablePromptUserStep) getInstallStep();
if(step.getTitle()!=null) console.writeln(step.getTitle());
if(step.getDescription()!=null)console.writeln(step.getDescription());
if(step.getText()!=null) console.writeln(step.getText());
return console.promptYesNo("Continue installation?");
}
}