001: package com.memoire.vainstall.tui;
002:
003: import java.io.*;
004: import com.memoire.vainstall.*;
005:
006: public class VATextUI extends VAStepFactory {
007: public void initUI() {
008: // System.setErr(new PrintStream(new NullOutputStream()));
009:
010: // create your dedicated wizard here
011: setWizard(TuiWizard.createWizard());
012: }
013:
014: public void activateUI() {
015: while (true)
016: getWizard().show();
017: }
018:
019: public void quitUI() {
020: if (TuiWizard.ansi) {
021: TuiWizard.clear();
022: TuiWizard.print("\033[00m");
023: } else
024: for (int i = 0; i < 24; i++)
025: TuiWizard.println("");
026: }
027:
028: public void showFatalError(Throwable t) {
029: // customize your error management here
030: t.printStackTrace();
031: System.exit(1);
032: }
033:
034: public void showError(Throwable t) {
035: // customize your error management here
036: TuiWizard.error(t.getMessage());
037: }
038:
039: public VAStep createSetupLanguageStep() {
040: // System.err.println("LANGUAGE");
041: TuiLanguageStep s = new TuiLanguageStep();
042: s.setInstaller(getInstaller());
043: getWizard().setStep(s);
044: return s;
045: }
046:
047: public VAStep createWelcomeStep() {
048: // System.err.println("WELCOME");
049: TuiWelcomeStep s = new TuiWelcomeStep();
050: s.setInstaller(getInstaller());
051: getWizard().setStep(s);
052: return s;
053: }
054:
055: public VAStep createLicenseStep() {
056: // System.err.println("LICENSE");
057: TuiLicenseStep s = new TuiLicenseStep();
058: s.setInstaller(getInstaller());
059: getWizard().setStep(s);
060: return s;
061: }
062:
063: public VAStep createReadmeStep() {
064: // System.err.println("README");
065: TuiReadmeStep s = new TuiReadmeStep();
066: s.setInstaller(getInstaller());
067: getWizard().setStep(s);
068: return s;
069: }
070:
071: public VAStep createLicenseKeyStep() {
072: throw new RuntimeException("!!! not yet implemented !!!");
073: }
074:
075: public VAStep createUpgradeStep() {
076: // System.err.println("UPGRADE");
077: TuiUpgradeStep s = new TuiUpgradeStep();
078: s.setInstaller(getInstaller());
079: getWizard().setStep(s);
080: return s;
081: }
082:
083: public VAStep createDirectoryStep() {
084: // System.err.println("DIRECTORY");
085: TuiDirectoryStep s = new TuiDirectoryStep();
086: s.setInstaller(getInstaller());
087: getWizard().setStep(s);
088: return s;
089: }
090:
091: public VAStep createInstallStep() {
092: // System.err.println("INSTALL");
093: TuiInstallStep s = new TuiInstallStep();
094: s.setInstaller(getInstaller());
095: getWizard().setStep(s);
096: return s;
097: }
098:
099: public VAStep createShortcutStep() {
100: // System.err.println("SHORTCUT");
101: TuiShortcutStep s = new TuiShortcutStep();
102: s.setInstaller(getInstaller());
103: getWizard().setStep(s);
104: return s;
105: }
106:
107: public VAStep createEndStep() {
108: // System.err.println("END");
109: TuiEndStep s = new TuiEndStep();
110: s.setInstaller(getInstaller());
111: getWizard().setStep(s);
112: return s;
113: }
114: }
|