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 package wjhk.jupload2.testhelpers;
26
27 import java.awt.Color;
28 import java.awt.Component;
29 import java.awt.Font;
30 import java.awt.Point;
31 import java.io.File;
32 import java.util.ArrayList;
33 import java.util.List;
34
35 import javax.swing.ActionMap;
36 import javax.swing.TransferHandler;
37
38 import org.apache.log4j.Logger;
39
40 import wjhk.jupload2.filedata.FileData;
41 import wjhk.jupload2.gui.filepanel.FilePanel;
42
43
44
45
46 public class FilePanelTestHelper implements FilePanel {
47
48
49 public int removeFileNotToUpload_NbCalls = 0;
50
51
52 protected final Logger logger = Logger.getLogger(getClass());
53
54
55 public List<FileData> filesToUpload = new ArrayList<FileData>();
56
57
58
59
60 public FilePanelTestHelper(List<FileData> filesToUpload) {
61 this.filesToUpload = filesToUpload;
62 }
63
64
65
66
67 public void addFiles(File[] f) {
68 throw new UnsupportedOperationException(this.getClass() + ".addFiles() is not implemented in tests cases");
69 }
70
71
72
73
74 public void clearSelection() {
75 throw new UnsupportedOperationException(this.getClass() + ".clearSelection() is not implemented in tests cases");
76 }
77
78
79
80
81 public void focusTable() {
82 throw new UnsupportedOperationException(this.getClass() + ".focusTable() is not implemented in tests cases");
83 }
84
85
86
87
88 public ActionMap getActionMap() {
89 throw new UnsupportedOperationException(this.getClass() + ".getActionMap() is not implemented in tests cases");
90 }
91
92
93
94
95 public Component getDropComponent() {
96 throw new UnsupportedOperationException(this.getClass()
97 + ".getDropComponent() is not implemented in tests cases");
98 }
99
100
101
102
103 public FileData getFileDataAt(Point point) {
104 throw new UnsupportedOperationException(this.getClass() + ".getFileDataAt() is not implemented in tests cases");
105 }
106
107
108
109
110 public List<FileData> getFiles() {
111 return (this.filesToUpload);
112 }
113
114
115
116
117 public int getFilesLength() {
118 return this.filesToUpload.size();
119 }
120
121
122
123
124 public void remove(FileData fileData) {
125 this.logger.warn(this.getClass() + ".remove() is not implemented in tests cases");
126 }
127
128
129
130
131 public void removeAll() {
132 throw new UnsupportedOperationException(this.getClass() + ".removeAll() is not implemented in tests cases");
133 }
134
135
136
137
138 public void removeSelected() {
139 throw new UnsupportedOperationException(this.getClass() + ".removeSelected() is not implemented in tests cases");
140 }
141
142
143
144
145 public void setTransferHandler(TransferHandler newHandler) {
146 throw new UnsupportedOperationException(this.getClass()
147 + ".setTransferHandler() is not implemented in tests cases");
148 }
149
150
151
152
153
154 public void setGridBorderColor(Color color) {
155 throw new UnsupportedOperationException(this.getClass()
156 + ".setGridBorderColor() is not implemented in tests cases");
157 }
158
159
160
161
162
163 public void setTableHeaderBackColor(Color color) {
164 throw new UnsupportedOperationException(this.getClass()
165 + ".setTableHeaderBackColor() is not implemented in tests cases");
166 }
167
168
169
170
171
172 public void setTableHeaderFont(Font font) {
173 throw new UnsupportedOperationException(this.getClass()
174 + ".setTableHeaderFont() is not implemented in tests cases");
175 }
176
177
178
179
180
181 public void setTableHeaderTextColor(Color color) {
182 throw new UnsupportedOperationException(this.getClass()
183 + ".setTableHeaderTextColor() is not implemented in tests cases");
184 }
185
186 public void setFileListViewMode(FileListViewMode fileListMode) {
187
188 }
189
190 public void removeFileNotToUpload() {
191
192 removeFileNotToUpload_NbCalls += 1;
193 }
194
195 public FileListViewMode getFileListMode() {
196
197 return null;
198 }
199
200 public void reload() {
201
202
203 }
204
205 public void remove(FileData[] files) {
206
207
208 }
209
210 public void cleanHierarchy() {
211
212
213 }
214 }