diff options
Diffstat (limited to 'src/cppcheckplus/control/MyContorlUtil.java')
-rw-r--r-- | src/cppcheckplus/control/MyContorlUtil.java | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/cppcheckplus/control/MyContorlUtil.java b/src/cppcheckplus/control/MyContorlUtil.java index acdc9ba..a43d570 100644 --- a/src/cppcheckplus/control/MyContorlUtil.java +++ b/src/cppcheckplus/control/MyContorlUtil.java | |||
@@ -47,6 +47,7 @@ import org.w3c.dom.Document; | |||
47 | import org.w3c.dom.Element; | 47 | import org.w3c.dom.Element; |
48 | import org.w3c.dom.Node; | 48 | import org.w3c.dom.Node; |
49 | import org.w3c.dom.NodeList; | 49 | import org.w3c.dom.NodeList; |
50 | import toolsconfig.ToolsRegistry; | ||
50 | 51 | ||
51 | 52 | ||
52 | /** | 53 | /** |
@@ -368,7 +369,7 @@ public class MyContorlUtil { | |||
368 | 369 | ||
369 | } | 370 | } |
370 | 371 | ||
371 | public static void loadToolsRoad(String xml, Main main) { | 372 | public static void loadToolsRoad(String xml, UIFrame main) { |
372 | try { | 373 | try { |
373 | DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); | 374 | DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); |
374 | DocumentBuilder db = dbf.newDocumentBuilder(); | 375 | DocumentBuilder db = dbf.newDocumentBuilder(); |
@@ -389,21 +390,15 @@ public class MyContorlUtil { | |||
389 | String para = | 390 | String para = |
390 | MyContorlUtil.getStringAttribute(menu, "para"); | 391 | MyContorlUtil.getStringAttribute(menu, "para"); |
391 | 392 | ||
392 | switch (toolName) { | 393 | try { |
393 | case "cppcheck": | 394 | Class<?> clazz = |
394 | main.cppcheckPath = filePath; | 395 | Class.forName("toolsconfig." + toolName); |
395 | main.paracppcheck = para; | 396 | Object obj = clazz.getDeclaredConstructor() |
396 | break; | 397 | .newInstance(); |
397 | case "flawfinder": | 398 | ToolsRegistry.getTool(toolName) |
398 | main.flawfinderPath = filePath; | 399 | .init(filePath, para, main); |
399 | main.paraflawfinder = para; | 400 | } catch (Exception e) { |
400 | break; | 401 | e.printStackTrace(); |
401 | case "clang-tidy": | ||
402 | main.clangtidyPath = filePath; | ||
403 | main.paraclangtidy = para; | ||
404 | break; | ||
405 | default: | ||
406 | break; | ||
407 | } | 402 | } |
408 | } | 403 | } |
409 | } | 404 | } |