Monday, 15 June 2015

eclipse - how to synchronize the java file with dynamically generated file? -



eclipse - how to synchronize the java file with dynamically generated file? -

i have created eclipse plugin dynamically generate text file. when user right click method bundle explorer generate new file class construction , method body. want synchronize these 2 files. when user create changes in method within java file. must updated in generated file.

consider scenario have java file 2 methods

public class calculator{ public int add(int ,int b){ int c=a+b; homecoming c; } public int sub(int ,int b){ int c=a-b; homecoming c; } }

the user right click add together method bundle explorer , generate file. file follows

file name generated based on class name , method name.

calculator_add.txt:

public class calculator{ public int add(int ,int b){ int c=a+b; homecoming c; } }

if user changes logic in method must reflected in generated file. how can accomplish in eclipse. please give suggestion. much helpful.

i'm not sure should done way; describe sounds more buildstep alike thing mark methods want included/processed

so bit restructure original problem , seek give hints that

when user selects method; method added list of tobecopied things add custom builder or "generate outputs" menu item process can launched when runs, iterates on list of tobecopied , reads methods

i hope helps

java eclipse eclipse-plugin eclipse-jdt

No comments:

Post a Comment