summaryrefslogtreecommitdiffstats
path: root/src/cppcheckplus/menu/MyMenu.java
diff options
context:
space:
mode:
authorWe-unite <3205135446@qq.com>2025-02-21 16:11:32 +0800
committerWe-unite <3205135446@qq.com>2025-02-21 16:11:32 +0800
commit9ff0011281e6ee6324509003463e371a9c213aa8 (patch)
treea588132a898b004aaefc587e674c8f459401e00b /src/cppcheckplus/menu/MyMenu.java
parent82e3bb8888849e8a47acf5676f5baa63875550c6 (diff)
downloadproject-9ff0011281e6ee6324509003463e371a9c213aa8.tar.gz
project-9ff0011281e6ee6324509003463e371a9c213aa8.zip
Tools configuration decoupled from ui frame.
In this commit, I made HUGE changes: What about the main class? =========== The Main class is devided into 2 parts, one is just to call main func, while the other works as the ui frame of the whole program, to make them clear. In the old program, in the main function we `new Main`, and the main code of ui is in the constuctor of Main. What a chaos! In fact, the whole ui is not necessary to be in Main class. Let's make another room. Decoupling!!! =========== Decouple the execute part of each check tool into independent class. As you see, there's a new package named `toolsconfig`, and an abstract class `ToolsConfig` is the basic class of all other tool class. Path, paramaters, textPanel, result are all in each class. Also, to make it easier to use, there's a class named `ToolsRegistry`. Its core is a "hash map : tool name --> tool class". As a result of which, we need to call the constructor of each class, and they will register themselves. The best way to construct them, is to do while parsing the settings.xml. In order to make lower change to MyContorlUtil::loadToolsRoad, I made a trick here, using the tool name to find its class by reflection, then new an object for it and calls the constructor. Hope all changes works well. Best wishes.
Diffstat (limited to 'src/cppcheckplus/menu/MyMenu.java')
0 files changed, 0 insertions, 0 deletions