Skip to content
Snippets Groups Projects
Commit c7b5bfc7 authored by Villsty's avatar Villsty
Browse files

small edits

parent bbdfccaf
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,8 @@ public interface CommandLineInterface {
*/
void keyPressed(char key);
void KeyPressed(char key);
/**
* Get the text to display on the screen.
*
......
......@@ -6,7 +6,7 @@ package no.uib.inf101.terminal;
// CommandLineInterface. Du trenger ikke gjøre noen endringer i denne
// filen for denne lab'en (med mindre du selv ønsker).
public class DummyShell implements CommandLineInterface {
public abstract class DummyShell implements CommandLineInterface {
private String screenContent = "$ ";
......
......@@ -8,7 +8,7 @@ package no.uib.inf101.terminal;
import java.util.ArrayList;
public class EchoShell implements CommandLineInterface {
public abstract class EchoShell implements CommandLineInterface {
ArrayList<String> outputLines = new ArrayList<>();
String currentLine = "";
......
package no.uib.inf101.terminal;
// UiB INF101 ShellLab - Main.java
// Dette er filen som inneholder main-metoden.
public class Main {
public static void main(String[] args) {
......
......@@ -51,12 +51,19 @@ public class SimpleShell implements CommandLineInterface {
// javadoc comment here unless there is something special about this
// implementation. You should remove to-do comments when you are done.
//test
@Override
public void keyPressed(char key) {
}
/**
* Called when a key is pressed.
*
* @param key The key that was pressed
*/
@Override
public void KeyPressed(char key) {
if (key == '\n') {
this.processCurrentCommandLine();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment