package guitests.guihandles;

import javafx.collections.ObservableList;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import seedu.address.ui.CommandBox;

/**
 * A handle to the {@code CommandBox} in the GUI.
 */
public class CommandBoxHandle extends NodeHandle<TextField> {

    public static final String COMMAND_INPUT_FIELD_ID = "#commandTextField";

    public CommandBoxHandle(TextField commandBoxNode) {
        super(commandBoxNode);
    }

    /**
     * Returns the text in the command box.
     */
    public String getInput() {
        return getRootNode().getText();
    }

    /**
     * Enters the given command in the Command Box and presses enter.
     * @return true if the command succeeded, false otherwise.
     */
    public boolean run(String command) {
        click();
        guiRobot.interact(() -> getRootNode().setText(command));
        guiRobot.pauseForHuman();

        guiRobot.type(KeyCode.ENTER);

        return !getStyleClass().contains(CommandBox.ERROR_STYLE_CLASS);
    }

    /**
     * Returns the list of style classes present in the command box.
     */
    public ObservableList<String> getStyleClass() {
        return getRootNode().getStyleClass();
    }
}

@@ -142,44 +142,8 @@
 ode;
-%0Aimport seedu.address.ui.CommandBox;
 %0A%0A/*
@@ -653,71 +653,8 @@
 er.%0A
-     * @return true if the command succeeded, false otherwise.%0A
     
@@ -672,15 +672,12 @@
 lic 
-boolean
+void
  run
@@ -853,81 +853,8 @@
 ER);
-%0A%0A        return !getStyleClass().contains(CommandBox.ERROR_STYLE_CLASS);
 %0A   

update return type