use of com.intellij.ide.util.newProjectWizard.FrameworkSupportNode in project intellij-community by JetBrains.
the class FrameworkSupportModelBase method setSelectedVersion.
public void setSelectedVersion(@NotNull String frameworkOrGroupId, @NotNull FrameworkVersion version) {
FrameworkVersion oldVersion = mySelectedVersions.put(frameworkOrGroupId, version);
if (!Comparing.equal(oldVersion, version)) {
for (Map.Entry<String, FrameworkSupportNode> entry : mySettingsMap.entrySet()) {
if (hasParentWithId(entry.getValue(), frameworkOrGroupId)) {
if (!entry.getValue().getId().equals(frameworkOrGroupId)) {
FrameworkSupportOptionsComponent component = myOptionsComponentsMap.get(entry.getKey());
if (component != null) {
component.updateVersionsComponent();
}
}
updateFrameworkLibraryComponent(entry.getKey());
}
}
}
myVersionEventDispatcher.getMulticaster().versionChanged(version);
}
use of com.intellij.ide.util.newProjectWizard.FrameworkSupportNode in project intellij-community by JetBrains.
the class FrameworkSupportModelBase method setFrameworkComponentEnabled.
public void setFrameworkComponentEnabled(@NotNull @NonNls final String providerId, final boolean enable) {
final FrameworkSupportNode node = mySettingsMap.get(providerId);
if (node != null && enable != node.isChecked()) {
node.setChecked(enable);
// ensure configurable to be created and registered to disposer
node.getConfigurable();
if (myFrameworkVersions.get(providerId) == null) {
for (FrameworkVersion version : node.getUserObject().getFrameworkType().getVersions()) {
if (version.getAvailabilityCondition().isAvailableFor(this)) {
setSelectedVersion(providerId, version);
}
}
}
}
}
use of com.intellij.ide.util.newProjectWizard.FrameworkSupportNode in project intellij-community by JetBrains.
the class FrameworkSupportProviderTestCase method addSupport.
protected void addSupport() {
new WriteCommandAction.Simple(getProject()) {
@Override
protected void run() throws Throwable {
final VirtualFile root = getVirtualFile(createTempDir("contentRoot"));
PsiTestUtil.addContentRoot(myModule, root);
final ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
try {
List<FrameworkSupportConfigurable> selectedConfigurables = new ArrayList<>();
final IdeaModifiableModelsProvider modelsProvider = new IdeaModifiableModelsProvider();
for (FrameworkSupportNode node : myNodes.values()) {
if (node.isChecked()) {
final FrameworkSupportInModuleConfigurable configurable = getOrCreateConfigurable(node.getUserObject());
configurable.addSupport(myModule, model, modelsProvider);
if (configurable instanceof OldFrameworkSupportProviderWrapper.FrameworkSupportConfigurableWrapper) {
selectedConfigurables.add(((OldFrameworkSupportProviderWrapper.FrameworkSupportConfigurableWrapper) configurable).getConfigurable());
}
}
}
for (FrameworkSupportCommunicator communicator : FrameworkSupportCommunicator.EP_NAME.getExtensions()) {
communicator.onFrameworkSupportAdded(myModule, model, selectedConfigurables, myFrameworkSupportModel);
}
} finally {
model.commit();
}
for (FrameworkSupportInModuleConfigurable configurable : myConfigurables.values()) {
Disposer.dispose(configurable);
}
}
}.execute().throwException();
}
use of com.intellij.ide.util.newProjectWizard.FrameworkSupportNode in project intellij-community by JetBrains.
the class FrameworkSupportProviderTestCase method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
final Project project = getProject();
myFrameworkSupportModel = new FrameworkSupportModelImpl(project, "", LibrariesContainerFactory.createContainer(project));
myNodes = new LinkedHashMap<>();
final List<FrameworkSupportInModuleProvider> providers = FrameworkSupportUtil.getAllProviders();
Collections.sort(providers, FrameworkSupportUtil.getFrameworkSupportProvidersComparator(providers));
for (FrameworkSupportInModuleProvider provider : providers) {
final FrameworkSupportNode node = new FrameworkSupportNode(provider, null, myFrameworkSupportModel, getTestRootDisposable());
myNodes.put(provider.getFrameworkType(), node);
myFrameworkSupportModel.registerComponent(provider, node);
}
myConfigurables = new HashMap<>();
}
Aggregations