本文整理汇总了Java中com.intellij.util.execution.ParametersListUtil类的典型用法代码示例。如果您正苦于以下问题:Java ParametersListUtil类的具体用法?Java ParametersListUtil怎么用?Java ParametersListUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParametersListUtil类属于com.intellij.util.execution包,在下文中一共展示了ParametersListUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CompilerUIConfigurable
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
public CompilerUIConfigurable(@NotNull final Project project) {
myProject = project;
myPatternLegendLabel.setText(XmlStringUtil.wrapInHtml(
"Use <b>;</b> to separate patterns and <b>!</b> to negate a pattern. " +
"Accepted wildcards: <b>?</b> — exactly one symbol; <b>*</b> — zero or more symbols; " +
"<b>/</b> — path separator; <b>/**/</b> — any number of directories; " +
"<i><dir_name></i>:<i><pattern></i> — restrict to source roots with the specified name"
));
myPatternLegendLabel.setForeground(new JBColor(Gray._50, Gray._130));
tweakControls(project);
myVMOptionsField.getDocument().addDocumentListener(new DocumentAdapter() {
protected void textChanged(DocumentEvent e) {
mySharedVMOptionsField.setEnabled(e.getDocument().getLength() == 0);
myHeapSizeField.setEnabled(ContainerUtil.find(ParametersListUtil.parse(myVMOptionsField.getText()), new Condition<String>() {
@Override
public boolean value(String s) {
return StringUtil.startsWithIgnoreCase(s, "-Xmx");
}
}) == null);
}
});
}
示例2: 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;
}
示例3: getMavenOptsProperties
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
@NotNull
private static Map<String, String> getMavenOptsProperties() {
Map<String, String> res = ourPropertiesFromMvnOpts;
if (res == null) {
String mavenOpts = System.getenv("MAVEN_OPTS");
if (mavenOpts != null) {
res = new HashMap<String, String>();
final String[] split = ParametersListUtil.parseToArray(mavenOpts);
for (String parameter : split) {
final Matcher matcher = PROPERTY_PATTERN.matcher(parameter);
if (matcher.matches()) {
res.put(matcher.group(1), matcher.group(2));
}
}
}
else {
res = Collections.emptyMap();
}
ourPropertiesFromMvnOpts = res;
}
return res;
}
示例4: 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);
}
示例5: createUIComponents
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
private void createUIComponents() {
myProtectedBranchesButton = new TextFieldWithBrowseButton.NoPathCompletion(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Messages.showTextAreaDialog(myProtectedBranchesButton.getTextField(), "Protected Branches", "Git.Force.Push.Protected.Branches",
ParametersListUtil.COLON_LINE_PARSER, ParametersListUtil.COLON_LINE_JOINER);
}
});
myProtectedBranchesButton.setButtonIcon(AllIcons.Actions.ShowViewer);
myUpdateMethodComboBox = new ComboBox(new EnumComboBoxModel<UpdateMethod>(UpdateMethod.class));
myUpdateMethodComboBox.setRenderer(new ListCellRendererWrapper<UpdateMethod>() {
@Override
public void customize(JList list, UpdateMethod value, int index, boolean selected, boolean hasFocus) {
setText(StringUtil.capitalize(StringUtil.toLowerCase(value.name().replace('_', ' '))));
}
});
}
示例6: calculateCommand
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
@NotNull
private static List<String> calculateCommand(@NotNull final String interpreterPath,
@NotNull final TheRRunConfiguration runConfiguration) {
final List<String> command = new ArrayList<String>();
command.add(FileUtil.toSystemDependentName(interpreterPath));
command.addAll(TheRInterpreterConstants.DEFAULT_PARAMETERS);
final String scriptArgs = runConfiguration.getScriptArgs();
if (!StringUtil.isEmptyOrSpaces(scriptArgs)) {
command.add(TheRInterpreterConstants.ARGS_PARAMETER);
command.addAll(ParametersListUtil.parse(scriptArgs));
}
return command;
}
示例7: 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();
}
示例8: 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;
}
示例9: 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, " "));
}
示例10: 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;
}
示例11: load
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
/**
* Load settings into the configuration panel
*
* @param settings the settings to load
*/
public void load(@NotNull GitVcsSettings settings, @NotNull GitSharedSettings sharedSettings) {
myGitField.setText(settings.getAppSettings().getPathToGit());
mySSHExecutableComboBox.setSelectedItem(settings.isIdeaSsh() ? IDEA_SSH : NATIVE_SSH);
myAutoUpdateIfPushRejected.setSelected(settings.autoUpdateIfPushRejected());
mySyncControl.setSelected(settings.getSyncSetting() == DvcsSyncSettings.Value.SYNC);
myAutoCommitOnCherryPick.setSelected(settings.isAutoCommitOnCherryPick());
myWarnAboutCrlf.setSelected(settings.warnAboutCrlf());
myWarnAboutDetachedHead.setSelected(settings.warnAboutDetachedHead());
myEnableForcePush.setSelected(settings.isForcePushAllowed());
myUpdateMethodComboBox.setSelectedItem(settings.getUpdateType());
myProtectedBranchesButton.setText(ParametersListUtil.COLON_LINE_JOINER.fun(sharedSettings.getForcePushProhibitedPatterns()));
}
示例12: 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;
}
示例13: getBashCommandsToRunScript
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
/** Appends '--script_path' to blaze flags, then runs 'bash -c blaze build ... && run_script' */
private static List<String> getBashCommandsToRunScript(BlazeCommand.Builder blazeCommand) {
File scriptFile = createTempOutputFile();
blazeCommand.addBlazeFlags("--script_path=" + scriptFile.getPath());
String blaze = ParametersListUtil.join(blazeCommand.build().toList());
return ImmutableList.of("/bin/bash", "-c", blaze + " && " + scriptFile.getPath());
}
示例14: getScriptParams
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
private static String getScriptParams(BlazeCommandRunConfigurationCommonState state) {
List<String> params = Lists.newArrayList(state.getExeFlagsState().getExpandedFlags());
String filterFlag = state.getTestFilterFlag();
if (filterFlag != null) {
params.add(filterFlag.substring((BlazeFlags.TEST_FILTER + "=").length()));
}
return ParametersListUtil.join(params);
}
示例15: getModifierForCommandLine
import com.intellij.util.execution.ParametersListUtil; //导入依赖的package包/类
@NotNull
@Override
public NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine> getModifierForCommandLine()
{
return new NotNullPairFunction<DotNetConfigurationWithCoverage, GeneralCommandLine, GeneralCommandLine>()
{
@NotNull
@Override
public GeneralCommandLine fun(DotNetConfigurationWithCoverage t, GeneralCommandLine v)
{
CoverageEnabledConfiguration coverageEnabledConfiguration = DotNetCoverageEnabledConfiguration.get(t);
File openCoverConsoleExecutable = getOpenCoverConsoleExecutable();
GeneralCommandLine newCommandLine = new GeneralCommandLine();
newCommandLine.setExePath(openCoverConsoleExecutable.getPath());
newCommandLine.addParameter("-register:user");
newCommandLine.addParameter("-target:" + v.getExePath());
newCommandLine.addParameter("-filter:+[*]*");
newCommandLine.addParameter("-output:" + coverageEnabledConfiguration.getCoverageFilePath());
String parametersAsString = ParametersListUtil.join(v.getParametersList().getParameters());
if(!StringUtil.isEmpty(parametersAsString))
{
newCommandLine.addParameter("-targetargs:" + parametersAsString + "");
}
return newCommandLine;
}
};
}