-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientFileSaveErrorState.java
70 lines (57 loc) · 1.52 KB
/
ClientFileSaveErrorState.java
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
public class ClientFileSaveErrorState extends MessageState
{
/*
Amber Krause
December 6, 2016
CISC 230-02
Doctor Jarvis
This class models the ClientFileSaveErrorState dialog box.
Class variables:
instance
the ClientFileSaveErrorState object.
Enumeration types:
StateName
represents the buttons in the dialog box.
Constructors:
ClientFileSaveErrorState()
creates a new ClientFileSaveErrorState object.
Methods:
getInstance()
accessor for instance.
execute()
launches the dialog box and returns the next NavigationState.
Modification History:
December 6, 2016
original version.
*/
private enum StateName
{
OK;
} //enum StateName
private static ClientFileSaveErrorState instance = new ClientFileSaveErrorState();
private ClientFileSaveErrorState()
{
super(StateName.values());
} //constructor
public static ClientFileSaveErrorState getInstance()
{
return ClientFileSaveErrorState.instance;
} //getInstance
public NavigationState execute()
{
//launch the dialog box and return the next NavigationState
StateName buttonClicked;
NavigationState nextState;
buttonClicked = StateName.valueOf(super.showDialog());
switch(buttonClicked)
{
case OK:
{
nextState = ClientSaveFileState.getInstance();
break;
} //case OK
default: { throw new IllegalArgumentException("ClientFileSaveErrorState.execute: no execution statement has been written for this case"); }
} //switch
return nextState;
} //execute
} //class ClientFileSaveErrorStateState