Load a file and apply mappings of the given type. @param impl Mapping implementation type.
(MappingImpl impl)
| 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()); |
no test coverage detected