Package org.eclipse.osgi.service.debug

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


    }
    super.buttonPressed(buttonId);
  }

  private void performOk() {
    DebugOptions options = getOptions();
    if (isDirty) {
      options.setDebugEnabled(platformSwitch.getSelection());
      if (platformSwitch.getSelection()) {
        // if this is off, we won't be able to save anything
        List<String> checkedKeys = new ArrayList<String>();
        for (Object checked : Arrays.asList(tv.getCheckedElements())) {
          if (checked instanceof PluginNode)
            checkedKeys.add(((PluginNode) checked).getPlugin()
                + MAINSWITCH);
          else if (checked instanceof OptionNode)
            checkedKeys.add(((OptionNode) checked).getOption());
        }

        for (PluginNode plugin : optionsMap.keySet()) {
          Properties props = optionsMap.get(plugin);
          for (Object keyObject : props.keySet()) {
            String key = (String) keyObject;
            boolean isOn = options.getBooleanOption(key, false);
            boolean shouldBeOn = checkedKeys.contains(key);
            if (isOn != shouldBeOn) {
              options
                  .setOption(key, Boolean
                      .toString(shouldBeOn));
            }
          }
        }
View Full Code Here


  public boolean getBooleanDebugOption(String option, boolean defaultValue) {
    if (debugTracker == null) {
      debugTracker = new ServiceTracker(bundleContext, DebugOptions.class.getName(), null);
      debugTracker.open();
    }
    DebugOptions options = (DebugOptions) debugTracker.getService();
    if (options != null) {
      String value = options.getOption(option);
      if (value != null)
        return "true".equalsIgnoreCase(value); //$NON-NLS-1$
    }
    return defaultValue;
  }
View Full Code Here

  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

    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);
    return (result == null) ? false : result.equalsIgnoreCase("true"); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.debug.DebugOptions

Copyright © 2018 www.massapicom. 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.