Search in sources :

Example 1 with AncestorAdapter

use of org.elixir_lang.utils.AncestorAdapter in project intellij-elixir by KronicDeth.

the class ElixirCompilerOptionsConfigurable method setupUiListeners.

private void setupUiListeners() {
    myConfigureMixButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            DataContext context = DataManager.getInstance().getDataContext(myConfigureMixButton);
            Settings settings = ObjectUtils.assertNotNull(Settings.KEY.getData(context));
            Configurable configurable = settings.find(ElixirExternalToolsConfigurable.ELIXIR_RELATED_TOOLS);
            if (configurable != null) {
                settings.select(configurable);
            }
        }
    });
    myRootPanel.addAncestorListener(new AncestorAdapter() {

        @Override
        public void ancestorAdded(AncestorEvent event) {
            reset();
        }
    });
}
Also used : DataContext(com.intellij.openapi.actionSystem.DataContext) AncestorAdapter(org.elixir_lang.utils.AncestorAdapter) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) CompilerConfigurable(com.intellij.compiler.options.CompilerConfigurable) ElixirExternalToolsConfigurable(org.elixir_lang.settings.ElixirExternalToolsConfigurable) Configurable(com.intellij.openapi.options.Configurable) AncestorEvent(javax.swing.event.AncestorEvent) Settings(com.intellij.openapi.options.ex.Settings) MixSettings(org.elixir_lang.mix.settings.MixSettings)

Aggregations

CompilerConfigurable (com.intellij.compiler.options.CompilerConfigurable)1 DataContext (com.intellij.openapi.actionSystem.DataContext)1 Configurable (com.intellij.openapi.options.Configurable)1 Settings (com.intellij.openapi.options.ex.Settings)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 AncestorEvent (javax.swing.event.AncestorEvent)1 MixSettings (org.elixir_lang.mix.settings.MixSettings)1 ElixirExternalToolsConfigurable (org.elixir_lang.settings.ElixirExternalToolsConfigurable)1 AncestorAdapter (org.elixir_lang.utils.AncestorAdapter)1