Class TargetEvents

java.lang.Object
org.eclipse.pde.core.target.TargetEvents

public class TargetEvents extends Object
Target events and event topic definitions.

The following code is an example of to subscribe to the TOPIC_TARGET_SAVED event:

 EventHandler eventHandler = event -> {
        if (event.getProperty(IEventBroker.DATA) instanceof ITargetHandle handle) {
                // Work with the target handle...
        }
 };
 IEclipseContext context = EclipseContextFactory.getServiceContext(bundleContext);
 IEventBroker broker = context.get(IEventBroker.class);
 if (broker != null) {
        broker.subscribe(TargetEvents.TOPIC_TARGET_SAVED, eventHandler);
        // Do not forget to unsubscribe later!
 }
 
Since:
3.13
See Also: