Java Code Examples for com.intellij.util.PlatformUtils#isIntelliJ()

The following examples show how to use com.intellij.util.PlatformUtils#isIntelliJ() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Return true if the passed module is of a Flutter type. Before version M16 this plugin had its own Flutter {@link ModuleType}.
 * Post M16 a Flutter module is defined by the following:
 * <p>
 * <code>
 * [Flutter support enabled for a module] ===
 * [Dart support enabled && referenced Dart SDK is the one inside a Flutter SDK]
 * </code>
 */
public static boolean isFlutterModule(@Nullable final Module module) {
  if (module == null || module.isDisposed()) return false;

  if (PlatformUtils.isIntelliJ() || FlutterUtils.isAndroidStudio()) {
    // [Flutter support enabled for a module] ===
    //   [Dart support enabled && referenced Dart SDK is the one inside a Flutter SDK]
    final DartSdk dartSdk = DartPlugin.getDartSdk(module.getProject());
    final String dartSdkPath = dartSdk != null ? dartSdk.getHomePath() : null;
    return validDartSdkPath(dartSdkPath) && DartPlugin.isDartSdkEnabled(module);
  }
  else {
    // If not IntelliJ, assume a small IDE (no multi-module project support).
    return declaresFlutter(module);
  }
}
 
Example 2
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Return true if the passed module is of a Flutter type. Before version M16 this plugin had its own Flutter {@link ModuleType}.
 * Post M16 a Flutter module is defined by the following:
 * <p>
 * <code>
 * [Flutter support enabled for a module] ===
 * [Dart support enabled && referenced Dart SDK is the one inside a Flutter SDK]
 * </code>
 */
public static boolean isFlutterModule(@Nullable final Module module) {
  if (module == null || module.isDisposed()) return false;

  if (PlatformUtils.isIntelliJ() || FlutterUtils.isAndroidStudio()) {
    // [Flutter support enabled for a module] ===
    //   [Dart support enabled && referenced Dart SDK is the one inside a Flutter SDK]
    final DartSdk dartSdk = DartPlugin.getDartSdk(module.getProject());
    final String dartSdkPath = dartSdk != null ? dartSdk.getHomePath() : null;
    return validDartSdkPath(dartSdkPath) && DartPlugin.isDartSdkEnabled(module);
  }
  else {
    // If not IntelliJ, assume a small IDE (no multi-module project support).
    return declaresFlutter(module);
  }
}
 
Example 3
Source File: JavaColorSettings.java    From Custom-Syntax-Highlighter with MIT License 4 votes vote down vote up
@Override
public DisplayPriority getPriority() {
  return PlatformUtils.isIntelliJ() ? DisplayPriority.KEY_LANGUAGE_SETTINGS : DisplayPriority.LANGUAGE_SETTINGS;
}
 
Example 4
Source File: BlazePythonSyncPlugin.java    From intellij with Apache License 2.0 4 votes vote down vote up
private static boolean supportsPythonWorkspaceType() {
  // support python workspace type in IntelliJ for historical reasons (this is discouraged for new
  // projects)
  return PlatformUtils.isIntelliJ() || PlatformUtils.isPyCharm();
}