org.eclipse.core.runtime.Platform.getDebugOption()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.eclipse.core.runtime.Platform.getDebugOption()方法的一些代码示例,展示了Platform.getDebugOption()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Platform.getDebugOption()方法的具体详情如下:
包路径:org.eclipse.core.runtime.Platform
类名称:Platform
方法名:getDebugOption

Platform.getDebugOption介绍

[英]Returns the identified option. null is returned if no such option is found. Options are specified in the general form <plug-in id>/<option-path>. For example, org.eclipse.core.runtime/debug

Clients are also able to acquire the DebugOptions service and query it for debug options.
[中]返回已识别的选项。如果找不到此类选项,则返回null。选项以常规形式<plug-in id>/<option path>指定。例如,org.eclipse.core.runtime/debug
客户端还可以获取DebugOptions服务并查询其调试选项。

代码示例

代码示例来源:origin: org.eclipse.core/runtime

/**
 * Returns whether monitoring of a given performance event is enabled.
 * <p>
 * For frequent performance events, the result of this method call should
 * be cached by the caller to minimize overhead when performance monitoring
 * is turned off.  It is not possible for enablement to change during the life
 * of this invocation of the platform.
 * </p>
 * 
 * @param eventName The name of the event to determine enablement for
 * @return <code>true</code>If the performance event with the given
 * name is enabled, and <code>false</code> otherwise.
 */
