本文整理汇总了Java中com.intellij.execution.configurations.ConfigurationFactory类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationFactory类的具体用法?Java ConfigurationFactory怎么用?Java ConfigurationFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationFactory类属于com.intellij.execution.configurations包,在下文中一共展示了ConfigurationFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AppleScriptConfigurationType
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public AppleScriptConfigurationType() {
super("AppleScriptRunType", "Run AppleScript", "Run Configuration for AppleScript", AppleScriptIcons.FILE);
addFactory(new ConfigurationFactory(this) {
@Override
public boolean isConfigurationSingletonByDefault() {
return true;
}
@Override
public boolean canConfigurationBeSingleton() {
return false;
}
@NotNull
@Override
public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
return new AppleScriptRunConfiguration(project, this, " Template config");
}
});
}
示例2: createRemoteDebug
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
private void createRemoteDebug(
final RunManagerImpl runManager,
final HybrisProjectDescriptor hybrisProjectDescriptor
) {
final RemoteConfigurationType remoteConfigurationType = ConfigurationTypeUtil.findConfigurationType(
RemoteConfigurationType.class);
final ConfigurationFactory configurationFactory = remoteConfigurationType.getConfigurationFactories()[0];
final String debugName = HybrisI18NBundleUtils.message("hybris.project.import.run.configuration.remote.debug");
final RunnerAndConfigurationSettings runner = runManager.createRunConfiguration(
debugName,
configurationFactory
);
final RemoteConfiguration remoteConfiguration = (RemoteConfiguration) runner.getConfiguration();
remoteConfiguration.PORT = getDebugPort(hybrisProjectDescriptor);
ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
runner.setSingleton(true);
runner.setActivateToolWindowBeforeRun(true);
runManager.addConfiguration(runner, true);
runManager.setSelectedConfiguration(runner);
}));
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:DebugRunConfigurationConfigurator.java
示例3: doOKAction
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
@Override
protected void doOKAction() {
final RunManagerImpl runManager = (RunManagerImpl)RunManagerEx.getInstanceEx(myProject);
for (Enumeration nodes = myRoot.depthFirstEnumeration(); nodes.hasMoreElements(); ) {
final DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodes.nextElement();
final Descriptor descriptor = (Descriptor)node.getUserObject();
final boolean isChecked = descriptor.isChecked();
if (descriptor instanceof ConfigurationTypeDescriptor) {
ConfigurationTypeDescriptor typeDesc = (ConfigurationTypeDescriptor)descriptor;
for (ConfigurationFactory factory : typeDesc.getConfigurationType().getConfigurationFactories()) {
RunnerAndConfigurationSettings settings = runManager.getConfigurationTemplate(factory);
update(settings.getConfiguration(), isChecked, runManager);
}
}
else if (descriptor instanceof ConfigurationDescriptor) {
ConfigurationDescriptor configDesc = (ConfigurationDescriptor)descriptor;
update(configDesc.getConfiguration(), isChecked, runManager);
}
}
RunManagerImpl.getInstanceImpl(myProject).fireBeforeRunTasksUpdated();
close(OK_EXIT_CODE);
}
示例4: addRunConfiguration
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public void addRunConfiguration(@NotNull final ConfigurationFactory factory) {
final RunConfigurable configurable = (RunConfigurable)getConfigurable();
final SingleConfigurationConfigurable<RunConfiguration> configuration = configurable.createNewConfiguration(factory);
if (!isVisible()) {
getContentPanel().addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
if (configuration != null) {
configurable.updateRightPanel(configuration);
getContentPanel().removeComponentListener(this);
}
}
});
}
}
示例5: customizeModule
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
@Override
public void customizeModule(@NotNull Project project,
@NotNull Module module,
@NotNull IdeModifiableModelsProvider modelsProvider,
@Nullable IdeaAndroidProject androidProject) {
if (androidProject != null) {
AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null && !facet.isLibraryProject()) {
RunManager runManager = RunManager.getInstance(project);
ConfigurationFactory configurationFactory = AndroidRunConfigurationType.getInstance().getFactory();
List<RunConfiguration> configs = runManager.getConfigurationsList(configurationFactory.getType());
for (RunConfiguration config : configs) {
if (config instanceof AndroidRunConfiguration) {
AndroidRunConfiguration androidRunConfig = (AndroidRunConfiguration)config;
if (androidRunConfig.getConfigurationModule().getModule() == module) {
// There is already a run configuration for this module.
return;
}
}
}
addRunConfiguration(facet, null, false, TargetSelectionMode.SHOW_DIALOG, null);
}
}
}
示例6: setupRootModel
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
@Override
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
setJavaRootModel(rootModel);
Project project = rootModel.getProject();
RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(project);
//Create "Run dub" configuration
RunnerAndConfigurationSettings runDubSettings = runManager.findConfigurationByName(RUN_DUB_CONFIG_NAME);
if(runDubSettings == null) {
final DLangRunDubConfigurationType configurationType
= Extensions.findExtension(ConfigurationType.CONFIGURATION_TYPE_EP, DLangRunDubConfigurationType.class);
final ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
runDubSettings = runManager.createRunConfiguration(RUN_DUB_CONFIG_NAME, factory);
((ModuleBasedConfiguration) runDubSettings.getConfiguration()).setModule(rootModel.getModule());
runManager.addConfiguration(runDubSettings, false);
}
}
示例7: setupDebugRunConfiguration
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
private void setupDebugRunConfiguration(@NotNull Project project) {
RunManager runManager = RunManager.getInstance(project);
boolean hasExistingDebugConfiguration =
runManager
.getAllConfigurationsList()
.stream()
.anyMatch(config -> config instanceof CloudDebugRunConfiguration);
if (!hasExistingDebugConfiguration) {
CloudDebugConfigType debugConfigType = CloudDebugConfigType.getInstance();
ConfigurationFactory factory = debugConfigType.getConfigurationFactories()[0];
RunnerAndConfigurationSettings settings =
runManager.createConfiguration(
new CloudDebugRunConfiguration(project, factory).clone(), factory);
runManager.addConfiguration(settings, false /*isShared*/);
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:20,代码来源:AppEngineStandardWebIntegration.java
示例8: createNewConfiguration
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
private void createNewConfiguration(Project project) {
final RunManagerImpl manager = RunManagerImpl.getInstanceImpl(project);
final ConfigurationFactory factory =
configType != null ? configType.getConfigurationFactories()[0] : null;
EditConfigurationsDialog dialog = new EditConfigurationsDialog(project, factory);
if (dialog.showAndGet()) {
RunnerAndConfigurationSettings settings = manager.getSelectedConfiguration();
if (settings != null) {
manager.addConfiguration(settings, false /*isShared*/);
}
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:17,代码来源:CloudToolsRunConfigurationAction.java
示例9: createConfigurationForTask
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
private static void createConfigurationForTask(Project project, TaskData taskData) {
TaskConfigurationType configurationType = new TaskConfigurationType();
ConfigurationFactory factory = configurationType.getConfigurationFactories()[0];
RunManager manager = RunManager.getInstance(project);
TaskConfiguration taskConfiguration = new TaskConfiguration(
project,
factory
);
taskConfiguration.setFromTaskData(taskData);
RunnerAndConfigurationSettings configuration = manager.createConfiguration(
taskConfiguration,
factory
);
manager.addConfiguration(configuration, true);
manager.setSelectedConfiguration(configuration);
}
示例10: XQueryRunConfiguration
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public XQueryRunConfiguration(String name, XQueryRunConfigurationModule configurationModule,
ConfigurationFactory factory, VariablesValidator variablesValidator,
ContextItemValidator contextItemValidator, DataSourceValidator dataSourceValidator,
AlternativeJreValidator alternativeJreValidator, ModuleValidator moduleValidator,
XmlConfigurationAccessor xmlConfigurationAccessor,
VariablesAccessor variablesAccessor) {
super(name, configurationModule, factory);
this.variablesValidator = variablesValidator;
this.contextItemValidator = contextItemValidator;
this.dataSourceValidator = dataSourceValidator;
this.alternativeJreValidator = alternativeJreValidator;
this.moduleValidator = moduleValidator;
this.xmlConfigurationAccessor = xmlConfigurationAccessor;
this.variablesAccessor = variablesAccessor;
setWorkingDirectory(getProject().getBasePath());
}
示例11: setUp
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
XQueryRunConfigurationModule module = new XQueryRunConfigurationModule(getProject());
XQueryRunConfigurationType type = new XQueryRunConfigurationType();
ConfigurationFactory factory = new XQueryRunConfigurationFactory(XQUERY_MAIN_MODULE, type);
variablesValidator = mock(VariablesValidator.class);
contextItemValidator = mock(ContextItemValidator.class);
dataSourceValidator = mock(DataSourceValidator.class);
alternativeJreValidator = mock(AlternativeJreValidator.class);
moduleValidator = mock(ModuleValidator.class);
xmlConfigurationAccessor = mock(XmlConfigurationAccessor.class);
variablesAccessor = mock(VariablesAccessor.class);
configuration = new TestXQueryRunConfiguration(XQUERY_MAIN_MODULE, module, factory,
variablesValidator, contextItemValidator, dataSourceValidator, alternativeJreValidator, moduleValidator,
xmlConfigurationAccessor, variablesAccessor);
configuration.setVariables(variables);
configuration.setDataSourceName(DATA_SOURCE_NAME);
}
示例12: showMavenToolWindow
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public void showMavenToolWindow() {
ConfigurationType configurationType = new JUnitConfigurationType();
ConfigurationFactory configurationFactory = new ConfigurationFactoryEx<JUnitConfiguration>(configurationType) {
@NotNull
@Override
public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
return new JUnitConfiguration(project.getName(), project, this);
}
};
JUnitConfiguration configuration = new JUnitConfiguration(project.getName(), project, configurationFactory);
Executor executor = new DefaultRunExecutor();
ProcessHandler processHandler = new NopProcessHandler();
TestConsoleProperties consoleProperties = new MavenTestConsoleProperties(mavenProject, project, executor, configuration, processHandler);
BaseTestsOutputConsoleView consoleView;
try {
consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(TOOL_WINDOW_ID, processHandler, consoleProperties);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
showInToolWindow(consoleView, mavenProject.getFinalName());
processHandler.startNotify();
}
示例13: createRunConfiguration
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
private static RunnerAndConfigurationSettings createRunConfiguration(
Project project, String debugPort) {
final RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
final ConfigurationFactory factory = remoteConfigurationType.getFactory();
final RunnerAndConfigurationSettings runSettings =
RunManager.getInstance(project)
.createRunConfiguration(getRunConfigurationName(debugPort), factory);
final RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
configuration.HOST = "localhost";
configuration.PORT = debugPort;
configuration.USE_SOCKET_TRANSPORT = true;
configuration.SERVER_MODE = false;
return runSettings;
}
示例14: testPersistency
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public void testPersistency() throws Exception {
final ConfigurationFactory factory =
TestConfigurationType.getInstance().getConfigurationFactories()[0];
final TestConfiguration cfg =
new TestConfiguration(getProject(), factory, "test serialization");
cfg.data.target = "//src/com/facebook/buck:test";
cfg.data.testSelectors = "com.facebook.buck.Test";
cfg.data.additionalParams = "--num-threads 239";
final Element testElement = new Element("test_element");
cfg.writeExternal(testElement);
final TestConfiguration cfg2 =
new TestConfiguration(getProject(), factory, "test serialization");
cfg2.readExternal(testElement);
Assert.assertEquals("//src/com/facebook/buck:test", cfg2.data.target);
Assert.assertEquals("com.facebook.buck.Test", cfg2.data.testSelectors);
Assert.assertEquals("--num-threads 239", cfg2.data.additionalParams);
}
示例15: JavaEEConfigurationImpl
import com.intellij.execution.configurations.ConfigurationFactory; //导入依赖的package包/类
public JavaEEConfigurationImpl(Project project,
ConfigurationFactory factory,
String name,
JavaEEServerBundleType bundleType,
ServerModel serverModel,
boolean isLocal,
ExecutableObjectStartupPolicy startupPolicy)
{
super(project, factory, name);
myBundleType = bundleType;
myIsLocal = isLocal;
myStartupPolicy = startupPolicy;
myServerModel = (JavaeeServerModel) serverModel;
myDeploymentSettings = new JavaEEDeploymentSettingsImpl(project, bundleType, this);
myServerModel.setCommonModel(this);
}