one
one

Reputation: 511

eclipse plugin: get notification on debug terminate

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

Upvotes: 2

Views: 95

Answers (1)

greg-449
greg-449

Reputation: 111142

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

Upvotes: 2

Related Questions