当前位置: 首页>>代码示例>>Java>>正文


Java ParametersListUtil.parse方法代码示例

本文整理汇总了Java中com.intellij.util.execution.ParametersListUtil.parse方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersListUtil.parse方法的具体用法?Java ParametersListUtil.parse怎么用?Java ParametersListUtil.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.execution.ParametersListUtil的用法示例。


在下文中一共展示了ParametersListUtil.parse方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAdditionalParameters

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
@NotNull
@Override
public List<String> getAdditionalParameters() {
  if (myCommandLineOptions == null) {
    if (myUseCustomProfile && myUserDataDirectoryPath != null) {
      return Collections.singletonList(USER_DATA_DIR_ARG + FileUtilRt.toSystemDependentName(myUserDataDirectoryPath));
    }
    else {
      return Collections.emptyList();
    }
  }

  List<String> cliOptions = ParametersListUtil.parse(myCommandLineOptions);
  if (myUseCustomProfile && myUserDataDirectoryPath != null) {
    cliOptions.add(USER_DATA_DIR_ARG + FileUtilRt.toSystemDependentName(myUserDataDirectoryPath));
  }
  return cliOptions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ChromeSettings.java

示例2: setData

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
protected void setData(final MavenRunnerParameters data) {
  data.setWorkingDirPath(workingDirComponent.getComponent().getText());
  data.setGoals(ParametersListUtil.parse(goalsComponent.getComponent().getText()));
  data.setResolveToWorkspace(myResolveToWorkspaceCheckBox.isSelected());

  Map<String, Boolean> profilesMap = new LinkedHashMap<String, Boolean>();

  List<String> profiles = ParametersListUtil.parse(profilesComponent.getComponent().getText());

  for (String profile : profiles) {
    Boolean isEnabled = true;
    if (profile.startsWith("-") || profile.startsWith("!")) {
      profile = profile.substring(1);
      if (profile.isEmpty()) continue;

      isEnabled = false;
    }

    profilesMap.put(profile, isEnabled);
  }
  data.setProfilesMap(profilesMap);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:MavenRunnerParametersPanel.java

示例3: execute

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
@Nonnull
private static Process execute(@Nonnull String exePath, @Nonnull String parametersTemplate, @Nonnull Map<String, String> patterns)
        throws ExecutionException {
  List<String> parameters = ParametersListUtil.parse(parametersTemplate, true);

  List<String> from = new ArrayList<>();
  List<String> to = new ArrayList<>();
  for (Map.Entry<String, String> entry : patterns.entrySet()) {
    from.add(entry.getKey());
    to.add(entry.getValue());
  }

  List<String> args = new ArrayList<>();
  for (String parameter : parameters) {
    String arg = StringUtil.replace(parameter, from, to);
    if (!StringUtil.isEmptyOrSpaces(arg)) args.add(arg);
  }

  GeneralCommandLine commandLine = new GeneralCommandLine();
  commandLine.setExePath(exePath);
  commandLine.addParameters(args);
  return commandLine.createProcess();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ExternalDiffToolUtil.java

示例4: getAdditionalParameters

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
@Nonnull
@Override
public List<String> getAdditionalParameters() {
  if (myCommandLineOptions == null) {
    if (myUseCustomProfile && myUserDataDirectoryPath != null) {
      return Collections.singletonList(USER_DATA_DIR_ARG + FileUtilRt.toSystemDependentName(myUserDataDirectoryPath));
    }
    else {
      return Collections.emptyList();
    }
  }

  List<String> cliOptions = ParametersListUtil.parse(myCommandLineOptions);
  if (myUseCustomProfile && myUserDataDirectoryPath != null) {
    cliOptions.add(USER_DATA_DIR_ARG + FileUtilRt.toSystemDependentName(myUserDataDirectoryPath));
  }
  return cliOptions;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ChromeSettings.java

示例5: checkTokenizer

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
private static void checkTokenizer(String paramString, String... expected) {
  ParametersList params = new ParametersList();
  params.addParametersString(paramString);
  assertEquals(asList(expected), params.getList());

  List<String> lines = ParametersListUtil.parse(paramString, true);
  assertEquals(paramString, StringUtil.join(lines, " "));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ParametersListTest.java

示例6: getBrokenPluginVersions

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
@NotNull
private static MultiMap<String, String> getBrokenPluginVersions() {
  if (ourBrokenPluginVersions == null) {
    ourBrokenPluginVersions = MultiMap.createSet();

    if (System.getProperty("idea.ignore.disabled.plugins") == null && !isUnitTestMode()) {
      BufferedReader br = new BufferedReader(new InputStreamReader(PluginManagerCore.class.getResourceAsStream("/brokenPlugins.txt")));
      try {
        String s;
        while ((s = br.readLine()) != null) {
          s = s.trim();
          if (s.startsWith("//")) continue;

          List<String> tokens = ParametersListUtil.parse(s);
          if (tokens.isEmpty()) continue;

          if (tokens.size() == 1) {
            throw new RuntimeException("brokenPlugins.txt is broken. The line contains plugin name, but does not contains version: " + s);
          }

          String pluginId = tokens.get(0);
          List<String> versions = tokens.subList(1, tokens.size());

          ourBrokenPluginVersions.putValues(pluginId, versions);
        }
      }
      catch (IOException e) {
        throw new RuntimeException("Failed to read /brokenPlugins.txt", e);
      }
      finally {
        StreamUtil.closeStream(br);
      }
    }
  }
  return ourBrokenPluginVersions;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:PluginManagerCore.java

示例7: createCommandLine

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
private static List<String> createCommandLine(CompileContext context,
                                              ModuleChunk chunk,
                                              List<File> srcFiles,
                                              String mainOutputDir, @Nullable ProcessorConfigProfile profile, GreclipseSettings settings) {
  final List<String> args = new ArrayList<String>();

  args.add("-cp");
  args.add(getClasspathString(chunk));

  JavaBuilder.addCompilationOptions(args, context, chunk, profile);

  args.add("-d");
  args.add(mainOutputDir);

  //todo AjCompilerSettings exact duplicate, JavaBuilder.loadCommonJavacOptions inexact duplicate 
  List<String> params = ParametersListUtil.parse(settings.cmdLineParams);
  for (Iterator<String> iterator = params.iterator(); iterator.hasNext(); ) {
    String option = iterator.next();
    if ("-target".equals(option)) {
      iterator.next();
      continue;
    }
    else if (option.isEmpty() || "-g".equals(option) || "-verbose".equals(option)) {
      continue;
    }
    args.add(option);
  }

  if (settings.debugInfo) {
    args.add("-g");
  }

  for (File file : srcFiles) {
    args.add(file.getPath());
  }

  return args;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:GreclipseBuilder.java

示例8: parseCmdParameters

import com.intellij.util.execution.ParametersListUtil; //导入方法依赖的package包/类
private static List<String> parseCmdParameters(@Nullable String cmdArgsLine) {
  return cmdArgsLine != null ? ParametersListUtil.parse(cmdArgsLine) : ContainerUtil.<String>newArrayList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ExternalSystemExecuteTaskTask.java


注:本文中的com.intellij.util.execution.ParametersListUtil.parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。