запаковка со стороны визуализатора инклудов
This commit is contained in:
10
.idea/workspace.xml
generated
10
.idea/workspace.xml
generated
@@ -7,17 +7,9 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludeToInsertJson.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludesToInsertJson.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_InsertIncludesPass.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/Project/db_project_info.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/FileInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Analysis/FileInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Include.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Analysis/Include.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Json/FileIncludesJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Analysis/Json/FileIncludesJson.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Json/IncludesJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Analysis/Json/IncludesJson.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/UI/IncludesMenu.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/UI/IncludesMenu.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludeToInsertJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/Includes/Transformation/IncludeToInsertJson.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -6,6 +6,8 @@ import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Sapfor.SapforTransformation;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.FileInfo;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Analysis.Include;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Transformation.IncludeToInsertJson;
|
||||
import _VisualDVM.ProjectData.SapforData.Includes.Transformation.IncludesToInsertJson;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -24,23 +26,18 @@ public class SPF_InsertIncludesPass extends SapforTransformation {
|
||||
Log.Writeln_("Не найдено файлов, имеющих зависимости по включению.");
|
||||
return false;
|
||||
}
|
||||
Vector<String> Result = new Vector<>();
|
||||
IncludesToInsertJson includes = new IncludesToInsertJson();
|
||||
for (FileInfo fileInfo : target.addictedFiles.values()) {
|
||||
Vector<Include> selected_children = fileInfo.dependencies.stream().filter(Selectable::isSelected).collect(Collectors.toCollection(Vector::new));
|
||||
if (!selected_children.isEmpty()) {
|
||||
Result.add(fileInfo.file);
|
||||
Result.add(String.valueOf(selected_children.size()));
|
||||
for (Include di : selected_children) {
|
||||
Result.add(String.valueOf(di.line));
|
||||
Result.add(di.dependencyFileName);
|
||||
}
|
||||
}
|
||||
if (!selected_children.isEmpty())
|
||||
for (Include di : selected_children)
|
||||
includes.allIncludes.add(new IncludeToInsertJson(di.dependencyFileName,fileInfo.file, di.line));
|
||||
}
|
||||
if (Result.isEmpty()) {
|
||||
if (includes.allIncludes.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одного заголовка для подстановки");
|
||||
return false;
|
||||
}
|
||||
Options = Utils_.toU(String.join("|", Result));
|
||||
Options = Utils_.gson.toJson(includes);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package _VisualDVM.ProjectData.SapforData.Includes.Transformation;
|
||||
import Common.Utils.Utils_;
|
||||
import com.google.gson.annotations.Expose;
|
||||
public class IncludeToInsertJson {
|
||||
@Expose
|
||||
@@ -7,4 +8,14 @@ public class IncludeToInsertJson {
|
||||
public String fileName;
|
||||
@Expose
|
||||
public int line;
|
||||
//--
|
||||
public IncludeToInsertJson(){
|
||||
|
||||
}
|
||||
//--
|
||||
public IncludeToInsertJson(String includeName_in, String fileName_in, int line_in){
|
||||
includeName = Utils_.toU(includeName_in);
|
||||
fileName = Utils_.toU(fileName_in);
|
||||
line= line_in;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user