package ru.pravvich.start;

/**
 * @since Pavel Ravvich
 * @since 09.11.2016
 */
public class StartUI {
    private Input input;
    private Tracker tracker = new Tracker();

    public StartUI(Input input) {
        this.input = input;
    }

    // init new task
    public void startUpp() {
        MenuTracker menuTracker = new MenuTracker(this.input,this.tracker);
        menuTracker.fillAction();
        menuTracker.showMenu();
        do {
            int key = this.input.askInt("Select action: ");
            menuTracker.select(key);
            menuTracker.showMenu();
        } while (!("y").equals(this.input.ask("For quit enter (y) : ")));
    }

    public static void main(String[] args) {

        System.out.println("Welcome to task manager!");
        Input input = new ConsoleInput();
        StartUI startUI = new StartUI(input);
        startUI.startUpp();
    }
}
@@ -168,16 +168,183 @@
 ker();%0A%0A
+    // only for tests%0A    public void setInput(Input input) %7B%0A        this.input = input;%0A    %7D%0A%0A    public Tracker getTracker() %7B%0A        return this.tracker;%0A    %7D%0A%0A
     publ

add method setInput() for work tests