Package com.jetbrains.lang.dart.sdk

Examples of com.jetbrains.lang.dart.sdk.DartSdk


    }
  }

  @Nullable
  public static String getStandardLibraryNameByRelativePath(final @NotNull Project project, final @NotNull String relativePath) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    final List<String> libNames = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).getKeysByValue(relativePath);
    return libNames == null || libNames.isEmpty() ? null : libNames.get(0);
  }
View Full Code Here


    return libNames == null || libNames.isEmpty() ? null : libNames.get(0);
  }

  @Nullable
  public static VirtualFile getStandardLibraryFromSdk(final @NotNull Project project, final @NotNull String libraryName) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    final String relativeLibPath = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).get(libraryName);
    return relativeLibPath == null ? null : LocalFileSystem.getInstance().findFileByPath(sdk.getHomePath() + "/lib/" + relativeLibPath);
  }
View Full Code Here

    final String relativeLibPath = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).get(libraryName);
    return relativeLibPath == null ? null : LocalFileSystem.getInstance().findFileByPath(sdk.getHomePath() + "/lib/" + relativeLibPath);
  }

  public static Collection<String> getAllStandardLibrariesFromSdk(final @NotNull Project project) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    return sdk == null ? Collections.<String>emptyList() : getLibraryNameToRelativePathMap(project, sdk).keySet();
  }
View Full Code Here

    return dartFile;
  }

  public void check(final @NotNull Project project) throws RuntimeConfigurationError {
    // check sdk
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    if (sdk == null) {
      throw new RuntimeConfigurationError(DartBundle.message("dart.sdk.is.not.configured"), new Runnable() {
        public void run() {
          ShowSettingsUtilImpl.showSettingsDialog(project, DartConfigurable.DART_SETTINGS_PAGE_ID, "");
        }
View Full Code Here

    ProcessTerminatedListener.attach(processHandler, getEnvironment().getProject());
    return processHandler;
  }

  private GeneralCommandLine createCommandLine(final @Nullable String overriddenMainFilePath) throws ExecutionException {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    if (sdk == null) {
      throw new ExecutionException(DartBundle.message("dart.sdk.is.not.configured"));
    }

    final String dartExePath = DartSdkUtil.getDartExePath(sdk);
View Full Code Here

  }

  @Override
  @Nullable
  protected OSProcessHandler createProcessHandler(@NotNull final Project project, final int port) throws ExecutionException {
    final DartSdk dartSdk = DartSdk.getGlobalDartSdk();
    if (dartSdk == null) return null;

    final GeneralCommandLine commandLine = new GeneralCommandLine().withWorkDirectory(firstServedDir.getParent().getPath());
    commandLine.setExePath(FileUtil.toSystemDependentName(DartSdkUtil.getPubPath(dartSdk)));
    commandLine.addParameter("serve");
View Full Code Here

    }

    final Module module = ModuleUtilCore.findModuleForPsiElement(file);
    if (module == null) return ProblemDescriptor.EMPTY_ARRAY;

    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    if (sdk == null) {
      return createProblemDescriptors(file, manager, DartBundle.message("dart.sdk.is.not.configured"),
                                      new OpenDartSettingsQuickFix(DartBundle.message("setup.dart.sdk")));
    }

    if (!DartSdkGlobalLibUtil.isDartSdkGlobalLibAttached(module, sdk.getGlobalLibName())) {
      final String message = DartSdkGlobalLibUtil.isIdeWithMultipleModuleSupport()
                             ? DartBundle.message("dart.support.is.not.enabled.for.module.0", module.getName())
                             : DartBundle.message("dart.support.is.not.enabled.for.project");

      return createProblemDescriptors(file, manager, message,
                                      new EnableDartSupportQuickFix(module, sdk.getGlobalLibName()),
                                      new OpenDartSettingsQuickFix(DartBundle.message("open.dart.settings")));
    }

    return ProblemDescriptor.EMPTY_ARRAY;
  }
View Full Code Here

  @Override
  @Nullable
  public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, @NotNull final FileEditor fileEditor) {
    if (file.isInLocalFileSystem() && PubspecYamlUtil.PUBSPEC_YAML.equalsIgnoreCase(file.getName())) {
      final DartSdk sdk = DartSdk.getGlobalDartSdk();
      final Module module = ModuleUtilCore.findModuleForFile(file, myProject);
      if (module != null && sdk != null && DartSdkGlobalLibUtil.isDartSdkGlobalLibAttached(module, sdk.getGlobalLibName())) {
        return new PubActionsPanel();
      }
    }

    return null;
View Full Code Here

    // similar to DartConfigurable.apply()
    final ModifiableModelsProvider modifiableModelsProvider = ModifiableModelsProvider.SERVICE.getInstance();
    if (DartSdkUtil.isDartSdkHome(data.dartSdkPath)) {
      final LibraryTable.ModifiableModel libraryTableModifiableModel = modifiableModelsProvider.getLibraryTableModifiableModel();

      final DartSdk sdk = DartSdk.findDartSdkAmongGlobalLibs(libraryTableModifiableModel.getLibraries());
      final String dartSdkLibName;

      if (sdk == null) {
        dartSdkLibName = DartSdkGlobalLibUtil.createDartSdkGlobalLib(libraryTableModifiableModel, data.dartSdkPath);
      }
      else {
        dartSdkLibName = sdk.getGlobalLibName();

        if (!data.dartSdkPath.equals(sdk.getHomePath())) {
          DartSdkGlobalLibUtil.updateDartSdkGlobalLib(libraryTableModifiableModel, dartSdkLibName, data.dartSdkPath);
        }
      }

      final Library dartSdkGlobalLib = libraryTableModifiableModel.getLibraryByName(dartSdkLibName);
View Full Code Here

  public DartGeneratorPeer() {
    // set initial values before initDartSdkAndDartiumControls() because listeners should not be triggered on initialization

    final Library[] libraries = ModifiableModelsProvider.SERVICE.getInstance().getLibraryTableModifiableModel().getLibraries();
    final DartSdk sdkInitial = DartSdk.findDartSdkAmongGlobalLibs(libraries);
    mySdkPathTextWithBrowse.setText(sdkInitial == null ? "" : FileUtil.toSystemDependentName(sdkInitial.getHomePath()));

    final WebBrowser dartiumInitial = DartiumUtil.getDartiumBrowser();
    myDartiumSettingsCurrent = new ChromeSettings();
    if (dartiumInitial != null) {
      final BrowserSpecificSettings browserSpecificSettings = dartiumInitial.getSpecificSettings();
View Full Code Here

TOP

Related Classes of com.jetbrains.lang.dart.sdk.DartSdk

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.