Search in sources :

Example 1 with ModifiableCompilerOptions

use of com.intellij.lang.javascript.flex.projectStructure.model.ModifiableCompilerOptions in project intellij-plugins by JetBrains.

the class CompilerOptionsConfigurable method initButtonsAndAdditionalOptions.

private void initButtonsAndAdditionalOptions() {
    if (myMode == Mode.BC || myMode == Mode.Module) {
        final CompilerOptionsListener optionsListener = new CompilerOptionsListener() {

            public void optionsInTableChanged() {
                updateTreeTable();
            }

            public void additionalOptionsChanged() {
                updateAdditionalOptionsControls();
            }
        };
        if (myMode == Mode.BC) {
            myBCManager.getModuleLevelCompilerOptions().addOptionsListener(optionsListener, myDisposable);
        }
        myProjectLevelOptionsHolder.getProjectLevelCompilerOptions().addOptionsListener(optionsListener, myDisposable);
    }
    final ActionListener projectDefaultsListener = new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            ModifiableCompilerOptions compilerOptions = myProjectLevelOptionsHolder.getProjectLevelCompilerOptions();
            final CompilerOptionsConfigurable configurable = new CompilerOptionsConfigurable(Mode.Project, null, myProject, myNature, myDependenciesConfigurable, compilerOptions);
            ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
        }
    };
    final ActionListener moduleDefaultsListener = new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            ModifiableCompilerOptions compilerOptions = myBCManager.getModuleLevelCompilerOptions();
            final CompilerOptionsConfigurable configurable = new CompilerOptionsConfigurable(Mode.Module, myModule, myProject, myNature, myDependenciesConfigurable, compilerOptions);
            ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
        }
    };
    myConfigFileTextWithBrowse.addBrowseFolderListener(null, null, myProject, FlexUtils.createFileChooserDescriptor("xml"));
    myConfigFileTextWithBrowse.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {

        protected void textChanged(final DocumentEvent e) {
            updateAdditionalOptionsControls();
            fireConfigFileChanged();
        }
    });
    myConfigFileLabel.setVisible(myMode == Mode.BC);
    myConfigFileTextWithBrowse.setVisible(myMode == Mode.BC);
    myInheritedOptionsLabel.setVisible(myMode == Mode.BC || myMode == Mode.Module);
    myInheritedOptionsField.setVisible(myMode == Mode.BC || myMode == Mode.Module);
    final String labelText = myMode == Mode.BC ? "Additional compiler options:" : myMode == Mode.Module ? "Default options for module:" : "Default options for project:";
    myAdditionalOptionsLabel.setText(labelText);
    myAdditionalOptionsField.setDialogCaption(StringUtil.capitalizeWords(labelText, true));
    myAdditionalOptionsField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {

        protected void textChanged(final DocumentEvent e) {
            updateAdditionalOptionsControls();
            fireAdditionalOptionsChanged();
        }
    });
    myNoteLabel.setIcon(UIUtil.getBalloonInformationIcon());
    myProjectDefaultsButton.addActionListener(projectDefaultsListener);
    myProjectDefaultsButton.setVisible(myMode == Mode.BC || myMode == Mode.Module);
    myModuleDefaultsButton.addActionListener(moduleDefaultsListener);
    myModuleDefaultsButton.setVisible(myMode == Mode.BC);
}
Also used : CompilerOptionsListener(com.intellij.lang.javascript.flex.projectStructure.model.CompilerOptionsListener) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) DocumentEvent(javax.swing.event.DocumentEvent) ModifiableCompilerOptions(com.intellij.lang.javascript.flex.projectStructure.model.ModifiableCompilerOptions)

Aggregations

CompilerOptionsListener (com.intellij.lang.javascript.flex.projectStructure.model.CompilerOptionsListener)1 ModifiableCompilerOptions (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableCompilerOptions)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 DocumentEvent (javax.swing.event.DocumentEvent)1