Is there a way for an eclipse plugin to get a notification when user clicks on the "Terminate Debug" button?
当用户点击“终止调试”按钮时,有没有办法让eclipse插件获得通知?
1 个解决方案
#1
You can call
你可以打电话
DebugPlugin.getDefault().addDebugEventListener(listener);
to set up an IDebugEventSetListener
. The DebugEvent
passed to the handleDebugEvents
method of the listener has TERMINATE
as one of the event kinds.
设置IDebugEventSetListener。传递给侦听器的handleDebugEvents方法的DebugEvent将TERMINATE作为事件种类之一。
For example this handler is from the Ant plugin:
例如,这个处理程序来自Ant插件:
@Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
if (event.getKind() == DebugEvent.TERMINATE && event.getSource().equals(fProcess)) {
terminated();
}
}
}
#1
You can call
你可以打电话
DebugPlugin.getDefault().addDebugEventListener(listener);
to set up an IDebugEventSetListener
. The DebugEvent
passed to the handleDebugEvents
method of the listener has TERMINATE
as one of the event kinds.
设置IDebugEventSetListener。传递给侦听器的handleDebugEvents方法的DebugEvent将TERMINATE作为事件种类之一。
For example this handler is from the Ant plugin:
例如,这个处理程序来自Ant插件:
@Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
if (event.getKind() == DebugEvent.TERMINATE && event.getSource().equals(fProcess)) {
terminated();
}
}
}