简体   繁体   English

如何使用 java 代码为自定义代码创建编辑器

[英]How can I create an editor for a custom code using java code

I'm reading methods from a text file and then execute them in my java program.我正在从文本文件中读取方法,然后在我的 java 程序中执行它们。 For this I'm using java reflection.为此,我使用 java 反射。 I want to know how can I create an editor for these text files so that I can have syntax coloring and code completion (and maybe later on compiling) because today these files are hard to read.我想知道如何为这些文本文件创建一个编辑器,以便我可以进行语法着色和代码完成(可能稍后在编译时),因为今天这些文件很难阅读。

Do you have any idea where should I start looking?你知道我应该从哪里开始寻找吗?

Here is an example of a lines in the file:以下是文件中一行的示例:

a := 5;

b := 6;

sum := add(a, b);

Better don't create your own text editor, it's not worth the effort.最好不要创建自己的文本编辑器,这不值得。 Just create some custom syntax highlighting, for example for IntellijIdea or any other text editor which you prefer.只需创建一些自定义语法突出显示,例如 IntellijIdea 或您喜欢的任何其他文本编辑器。 Example for IntellijIdea: https://blog.jetbrains.com/idea/2010/09/custom-file-types-in-intellij-idea/ IntellijIdea 示例: https://blog.jetbrains.com/idea/2010/09/custom-file-types-in-intellij-idea/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何创建一个可以在应用程序中“运行Java代码”的文本编辑器? - How to create a text editor that can “run Java code” in an application? 如何在Java中为异常创建自定义HTTP错误代码? - How do I create a custom HTTP error code in Java for an exception? 如何仅使用代码而不使用图形拖放来用Java创建GUI? [超级新手] - How can I create a GUI in Java using only code and not the graphical drag and drop? [uber-newbie] 如何用Java创建对象对或组织代码 - How can I create pairs of objects in Java or organize my code 如何在Android中用Java代码创建一个Radio组? - How can i create a Radio group in java code in Android? 如何为Java创建或编码以自动递增电子邮件 - How can I create or code to auto increment email, for java 如何使用rejava(reJ)调试jave字节码? (Java字节码编辑器) - How can I use rejava (reJ) to debug jave bytecode? (java byte code editor) 如何运行用Sublime Editor创建的Java代码? - How to run my Java code that I created with sublime editor? 如何为org.quartz.JobDetail创建自定义编辑器? - How can I create a custom editor for org.quartz.JobDetail? 如何使用 ThreadpoolExecutor 和 Callable Future 创建多线程代码 - How can I create multithreaded code using ThreadpoolExecutor & Callable Future
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM