use of org.eclipse.osgi.service.debug.DebugOptions in project ecf by eclipse.
the class Trace method shouldTrace0.
protected static boolean shouldTrace0(String option) {
if (option == null)
return false;
Activator activator = Activator.getDefault();
if (activator == null)
return false;
DebugOptions debugOptions = activator.getDebugOptions();
if (debugOptions == null)
return false;
String result = debugOptions.getOption(option);
// $NON-NLS-1$
return (result == null) ? false : result.equalsIgnoreCase("true");
}
use of org.eclipse.osgi.service.debug.DebugOptions in project rt.equinox.framework by eclipse.
the class ModuleResolver method setDebugOptions.
void setDebugOptions() {
DebugOptions options = adaptor.getDebugOptions();
// may be null if debugging is not enabled
if (options == null)
return;
boolean debugAll = options.getBooleanOption(OPTION_RESOLVER, false);
DEBUG_ROOTS = debugAll || options.getBooleanOption(OPTION_ROOTS, false);
DEBUG_PROVIDERS = debugAll || options.getBooleanOption(OPTION_PROVIDERS, false);
DEBUG_HOOKS = debugAll || options.getBooleanOption(OPTION_HOOKS, false);
DEBUG_USES = debugAll || options.getBooleanOption(OPTION_USES, false);
DEBUG_WIRING = debugAll || options.getBooleanOption(OPTION_WIRING, false);
DEBUG_REPORT = debugAll || options.getBooleanOption(OPTION_REPORT, false);
}
use of org.eclipse.osgi.service.debug.DebugOptions in project epp.mpc by eclipse.
the class MarketplaceClientUiPlugin method start.
@Override
public void start(BundleContext context) throws Exception {
instance = this;
super.start(context);
MarketplaceClientUiPlugin.bundleContext = context;
clientServiceTracker = new ServiceTracker<IMarketplaceClientService, IMarketplaceClientService>(context, IMarketplaceClientService.class, null);
clientServiceTracker.open();
resourceProvider = new ResourceProvider();
Hashtable<String, String> props = new Hashtable<String, String>(2);
props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, MarketplaceClientUi.BUNDLE_ID);
context.registerService(DebugOptionsListener.class.getName(), new DebugOptionsListener() {
public void optionsChanged(DebugOptions options) {
DebugTrace debugTrace = null;
boolean debug = options.getBooleanOption(MarketplaceClientUi.BUNDLE_ID + DEBUG_OPTION, false);
if (debug) {
debugTrace = options.newDebugTrace(MarketplaceClientUi.BUNDLE_ID);
}
DEBUG = debug;
MarketplaceClientUiPlugin.debugTrace = debugTrace;
}
}, props);
}
use of org.eclipse.osgi.service.debug.DebugOptions in project jbosstools-openshift by jbosstools.
the class Trace method isDebugging.
public boolean isDebugging() {
Bundle bundle = FrameworkUtil.getBundle(getClass());
if (bundle == null) {
return DEFAULT_DEBUG;
}
DebugOptions debugOptions = getDebugOptions();
if (debugOptions == null) {
return DEFAULT_DEBUG;
}
if (!debugOptions.isDebugEnabled()) {
return false;
}
if (!debugOptions.getBooleanOption(pluginId + GLOBAL_DEBUG_KEY, DEFAULT_DEBUG)) {
return false;
}
return debugOptions.getBooleanOption(pluginId + CLIENT_DEBUG_KEY, DEFAULT_DEBUG);
}
use of org.eclipse.osgi.service.debug.DebugOptions in project eclipse.platform.runtime by eclipse.
the class Activator method getBooleanDebugOption.
/**
* Return the boolean value in the debug options for the given key, or
* return the default value if there is none.
*/
public boolean getBooleanDebugOption(String option, boolean defaultValue) {
if (debugTracker == null) {
debugTracker = new ServiceTracker<>(bundleContext, DebugOptions.class, null);
debugTracker.open();
}
DebugOptions options = (DebugOptions) debugTracker.getService();
if (options != null) {
String value = options.getOption(option);
if (value != null)
// $NON-NLS-1$
return "true".equalsIgnoreCase(value);
}
return defaultValue;
}
Aggregations