本文整理汇总了Java中com.intellij.execution.application.ApplicationConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationConfiguration类的具体用法?Java ApplicationConfiguration怎么用?Java ApplicationConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationConfiguration类属于com.intellij.execution.application包,在下文中一共展示了ApplicationConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configApplicationConfiguration
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
/**
* Modifies the run configuration by adding parameters to it, such as a Main class which the
* user selects.
*/
@NotNull
public ApplicationConfiguration configApplicationConfiguration(TreeClassChooser chooser) {
if (configurationType.equals("Application")) {
logger.info("Creating ApplicationConfiguration.");
ApplicationConfiguration appCon =
(ApplicationConfiguration)
runManager.getSelectedConfiguration().getConfiguration();
logger.info("Setting main class and module to " + configurationType);
appCon.setMainClass(chooser.getSelected());
appCon.setModule(module);
return appCon;
}
logger.info("No applicable configurationType was found.");
return null;
}
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:20,代码来源:RunConfigurationFactory.java
示例2: _initJavaSettings
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
/**
* Initialisiert den Classpath, die MainRoutine und VMOptions f�r Java in Verbindung mit dem SwingExplorer
*
* @param pProfileState Profile-State
* @throws ExecutionException
*/
private void _initJavaSettings(RunProfileState pProfileState) throws ExecutionException
{
if (pProfileState instanceof ApplicationConfiguration.JavaApplicationCommandLineState)
{
ApplicationConfiguration.JavaApplicationCommandLineState profileState = (ApplicationConfiguration.JavaApplicationCommandLineState) pProfileState;
_initJarFiles();
_initPort();
_appendSwingExplorerJarsToClassPath(profileState);
// VMParameter hinzuf�gen
JavaParameters javaParameters = profileState.getJavaParameters();
ParametersList vmParametersList = javaParameters.getVMParametersList();
vmParametersList.add("-javaagent:" + swagJarFile.getPath());
vmParametersList.add("-Xbootclasspath/a:" + swagJarFile.getPath());
vmParametersList.add("-Dswex.mport=" + port);
vmParametersList.add("-Dcom.sun.management.jmxremote");
// Main-Klasse austauschen gegen die des SwingExplorers. Der SE zieht die andere Main-Klasse selbst hoch!
String mainClass = javaParameters.getMainClass();
javaParameters.setMainClass("org.swingexplorer.Launcher");
javaParameters.getProgramParametersList().addAt(0, mainClass);
}
}
开发者ID:wglanzer,项目名称:swingexplorer-idea,代码行数:31,代码来源:Runner.java
示例3: testMoveApplication
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testMoveApplication() throws IOException {
PsiClass psiClass = mySource.createClass("Application", APPLICATION_CODE);
assertNotNull(psiClass);
ApplicationConfiguration configuration = createConfiguration(psiClass);
move(psiClass, "pkg");
try {
configuration.checkConfiguration();
}
catch (RuntimeConfigurationException e) {
assertTrue("Unexpected ConfigurationException: " + e ,false);
}
assertEquals("pkg.Application", configuration.MAIN_CLASS_NAME);
rename(JavaPsiFacade.getInstance(myProject).findPackage("pkg"), "pkg2");
assertEquals("pkg2.Application", configuration.MAIN_CLASS_NAME);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ConfigurationRefactoringsTest.java
示例4: testRunApplicationName
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testRunApplicationName() {
ApplicationConfiguration configuration = new ApplicationConfiguration(null, getProject(), ApplicationConfigurationType.getInstance());
configuration.MAIN_CLASS_NAME = "com.comp.AClass";
configuration.setGeneratedName();
checkSuggestedName("AClass.main()", configuration);
configuration.setName("Other name");
configuration.setNameChangedByUser(true);
checkSuggestedName("Other name", configuration);
configuration.setName("1234567890123456789012345 other long name");
checkSuggestedName("12345678901234567890...", configuration);
configuration.MAIN_CLASS_NAME = "com.comp.A12345678901234567890123LongName";
configuration.setGeneratedName();
checkSuggestedName("A1234567890123....main()", configuration);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:BaseRunConfigurationActionTest.java
示例5: testCreatingApplicationConfiguration
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testCreatingApplicationConfiguration() throws ConfigurationException {
if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return;
ApplicationConfiguration configuration = new ApplicationConfiguration(null, myProject, ApplicationConfigurationType.getInstance());
ApplicationConfigurable editor = new ApplicationConfigurable(myProject);
try {
editor.getComponent(); // To get all the watchers installed.
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
configurable.reset();
CommonJavaParametersPanel javaParameters = editor.getCommonProgramParameters();
javaParameters.setProgramParameters("prg");
javaParameters.setVMParameters("vm");
javaParameters.setWorkingDirectory("dir");
assertTrue(configurable.isModified());
configurable.apply();
assertEquals("prg", configuration.getProgramParameters());
assertEquals("vm", configuration.getVMParameters());
assertEquals("dir", configuration.getWorkingDirectory());
}
finally {
Disposer.dispose(editor);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ConfigurationsTest.java
示例6: configurationPatchIfNecessary
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
/**
* Aplikování patche na budoucí konfigurace
*
* @param project aktuální projekt
* @param jre cesta k JVM
*/
private void configurationPatchIfNecessary( final @NotNull Project project, final @NotNull String jre )
{
// Template configuration.
RunManager runManager = RunManagerImpl.getInstance(project) ;
//Modifikace akutální konfigurací
for ( RunConfiguration configuration : runManager.getAllConfigurationsList() )
{
if (configuration instanceof ApplicationConfiguration)
{
patchConfiguration((ApplicationConfiguration) configuration, jre);
}
else if (configuration instanceof MavenRunConfiguration )
{
patchConfiguration((MavenRunConfiguration) configuration, jre);
}
}
}
开发者ID:HotswapProjects,项目名称:HotswapAgentIntelliJ,代码行数:25,代码来源:HotswapAgentIntegration.java
示例7: testCreatingApplicationConfiguration
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testCreatingApplicationConfiguration() throws ConfigurationException {
if (IdeaTestUtil.COVERAGE_ENABLED_BUILD) return;
ApplicationConfiguration configuration = new ApplicationConfiguration(null, myProject, ApplicationConfigurationType.getInstance());
ApplicationConfigurable editor = new ApplicationConfigurable(myProject);
try {
editor.getComponent(); // To get all the watchers installed.
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
configurable.reset();
CommonJavaParametersPanel javaParameters = editor.getCommonProgramParameters();
javaParameters.setProgramParameters("prg");
javaParameters.setVMParameters("vm");
javaParameters.setWorkingDirectory("dir");
assertTrue(configurable.isModified());
configurable.apply();
assertEquals("prg", configuration.getProgramParameters());
assertEquals("vm", configuration.getVMParameters());
assertEquals("dir", configuration.getWorkingDirectory());
}
finally {
Disposer.dispose(editor);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:ConfigurationsTest.java
示例8: setProcessParameters
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
@Override
protected void setProcessParameters(Project project, ApplicationConfiguration configuration, Module module, @NotNull VirtualFile testsFile) {
configuration.setMainClassName(EduIntelliJNames.TEST_RUNNER_CLASS);
configuration.setModule(module);
PsiFile psiFile = PsiManager.getInstance(project).findFile(testsFile);
Collection<KtClass> ktClasses = PsiTreeUtil.findChildrenOfType(psiFile, KtClass.class);
for (KtClass ktClass : ktClasses) {
String name = ktClass.getName();
configuration.setProgramParameters(name);
}
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:12,代码来源:EduKotlinPyCharmTaskChecker.java
示例9: createRunner
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void createRunner() {
if (configurationType.equals("Application")) {
logger.info("Creating runner for type " + configurationType);
ApplicationConfiguration appCon =
(ApplicationConfiguration)
runManager.getSelectedConfiguration().getConfiguration();
if (checkForMainClass(appCon)) {
logger.info("Main class found, starting to execute project.");
ProjectExecutor executor = new ProjectExecutor();
executor.executeConfiguration(new ObjectFinder().findCurrentProject(), appCon);
}
}
}
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:14,代码来源:RunConfigurationFactory.java
示例10: checkForMainClass
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
/**
* Makes sure the configuration has a defined main class. This method only works for the
* Application type of configuration, For other types it may be necessary to create their own.
*
* @param appCon Current configuration
* @return Whether the class has a valid main class or not
*/
private boolean checkForMainClass(ApplicationConfiguration appCon) {
if (appCon.getMainClass() == null) {
logger.info("No main class was found, prompting user to choose one.");
TreeClassChooser chooser = chooseMainClassForProject();
if (chooser.getSelected() == null) {
return false;
}
configApplicationConfiguration(chooser);
}
return true;
}
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:19,代码来源:RunConfigurationFactory.java
示例11: _appendSwingExplorerJarsToClassPath
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
/**
* F�gt die JAR-Dateien zum Classpath des auszuf�hrenden Programms hinzu
*
* @param profileState Profil, bei dem es hinzugef�gt werden soll
* @throws ExecutionException Wenn die JavaParameter nicht geladen werden konnten
*/
private void _appendSwingExplorerJarsToClassPath(ApplicationConfiguration.JavaApplicationCommandLineState profileState) throws ExecutionException
{
PathsList classPath = profileState.getJavaParameters().getClassPath();
classPath.add(swagJarFile);
classPath.add(swexplJarFile);
}
开发者ID:wglanzer,项目名称:swingexplorer-idea,代码行数:14,代码来源:Runner.java
示例12: testRenameApplication
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testRenameApplication() throws IOException {
PsiClass psiClass = mySource.createClass("Application", APPLICATION_CODE);
assertNotNull(psiClass);
ApplicationConfiguration configuration = createConfiguration(psiClass);
assertNotNull(configuration);
rename(psiClass, "NewName");
try {
configuration.checkConfiguration();
}
catch (RuntimeConfigurationException e) {
assertTrue("Unexpected ConfigurationException: " + e ,false);
}
assertEquals("NewName", configuration.MAIN_CLASS_NAME);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ConfigurationRefactoringsTest.java
示例13: testApplication
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testApplication() {
PsiClass psiClass = findClass(getModule1(), CLASS_NAME);
PsiMethod psiMethod = psiClass.findMethodsByName("main", false)[0];
ApplicationConfiguration configuration = createConfiguration(psiMethod);
assertEquals(CLASS_NAME, configuration.MAIN_CLASS_NAME);
assertEquals(configuration.suggestedName(), configuration.getName());
assertEquals(SHORT_CLASS_NAME, configuration.getName());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ContextConfigurationTest.java
示例14: testCreateConfiguration
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testCreateConfiguration() throws IOException, ExecutionException {
Module module1 = getModule1();
PsiClass psiClass = findTestA(module1);
JUnitConfiguration configuration = createConfiguration(psiClass);
assertEquals(Collections.singleton(module1), ContainerUtilRt.newHashSet(configuration.getModules()));
checkClassName(psiClass.getQualifiedName(), configuration);
assertEquals(psiClass.getName(), configuration.getName());
checkTestObject(JUnitConfiguration.TEST_CLASS, configuration);
Module module2 = getModule2();
Assertion.compareUnordered(new Module[]{module1, module2}, configuration.getValidModules());
PsiClass innerTest = findClass(module1, INNER_TEST_NAME);
configuration = createJUnitConfiguration(innerTest, TestClassConfigurationProducer.class, new MapDataContext());
checkClassName(RT_INNER_TEST_NAME, configuration);
checkCanRun(configuration);
PsiMethod[] testMethod = innerTest.findMethodsByName("test", false);
assertEquals(1, testMethod.length);
configuration = createConfiguration(testMethod[0]);
checkClassName(RT_INNER_TEST_NAME, configuration);
checkMethodName("test", configuration);
checkTestObject(JUnitConfiguration.TEST_METHOD, configuration);
checkCanRun(configuration);
PsiMethod mainMethod = innerTest.findMethodsByName("main", false)[0];
ApplicationConfiguration appConfiguration = createConfiguration(mainMethod);
assertEquals(RT_INNER_TEST_NAME, appConfiguration.MAIN_CLASS_NAME);
checkCanRun(configuration);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ConfigurationsTest.java
示例15: testTestClassPathWhenRunningConfigurations
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testTestClassPathWhenRunningConfigurations() throws IOException, ExecutionException {
addModule("module4", false);
Module module4 = getModule4();
assignJdk(module4);
addSourcePath(module4, "testSrc", true);
addSourcePath(module4, "src", false);
String output = setCompilerOutput(module4, "classes", false);
String testOuput = setCompilerOutput(module4, "testClasses", true);
ApplicationConfiguration applicationConfiguration = createConfiguration(findClass(module4, "Application"));
JavaParameters parameters = checkCanRun(applicationConfiguration);
String classPath = parameters.getClassPath().getPathsString();
checkDoesNotContain(classPath, testOuput);
checkContains(classPath, output);
JUnitConfiguration junitConfiguration =
createJUnitConfiguration(findClass(module4, "TestApplication"), TestClassConfigurationProducer.class, new MapDataContext());
parameters = checkCanRun(junitConfiguration);
classPath = parameters.getClassPath().getPathsString();
checkContains(classPath, testOuput);
checkContains(classPath, output);
applicationConfiguration.MAIN_CLASS_NAME = junitConfiguration.getPersistentData().getMainClassName();
classPath = checkCanRun(applicationConfiguration).getClassPath().getPathsString();
checkContains(classPath, testOuput);
checkContains(classPath, output);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ConfigurationsTest.java
示例16: testCreateInnerPackageLocalApplication
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testCreateInnerPackageLocalApplication() throws ExecutionException {
PsiClass psiClass = findClass(getModule1(), "test2.NotATest.InnerApplication");
assertNotNull(psiClass);
ApplicationConfiguration configuration = createConfiguration(psiClass);
assertEquals("test2.NotATest$InnerApplication", configuration.MAIN_CLASS_NAME);
checkCanRun(configuration);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ConfigurationsTest.java
示例17: testRunThirdPartyApplication
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
public void testRunThirdPartyApplication() throws ExecutionException {
ApplicationConfiguration configuration =
new ApplicationConfiguration("Third party", myProject, ApplicationConfigurationType.getInstance());
configuration.setModule(getModule1());
configuration.MAIN_CLASS_NAME = "third.party.Main";
checkCanRun(configuration);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ConfigurationsTest.java
示例18: updateJavaParameters
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
@Override
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
if (!isApplicableFor(configuration)) {
return;
}
ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
if (settings == null) {
settings = new SnapShooterConfigurationSettings();
appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
}
if (appConfiguration.ENABLE_SWING_INSPECTOR) {
settings.setLastPort(NetUtils.tryToFindAvailableSocketPort());
}
if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
// add +1 because idea_rt.jar will be added as the last entry to the classpath
params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
Set<String> paths = new TreeSet<String>();
paths.add(PathUtil.getJarPathForClass(SnapShooter.class)); // ui-designer-impl
paths.add(PathUtil.getJarPathForClass(BaseComponent.class)); // appcore-api
paths.add(PathUtil.getJarPathForClass(ProjectComponent.class)); // openapi
paths.add(PathUtil.getJarPathForClass(LwComponent.class)); // UIDesignerCore
paths.add(PathUtil.getJarPathForClass(GridConstraints.class)); // forms_rt
paths.add(PathUtil.getJarPathForClass(PaletteGroup.class)); // openapi
paths.add(PathUtil.getJarPathForClass(LafManagerListener.class)); // ui-impl
paths.add(PathUtil.getJarPathForClass(DataProvider.class)); // action-system-openapi
paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class)); // idea
paths.add(PathUtil.getJarPathForClass(Navigatable.class)); // pom
paths.add(PathUtil.getJarPathForClass(AreaInstance.class)); // extensions
paths.add(PathUtil.getJarPathForClass(FormLayout.class)); // jgoodies
paths.addAll(PathManager.getUtilClassPath());
for(String path: paths) {
params.getClassPath().addFirst(path);
}
params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:SnapShooterConfigurationExtension.java
示例19: runProcess
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
protected ProcessHandler runProcess(String className,
Module module,
final Class<? extends Executor> executorClass,
final ProcessListener listener, final ProgramRunner runner) throws ExecutionException {
final ApplicationConfiguration configuration = createApplicationConfiguration(className, module);
return runConfiguration(executorClass, listener, runner, configuration);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GroovyCompilerTestCase.java
示例20: createApplicationConfiguration
import com.intellij.execution.application.ApplicationConfiguration; //导入依赖的package包/类
protected ApplicationConfiguration createApplicationConfiguration(String className, Module module) {
final ApplicationConfiguration configuration =
new ApplicationConfiguration("app", getProject(), ApplicationConfigurationType.getInstance());
configuration.setModule(module);
configuration.setMainClassName(className);
return configuration;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GroovyCompilerTestCase.java
注:本文中的com.intellij.execution.application.ApplicationConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论