Ejemplo n.º 1
0
        @Override
        public void optionsChanged(DebugOptions options) {
          debug = options.getBooleanOption(Activator.PLUGIN_ID + "/debug", false); // $NON-NLS-1$

          debugProgressMonitors =
              debug
                  && options.getBooleanOption(
                      Activator.PLUGIN_ID + "/progress_monitors", false); // $NON-NLS-1$
        }
Ejemplo n.º 2
0
 public void start(BundleContext inContext) throws Exception {
   GCActivator.context = inContext;
   DebugOptions debug = (DebugOptions) getService(DebugOptions.class.getName());
   if (debug != null) {
     CoreGarbageCollector.setDebugMode(debug.getBooleanOption(DEBUG_STRING, DEFAULT_DEBUG));
   }
 }
 public static void trace(String option, String msg, Throwable error) {
   final DebugOptions debugOptions = activator.getDebugOptions();
   if (debugOptions.isDebugEnabled()
       && debugOptions.getBooleanOption(PI_RENDERERS + option, false)) {
     System.out.println(msg);
     if (error != null) {
       error.printStackTrace(System.out);
     }
   }
   activator.getTrace().trace(option, msg, error);
 }
Ejemplo n.º 4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
  * )
  */
 @SuppressWarnings({"rawtypes", "unchecked"})
 public void start(BundleContext context) throws Exception {
   super.start(context);
   plugin = this;
   DebugOptions service = null;
   final ServiceReference reference = context.getServiceReference(DebugOptions.class.getName());
   if (reference != null) service = (DebugOptions) context.getService(reference);
   if (service == null) return;
   try {
     LOGGING = service.getBooleanOption("org.eclipse.rcptt.tesla.core.am/logging", false);
   } finally {
     // we have what we want - release the service
     context.ungetService(reference);
   }
 }
Ejemplo n.º 5
0
 private void setDebugEnabled(final BundleContext bundleContext) {
   final ServiceReference<?> debugOptionsReference =
       bundleContext.getServiceReference(DebugOptions.class.getName());
   if (debugOptionsReference != null) {
     final DebugOptions debugOptions =
         (DebugOptions) bundleContext.getService(debugOptionsReference);
     if (debugOptions != null) {
       Log.debugEnabled =
           debugOptions.getBooleanOption(
               "org.eclipse.equinox.weaving.caching/debug", false); // $NON-NLS-1$
     }
   }
   if (debugOptionsReference != null) {
     bundleContext.ungetService(debugOptionsReference);
   }
 }
Ejemplo n.º 6
0
 public static boolean isDebugging(String option) {
   DebugOptions debugOptions = getDefault().getDebugOptions();
   return debugOptions != null
       && debugOptions.getBooleanOption(option == null ? ID : ID + option, false);
 }
Ejemplo n.º 7
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org
  * .eclipse.osgi.service.debug.DebugOptions)
  */
 public void optionsChanged(DebugOptions options) {
   Trace.CONFIG = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_CONFIG, false);
   Trace.INFO = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_INFO, false);
   Trace.WARNING = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_WARNING, false);
   Trace.SEVERE = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_SEVERE, false);
   Trace.FINER = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_FINER, false);
   Trace.FINEST = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_FINEST, false);
   Trace.RESOURCES = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_RESOURCES, false);
   Trace.EXTENSION_POINT =
       options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_EXTENSION_POINT, false);
   Trace.LISTENERS = options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_LISTENERS, false);
   Trace.RUNTIME_TARGET =
       options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_RUNTIME_TARGET, false);
   Trace.PERFORMANCE =
       options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_PERFORMANCE, false);
   Trace.PUBLISHING =
       options.getBooleanOption(Activator.PLUGIN_ID + Trace.STRING_PUBLISHING, false);
 }