Examples of DebugOptions


Examples of org.eclipse.osgi.service.debug.DebugOptions

    return location.append(F_META_AREA).append(F_LOG);
  }

  public IPath getTraceLocation() throws IllegalStateException {

    DebugOptions debugOptions = Activator.getDefault().getDebugOptions();
    if (debugOptions == null) {
      return null;
    }
    return new Path(debugOptions.getFile().getAbsolutePath());
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

    // set the trace file location now that we created the data area
    IPath tracePath = location.append(F_META_AREA).append(F_TRACE);
    Activator activator = Activator.getDefault();
    if (activator != null) {
      DebugOptions debugOptions = activator.getDebugOptions();
      if (debugOptions != null) {
        debugOptions.setFile(tracePath.toFile());
      } else {
        System.out.println("ERROR: Unable to acquire debug service. Application will proceed, but debugging will be disabled."); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

  private boolean debug() {
    Activator activator = Activator.getDefault();
    if (activator == null)
      return false;
    DebugOptions debugOptions = activator.getDebugOptions();
    if (debugOptions == null)
      return false;
    return debugOptions.getBooleanOption(OPTION_DEBUG, false);
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

        }
        ServiceTracker<DebugOptions,Object> debugTracker = new ServiceTracker<DebugOptions,Object>(context, DebugOptions.class.getName(),
                null);
        debugTracker.open();

        DebugOptions debugOptions = (DebugOptions) debugTracker.getService();
        if (debugOptions == null) {
            return false;
        }
        // if platform debugging is enabled, check to see if this plugin is enabled for debugging
        return debugOptions.isDebugEnabled() ? debugOptions.getBooleanOption(key,false) : false;
    }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

  /**
   * @see Platform
   */
  public String getOption(String option) {
    DebugOptions options = getDebugOptions();
    if (options != null)
      return options.getOption(option);
    return null;
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

   
    public boolean getDebugOption(String option) {
        if (myDebugTracker == null) {
            return false;
        }
        DebugOptions options = (DebugOptions) myDebugTracker.getService();
        if (options != null) {
            option = myPluginID + option;
            String value = options.getOption(option);
            return "true".equalsIgnoreCase(value);
        }
        return false;
    }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

  private void getDebugOptions(BundleContext context) {
    ServiceReference debugRef = context.getServiceReference(DebugOptions.class.getName());
    if (debugRef == null)
      return;
    DebugOptions debugOptions = (DebugOptions) context.getService(debugRef);
    DEBUG = debugOptions.getBooleanOption(PI_APP + "/debug", false); //$NON-NLS-1$
    context.ungetService(debugRef);
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

    if (debugTracker == null) {
      if (JobManager.DEBUG)
        JobMessages.message("Debug tracker is not set"); //$NON-NLS-1$
      return defaultValue;
    }
    DebugOptions options = (DebugOptions) debugTracker.getService();
    if (options != null) {
      String value = options.getOption(option);
      if (value != null)
        return value.equalsIgnoreCase("true"); //$NON-NLS-1$
    }
    return defaultValue;
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

  public boolean getBooleanDebugOption(String option, boolean defaultValue) {
    if (debugTracker == null) {
      RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, RegistryMessages.bundle_not_activated, null));
      return defaultValue;
    }
    DebugOptions options = (DebugOptions) debugTracker.getService();
    if (options != null) {
      String value = options.getOption(option);
      if (value != null)
        return value.equalsIgnoreCase("true"); //$NON-NLS-1$
    }
    return defaultValue;
  }
View Full Code Here

Examples of org.eclipse.osgi.service.debug.DebugOptions

    updateApplyButton();
    setTitle(UIText.GitTraceConfigurationDialog_DialogTitle);
  }

  private void initValues() {
    DebugOptions options = getOptions();
    fillOptionsMapFromCurrent(options);
    tv.setCheckStateProvider(new ICheckStateProvider() {
      public boolean isGrayed(Object element) {
        return false;
      }

      public boolean isChecked(Object element) {
        Object data = element;
        Properties props;
        String key;
        if (data instanceof PluginNode) {
          PluginNode node = (PluginNode) data;
          props = optionsMap.get(node);
          key = node.getPlugin() + MAINSWITCH;
        } else if (data instanceof OptionNode) {
          OptionNode node = (OptionNode) data;
          props = optionsMap.get(node.getPlugin());
          key = node.getOption();
        } else {
          return false;
        }
        boolean active = Boolean.valueOf(props.getProperty(key))
            .booleanValue();
        return active;
      }
    });

    tv.setInput(PLUGIN_LIST);
    tv.expandAll();

    if (platformSwitch.getSelection() != options.isDebugEnabled()) {
      platformSwitch.setSelection(options.isDebugEnabled());
    }

    traceFileLocation.setText(getOptions().getFile().getPath());
    updateEnablement();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.