()
| 310 | } |
| 311 | |
| 312 | private void toggleMatchable() { |
| 313 | ClassInstance cls = srcPane.getSelectedClass(); |
| 314 | if (cls == null) return; |
| 315 | |
| 316 | if (!cls.isMatchable() || !cls.hasMatch()) { |
| 317 | boolean newValue = !cls.isMatchable(); |
| 318 | if (!newValue && !cls.hasPotentialMatch()) return; |
| 319 | |
| 320 | cls.setMatchable(newValue); |
| 321 | gui.onMatchChange(EnumSet.allOf(MatchType.class)); |
| 322 | return; |
| 323 | } |
| 324 | |
| 325 | MemberInstance<?> member = srcPane.getSelectedMethod(); |
| 326 | if (member == null) member = srcPane.getSelectedField(); |
| 327 | |
| 328 | if (!member.isMatchable() || !member.hasMatch()) { |
| 329 | boolean newValue = !member.isMatchable(); |
| 330 | if (!newValue && !member.hasPotentialMatch()) return; |
| 331 | |
| 332 | if (member.setMatchable(newValue)) { |
| 333 | gui.onMatchChange(member instanceof MethodInstance ? EnumSet.of(MatchType.Method, MatchType.MethodVar) : EnumSet.of(MatchType.Field)); |
| 334 | } |
| 335 | |
| 336 | return; |
| 337 | } |
| 338 | |
| 339 | MethodVarInstance var = srcPane.getSelectedMethodVar(); |
| 340 | |
| 341 | if (!var.isMatchable() || !var.hasMatch()) { |
| 342 | boolean newValue = !var.isMatchable(); |
| 343 | if (!newValue && !var.hasPotentialMatch()) return; |
| 344 | |
| 345 | var.setMatchable(!var.isMatchable()); |
| 346 | gui.onMatchChange(EnumSet.of(MatchType.MethodVar)); |
| 347 | return; |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | private class SelectListener implements IGuiComponent { |
| 352 | @Override |
no test coverage detected