public static boolean isEnabled(String eventName) {
  if (!ENABLED)
    return false;
  String option = Platform.getDebugOption(eventName);
  return option != null && !option.equalsIgnoreCase("false") && !option.equalsIgnoreCase("-1"); //$NON-NLS-1$ //$NON-NLS-2$
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.jsp.core

private static boolean calculateValue() {
  String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspsearch"); //$NON-NLS-1$
  boolean debug = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
  return debug;
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity

private ConnectionProfileManager() {
  super();
  String debug = Platform
      .getDebugOption(OPTION_DEBUG_CONNECTION_PROFILE_EXTENSION);
  DEBUG_CONNECTION_PROFILE_EXTENSION = debug == null ? false : (debug
      .equalsIgnoreCase("true") ? true : false); //$NON-NLS-1$
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui

private static boolean getDebugValue() {
  String value = Platform.getDebugOption("org.eclipse.wst.sse.ui/debug/outline"); //$NON-NLS-1$
  boolean result = (value != null) && value.equalsIgnoreCase("true"); //$NON-NLS-1$
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.intro

private static boolean getDebugOption(String option) {
  return "true".equalsIgnoreCase(//$NON-NLS-1$
    Platform.getDebugOption(PLUGIN_ID + option));
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private static boolean getDebugOption(String option) {
    return "true".equalsIgnoreCase(Platform.getDebugOption(PlatformUI.PLUGIN_ID + option)); //$NON-NLS-1$
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

private static boolean getDebugOption(String option) {
  return "true".equalsIgnoreCase(Platform.getDebugOption(IDEWorkbenchPlugin.IDE_WORKBENCH + option)); //$NON-NLS-1$
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private static boolean internal_isEnabled(String eventName) {
    String option = Platform.getDebugOption(eventName);
    return option != null && !option.equalsIgnoreCase("false") && !option.equalsIgnoreCase("-1"); //$NON-NLS-1$ //$NON-NLS-2$
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jem.util

private boolean isDebugging(Bundle bundle) {
  String symbolicName = bundle.getSymbolicName();
  if (symbolicName != null) {
    String key = symbolicName + "/debug"; //$NON-NLS-1$
    String value = Platform.getDebugOption(key);
    return value == null ? false : value.equalsIgnoreCase("true"); //$NON-NLS-1$
  }
  return false;
}

代码示例来源:origin: eclipse/eclemma

private static ITracer getTracer(String channel) {
 String key = KEYPREFIX_DEBUG + channel;
 if (Boolean.valueOf(Platform.getDebugOption(key)).booleanValue()) {
  return new PrintStreamTracer(channel);
 } else {
  return NUL_TRACER;
 }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.intro

@Override
public void start(BundleContext context) throws Exception {
  super.start(context);
  inst = this;
  if (Log.logInfo)
    Log.info("IntroPlugin - calling start on Intro bundle"); //$NON-NLS-1$
  // Setup debugging options
  DEBUG = isDebugging();
  if (DEBUG) {
    DEBUG_NO_BROWSER = "true".equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/flags/noBrowser")); //$NON-NLS-1$ //$NON-NLS-2$
  }
  if (DEBUG) {
    DEBUG_TOOLBAR = "true".equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID + "/debug/toolbar")); //$NON-NLS-1$ //$NON-NLS-2$
  }
}

代码示例来源:origin: org.eclipse.ocl/ecore

public static boolean shouldTrace(String option) {
  if (getPlugin() != null) {
    if (getPlugin().isDebugging()) {
      return Boolean.TRUE.toString().equalsIgnoreCase(
        Platform.getDebugOption(option));
    }
    return false;
  }
  return Boolean.getBoolean("org.eclipse.ocl.ecore.debug"); //$NON-NLS-1$
}

代码示例来源:origin: org.eclipse/ocl

public static boolean shouldTrace(String option) {
  if (getPlugin() != null) {
    if (getPlugin().isDebugging()) {
      return Boolean.TRUE.toString().equalsIgnoreCase(
        Platform.getDebugOption(option));
    }
    return false;
  }
  return traceAll || Boolean.getBoolean(option);
}

代码示例来源:origin: pulse00/Twig-Eclipse-Plugin

public static boolean debug() {

    String debugOption = Platform.getDebugOption(isDebugMode); // $NON-NLS-1$
    return getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption);

  }
}

代码示例来源:origin: pdt-eg/Core-Plugin

public static boolean debug() {
    String debugOption = Platform.getDebugOption(isDebugMode); //$NON-NLS-1$
    return getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption); 
    
  }    
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.cheatsheets

public static boolean isTracing() {
  if (CheatSheetPlugin.getPlugin().isDebugging()) {
    String traceTimes = Platform.getDebugOption("org.eclipse.ui.cheatsheets/trace/creation/times"); //$NON-NLS-1$
    if (traceTimes != null && traceTimes.equalsIgnoreCase("true")) { //$NON-NLS-1$
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.openehealth.ipf.eclipse.ocl/ipf-eclipse-ocl

public static boolean shouldTrace(String option) {
  if (getPlugin() != null) {
    if (getPlugin().isDebugging()) {
      return Boolean.TRUE.toString().equalsIgnoreCase(
        Platform.getDebugOption(option));
    }
    return false;
  }
  return traceAll || Boolean.getBoolean(option);
}

代码示例来源:origin: rombert/ereviewboard

public void trace(TraceLocation location, String message) {
  if (!Platform.inDebugMode())
    return;
  String debugOption = Platform.getDebugOption(PLUGIN_ID + "/debug" + location.getPrefix());
  
  if ( !Boolean.parseBoolean(debugOption) ) 
    return;
  getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
}

代码示例来源:origin: org.eclipse.ocl/uml

public static boolean shouldTrace(String option) {
  if (getPlugin() != null) {
    if (getPlugin().isDebugging()) {
      return Boolean.TRUE.toString().equalsIgnoreCase(
        Platform.getDebugOption(option));
    }
    return false;
  }
  return Boolean.getBoolean("org.eclipse.ocl.uml.debug"); //$NON-NLS-1$
}

代码示例来源:origin: eclipse/buildship

private EclipseLogger createLogger() {
  Map<TraceScope, Boolean> tracingEnablement = Maps.newHashMap();
  for (TraceScope scope : CoreTraceScopes.values()) {
    String option = Platform.getDebugOption("org.eclipse.buildship.core/trace/" + scope.getScopeKey());
    tracingEnablement.put(scope, "true".equalsIgnoreCase(option));
  }
  return new EclipseLogger(getLog(), PLUGIN_ID, tracingEnablement);
}

相关文章