本文整理汇总了Java中com.intellij.execution.configuration.ConfigurationFactoryEx类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationFactoryEx类的具体用法?Java ConfigurationFactoryEx怎么用?Java ConfigurationFactoryEx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationFactoryEx类属于com.intellij.execution.configuration包,在下文中一共展示了ConfigurationFactoryEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JarApplicationConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public JarApplicationConfigurationType() {
super("JarApplication", ExecutionBundle.message("jar.application.configuration.name"),
ExecutionBundle.message("jar.application.configuration.description"), AllIcons.FileTypes.Archive);
addFactory(new ConfigurationFactoryEx(this) {
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
JarApplicationConfiguration jarApplicationConfiguration = (JarApplicationConfiguration)configuration;
if (StringUtil.isEmpty(jarApplicationConfiguration.getWorkingDirectory())) {
String baseDir = FileUtil.toSystemIndependentName(StringUtil.notNullize(configuration.getProject().getBasePath()));
jarApplicationConfiguration.setWorkingDirectory(baseDir);
}
}
public RunConfiguration createTemplateConfiguration(Project project) {
return new JarApplicationConfiguration(project, this, "");
}
});
}
示例2: createAndRunConfiguration
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
@Override
public void createAndRunConfiguration(@NotNull ServerType<?> serverType, @Nullable RemoteServer<?> remoteServer) {
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
RunManagerEx runManager = RunManagerEx.getInstanceEx(myProject);
ConfigurationFactoryEx factory = configurationType.getFactory();
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
factory.onNewConfigurationCreated(settings.getConfiguration());
DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>)settings.getConfiguration();
if (remoteServer != null) {
runConfiguration.setServerName(remoteServer.getName());
}
if (RunDialog.editConfiguration(myProject, settings, "Create Deployment Configuration",
DefaultRunExecutor.getRunExecutorInstance())) {
runManager.addConfiguration(settings, runManager.isConfigurationShared(settings), runManager.getBeforeRunTasks(runConfiguration),
false);
runManager.setSelectedConfiguration(settings);
ProgramRunnerUtil.executeConfiguration(myProject, settings, DefaultRunExecutor.getRunExecutorInstance());
}
}
示例3: actionPerformed
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final SingleConfigurationConfigurable<RunConfiguration> configuration = getSelectedConfiguration();
LOG.assertTrue(configuration != null);
try {
final DefaultMutableTreeNode typeNode = getSelectedConfigurationTypeNode();
final RunnerAndConfigurationSettings settings = configuration.getSnapshot();
final String copyName = createUniqueName(typeNode, configuration.getNameText(), CONFIGURATION, TEMPORARY_CONFIGURATION);
settings.setName(copyName);
final ConfigurationFactory factory = settings.getFactory();
if (factory instanceof ConfigurationFactoryEx) {
((ConfigurationFactoryEx)factory).onConfigurationCopied(settings.getConfiguration());
}
final SingleConfigurationConfigurable<RunConfiguration> configurable = createNewConfiguration(settings, typeNode, getSelectedNode());
IdeFocusManager.getInstance(myProject).requestFocus(configurable.getNameTextField(), true);
configurable.getNameTextField().setSelectionStart(0);
configurable.getNameTextField().setSelectionEnd(copyName.length());
}
catch (ConfigurationException e1) {
Messages.showErrorDialog(myToolbarDecorator.getActionsPanel(), e1.getMessage(), e1.getTitle());
}
}
示例4: actionPerformed
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final SingleConfigurationConfigurable<RunConfiguration> configuration = getSelectedConfiguration();
LOG.assertTrue(configuration != null);
try {
final DefaultMutableTreeNode typeNode = getSelectedConfigurationTypeNode();
final RunnerAndConfigurationSettings settings = configuration.getSnapshot();
final String copyName = createUniqueName(typeNode, configuration.getNameText(), CONFIGURATION, TEMPORARY_CONFIGURATION);
settings.setName(copyName);
final ConfigurationFactory factory = settings.getFactory();
if (factory instanceof ConfigurationFactoryEx) {
((ConfigurationFactoryEx)factory).onConfigurationCopied(settings.getConfiguration());
}
final SingleConfigurationConfigurable<RunConfiguration> configurable = createNewConfiguration(settings, typeNode);
IdeFocusManager.getInstance(myProject).requestFocus(configurable.getNameTextField(), true);
configurable.getNameTextField().setSelectionStart(0);
configurable.getNameTextField().setSelectionEnd(copyName.length());
}
catch (ConfigurationException e1) {
Messages.showErrorDialog(myToolbarDecorator.getActionsPanel(), e1.getMessage(), e1.getTitle());
}
}
示例5: TestNGConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public TestNGConfigurationType() {
myFactory = new ConfigurationFactoryEx(this)
{
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
LOGGER.info("Create TestNG Template Configuration");
return new TestNGConfiguration("", project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例6: showMavenToolWindow
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的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();
}
示例7: actionPerformed
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(AnActionEvent e) {
final SingleConfigurationConfigurable<RunConfiguration> configuration = getSelectedConfiguration();
LOG.assertTrue(configuration != null);
try {
final DefaultMutableTreeNode typeNode = getSelectedConfigurationTypeNode();
final RunnerAndConfigurationSettings settings = configuration.getSnapshot();
final String copyName = createUniqueName(typeNode, configuration.getNameText(), CONFIGURATION, TEMPORARY_CONFIGURATION);
settings.setName(copyName);
final ConfigurationFactory factory = settings.getFactory();
if (factory instanceof ConfigurationFactoryEx) {
((ConfigurationFactoryEx)factory).onConfigurationCopied(settings.getConfiguration());
}
final SingleConfigurationConfigurable<RunConfiguration> configurable = createNewConfiguration(settings, typeNode);
IdeFocusManager.getInstance(myProject).requestFocus(configurable.getNameTextField(), true);
configurable.getNameTextField().setSelectionStart(0);
configurable.getNameTextField().setSelectionEnd(copyName.length());
}
catch (ConfigurationException e1) {
Messages.showErrorDialog(myToolbarDecorator.getActionsPanel(), e1.getMessage(), e1.getTitle());
}
}
示例8: ApplicationConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public ApplicationConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new ApplicationConfiguration("", project, ApplicationConfigurationType.this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例9: AppletConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
/**reflection*/
AppletConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new AppletConfiguration(project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例10: createNewConfiguration
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
SingleConfigurationConfigurable<RunConfiguration> createNewConfiguration(final ConfigurationFactory factory) {
DefaultMutableTreeNode node = null;
DefaultMutableTreeNode selectedNode = null;
TreePath selectionPath = myTree.getSelectionPath();
if (selectionPath != null) {
selectedNode = (DefaultMutableTreeNode)selectionPath.getLastPathComponent();
}
DefaultMutableTreeNode typeNode = getConfigurationTypeNode(factory.getType());
if (typeNode == null) {
typeNode = new DefaultMutableTreeNode(factory.getType());
myRoot.add(typeNode);
sortTopLevelBranches();
((DefaultTreeModel)myTree.getModel()).reload();
}
node = typeNode;
if (selectedNode != null && typeNode.isNodeDescendant(selectedNode)) {
node = selectedNode;
if (getKind(node).isConfiguration()) {
node = (DefaultMutableTreeNode)node.getParent();
}
}
final RunnerAndConfigurationSettings settings = getRunManager().createConfiguration(createUniqueName(typeNode, null, CONFIGURATION, TEMPORARY_CONFIGURATION), factory);
if (factory instanceof ConfigurationFactoryEx) {
((ConfigurationFactoryEx)factory).onNewConfigurationCreated(settings.getConfiguration());
}
return createNewConfiguration(settings, node, selectedNode);
}
示例11: TestNGTestDiscoveryConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public TestNGTestDiscoveryConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
public RunConfiguration createTemplateConfiguration(Project project) {
return new TestNGTestDiscoveryConfiguration("", project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例12: TestNGConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public TestNGConfigurationType() {
myFactory = new ConfigurationFactoryEx(this)
{
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new TestNGConfiguration("", project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例13: JUnitConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
/**reflection*/
public JUnitConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
public RunConfiguration createTemplateConfiguration(Project project) {
return new JUnitConfiguration("", project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例14: JUnitTestDiscoveryConfigurationType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public JUnitTestDiscoveryConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
public RunConfiguration createTemplateConfiguration(Project project) {
return new JUnitTestDiscoveryConfiguration("", project, this);
}
@Override
public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
((ModuleBasedConfiguration)configuration).onNewConfigurationCreated();
}
};
}
示例15: PageObjectRunConfigType
import com.intellij.execution.configuration.ConfigurationFactoryEx; //导入依赖的package包/类
public PageObjectRunConfigType() {
myConfigurationFactory = new ConfigurationFactoryEx(this) {
@Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new PageObjectRunConfig("", this, project);
}
};
}