public abstract class RunConfigurationProducer<T extends RunConfiguration>
extends java.lang.Object
LocatableConfigurationBase
class.Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<RunConfigurationProducer> |
EP_NAME |
Modifier | Constructor and Description |
---|---|
|
RunConfigurationProducer(boolean internalUsageOnly)
Do NOT use directly.
|
protected |
RunConfigurationProducer(java.lang.Class<? extends ConfigurationType> type)
Deprecated.
Use
LazyRunConfigurationProducer . |
protected |
RunConfigurationProducer(ConfigurationFactory configurationFactory)
Deprecated.
Use
LazyRunConfigurationProducer . |
protected |
RunConfigurationProducer(ConfigurationType configurationType)
Deprecated.
Use
LazyRunConfigurationProducer . |
Modifier and Type | Method and Description |
---|---|
protected RunnerAndConfigurationSettings |
cloneTemplateConfiguration(ConfigurationContext context) |
protected static RunnerAndConfigurationSettings |
cloneTemplateConfigurationStatic(ConfigurationContext context,
ConfigurationFactory configurationFactory) |
ConfigurationFromContext |
createConfigurationFromContext(ConfigurationContext context)
Creates a run configuration from the context.
|
RunConfiguration |
createLightConfiguration(ConfigurationContext context) |
RunnerAndConfigurationSettings |
findExistingConfiguration(ConfigurationContext context)
Searches the list of existing run configurations to find one created from this context.
|
ConfigurationFromContext |
findOrCreateConfigurationFromContext(ConfigurationContext context)
Searches the list of existing run configurations to find one created from this context.
|
ConfigurationFactory |
getConfigurationFactory() |
protected java.util.List<RunnerAndConfigurationSettings> |
getConfigurationSettingsList(RunManager runManager) |
ConfigurationType |
getConfigurationType() |
static <T extends RunConfigurationProducer> |
getInstance(java.lang.Class<? extends T> aClass) |
static java.util.List<RunConfigurationProducer<?>> |
getProducers(Project project) |
abstract boolean |
isConfigurationFromContext(T configuration,
ConfigurationContext context)
Checks if the specified configuration was created from the specified context.
|
boolean |
isPreferredConfiguration(ConfigurationFromContext self,
ConfigurationFromContext other)
When two configurations are created from the same context by two different producers, checks if the configuration created by
this producer should be discarded in favor of the other one.
|
void |
onFirstRun(ConfigurationFromContext configuration,
ConfigurationContext context,
java.lang.Runnable startRunnable)
Called before a configuration created from context by this producer is first executed.
|
protected abstract boolean |
setupConfigurationFromContext(T configuration,
ConfigurationContext context,
Ref<PsiElement> sourceElement)
Sets up a configuration based on the specified context.
|
boolean |
shouldReplace(ConfigurationFromContext self,
ConfigurationFromContext other)
When two configurations are created from the same context by two different producers, checks if the configuration created by
this producer should replace the other one, that is if the other one should be discarded.
|
public static final ExtensionPointName<RunConfigurationProducer> EP_NAME
@Deprecated protected RunConfigurationProducer(ConfigurationFactory configurationFactory)
LazyRunConfigurationProducer
.@Deprecated protected RunConfigurationProducer(java.lang.Class<? extends ConfigurationType> type)
LazyRunConfigurationProducer
.public RunConfigurationProducer(boolean internalUsageOnly)
@Deprecated protected RunConfigurationProducer(ConfigurationType configurationType)
LazyRunConfigurationProducer
.public static java.util.List<RunConfigurationProducer<?>> getProducers(Project project)
public ConfigurationFactory getConfigurationFactory()
public final ConfigurationType getConfigurationType()
public ConfigurationFromContext createConfigurationFromContext(ConfigurationContext context)
context
- contains the information about a location in the source code.protected abstract boolean setupConfigurationFromContext(T configuration, ConfigurationContext context, Ref<PsiElement> sourceElement)
configuration
- a clone of the template run configuration of the specified typecontext
- contains the information about a location in the source code.sourceElement
- a reference to the source element for the run configuration (by default contains the element at caret,
can be updated by the producer to point to a higher-level element in the tree).public abstract boolean isConfigurationFromContext(T configuration, ConfigurationContext context)
configuration
- a configuration instance.context
- contains the information about a location in the source code.public boolean isPreferredConfiguration(ConfigurationFromContext self, ConfigurationFromContext other)
self
- a configuration created by this producer.other
- a configuration created by another producer.shouldReplace(ConfigurationFromContext, ConfigurationFromContext)
public boolean shouldReplace(ConfigurationFromContext self, ConfigurationFromContext other)
This is the same relationship as isPreferredConfiguration(ConfigurationFromContext, ConfigurationFromContext)
but
specified from the "replacement" side.
self
- a configuration created by this producer.other
- a configuration created by another producer.isPreferredConfiguration(ConfigurationFromContext, ConfigurationFromContext)
public void onFirstRun(ConfigurationFromContext configuration, ConfigurationContext context, java.lang.Runnable startRunnable)
configuration
- a configuration created by this producer.context
- the contextstartRunnable
- the runnable that needs to be called after additional customization is complete.public ConfigurationFromContext findOrCreateConfigurationFromContext(ConfigurationContext context)
context
- contains the information about a location in the source code.public RunnerAndConfigurationSettings findExistingConfiguration(ConfigurationContext context)
context
- contains the information about a location in the source code.protected java.util.List<RunnerAndConfigurationSettings> getConfigurationSettingsList(RunManager runManager)
protected RunnerAndConfigurationSettings cloneTemplateConfiguration(ConfigurationContext context)
protected static RunnerAndConfigurationSettings cloneTemplateConfigurationStatic(ConfigurationContext context, ConfigurationFactory configurationFactory)
public static <T extends RunConfigurationProducer> T getInstance(java.lang.Class<? extends T> aClass)
public RunConfiguration createLightConfiguration(ConfigurationContext context)