36744
|
1 |
/*
|
|
2 |
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
* or visit www.oracle.com if you need additional information or have any
|
|
21 |
* questions.
|
|
22 |
*/
|
|
23 |
package org.netbeans.jemmy.operators;
|
|
24 |
|
|
25 |
import java.awt.Component;
|
|
26 |
import java.awt.Point;
|
|
27 |
import java.awt.Rectangle;
|
|
28 |
|
|
29 |
import javax.swing.JTable;
|
|
30 |
import javax.swing.event.ChangeEvent;
|
|
31 |
import javax.swing.event.ListSelectionEvent;
|
|
32 |
import javax.swing.event.TableColumnModelEvent;
|
|
33 |
import javax.swing.plaf.TableHeaderUI;
|
|
34 |
import javax.swing.table.JTableHeader;
|
|
35 |
import javax.swing.table.TableCellRenderer;
|
|
36 |
import javax.swing.table.TableColumn;
|
|
37 |
import javax.swing.table.TableColumnModel;
|
|
38 |
|
|
39 |
import org.netbeans.jemmy.ComponentChooser;
|
|
40 |
import org.netbeans.jemmy.ComponentSearcher;
|
|
41 |
import org.netbeans.jemmy.Outputable;
|
|
42 |
import org.netbeans.jemmy.TestOut;
|
|
43 |
import org.netbeans.jemmy.Timeoutable;
|
|
44 |
import org.netbeans.jemmy.Timeouts;
|
|
45 |
import org.netbeans.jemmy.drivers.DriverManager;
|
|
46 |
import org.netbeans.jemmy.drivers.OrderedListDriver;
|
|
47 |
|
|
48 |
/**
|
|
49 |
* ComponentOperator.BeforeDragTimeout - time to sleep before column moving <BR>
|
|
50 |
* ComponentOperator.AfterDragTimeout - time to sleep after column moving <BR>
|
|
51 |
* ComponentOperator.WaitComponentTimeout - time to wait component displayed
|
|
52 |
* <BR>.
|
|
53 |
*
|
|
54 |
* @author Alexandre Iline (alexandre.iline@oracle.com)
|
|
55 |
*
|
|
56 |
*/
|
|
57 |
public class JTableHeaderOperator extends JComponentOperator
|
|
58 |
implements Outputable, Timeoutable {
|
|
59 |
|
|
60 |
private TestOut output;
|
|
61 |
private Timeouts timeouts;
|
|
62 |
|
|
63 |
private OrderedListDriver driver;
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Constructor.
|
|
67 |
*
|
|
68 |
* @param b a component
|
|
69 |
*/
|
|
70 |
public JTableHeaderOperator(JTableHeader b) {
|
|
71 |
super(b);
|
|
72 |
driver = DriverManager.getOrderedListDriver(getClass());
|
|
73 |
}
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Constructs a JTableHeaderOperator object.
|
|
77 |
*
|
|
78 |
* @param cont a container
|
|
79 |
* @param chooser a component chooser specifying searching criteria.
|
|
80 |
* @param index an index between appropriate ones.
|
|
81 |
*/
|
|
82 |
public JTableHeaderOperator(ContainerOperator<?> cont, ComponentChooser chooser, int index) {
|
|
83 |
this((JTableHeader) cont.
|
|
84 |
waitSubComponent(new JTableHeaderFinder(chooser),
|
|
85 |
index));
|
|
86 |
copyEnvironment(cont);
|
|
87 |
}
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Constructs a JTableHeaderOperator object.
|
|
91 |
*
|
|
92 |
* @param cont a container
|
|
93 |
* @param chooser a component chooser specifying searching criteria.
|
|
94 |
*/
|
|
95 |
public JTableHeaderOperator(ContainerOperator<?> cont, ComponentChooser chooser) {
|
|
96 |
this(cont, chooser, 0);
|
|
97 |
}
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Constructs a JTableHeaderOperator object.
|
|
101 |
*
|
|
102 |
* @param cont a container
|
|
103 |
* @param index an index between appropriate ones.
|
|
104 |
*/
|
|
105 |
public JTableHeaderOperator(ContainerOperator<?> cont, int index) {
|
|
106 |
this((JTableHeader) waitComponent(cont,
|
|
107 |
new JTableHeaderFinder(ComponentSearcher.
|
|
108 |
getTrueChooser("Any JTableHeader")),
|
|
109 |
index));
|
|
110 |
copyEnvironment(cont);
|
|
111 |
}
|
|
112 |
|
|
113 |
/**
|
|
114 |
* Constructs a JTableHeaderOperator object.
|
|
115 |
*
|
|
116 |
* @param cont a container
|
|
117 |
*/
|
|
118 |
public JTableHeaderOperator(ContainerOperator<?> cont) {
|
|
119 |
this(cont, 0);
|
|
120 |
}
|
|
121 |
|
|
122 |
@Override
|
|
123 |
public void setTimeouts(Timeouts times) {
|
|
124 |
this.timeouts = times;
|
|
125 |
super.setTimeouts(timeouts);
|
|
126 |
}
|
|
127 |
|
|
128 |
@Override
|
|
129 |
public Timeouts getTimeouts() {
|
|
130 |
return timeouts;
|
|
131 |
}
|
|
132 |
|
|
133 |
@Override
|
|
134 |
public void setOutput(TestOut out) {
|
|
135 |
output = out;
|
|
136 |
super.setOutput(output);
|
|
137 |
}
|
|
138 |
|
|
139 |
@Override
|
|
140 |
public TestOut getOutput() {
|
|
141 |
return output;
|
|
142 |
}
|
|
143 |
|
|
144 |
/**
|
|
145 |
* Selects a column.
|
|
146 |
*
|
|
147 |
* @param columnIndex an index of a column to select.
|
|
148 |
*/
|
|
149 |
public void selectColumn(int columnIndex) {
|
|
150 |
driver.selectItem(this, columnIndex);
|
|
151 |
}
|
|
152 |
|
|
153 |
/**
|
|
154 |
* Selects some columns.
|
|
155 |
*
|
|
156 |
* @param columnIndices indices of columns to select.
|
|
157 |
*/
|
|
158 |
public void selectColumns(int[] columnIndices) {
|
|
159 |
driver.selectItems(this, columnIndices);
|
|
160 |
}
|
|
161 |
|
|
162 |
/**
|
|
163 |
* Moves a column to a different location.
|
|
164 |
*
|
|
165 |
* @param moveColumn an original column index.
|
|
166 |
* @param moveTo a desctination column index.
|
|
167 |
*/
|
|
168 |
public void moveColumn(int moveColumn, int moveTo) {
|
|
169 |
driver.moveItem(this, moveColumn, moveTo);
|
|
170 |
}
|
|
171 |
|
|
172 |
/**
|
|
173 |
* Return a point to click on column header.
|
|
174 |
*
|
|
175 |
* @param columnIndex an index of a column to click on.
|
|
176 |
* @return the point to click.
|
|
177 |
*/
|
|
178 |
public Point getPointToClick(int columnIndex) {
|
|
179 |
Rectangle rect = getHeaderRect(columnIndex);
|
|
180 |
return (new Point(rect.x + rect.width / 2,
|
|
181 |
rect.y + rect.height / 2));
|
|
182 |
}
|
|
183 |
|
|
184 |
@Override
|
|
185 |
public void copyEnvironment(Operator anotherOperator) {
|
|
186 |
super.copyEnvironment(anotherOperator);
|
|
187 |
driver
|
|
188 |
= (OrderedListDriver) DriverManager.
|
|
189 |
getDriver(DriverManager.ORDEREDLIST_DRIVER_ID,
|
|
190 |
getClass(),
|
|
191 |
anotherOperator.getProperties());
|
|
192 |
}
|
|
193 |
|
|
194 |
////////////////////////////////////////////////////////
|
|
195 |
//Mapping //
|
|
196 |
/**
|
|
197 |
* Maps {@code JTableHeader.setTable(JTable)} through queue
|
|
198 |
*/
|
|
199 |
public void setTable(final JTable jTable) {
|
|
200 |
runMapping(new MapVoidAction("setTable") {
|
|
201 |
@Override
|
|
202 |
public void map() {
|
|
203 |
((JTableHeader) getSource()).setTable(jTable);
|
|
204 |
}
|
|
205 |
});
|
|
206 |
}
|
|
207 |
|
|
208 |
/**
|
|
209 |
* Maps {@code JTableHeader.getTable()} through queue
|
|
210 |
*/
|
|
211 |
public JTable getTable() {
|
|
212 |
return (runMapping(new MapAction<JTable>("getTable") {
|
|
213 |
@Override
|
|
214 |
public JTable map() {
|
|
215 |
return ((JTableHeader) getSource()).getTable();
|
|
216 |
}
|
|
217 |
}));
|
|
218 |
}
|
|
219 |
|
|
220 |
/**
|
|
221 |
* Maps {@code JTableHeader.setReorderingAllowed(boolean)} through queue
|
|
222 |
*/
|
|
223 |
public void setReorderingAllowed(final boolean b) {
|
|
224 |
runMapping(new MapVoidAction("setReorderingAllowed") {
|
|
225 |
@Override
|
|
226 |
public void map() {
|
|
227 |
((JTableHeader) getSource()).setReorderingAllowed(b);
|
|
228 |
}
|
|
229 |
});
|
|
230 |
}
|
|
231 |
|
|
232 |
/**
|
|
233 |
* Maps {@code JTableHeader.getReorderingAllowed()} through queue
|
|
234 |
*/
|
|
235 |
public boolean getReorderingAllowed() {
|
|
236 |
return (runMapping(new MapBooleanAction("getReorderingAllowed") {
|
|
237 |
@Override
|
|
238 |
public boolean map() {
|
|
239 |
return ((JTableHeader) getSource()).getReorderingAllowed();
|
|
240 |
}
|
|
241 |
}));
|
|
242 |
}
|
|
243 |
|
|
244 |
/**
|
|
245 |
* Maps {@code JTableHeader.setResizingAllowed(boolean)} through queue
|
|
246 |
*/
|
|
247 |
public void setResizingAllowed(final boolean b) {
|
|
248 |
runMapping(new MapVoidAction("setResizingAllowed") {
|
|
249 |
@Override
|
|
250 |
public void map() {
|
|
251 |
((JTableHeader) getSource()).setResizingAllowed(b);
|
|
252 |
}
|
|
253 |
});
|
|
254 |
}
|
|
255 |
|
|
256 |
/**
|
|
257 |
* Maps {@code JTableHeader.getResizingAllowed()} through queue
|
|
258 |
*/
|
|
259 |
public boolean getResizingAllowed() {
|
|
260 |
return (runMapping(new MapBooleanAction("getResizingAllowed") {
|
|
261 |
@Override
|
|
262 |
public boolean map() {
|
|
263 |
return ((JTableHeader) getSource()).getResizingAllowed();
|
|
264 |
}
|
|
265 |
}));
|
|
266 |
}
|
|
267 |
|
|
268 |
/**
|
|
269 |
* Maps {@code JTableHeader.getDraggedColumn()} through queue
|
|
270 |
*/
|
|
271 |
public TableColumn getDraggedColumn() {
|
|
272 |
return (runMapping(new MapAction<TableColumn>("getDraggedColumn") {
|
|
273 |
@Override
|
|
274 |
public TableColumn map() {
|
|
275 |
return ((JTableHeader) getSource()).getDraggedColumn();
|
|
276 |
}
|
|
277 |
}));
|
|
278 |
}
|
|
279 |
|
|
280 |
/**
|
|
281 |
* Maps {@code JTableHeader.getDraggedDistance()} through queue
|
|
282 |
*/
|
|
283 |
public int getDraggedDistance() {
|
|
284 |
return (runMapping(new MapIntegerAction("getDraggedDistance") {
|
|
285 |
@Override
|
|
286 |
public int map() {
|
|
287 |
return ((JTableHeader) getSource()).getDraggedDistance();
|
|
288 |
}
|
|
289 |
}));
|
|
290 |
}
|
|
291 |
|
|
292 |
/**
|
|
293 |
* Maps {@code JTableHeader.getResizingColumn()} through queue
|
|
294 |
*/
|
|
295 |
public TableColumn getResizingColumn() {
|
|
296 |
return (runMapping(new MapAction<TableColumn>("getResizingColumn") {
|
|
297 |
@Override
|
|
298 |
public TableColumn map() {
|
|
299 |
return ((JTableHeader) getSource()).getResizingColumn();
|
|
300 |
}
|
|
301 |
}));
|
|
302 |
}
|
|
303 |
|
|
304 |
/**
|
|
305 |
* Maps {@code JTableHeader.setUpdateTableInRealTime(boolean)} through queue
|
|
306 |
*/
|
|
307 |
public void setUpdateTableInRealTime(final boolean b) {
|
|
308 |
runMapping(new MapVoidAction("setUpdateTableInRealTime") {
|
|
309 |
@Override
|
|
310 |
public void map() {
|
|
311 |
((JTableHeader) getSource()).setUpdateTableInRealTime(b);
|
|
312 |
}
|
|
313 |
});
|
|
314 |
}
|
|
315 |
|
|
316 |
/**
|
|
317 |
* Maps {@code JTableHeader.getUpdateTableInRealTime()} through queue
|
|
318 |
*/
|
|
319 |
public boolean getUpdateTableInRealTime() {
|
|
320 |
return (runMapping(new MapBooleanAction("getUpdateTableInRealTime") {
|
|
321 |
@Override
|
|
322 |
public boolean map() {
|
|
323 |
return ((JTableHeader) getSource()).getUpdateTableInRealTime();
|
|
324 |
}
|
|
325 |
}));
|
|
326 |
}
|
|
327 |
|
|
328 |
/**
|
|
329 |
* Maps {@code JTableHeader.setDefaultRenderer(TableCellRenderer)}
|
|
330 |
* through queue
|
|
331 |
*/
|
|
332 |
public void setDefaultRenderer(final TableCellRenderer tableCellRenderer) {
|
|
333 |
runMapping(new MapVoidAction("setDefaultRenderer") {
|
|
334 |
@Override
|
|
335 |
public void map() {
|
|
336 |
((JTableHeader) getSource()).setDefaultRenderer(tableCellRenderer);
|
|
337 |
}
|
|
338 |
});
|
|
339 |
}
|
|
340 |
|
|
341 |
/**
|
|
342 |
* Maps {@code JTableHeader.getDefaultRenderer()} through queue
|
|
343 |
*/
|
|
344 |
public TableCellRenderer getDefaultRenderer() {
|
|
345 |
return (runMapping(new MapAction<TableCellRenderer>("getDefaultRenderer") {
|
|
346 |
@Override
|
|
347 |
public TableCellRenderer map() {
|
|
348 |
return ((JTableHeader) getSource()).getDefaultRenderer();
|
|
349 |
}
|
|
350 |
}));
|
|
351 |
}
|
|
352 |
|
|
353 |
/**
|
|
354 |
* Maps {@code JTableHeader.columnAtPoint(Point)} through queue
|
|
355 |
*/
|
|
356 |
public int columnAtPoint(final Point point) {
|
|
357 |
return (runMapping(new MapIntegerAction("columnAtPoint") {
|
|
358 |
@Override
|
|
359 |
public int map() {
|
|
360 |
return ((JTableHeader) getSource()).columnAtPoint(point);
|
|
361 |
}
|
|
362 |
}));
|
|
363 |
}
|
|
364 |
|
|
365 |
/**
|
|
366 |
* Maps {@code JTableHeader.getHeaderRect(int)} through queue
|
|
367 |
*/
|
|
368 |
public Rectangle getHeaderRect(final int i) {
|
|
369 |
return (runMapping(new MapAction<Rectangle>("getHeaderRect") {
|
|
370 |
@Override
|
|
371 |
public Rectangle map() {
|
|
372 |
return ((JTableHeader) getSource()).getHeaderRect(i);
|
|
373 |
}
|
|
374 |
}));
|
|
375 |
}
|
|
376 |
|
|
377 |
/**
|
|
378 |
* Maps {@code JTableHeader.getUI()} through queue
|
|
379 |
*/
|
|
380 |
public TableHeaderUI getUI() {
|
|
381 |
return (runMapping(new MapAction<TableHeaderUI>("getUI") {
|
|
382 |
@Override
|
|
383 |
public TableHeaderUI map() {
|
|
384 |
return ((JTableHeader) getSource()).getUI();
|
|
385 |
}
|
|
386 |
}));
|
|
387 |
}
|
|
388 |
|
|
389 |
/**
|
|
390 |
* Maps {@code JTableHeader.setUI(TableHeaderUI)} through queue
|
|
391 |
*/
|
|
392 |
public void setUI(final TableHeaderUI tableHeaderUI) {
|
|
393 |
runMapping(new MapVoidAction("setUI") {
|
|
394 |
@Override
|
|
395 |
public void map() {
|
|
396 |
((JTableHeader) getSource()).setUI(tableHeaderUI);
|
|
397 |
}
|
|
398 |
});
|
|
399 |
}
|
|
400 |
|
|
401 |
/**
|
|
402 |
* Maps {@code JTableHeader.setColumnModel(TableColumnModel)} through queue
|
|
403 |
*/
|
|
404 |
public void setColumnModel(final TableColumnModel tableColumnModel) {
|
|
405 |
runMapping(new MapVoidAction("setColumnModel") {
|
|
406 |
@Override
|
|
407 |
public void map() {
|
|
408 |
((JTableHeader) getSource()).setColumnModel(tableColumnModel);
|
|
409 |
}
|
|
410 |
});
|
|
411 |
}
|
|
412 |
|
|
413 |
/**
|
|
414 |
* Maps {@code JTableHeader.getColumnModel()} through queue
|
|
415 |
*/
|
|
416 |
public TableColumnModel getColumnModel() {
|
|
417 |
return (runMapping(new MapAction<TableColumnModel>("getColumnModel") {
|
|
418 |
@Override
|
|
419 |
public TableColumnModel map() {
|
|
420 |
return ((JTableHeader) getSource()).getColumnModel();
|
|
421 |
}
|
|
422 |
}));
|
|
423 |
}
|
|
424 |
|
|
425 |
/**
|
|
426 |
* Maps {@code JTableHeader.columnAdded(TableColumnModelEvent)} through queue
|
|
427 |
*/
|
|
428 |
public void columnAdded(final TableColumnModelEvent tableColumnModelEvent) {
|
|
429 |
runMapping(new MapVoidAction("columnAdded") {
|
|
430 |
@Override
|
|
431 |
public void map() {
|
|
432 |
((JTableHeader) getSource()).columnAdded(tableColumnModelEvent);
|
|
433 |
}
|
|
434 |
});
|
|
435 |
}
|
|
436 |
|
|
437 |
/**
|
|
438 |
* Maps {@code JTableHeader.columnRemoved(TableColumnModelEvent)}
|
|
439 |
* through queue
|
|
440 |
*/
|
|
441 |
public void columnRemoved(final TableColumnModelEvent tableColumnModelEvent) {
|
|
442 |
runMapping(new MapVoidAction("columnRemoved") {
|
|
443 |
@Override
|
|
444 |
public void map() {
|
|
445 |
((JTableHeader) getSource()).columnRemoved(tableColumnModelEvent);
|
|
446 |
}
|
|
447 |
});
|
|
448 |
}
|
|
449 |
|
|
450 |
/**
|
|
451 |
* Maps {@code JTableHeader.columnMoved(TableColumnModelEvent)} through queue
|
|
452 |
*/
|
|
453 |
public void columnMoved(final TableColumnModelEvent tableColumnModelEvent) {
|
|
454 |
runMapping(new MapVoidAction("columnMoved") {
|
|
455 |
@Override
|
|
456 |
public void map() {
|
|
457 |
((JTableHeader) getSource()).columnMoved(tableColumnModelEvent);
|
|
458 |
}
|
|
459 |
});
|
|
460 |
}
|
|
461 |
|
|
462 |
/**
|
|
463 |
* Maps {@code JTableHeader.columnMarginChanged(ChangeEvent)} through queue
|
|
464 |
*/
|
|
465 |
public void columnMarginChanged(final ChangeEvent changeEvent) {
|
|
466 |
runMapping(new MapVoidAction("columnMarginChanged") {
|
|
467 |
@Override
|
|
468 |
public void map() {
|
|
469 |
((JTableHeader) getSource()).columnMarginChanged(changeEvent);
|
|
470 |
}
|
|
471 |
});
|
|
472 |
}
|
|
473 |
|
|
474 |
/**
|
|
475 |
* Maps {@code JTableHeader.columnSelectionChanged(ListSelectionEvent)}
|
|
476 |
* through queue
|
|
477 |
*/
|
|
478 |
public void columnSelectionChanged(final ListSelectionEvent listSelectionEvent) {
|
|
479 |
runMapping(new MapVoidAction("columnSelectionChanged") {
|
|
480 |
@Override
|
|
481 |
public void map() {
|
|
482 |
((JTableHeader) getSource()).columnSelectionChanged(listSelectionEvent);
|
|
483 |
}
|
|
484 |
});
|
|
485 |
}
|
|
486 |
|
|
487 |
/**
|
|
488 |
* Maps {@code JTableHeader.resizeAndRepaint()} through queue
|
|
489 |
*/
|
|
490 |
public void resizeAndRepaint() {
|
|
491 |
runMapping(new MapVoidAction("resizeAndRepaint") {
|
|
492 |
@Override
|
|
493 |
public void map() {
|
|
494 |
((JTableHeader) getSource()).resizeAndRepaint();
|
|
495 |
}
|
|
496 |
});
|
|
497 |
}
|
|
498 |
|
|
499 |
/**
|
|
500 |
* Maps {@code JTableHeader.setDraggedColumn(TableColumn)} through queue
|
|
501 |
*/
|
|
502 |
public void setDraggedColumn(final TableColumn tableColumn) {
|
|
503 |
runMapping(new MapVoidAction("setDraggedColumn") {
|
|
504 |
@Override
|
|
505 |
public void map() {
|
|
506 |
((JTableHeader) getSource()).setDraggedColumn(tableColumn);
|
|
507 |
}
|
|
508 |
});
|
|
509 |
}
|
|
510 |
|
|
511 |
/**
|
|
512 |
* Maps {@code JTableHeader.setDraggedDistance(int)} through queue
|
|
513 |
*/
|
|
514 |
public void setDraggedDistance(final int i) {
|
|
515 |
runMapping(new MapVoidAction("setDraggedDistance") {
|
|
516 |
@Override
|
|
517 |
public void map() {
|
|
518 |
((JTableHeader) getSource()).setDraggedDistance(i);
|
|
519 |
}
|
|
520 |
});
|
|
521 |
}
|
|
522 |
|
|
523 |
/**
|
|
524 |
* Maps {@code JTableHeader.setResizingColumn(TableColumn)} through queue
|
|
525 |
*/
|
|
526 |
public void setResizingColumn(final TableColumn tableColumn) {
|
|
527 |
runMapping(new MapVoidAction("setResizingColumn") {
|
|
528 |
@Override
|
|
529 |
public void map() {
|
|
530 |
((JTableHeader) getSource()).setResizingColumn(tableColumn);
|
|
531 |
}
|
|
532 |
});
|
|
533 |
}
|
|
534 |
|
|
535 |
//End of mapping //
|
|
536 |
////////////////////////////////////////////////////////
|
|
537 |
/**
|
|
538 |
* Checks component type.
|
|
539 |
*/
|
|
540 |
public static class JTableHeaderFinder implements ComponentChooser {
|
|
541 |
|
|
542 |
ComponentChooser subFinder;
|
|
543 |
|
|
544 |
/**
|
|
545 |
* Constructs JTableHeaderFinder.
|
|
546 |
*
|
|
547 |
* @param sf other searching criteria.
|
|
548 |
*/
|
|
549 |
public JTableHeaderFinder(ComponentChooser sf) {
|
|
550 |
subFinder = sf;
|
|
551 |
}
|
|
552 |
|
|
553 |
@Override
|
|
554 |
public boolean checkComponent(Component comp) {
|
|
555 |
if (comp instanceof JTableHeader) {
|
|
556 |
return subFinder.checkComponent(comp);
|
|
557 |
}
|
|
558 |
return false;
|
|
559 |
}
|
|
560 |
|
|
561 |
@Override
|
|
562 |
public String getDescription() {
|
|
563 |
return subFinder.getDescription();
|
|
564 |
}
|
|
565 |
|
|
566 |
@Override
|
|
567 |
public String toString() {
|
|
568 |
return "JTableHeaderFinder{" + "subFinder=" + subFinder + '}';
|
|
569 |
}
|
|
570 |
}
|
|
571 |
}
|