MCPcopy
hub / github.com/Col-E/Recaf / applyMap

Method applyMap

src/main/java/me/coley/recaf/ui/MainMenu.java:374–388  ·  view source on GitHub ↗

Load a file and apply mappings of the given type. @param impl Mapping implementation type.

(MappingImpl impl)

Source from the content-addressed store, hash-verified

372 * @param impl Mapping implementation type.
373 */
374 private void applyMap(MappingImpl impl) {
375 fcLoadMap.setInitialDirectory(config().getRecentLoadDir());
376 File file = fcLoadMap.showOpenDialog(null);
377 if (file != null) {
378 try {
379 Mappings mappings = impl.create(file.toPath(), controller.getWorkspace());
380 mappings.setCheckFieldHierarchy(true);
381 mappings.setCheckMethodHierarchy(true);
382 mappings.accept(controller.getWorkspace().getPrimary());
383 } catch (Exception ex) {
384 error(ex, "Failed to apply mappings: {}", file.getName());
385 ExceptionAlert.show(ex, "Failed to apply mappings: " + file.getName());
386 }
387 }
388 }
389
390 private void applyTinyV2Map(TinyV2Mappings.TinyV2SubType subType) {
391 fcLoadMap.setInitialDirectory(config().getRecentLoadDir());

Callers 1

populateMappingMenusMethod · 0.95

Calls 12

configMethod · 0.95
acceptMethod · 0.95
showMethod · 0.95
getRecentLoadDirMethod · 0.80
toPathMethod · 0.80
getPrimaryMethod · 0.80
createMethod · 0.65
getNameMethod · 0.65
getWorkspaceMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected