Search in sources :

Example 1 with FrameworkVersion

use of com.intellij.framework.FrameworkVersion 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);
}
Also used : FrameworkSupportNode(com.intellij.ide.util.newProjectWizard.FrameworkSupportNode) FrameworkVersion(com.intellij.framework.FrameworkVersion) FrameworkSupportOptionsComponent(com.intellij.ide.util.newProjectWizard.FrameworkSupportOptionsComponent) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with FrameworkVersion

use of com.intellij.framework.FrameworkVersion 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);
                }
            }
        }
    }
}
Also used : FrameworkSupportNode(com.intellij.ide.util.newProjectWizard.FrameworkSupportNode) FrameworkVersion(com.intellij.framework.FrameworkVersion)

Example 3 with FrameworkVersion

use of com.intellij.framework.FrameworkVersion in project intellij-community by JetBrains.

the class FrameworkVersionComponent method updateVersionsList.

public void updateVersionsList() {
    FrameworkVersion oldSelection = getSelectedVersion();
    List<? extends FrameworkVersion> versions = computeAvailableVersions();
    myVersionsBox.removeAllItems();
    for (FrameworkVersion version : versions) {
        myVersionsBox.addItem(version);
    }
    myVersionsPanel.setVisible(!versions.isEmpty());
    if (!versions.isEmpty()) {
        FrameworkVersion toSelect = oldSelection != null && versions.contains(oldSelection) ? oldSelection : versions.get(versions.size() - 1);
        myVersionsBox.setSelectedItem(toSelect);
        myModel.setSelectedVersion(myFrameworkOrGroupId, toSelect);
    }
}
Also used : FrameworkVersion(com.intellij.framework.FrameworkVersion)

Aggregations

FrameworkVersion (com.intellij.framework.FrameworkVersion)3 FrameworkSupportNode (com.intellij.ide.util.newProjectWizard.FrameworkSupportNode)2 FrameworkSupportOptionsComponent (com.intellij.ide.util.newProjectWizard.FrameworkSupportOptionsComponent)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1