Search in sources :

Example 1 with ComponentSet

use of com.intellij.flex.model.bc.ComponentSet in project intellij-plugins by JetBrains.

the class DependenciesConfigurable method updateSdkEntries.

private void updateSdkEntries(DefaultMutableTreeNode sdkNode, Sdk sdk) {
    sdkNode.removeAllChildren();
    ComponentSet componentSet = (ComponentSet) myComponentSetCombo.getSelectedItem();
    String targetPlayer = (String) myTargetPlayerCombo.getSelectedItem();
    for (String url : sdk.getRootProvider().getUrls(OrderRootType.CLASSES)) {
        final String swcPath = VirtualFileManager.extractPath(StringUtil.trimEnd(url, JarFileSystem.JAR_SEPARATOR));
        LinkageType linkageType = FlexCommonUtils.getSdkEntryLinkageType(sdk.getHomePath(), swcPath, myNature, targetPlayer, componentSet);
        if (linkageType == null) {
            // this swc is not applicable
            continue;
        }
        if (linkageType == LinkageType.Default) {
            linkageType = (LinkageType) myFrameworkLinkageCombo.getSelectedItem();
            if (linkageType == LinkageType.Default) {
                linkageType = FlexCommonUtils.getDefaultFrameworkLinkage(sdk.getVersionString(), myNature);
            }
        }
        SdkEntryItem item = new SdkEntryItem(FileUtil.toSystemDependentName(swcPath), linkageType);
        sdkNode.add(new DefaultMutableTreeNode(item, false));
    }
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) ComponentSet(com.intellij.flex.model.bc.ComponentSet) LinkageType(com.intellij.flex.model.bc.LinkageType)

Example 2 with ComponentSet

use of com.intellij.flex.model.bc.ComponentSet in project intellij-plugins by JetBrains.

the class DependenciesConfigurable method updateComponentSetCombo.

private void updateComponentSetCombo() {
    updateControls();
    final Sdk sdk = mySdkCombo.getSelectedJdk();
    if (sdk != null && myComponentSetCombo.isVisible()) {
        final Object selectedItem = myComponentSetCombo.getSelectedItem();
        final ComponentSet[] values = StringUtil.compareVersionNumbers(sdk.getVersionString(), "4.5") >= 0 ? ComponentSet.values() : new ComponentSet[] { ComponentSet.SparkAndMx, ComponentSet.MxOnly };
        myComponentSetCombo.setModel(new DefaultComboBoxModel(values));
        myComponentSetCombo.setSelectedItem(selectedItem);
    }
}
Also used : Sdk(com.intellij.openapi.projectRoots.Sdk) ComponentSet(com.intellij.flex.model.bc.ComponentSet)

Aggregations

ComponentSet (com.intellij.flex.model.bc.ComponentSet)2 LinkageType (com.intellij.flex.model.bc.LinkageType)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1