Search in sources :

Example 1 with DebugOptionsListener

use of org.eclipse.osgi.service.debug.DebugOptionsListener in project epp.mpc by eclipse.

the class MarketplaceClientCorePlugin method start.

public void start(BundleContext context) throws Exception {
    bundle = context.getBundle();
    instance = this;
    ProxyHelper.acquireProxyService();
    registerServices(context);
    serviceHelper = new ServiceHelperImpl();
    serviceHelper.startTracking(context);
    Hashtable<String, String> props = new Hashtable<String, String>(2);
    props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, MarketplaceClientCore.BUNDLE_ID);
    context.registerService(DebugOptionsListener.class.getName(), new DebugOptionsListener() {

        public void optionsChanged(DebugOptions options) {
            DebugTrace debugTrace = null;
            boolean debug = options.getBooleanOption(MarketplaceClientCore.BUNDLE_ID + DEBUG_OPTION, false);
            boolean fakeClient = false;
            if (debug) {
                debugTrace = options.newDebugTrace(MarketplaceClientCore.BUNDLE_ID);
                fakeClient = options.getBooleanOption(MarketplaceClientCore.BUNDLE_ID + DEBUG_FAKE_CLIENT_OPTION, false);
            }
            DEBUG = debug;
            DEBUG_FAKE_CLIENT = fakeClient;
            MarketplaceClientCorePlugin.debugTrace = debugTrace;
        }
    }, props);
}
Also used : DebugTrace(org.eclipse.osgi.service.debug.DebugTrace) Hashtable(java.util.Hashtable) DebugOptionsListener(org.eclipse.osgi.service.debug.DebugOptionsListener) DebugOptions(org.eclipse.osgi.service.debug.DebugOptions)

Example 2 with DebugOptionsListener

use of org.eclipse.osgi.service.debug.DebugOptionsListener 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);
}
Also used : DebugTrace(org.eclipse.osgi.service.debug.DebugTrace) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService) Hashtable(java.util.Hashtable) ResourceProvider(org.eclipse.epp.internal.mpc.ui.catalog.ResourceProvider) DebugOptionsListener(org.eclipse.osgi.service.debug.DebugOptionsListener) DebugOptions(org.eclipse.osgi.service.debug.DebugOptions)

Aggregations

Hashtable (java.util.Hashtable)2 DebugOptions (org.eclipse.osgi.service.debug.DebugOptions)2 DebugOptionsListener (org.eclipse.osgi.service.debug.DebugOptionsListener)2 DebugTrace (org.eclipse.osgi.service.debug.DebugTrace)2 ResourceProvider (org.eclipse.epp.internal.mpc.ui.catalog.ResourceProvider)1 IMarketplaceClientService (org.eclipse.epp.mpc.ui.IMarketplaceClientService)1