本文整理匯總了Java中com.intellij.execution.configurations.ConfigurationType類的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationType類的具體用法?Java ConfigurationType怎麽用?Java ConfigurationType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConfigurationType類屬於com.intellij.execution.configurations包,在下文中一共展示了ConfigurationType類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findAllProducers
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
private static List<RuntimeConfigurationProducer> findAllProducers(Location location, ConfigurationContext context) {
//todo load configuration types if not already loaded
Extensions.getExtensions(ConfigurationType.CONFIGURATION_TYPE_EP);
final RuntimeConfigurationProducer[] configurationProducers =
ApplicationManager.getApplication().getExtensions(RuntimeConfigurationProducer.RUNTIME_CONFIGURATION_PRODUCER);
final ArrayList<RuntimeConfigurationProducer> producers = new ArrayList<RuntimeConfigurationProducer>();
for (final RuntimeConfigurationProducer prototype : configurationProducers) {
final RuntimeConfigurationProducer producer;
try {
producer = prototype.createProducer(location, context);
}
catch (AbstractMethodError e) {
LOG.error(new ExtensionException(prototype.getClass()));
continue;
}
if (producer.getConfiguration() != null) {
LOG.assertTrue(producer.getSourceElement() != null, producer);
producers.add(producer);
}
}
return producers;
}
示例2: getSeparatorAbove
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
@Override
public ListSeparator getSeparatorAbove(ItemWrapper value) {
if (value.addSeparatorAbove()) return new ListSeparator();
final List<ItemWrapper> configurations = getValues();
final int index = configurations.indexOf(value);
if (index > 0 && index <= configurations.size() - 1) {
final ItemWrapper aboveConfiguration = configurations.get(index - 1);
if (aboveConfiguration != null && aboveConfiguration.isDynamic() != value.isDynamic()) {
return new ListSeparator();
}
final ConfigurationType currentType = value.getType();
final ConfigurationType aboveType = aboveConfiguration == null ? null : aboveConfiguration.getType();
if (aboveType != currentType && currentType != null) {
return new ListSeparator(); // new ListSeparator(currentType.getDisplayName());
}
}
return null;
}
示例3: testPluginProject
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
public void testPluginProject() throws Exception {
createSdk("devkit", IdeaJdk.getInstance());
Project project = createProjectFromTemplate(PluginModuleType.getInstance().getName(), null, null);
VirtualFile baseDir = project.getBaseDir();
VirtualFile virtualFile = VfsUtilCore.findRelativeFile("resources/META-INF/plugin.xml", baseDir);
assertNotNull(virtualFile);
RunnerAndConfigurationSettings configuration = RunManager.getInstance(project).getSelectedConfiguration();
assertNotNull(configuration);
ConfigurationType type = configuration.getType();
assertNotNull(type);
assertEquals(DevKitBundle.message("run.configuration.title"), type.getDisplayName());
VirtualFile[] files = FileEditorManager.getInstance(project).getOpenFiles();
assertEquals(1, files.length);
}
示例4: setupRootModel
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的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);
}
}
示例5: createPopupActionGroup
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
@NotNull
@Override
protected DefaultActionGroup createPopupActionGroup(JComponent jComponent) {
DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(ActionManager.getInstance().getAction("editRunConfigurations"));
AppCode appCode = new AppCode(jComponent);
List<Target> targets = appCode.getAvailableTargets();
ConfigurationType currentConfigType = null;
for (Target target : targets) {
if (target.getConfigType() != currentConfigType) {
actionGroup.addSeparator();
}
actionGroup.add(new SelectTargetAction(target));
currentConfigType = target.getConfigType();
}
return actionGroup;
}
示例6: getSeparatorAbove
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
@Override
public ListSeparator getSeparatorAbove(ItemWrapper value) {
if (value.addSeparatorAbove()) return new ListSeparator();
final List<ItemWrapper> configurations = getValues();
final int index = configurations.indexOf(value);
if (index > 0 && index <= configurations.size() - 1) {
final ItemWrapper aboveConfiguration = index == 0 ? null : configurations.get(index - 1);
if (aboveConfiguration != null && aboveConfiguration.isDynamic() != value.isDynamic()) {
return new ListSeparator();
}
final ConfigurationType currentType = value.getType();
final ConfigurationType aboveType = aboveConfiguration == null ? null : aboveConfiguration.getType();
if (aboveType != currentType && currentType != null) {
return new ListSeparator(); // new ListSeparator(currentType.getDisplayName());
}
}
return null;
}
示例7: init
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
void init() {
if (myInitialized) {
return;
}
if (myConfigurationName != null && myConfigurationType != null) {
Collection<RunnerAndConfigurationSettings> configurations = RunManagerImpl.getInstanceImpl(myProject).getSortedConfigurations();
for (RunnerAndConfigurationSettings runConfiguration : configurations) {
ConfigurationType type = runConfiguration.getType();
if (myConfigurationName.equals(runConfiguration.getName())
&& type != null
&& myConfigurationType.equals(type.getId())) {
setSettings(runConfiguration);
return;
}
}
}
}
示例8: showMavenToolWindow
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的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();
}
示例9: findAllProducers
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
private static List<RuntimeConfigurationProducer> findAllProducers(Location location, ConfigurationContext context) {
//todo load configuration types if not already loaded
Extensions.getExtensions(ConfigurationType.CONFIGURATION_TYPE_EP);
final RuntimeConfigurationProducer[] configurationProducers =
ApplicationManager.getApplication().getExtensions(RuntimeConfigurationProducer.RUNTIME_CONFIGURATION_PRODUCER);
final ArrayList<RuntimeConfigurationProducer> producers = new ArrayList<RuntimeConfigurationProducer>();
for (final RuntimeConfigurationProducer prototype : configurationProducers) {
final RuntimeConfigurationProducer producer;
try {
producer = prototype.createProducer(location, context);
}
catch (AbstractMethodError e) {
LOG.error(new ExtensionException(prototype.getClass()));
continue;
}
if (producer.getConfiguration() != null) {
LOG.assertTrue(producer.getSourceElement() != null, producer);
producers.add(producer);
}
}
return producers;
}
示例10: createConfiguration
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
/**
* Creates a run configuration, using the given template. The created configuration is then
* added to RunManager.
*/
public void createConfiguration() {
logger.info("Creating configuration.");
ConfigurationType type = ConfigurationTypeUtil.findConfigurationType(configurationType);
RunnerAndConfigurationSettings settings =
runManager.createRunConfiguration(
module.getName(), type.getConfigurationFactories()[0]);
logger.info("Adding configuration to RunManager.");
runManager.addConfiguration(settings, true);
logger.info("Setting created configuration to be the selected.");
runManager.setSelectedConfiguration(settings);
}
示例11: createRunManager
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
private static RunManagerImpl createRunManager(Element element) throws InvalidDataException {
Project project = getProject();
RunManagerImpl runManager = new RunManagerImpl(project, PropertiesComponent.getInstance(project));
runManager.initializeConfigurationTypes(new ConfigurationType[]{ApplicationConfigurationType.getInstance(),
JUnitConfigurationType.getInstance(), UnknownConfigurationType.INSTANCE});
runManager.loadState(element);
return runManager;
}
示例12: getRunConfigurationType
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
private static DeployToServerConfigurationType getRunConfigurationType(ServerType<?> cloudType) {
String id = DeployToServerConfigurationType.getId(cloudType);
for (ConfigurationType configurationType : ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions()) {
if (configurationType instanceof DeployToServerConfigurationType) {
DeployToServerConfigurationType deployConfigurationType = (DeployToServerConfigurationType)configurationType;
if (deployConfigurationType.getId().equals(id)) {
return deployConfigurationType;
}
}
}
return null;
}
示例13: initComponent
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
@Override
public void initComponent() {
//todo[nik] improve this: configuration types should be loaded lazily
ExtensionPoint<ConfigurationType> point = Extensions.getRootArea().getExtensionPoint(ConfigurationType.CONFIGURATION_TYPE_EP);
for (ServerType serverType : ServerType.EP_NAME.getExtensions()) {
point.registerExtension(new DeployToServerConfigurationType(serverType));
}
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:DeployToServerConfigurationTypesRegistrar.java
示例14: getDeployConfigurationType
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
@NotNull
public static DeployToServerConfigurationType getDeployConfigurationType(@NotNull ServerType<?> serverType) {
for (ConfigurationType type : ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions()) {
if (type instanceof DeployToServerConfigurationType) {
DeployToServerConfigurationType configurationType = (DeployToServerConfigurationType)type;
if (configurationType.getServerType().equals(serverType)) {
return configurationType;
}
}
}
throw new IllegalArgumentException("Cannot find run configuration type for " + serverType.getClass());
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:DeployToServerConfigurationTypesRegistrar.java
示例15: getIcon
import com.intellij.execution.configurations.ConfigurationType; //導入依賴的package包/類
public Icon getIcon(String file) {
final ConfigurationBean bean = myState.getHistoryElements().get(file);
if (bean != null) {
ConfigurationType type = ConfigurationTypeUtil.findConfigurationType(bean.configurationId);
if (type != null) return type.getIcon();
}
return null;
}