TextLogik sync
This commit is contained in:
		
							parent
							
								
									86ba50853c
								
							
						
					
					
						commit
						04647a5934
					
				| 
						 | 
				
			
			@ -12,16 +12,16 @@ public class TextLogik {
 | 
			
		|||
        textOutput = new TextOutput();
 | 
			
		||||
        String[] command;
 | 
			
		||||
 | 
			
		||||
        textOutput.UserInfoOutput("######################");
 | 
			
		||||
        textOutput.UserInfoOutput("#WELCOME TO THE EDITOR#");
 | 
			
		||||
        textOutput.UserInfoOutput("######################");
 | 
			
		||||
        textOutput.userInfoOutput("######################");
 | 
			
		||||
        textOutput.userInfoOutput("#WELCOME TO THE EDITOR#");
 | 
			
		||||
        textOutput.userInfoOutput("######################");
 | 
			
		||||
        do {
 | 
			
		||||
            textOutput.UserInfoOutput("Please enter a Command: ");
 | 
			
		||||
            textOutput.userInfoOutput("Please enter a Command: ");
 | 
			
		||||
            command = TextInput.checkForInput();
 | 
			
		||||
 | 
			
		||||
            switch (command[0]) {
 | 
			
		||||
                case "ADD":
 | 
			
		||||
                    textOutput.UserInfoOutput("Please enter your text: ");
 | 
			
		||||
                    textOutput.userInfoOutput("Please enter your text: ");
 | 
			
		||||
                    if (command.length == 1) {
 | 
			
		||||
                        checkIfSuccess(text.add(TextInput.getTextInput()));
 | 
			
		||||
                    } else if (isNumeric(command[1])) {
 | 
			
		||||
| 
						 | 
				
			
			@ -65,13 +65,13 @@ public class TextLogik {
 | 
			
		|||
 | 
			
		||||
                    break;
 | 
			
		||||
                case "INDEX":
 | 
			
		||||
                    textOutput.IndexOutput(text.index());
 | 
			
		||||
                    textOutput.indexOutput(text.index());
 | 
			
		||||
                    break;
 | 
			
		||||
                case "PRINT":
 | 
			
		||||
                    textOutput.print(text.getText());
 | 
			
		||||
                    break;
 | 
			
		||||
                case "REPLACE":
 | 
			
		||||
                    textOutput.UserInfoOutput("Please enter your text to replace: ");
 | 
			
		||||
                    textOutput.userInfoOutput("Please enter your text to replace: ");
 | 
			
		||||
                    if (command.length == 1){
 | 
			
		||||
                        checkIfSuccess(text.replace(TextInput.getTextInput(), TextInput.getTextInput()));
 | 
			
		||||
                    }else if(isNumeric(command[1])) {
 | 
			
		||||
| 
						 | 
				
			
			@ -102,7 +102,7 @@ public class TextLogik {
 | 
			
		|||
 | 
			
		||||
    private void checkIfSuccess(boolean method) {
 | 
			
		||||
        if(method) {
 | 
			
		||||
            textOutput.UserInfoOutput("Command was successfull");
 | 
			
		||||
            textOutput.userInfoOutput("Command was successfull");
 | 
			
		||||
        }else {
 | 
			
		||||
            textOutput.errorInvalidParagraph();
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue