-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuFilePathDisplay.java
More file actions
43 lines (39 loc) · 1.35 KB
/
MenuFilePathDisplay.java
File metadata and controls
43 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ie.atu.sw;
/**
* Displays messages regarding current path and successful or invalid update
*
*/
public class MenuFilePathDisplay {
/**
* Displays the current file path and asks the user if they want to change it
*
* @param type The type of the file path to display
*/
public void displayFilePathMenu(PathType type) { //Big O = O(1)
System.out.println("");
System.out.println(ConsoleColour.RED);
System.out.println("Current path for " + type + " file is: " + FilePathUtils.getFilePath(type));
System.out.print(ConsoleColour.BLACK_BOLD_BRIGHT);
System.out.print("Would you like to change it? (y/n): ");
}
/**
* Displays the updated file path
*
* @param newPath The updated file path
*/
public void displaySuccessMessage(String newPath) { //Big O = O(1)
System.out.println("Path updated successfully to: " + newPath);
}
/**
* Displays an error message for an invalid path
*/
public void displayErrorMessage() { //Big O = O(1)
System.out.println("Invalid path. Please try again.");
}
/**
* Displays a message when the path remains unchanged
*/
public void displayUnchangedMessage() { //Big O = O(1)
System.out.println("Path remains unchanged.");
}
}