The updated version of the applicationConfigurable sample plugin.
[idea/community.git] / samples / applicationConfigurable / src / fontConfigurable / MyButtonListener.java
1 package fontConfigurable;
2
3 import com.intellij.ide.ui.LafManager;
4 import com.intellij.ide.ui.UISettings;
5
6 import javax.swing.*;
7 import java.awt.event.ActionEvent;
8 import java.awt.event.ActionListener;
9
10 /**
11  * Created by IntelliJ IDEA.
12  * User: Alexey.Chursin
13  * Date: Aug 7, 2010
14  * Time: 9:36:45 PM
15  */
16 public class MyButtonListener implements ActionListener {
17
18
19     public JButton myButton;
20     public JComboBox myFontCombo;
21     public JComboBox myFontSize;
22
23
24     public void actionPerformed(ActionEvent e) {
25
26         UISettings settings = UISettings.getInstance();
27         LafManager lafManager = LafManager.getInstance();
28         // Restore default font
29         settings.FONT_FACE = "Segoe UI";
30         settings.FONT_SIZE = 12;
31         myFontCombo.setSelectedItem(settings.FONT_FACE);
32         myFontSize.setSelectedItem(String.valueOf(settings.FONT_SIZE));
33         settings.fireUISettingsChanged();
34         lafManager.updateUI();
35
36
37     }
38
39 }
40