From 485d3623272168fd0df000b8feb583e32743c6b0 Mon Sep 17 00:00:00 2001 From: "Hakon.Molnes" <hakon.molnes@student.uib.no> Date: Wed, 14 Feb 2024 13:54:06 +0100 Subject: [PATCH] Replace SimpleShell.java --- .../no/uib/inf101/terminal/SimpleShell.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/no/uib/inf101/terminal/SimpleShell.java b/src/main/java/no/uib/inf101/terminal/SimpleShell.java index c1cf454..9722c50 100644 --- a/src/main/java/no/uib/inf101/terminal/SimpleShell.java +++ b/src/main/java/no/uib/inf101/terminal/SimpleShell.java @@ -52,8 +52,8 @@ public class SimpleShell implements CommandLineInterface { //Implimentation of command-lin-Interface into our Shell-class - @Override - public void keyPressed(char key) { + + public void aKeyIsPressed(char key) { if (key == '\n') { this.processCurrentCommandLine(); } else if (key >= ' ' && key <= '~') { @@ -64,8 +64,8 @@ public class SimpleShell implements CommandLineInterface { } - @Override - public String getScreenContent() { + + public String whatTheScreenLooksLike() { String s = ""; for (String line : this.history) { s += line; @@ -169,4 +169,17 @@ public class SimpleShell implements CommandLineInterface { } + + public void keyPressed(char key) { + aKeyIsPressed(key); + } + + + + public String getScreenContent() { + + return whatTheScreenLooksLike(); + } + + } -- GitLab