mirror of https://gitee.com/makejava/EasyCode.git
修复乱码问题,并修复针对部分版本无法获取module的虚拟文件问题。
This commit is contained in:
parent
5a19e37707
commit
8670fcb0fc
|
@ -119,8 +119,9 @@ public class VelocityUtils {
|
|||
map.put("packageName", cacheDataUtils.getPackageName());
|
||||
if (selectModule != null) {
|
||||
//module绝对路径
|
||||
//noinspection ConstantConditions
|
||||
map.put("modulePath", selectModule.getModuleFile().getParent().getPath());
|
||||
if (selectModule.getModuleFile()!=null) {
|
||||
map.put("modulePath", selectModule.getModuleFile().getParent().getPath());
|
||||
}
|
||||
map.put("moduleName", selectModule.getName());
|
||||
}
|
||||
return map;
|
||||
|
|
|
@ -217,8 +217,12 @@ public class SelectSavePath extends JDialog {
|
|||
//选择路径
|
||||
pathChooseButton.addActionListener(e -> {
|
||||
//将当前选中的model设置为基础路径
|
||||
//noinspection ConstantConditions
|
||||
VirtualFile virtualFile = FileChooser.chooseFile(FileChooserDescriptorFactory.createSingleFolderDescriptor(), cacheDataUtils.getProject(), getSelectModule().getModuleFile().getParent());
|
||||
VirtualFile path = cacheDataUtils.getProject().getBaseDir();
|
||||
Module module = getSelectModule();
|
||||
if (module!=null && module.getModuleFile()!=null) {
|
||||
path = module.getModuleFile().getParent();
|
||||
}
|
||||
VirtualFile virtualFile = FileChooser.chooseFile(FileChooserDescriptorFactory.createSingleFolderDescriptor(), cacheDataUtils.getProject(), path);
|
||||
if (virtualFile != null) {
|
||||
pathField.setText(virtualFile.getPath());
|
||||
}
|
||||
|
@ -259,8 +263,10 @@ public class SelectSavePath extends JDialog {
|
|||
*/
|
||||
private String getBasePath() {
|
||||
Module module = getSelectModule();
|
||||
//noinspection ConstantConditions
|
||||
String baseDir = module.getModuleFile().getParent().getPath();
|
||||
String baseDir = cacheDataUtils.getProject().getBasePath();
|
||||
if (module!=null && module.getModuleFile()!=null) {
|
||||
baseDir = module.getModuleFile().getParent().getPath();
|
||||
}
|
||||
// 针对Maven项目
|
||||
File file = new File(baseDir + "/src/main/java");
|
||||
if (file.exists()) {
|
||||
|
|
Loading…
Reference in New Issue