1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.teeda.core.mock; |
17 | |
|
18 | |
import java.io.IOException; |
19 | |
|
20 | |
import javax.faces.application.StateManager; |
21 | |
import javax.faces.component.UIViewRoot; |
22 | |
import javax.faces.context.FacesContext; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 1345 | public class MockStateManager extends StateManager { |
28 | |
|
29 | |
private static final long serialVersionUID = 1L; |
30 | |
|
31 | |
public static final boolean MOCK_SAVING_STATE_CLIENT = true; |
32 | |
|
33 | |
public static final boolean MOCK_SAVING_STATE_SERVER = false; |
34 | |
|
35 | 1345 | private Boolean isSavingStateClient = null; |
36 | |
|
37 | |
public SerializedView saveSerializedView(FacesContext context) { |
38 | 5 | return null; |
39 | |
} |
40 | |
|
41 | |
public void writeState(FacesContext context, SerializedView state) |
42 | |
throws IOException { |
43 | 0 | } |
44 | |
|
45 | |
protected Object getTreeStructureToSave(FacesContext context) { |
46 | 0 | return null; |
47 | |
} |
48 | |
|
49 | |
protected Object getComponentStateToSave(FacesContext context) { |
50 | 0 | return null; |
51 | |
} |
52 | |
|
53 | |
public UIViewRoot restoteView(FacesContext context, String viewId) { |
54 | 0 | return null; |
55 | |
} |
56 | |
|
57 | |
protected UIViewRoot restoreTreeStructure(FacesContext context, |
58 | |
String viewId) { |
59 | 0 | return null; |
60 | |
} |
61 | |
|
62 | |
protected void restoreComponentState(FacesContext context, |
63 | |
UIViewRoot viewRoot) { |
64 | 0 | } |
65 | |
|
66 | |
public UIViewRoot restoreView(FacesContext context, String viewId, |
67 | |
String renderKitId) { |
68 | 0 | throw new UnsupportedOperationException(); |
69 | |
} |
70 | |
|
71 | |
protected UIViewRoot restoreTreeStructure(FacesContext context, |
72 | |
String viewId, String renderKitId) { |
73 | 0 | return null; |
74 | |
} |
75 | |
|
76 | |
protected void restoreComponentState(FacesContext context, |
77 | |
UIViewRoot viewRoot, String renderKitId) { |
78 | 0 | } |
79 | |
|
80 | |
public boolean isSavingStateInClient(FacesContext context) { |
81 | 9 | if (isSavingStateClient != null) { |
82 | 0 | return isSavingStateClient.booleanValue(); |
83 | |
} |
84 | 9 | return super.isSavingStateInClient(context); |
85 | |
} |
86 | |
|
87 | |
public void setSavingStateInClient(boolean savingState) { |
88 | 0 | isSavingStateClient = new Boolean(savingState); |
89 | 0 | } |
90 | |
} |