| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.fest.swing.edt; |
| 17 |
|
|
| 18 |
|
import static javax.swing.SwingUtilities.isEventDispatchThread; |
| 19 |
|
import static org.fest.swing.exception.ActionFailedException.actionFailure; |
| 20 |
|
|
| 21 |
|
import org.fest.swing.exception.ActionFailedException; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
@param |
| 26 |
|
|
| 27 |
|
@author |
| 28 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 5 |
Complexity Density: 0.62 |
|
| 29 |
|
public abstract class GuiQuery<T> extends GuiAction { |
| 30 |
|
|
| 31 |
|
private T result; |
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
@throws |
| 36 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
| 37 |
148956
|
public final void run() {... |
| 38 |
148956
|
if (!isEventDispatchThread()) |
| 39 |
1
|
throw actionFailure("Query should be executed in the event dispatch thread"); |
| 40 |
148955
|
try { |
| 41 |
148955
|
result = executeInEDT(); |
| 42 |
|
} catch (Throwable t) { |
| 43 |
283
|
catchedException(t); |
| 44 |
|
} finally { |
| 45 |
148955
|
notifyExecutionCompleted(); |
| 46 |
|
} |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
|
| 50 |
|
|
| 51 |
|
@return |
| 52 |
|
@throws |
| 53 |
|
|
| 54 |
|
protected abstract T executeInEDT() throws Throwable; |
| 55 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 56 |
148955
|
final T result() { return result; }... |
| 57 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 58 |
148955
|
final void clearResult() {... |
| 59 |
148955
|
result = null; |
| 60 |
|
} |
| 61 |
|
} |