Search in sources :

Example 1 with AirDescriptorInfoProvider

use of com.intellij.lang.javascript.flex.projectStructure.ui.AirPackagingConfigurableBase.AirDescriptorInfoProvider in project intellij-plugins by JetBrains.

the class FlexBCConfigurable method createChildConfigurables.

public void createChildConfigurables() {
    final BuildConfigurationNature nature = myConfiguration.getNature();
    if (myDependenciesConfigurable != null) {
        myDependenciesConfigurable.removeUserActivityListeners();
        myDependenciesConfigurable.disposeUIResources();
    }
    if (myCompilerOptionsConfigurable != null) {
        myCompilerOptionsConfigurable.removeUserActivityListeners();
        myCompilerOptionsConfigurable.disposeUIResources();
    }
    if (myAirDesktopPackagingConfigurable != null) {
        myAirDesktopPackagingConfigurable.removeUserActivityListeners();
        myAirDesktopPackagingConfigurable.disposeUIResources();
    }
    if (myAndroidPackagingConfigurable != null) {
        myAndroidPackagingConfigurable.removeUserActivityListeners();
        myAndroidPackagingConfigurable.disposeUIResources();
    }
    if (myIOSPackagingConfigurable != null) {
        myIOSPackagingConfigurable.removeUserActivityListeners();
        myIOSPackagingConfigurable.disposeUIResources();
    }
    myDependenciesConfigurable = new DependenciesConfigurable(myConfiguration, myModule.getProject(), myConfigEditor, mySdksModel);
    myDependenciesConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    myCompilerOptionsConfigurable = new CompilerOptionsConfigurable(myModule, nature, myDependenciesConfigurable, myConfiguration.getCompilerOptions());
    myCompilerOptionsConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    myCompilerOptionsConfigurable.addAdditionalOptionsListener(new CompilerOptionsConfigurable.OptionsListener() {

        public void configFileChanged(final String additionalConfigFilePath) {
            checkIfConfigFileOverridesOptions(additionalConfigFilePath);
        }

        public void additionalOptionsChanged(final String additionalOptions) {
        // may be parse additionalOptions in the same way as config file
        }
    });
    final AirDescriptorInfoProvider airDescriptorInfoProvider = new AirDescriptorInfoProvider() {

        public String getMainClass() {
            return myMainClassComponent.getText().trim();
        }

        public String getAirVersion() {
            final Sdk sdk = myDependenciesConfigurable.getCurrentSdk();
            return sdk == null || sdk.getVersionString() == null ? "" : StringUtil.notNullize(FlexCommonUtils.getAirVersion(sdk.getHomePath(), sdk.getVersionString()));
        }

        public String[] getExtensionIDs() {
            return FlexCompilationUtils.getAirExtensionIDs(myConfigEditor.getModifiableRootModel(myModule), myDependenciesConfigurable.getEditableObject());
        }

        public boolean isAndroidPackagingEnabled() {
            return myAndroidPackagingConfigurable != null && myAndroidPackagingConfigurable.isPackagingEnabled();
        }

        public boolean isIOSPackagingEnabled() {
            return myIOSPackagingConfigurable != null && myIOSPackagingConfigurable.isPackagingEnabled();
        }

        public void setCustomDescriptorForAndroidAndIOS(final String descriptorPath) {
            assert myAndroidPackagingConfigurable != null && myIOSPackagingConfigurable != null;
            myAndroidPackagingConfigurable.setUseCustomDescriptor(descriptorPath);
            myIOSPackagingConfigurable.setUseCustomDescriptor(descriptorPath);
        }
    };
    myAirDesktopPackagingConfigurable = nature.isDesktopPlatform() && nature.isApp() ? new AirDesktopPackagingConfigurable(myModule, myConfiguration.getAirDesktopPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myAirDesktopPackagingConfigurable != null) {
        myAirDesktopPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
    myAndroidPackagingConfigurable = nature.isMobilePlatform() && nature.isApp() ? new AndroidPackagingConfigurable(myModule, myConfiguration.getAndroidPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myAndroidPackagingConfigurable != null) {
        myAndroidPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
    myIOSPackagingConfigurable = nature.isMobilePlatform() && nature.isApp() ? new IOSPackagingConfigurable(myModule, myConfiguration.getIosPackagingOptions(), airDescriptorInfoProvider) : null;
    if (myIOSPackagingConfigurable != null) {
        myIOSPackagingConfigurable.addUserActivityListener(myUserActivityListener, myDisposable);
    }
}
Also used : BuildConfigurationNature(com.intellij.flex.model.bc.BuildConfigurationNature) AirDescriptorInfoProvider(com.intellij.lang.javascript.flex.projectStructure.ui.AirPackagingConfigurableBase.AirDescriptorInfoProvider) Sdk(com.intellij.openapi.projectRoots.Sdk)

Aggregations

BuildConfigurationNature (com.intellij.flex.model.bc.BuildConfigurationNature)1 AirDescriptorInfoProvider (com.intellij.lang.javascript.flex.projectStructure.ui.AirPackagingConfigurableBase.AirDescriptorInfoProvider)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1