|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DebugOptionsListener
A debug options listener is notified whenever one of its plug-in option-path entries is
changed. A listener is registered as an OSGi service using the DebugOptions.LISTENER_SYMBOLICNAME
service property to specify the symbolic name of the debug options listener.
The optionsChanged(DebugOptions)
method will automatically
be called upon registration of the debug options listener service. This allows the
listener to obtain the initial debug options. This initial call to the listener
will happen even if debug is not enabled at the time of registration
(DebugOptions.isDebugEnabled()
will return false in this case).
public class Activator implements BundleActivator, DebugOptionsListener { public static boolean DEBUG = false; public static DebugTrace trace; public void start(BundleContext context) { Hashtable props = new Hashtable(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, "com.mycompany.mybundle"); context.registerService(DebugOptionsListener.class.getName(), this, props); } public void optionsChanged(DebugOptions options) { if (trace == null) trace = options.newDebugTrace("com.mycompany.mybundle"); DEBUG = options.getBooleanOption("com.mycompany.mybundle/debug", false); } public void doSomeWork() { if (DEBUG) trace.trace(null, "Doing some work"); } ... }
Method Summary | |
---|---|
void |
optionsChanged(DebugOptions options)
Notifies this listener that an option-path for its plug-in has changed. |
Method Detail |
---|
void optionsChanged(DebugOptions options)
options
- a reference to the DebugOptions
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.