MCPcopy Create free account
hub / github.com/FabricMC/Matcher / toggleMatchable

Method toggleMatchable

src/main/java/matcher/gui/BottomPane.java:312–349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

initMethod · 0.95

Calls 15

isMatchableMethod · 0.95
hasPotentialMatchMethod · 0.95
setMatchableMethod · 0.95
isMatchableMethod · 0.95
hasPotentialMatchMethod · 0.95
setMatchableMethod · 0.95
hasMatchMethod · 0.80
getSelectedClassMethod · 0.65
onMatchChangeMethod · 0.65
getSelectedMethodMethod · 0.65
getSelectedFieldMethod · 0.65
isMatchableMethod · 0.65

Tested by

no test coverage detected