| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
package org.fest.swing.fixture; |
| 16 |
|
|
| 17 |
|
import java.awt.Point; |
| 18 |
|
import java.util.regex.Pattern; |
| 19 |
|
|
| 20 |
|
import javax.swing.JPanel; |
| 21 |
|
|
| 22 |
|
import org.fest.swing.core.*; |
| 23 |
|
import org.fest.swing.driver.JComponentDriver; |
| 24 |
|
import org.fest.swing.exception.ComponentLookupException; |
| 25 |
|
import org.fest.swing.exception.WaitTimedOutError; |
| 26 |
|
import org.fest.swing.timing.Timeout; |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
@link |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
@author |
| 37 |
|
@author |
| 38 |
|
|
|
|
|
| 32.4% |
Uncovered Elements: 48 (71) |
Complexity: 25 |
Complexity Density: 0.54 |
|
| 39 |
|
public class JPanelFixture extends ContainerFixture<JPanel> implements CommonComponentFixture, JComponentFixture, |
| 40 |
|
JPopupMenuInvokerFixture { |
| 41 |
|
|
| 42 |
|
private JComponentDriver driver; |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
@link |
| 46 |
|
@param |
| 47 |
|
@param |
| 48 |
|
@throws |
| 49 |
|
@throws |
| 50 |
|
@throws |
| 51 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 52 |
1
|
public JPanelFixture(Robot robot, String panelName) {... |
| 53 |
1
|
super(robot, panelName, JPanel.class); |
| 54 |
1
|
createDriver(); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
|
| 58 |
|
@link |
| 59 |
|
@param |
| 60 |
|
@param |
| 61 |
|
@throws |
| 62 |
|
@throws |
| 63 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 64 |
10
|
public JPanelFixture(Robot robot, JPanel target) {... |
| 65 |
10
|
super(robot, target); |
| 66 |
10
|
createDriver(); |
| 67 |
|
} |
| 68 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 69 |
11
|
private void createDriver() {... |
| 70 |
11
|
driver(new JComponentDriver(robot)); |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
|
| 74 |
|
@link |
| 75 |
|
@param |
| 76 |
|
@throws |
| 77 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 78 |
18
|
protected final void driver(JComponentDriver newDriver) {... |
| 79 |
18
|
validateNotNull(newDriver); |
| 80 |
17
|
driver = newDriver; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
|
| 84 |
|
@link |
| 85 |
|
@return |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 87 |
0
|
public JPanelFixture click() {... |
| 88 |
0
|
driver.click(target); |
| 89 |
0
|
return this; |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
|
| 93 |
|
@link |
| 94 |
|
@param |
| 95 |
|
@return |
| 96 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 97 |
0
|
public JPanelFixture click(MouseButton button) {... |
| 98 |
0
|
driver.click(target, button); |
| 99 |
0
|
return this; |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
|
| 103 |
|
@link |
| 104 |
|
@param |
| 105 |
|
@return |
| 106 |
|
@throws |
| 107 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 108 |
0
|
public JPanelFixture click(MouseClickInfo mouseClickInfo) {... |
| 109 |
0
|
driver.click(target, mouseClickInfo); |
| 110 |
0
|
return this; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
|
| 114 |
|
@link |
| 115 |
|
@return |
| 116 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 117 |
0
|
public JPanelFixture rightClick() {... |
| 118 |
0
|
driver.rightClick(target); |
| 119 |
0
|
return this; |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
|
| 123 |
|
@link |
| 124 |
|
@return |
| 125 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 126 |
0
|
public JPanelFixture doubleClick() {... |
| 127 |
0
|
driver.doubleClick(target); |
| 128 |
0
|
return this; |
| 129 |
|
} |
| 130 |
|
|
| 131 |
|
|
| 132 |
|
@link |
| 133 |
|
@return |
| 134 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 135 |
0
|
public JPanelFixture focus() {... |
| 136 |
0
|
driver.focus(target); |
| 137 |
0
|
return this; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
|
| 141 |
|
@link |
| 142 |
|
@link |
| 143 |
|
@param |
| 144 |
|
@return |
| 145 |
|
@throws |
| 146 |
|
@throws |
| 147 |
|
@see |
| 148 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 149 |
0
|
public JPanelFixture pressAndReleaseKey(KeyPressInfo keyPressInfo) {... |
| 150 |
0
|
driver.pressAndReleaseKey(target, keyPressInfo); |
| 151 |
0
|
return this; |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
|
| 155 |
|
@link |
| 156 |
|
|
| 157 |
|
@param |
| 158 |
|
@return |
| 159 |
|
@throws |
| 160 |
|
@throws |
| 161 |
|
@see |
| 162 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 163 |
0
|
public JPanelFixture pressAndReleaseKeys(int... keyCodes) {... |
| 164 |
0
|
driver.pressAndReleaseKeys(target, keyCodes); |
| 165 |
0
|
return this; |
| 166 |
|
} |
| 167 |
|
|
| 168 |
|
|
| 169 |
|
@link |
| 170 |
|
@param |
| 171 |
|
@return |
| 172 |
|
@throws |
| 173 |
|
@see |
| 174 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 175 |
0
|
public JPanelFixture pressKey(int keyCode) {... |
| 176 |
0
|
driver.pressKey(target, keyCode); |
| 177 |
0
|
return this; |
| 178 |
|
} |
| 179 |
|
|
| 180 |
|
|
| 181 |
|
@link |
| 182 |
|
@param |
| 183 |
|
@return |
| 184 |
|
@throws |
| 185 |
|
@see |
| 186 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 187 |
0
|
public JPanelFixture releaseKey(int keyCode) {... |
| 188 |
0
|
driver.releaseKey(target, keyCode); |
| 189 |
0
|
return this; |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
|
| 193 |
|
@link |
| 194 |
|
@return |
| 195 |
|
@throws |
| 196 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 197 |
0
|
public JPanelFixture requireFocused() {... |
| 198 |
0
|
driver.requireFocused(target); |
| 199 |
0
|
return this; |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
|
| 203 |
|
@link |
| 204 |
|
@return |
| 205 |
|
@throws |
| 206 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 207 |
0
|
public JPanelFixture requireEnabled() {... |
| 208 |
0
|
driver.requireEnabled(target); |
| 209 |
0
|
return this; |
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
|
| 213 |
|
@link |
| 214 |
|
@param |
| 215 |
|
@return |
| 216 |
|
@throws |
| 217 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 218 |
0
|
public JPanelFixture requireEnabled(Timeout timeout) {... |
| 219 |
0
|
driver.requireEnabled(target, timeout); |
| 220 |
0
|
return this; |
| 221 |
|
} |
| 222 |
|
|
| 223 |
|
|
| 224 |
|
@link |
| 225 |
|
@return |
| 226 |
|
@throws |
| 227 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 228 |
0
|
public JPanelFixture requireDisabled() {... |
| 229 |
0
|
driver.requireDisabled(target); |
| 230 |
0
|
return this; |
| 231 |
|
} |
| 232 |
|
|
| 233 |
|
|
| 234 |
|
@link |
| 235 |
|
@return |
| 236 |
|
@throws |
| 237 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 238 |
0
|
public JPanelFixture requireVisible() {... |
| 239 |
0
|
driver.requireVisible(target); |
| 240 |
0
|
return this; |
| 241 |
|
} |
| 242 |
|
|
| 243 |
|
|
| 244 |
|
@link |
| 245 |
|
@return |
| 246 |
|
@throws |
| 247 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 248 |
0
|
public JPanelFixture requireNotVisible() {... |
| 249 |
0
|
driver.requireNotVisible(target); |
| 250 |
0
|
return this; |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
|
| 254 |
|
@link |
| 255 |
|
@param |
| 256 |
|
@return |
| 257 |
|
@throws |
| 258 |
|
@since |
| 259 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 260 |
1
|
public JPanelFixture requireToolTip(String expected) {... |
| 261 |
1
|
driver.requireToolTip(target, expected); |
| 262 |
1
|
return this; |
| 263 |
|
} |
| 264 |
|
|
| 265 |
|
|
| 266 |
|
@link |
| 267 |
|
|
| 268 |
|
@param |
| 269 |
|
@return |
| 270 |
|
@throws |
| 271 |
|
@throws |
| 272 |
|
|
| 273 |
|
@since |
| 274 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 275 |
1
|
public JPanelFixture requireToolTip(Pattern pattern) {... |
| 276 |
1
|
driver.requireToolTip(target, pattern); |
| 277 |
1
|
return this; |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
|
| 281 |
|
@link |
| 282 |
|
@param |
| 283 |
|
@return |
| 284 |
|
|
| 285 |
|
@throws |
| 286 |
|
@since |
| 287 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 288 |
1
|
public Object clientProperty(Object key) {... |
| 289 |
1
|
return driver.clientProperty(target, key); |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
|
| 293 |
|
@link |
| 294 |
|
@return |
| 295 |
|
@throws |
| 296 |
|
@throws |
| 297 |
|
@throws |
| 298 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 299 |
1
|
public JPopupMenuFixture showPopupMenu() {... |
| 300 |
1
|
return new JPopupMenuFixture(robot, driver.invokePopupMenu(target)); |
| 301 |
|
} |
| 302 |
|
|
| 303 |
|
|
| 304 |
|
@link |
| 305 |
|
|
| 306 |
|
@param |
| 307 |
|
@return |
| 308 |
|
@throws |
| 309 |
|
@throws |
| 310 |
|
@throws |
| 311 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 312 |
1
|
public JPopupMenuFixture showPopupMenuAt(Point p) {... |
| 313 |
1
|
return new JPopupMenuFixture(robot, driver.invokePopupMenu(target, p)); |
| 314 |
|
} |
| 315 |
|
} |