处理Eclipse控制台上的Terminate按钮的单击? [英] Handle the click on the Terminate button of an Eclipse's console?
问题描述
使用Eclipse,我正在通过外部工具配置"启动外部程序.
Using Eclipse, I'm launching an external program through an "External Tool Configuration".
我的程序具有一个"bin/launch-program"可执行文件,但还有一个"bin/stop-program",这是停止该程序的唯一方法.
My program has a "bin/launch-program" executable, but also a "bin/stop-program" which is the only way to stop the program.
在"Eclipse的外部工具配置"的主"选项卡中,设置:
In my Eclipse's External Tool Configuration, tab "Main", I set:
- 位置:< PROGRAM_HOME>/bin/launch-program
- 工作目录:< PROGRAM_HOME>
但是我正在寻找一种处理 stop事件的方法.
But I'm looking a way to handle the stop event.
换句话说,启动外部程序效果很好:我在Eclipse的控制台中获得了输出.问题是:如何处理控制台的终止"按钮的单击,以启动特定的命令行?
In other words, launching an external program works well: I get the output in the Eclipse's console. The question is: how to handle the click on the Terminate button of the console, to launch a specific command line?
推荐答案
从eclipse控制台的终止"按钮终止程序等效于使用任务管理器将其杀死.在红色终止按钮上编辑命令并不安全,但是您可以使程序在退出前执行操作关机钩子
terminating the program from the terminate button of the eclipse console is equivalent to kill it by using a task manager. It's not safe to edit the command on the red terminate button, but you can make the program to do things before exiting shutdown hook
这篇关于处理Eclipse控制台上的Terminate按钮的单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!