本文整理汇总了Java中com.intellij.execution.configurations.ParametersList.parse方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersList.parse方法的具体用法?Java ParametersList.parse怎么用?Java ParametersList.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.configurations.ParametersList
的用法示例。
在下文中一共展示了ParametersList.parse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCommand
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
MvcCommand getCommand() {
String cmd;
if (myCreateAddon.isSelected()) {
cmd = "create-addon";
}
else if (myCreateApp.isSelected()) {
cmd = "create-app";
}
else if (myCreateArchetype.isSelected()) {
cmd = "create-archetype";
}
else if (myCreatePlugin.isSelected()) {
cmd = "create-plugin";
}
else {
throw new AssertionError("No selection");
}
String text = myOptionField.getText();
if (text == null) text = "";
return new MvcCommand(cmd, ParametersList.parse(text));
}
示例2: getParameters
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static String[] getParameters(String[] parameters, String programParameters)
{
List<String> result = new ArrayList<>();
for(String parameter : parameters)
{
if(parameter != null && (parameter.trim().length() > 0))
{
result.add(parameter.trim());
}
}
if(programParameters != null && (programParameters.trim().length() > 0))
{
String[] programParametersArray = ParametersList.parse(programParameters);
for(String s : programParametersArray)
{
if(s != null && s.trim().length() > 0)
{
result.add(s.trim());
}
}
}
return ArrayUtil.toStringArray(result);
}
示例3: getParameters
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
private static String[] getParameters(String[] parameters, String programParameters) {
List<String> result = new ArrayList<>();
for (String parameter : parameters) {
if (parameter != null && (parameter.trim().length() > 0)) {
result.add(parameter.trim());
}
}
if (programParameters != null && (programParameters.trim().length() > 0)) {
String[] programParametersArray = ParametersList.parse(programParameters);
for (String s : programParametersArray) {
if (s != null && s.trim().length() > 0) {
result.add(s.trim());
}
}
}
return ArrayUtil.toStringArray(result);
}
示例4: parse
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@NotNull
public static MvcCommand parse(@NotNull String cmd) {
String[] args = ParametersList.parse(cmd);
MvcCommand res = new MvcCommand();
int i = 0;
while (res.myCommand == null && i < args.length) {
String s = args[i];
if (s.startsWith("-D")) {
res.myProperties.add(s);
}
else if (res.myEnv == null && ourEnvironments.contains(s)) {
res.myEnv = s;
}
else {
res.myCommand = s;
}
i++;
}
res.myArgs.addAll(Arrays.asList(args).subList(i, args.length));
return res;
}
示例5: getAdditionalParameters
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
@NotNull
@Override
public String[] getAdditionalParameters() {
String[] cliOptions = ParametersList.parse(myCommandLineOptions);
if (myUseCustomProfile && myUserDataDirectoryPath != null) {
return ArrayUtil.mergeArrays(cliOptions, USER_DATA_DIR_ARG + FileUtil.toSystemDependentName(myUserDataDirectoryPath));
}
else {
return cliOptions;
}
}
示例6: launchEmulator
import com.intellij.execution.configurations.ParametersList; //导入方法依赖的package包/类
public void launchEmulator(@Nullable String avdName, @NotNull String commands) {
File sdkLocation = null;
if (Projects.isGradleProject(getModule().getProject()) && isAndroidStudio()) {
sdkLocation = IdeSdks.getAndroidSdkPath();
}
else {
AndroidPlatform platform = getConfiguration().getAndroidPlatform();
if (platform != null) {
sdkLocation = platform.getSdkData().getLocation();
}
}
if (sdkLocation != null) {
File emulatorPath = new File(sdkLocation, toolPath(FN_EMULATOR));
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(emulatorPath.getPath());
if (avdName != null) {
commandLine.addParameter("-avd");
commandLine.addParameter(avdName);
}
String[] params = ParametersList.parse(commands);
for (String s : params) {
if (!s.isEmpty()) {
commandLine.addParameter(s);
}
}
AvdManager manager = getAvdManagerSilently();
AvdInfo info = manager == null ? null : manager.getAvd(avdName, true);
final EmulatorRunner runner = new EmulatorRunner(getModule().getProject(), "AVD: " + avdName, commandLine, info);
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
@Override
public void run() {
try {
runner.start();
}
catch (ExecutionException e) {
Logger.getInstance(this.getClass()).error("Unexpected error while launching AVD", e);
}
}
});
}
}