How to edit the Editor TextArea from a Tool?

Hey, i’m trying to develop a tool that allows you to write code to the IDE in different ways. What i mean by this is similar to how (probably) G4P works, by adding specific lines of code to the TextArea used in the Editor, (or another example would be the Extended Code Completion Tool).

I tried looking into Processings source code to see if there was a way to easily edit the TextArea (or JTextArea or SketchCode or “AST/ASTNode/Block”(which apparently is not even part of processing, but eclipse, and after finding the source code for that, i gave up for some weeks…) or some PDEX…).

Anything is really appreciated, but best would be something that has these two methods :

getCode(); //to get the code in the Text editor. This is not 
//the problem... not the biggest at least...i think i found 
//maybe 3-5 ways to get that (even if not elegant at all)


setCode(); //i just can't find a way to do this one though...
//I probably can't just randomly set a TextField to the Code
// i want to... even if it's the code i 
//got from it, plus just one line...

So if anyone knows a way to access the Editor with a Tool, please tell me :sweat_smile:

1 Like

Hi! At https://github.com/processing/processing/wiki there are three pages detailing tools. The second one shows you how to wipe the code in the code text area.

2 Likes

Thank you soooo much :sweat_smile:
I can‘t believe i searched for so long and then the answer was right there all the Time (btw, i looked at that page around 3 times already before, but Never noticed that :weary: ).
Oh well, at least now i can get on with the Tool :wink:
Thanks again :blush:

1 Like