IDEA-106937 Run configuration: Make it possible to provide custom jres to use

This commit is contained in:
Denis.Zhdanov
2013-05-09 22:36:49 +04:00
parent ba770c3006
commit 082028adf6
3 changed files with 43 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.ui.ComponentWithBrowseButton;
import com.intellij.openapi.ui.TextComponentAccessor;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.GuiUtils;
import com.intellij.ui.InsertPathAction;
import com.intellij.ui.PanelWithAnchor;
@@ -49,6 +50,12 @@ public class AlternativeJREPanel extends JPanel implements PanelWithAnchor {
myFieldWithHistory = new TextFieldWithHistory();
final ArrayList<String> foundJDKs = new ArrayList<String>();
for (JreProvider provider : JreProvider.EP_NAME.getExtensions()) {
String path = provider.getJrePath();
if (!StringUtil.isEmpty(path)) {
foundJDKs.add(path);
}
}
final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
for (Sdk jdk : allJDKs) {
foundJDKs.add(jdk.getHomePath());

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.execution.ui;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.NotNull;
/**
* Extension point for providing custom jre to be shown at run configuration control.
*
* @author Denis Zhdanov
* @since 5/9/13 10:04 PM
*/
public interface JreProvider {
ExtensionPointName<JreProvider> EP_NAME = new ExtensionPointName<JreProvider>("com.intellij.jreProvider");
@NotNull
String getJrePath();
}

View File

@@ -392,6 +392,9 @@
<extensionPoint name="runConfigurationExtension"
interface="com.intellij.execution.RunConfigurationExtension"/>
<extensionPoint name="jreProvider"
interface="com.intellij.execution.ui.JreProvider"/>
<extensionPoint name="stepsBeforeRunProvider"
interface="com.intellij.execution.BeforeRunTaskProvider"
area="IDEA_PROJECT"/>