eclipse plugin: get notification on debug terminate

∥☆過路亽.° 提交于 2021-02-10 20:30:55

问题


Is there a way for an eclipse plugin to get a notification when user clicks on the "Terminate Debug" button? enter image description here


回答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.

For example this handler is from the Ant plugin:

@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();
        }
    }
}


来源:https://stackoverflow.com/questions/30148053/eclipse-plugin-get-notification-on-debug-terminate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!