cc6e16aba6c24e4401090b0dee4f38f43a928aa2
[idea/community.git] / platform / platform-impl / src / com / intellij / ide / ui / AppearanceConfigurable.java
1 /*
2  * Copyright 2000-2014 JetBrains s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.intellij.ide.ui;
17
18 import com.intellij.ide.IdeBundle;
19 import com.intellij.ide.ui.laf.darcula.DarculaInstaller;
20 import com.intellij.openapi.editor.ex.util.EditorUtil;
21 import com.intellij.openapi.options.BaseConfigurable;
22 import com.intellij.openapi.options.SearchableConfigurable;
23 import com.intellij.openapi.ui.ComboBox;
24 import com.intellij.openapi.util.Comparing;
25 import com.intellij.openapi.util.registry.Registry;
26 import com.intellij.openapi.wm.ex.WindowManagerEx;
27 import com.intellij.ui.components.JBCheckBox;
28 import com.intellij.util.ui.UIUtil;
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
31
32 import javax.swing.*;
33 import javax.swing.event.ChangeEvent;
34 import javax.swing.event.ChangeListener;
35 import java.awt.event.ActionEvent;
36 import java.awt.event.ActionListener;
37 import java.util.Dictionary;
38 import java.util.Hashtable;
39
40 /**
41  * @author Eugene Belyaev
42  */
43 public class AppearanceConfigurable extends BaseConfigurable implements SearchableConfigurable {
44   private MyComponent myComponent;
45
46   public String getDisplayName() {
47     return IdeBundle.message("title.appearance");
48   }
49
50   public AppearanceConfigurable() {
51     myComponent = new MyComponent();
52   }
53
54   private void initComponent() {
55     if (myComponent == null)  {
56       myComponent = new MyComponent();
57     }
58
59   }
60
61   public JComponent createComponent() {
62     initComponent();
63     DefaultComboBoxModel aModel = new DefaultComboBoxModel(UIUtil.getValidFontNames(false));
64     myComponent.myFontCombo.setModel(aModel);
65     myComponent.myFontSizeCombo.setModel(new DefaultComboBoxModel(UIUtil.getStandardFontSizes()));
66     myComponent.myPresentationModeFontSize.setModel(new DefaultComboBoxModel(UIUtil.getStandardFontSizes()));
67     myComponent.myFontSizeCombo.setEditable(true);
68     myComponent.myPresentationModeFontSize.setEditable(true);
69
70     myComponent.myLafComboBox.setModel(new DefaultComboBoxModel(LafManager.getInstance().getInstalledLookAndFeels()));
71     myComponent.myLafComboBox.setRenderer(new LafComboBoxRenderer());
72
73     Dictionary<Integer, JComponent> delayDictionary = new Hashtable<Integer, JComponent>();
74     delayDictionary.put(new Integer(0), new JLabel("0"));
75     delayDictionary.put(new Integer(1200), new JLabel("1200"));
76     //delayDictionary.put(new Integer(2400), new JLabel("2400"));
77     myComponent.myInitialTooltipDelaySlider.setLabelTable(delayDictionary);
78     UIUtil.setSliderIsFilled(myComponent.myInitialTooltipDelaySlider, Boolean.TRUE);
79     myComponent.myInitialTooltipDelaySlider.setMinimum(0);
80     myComponent.myInitialTooltipDelaySlider.setMaximum(1200);
81     myComponent.myInitialTooltipDelaySlider.setPaintLabels(true);
82     myComponent.myInitialTooltipDelaySlider.setPaintTicks(true);
83     myComponent.myInitialTooltipDelaySlider.setPaintTrack(true);
84     myComponent.myInitialTooltipDelaySlider.setMajorTickSpacing(1200);
85     myComponent.myInitialTooltipDelaySlider.setMinorTickSpacing(100);
86
87     myComponent.myEnableAlphaModeCheckBox.addActionListener(new ActionListener() {
88       public void actionPerformed(ActionEvent e) {
89         boolean state = myComponent.myEnableAlphaModeCheckBox.isSelected();
90         myComponent.myAlphaModeDelayTextField.setEnabled(state);
91         myComponent.myAlphaModeRatioSlider.setEnabled(state);
92       }
93     });
94
95     myComponent.myAlphaModeRatioSlider.setSize(100, 50);
96     @SuppressWarnings({"UseOfObsoleteCollectionType"})
97     Dictionary<Integer, JComponent> dictionary = new Hashtable<Integer, JComponent>();
98     dictionary.put(new Integer(0), new JLabel("0%"));
99     dictionary.put(new Integer(50), new JLabel("50%"));
100     dictionary.put(new Integer(100), new JLabel("100%"));
101     myComponent.myAlphaModeRatioSlider.setLabelTable(dictionary);
102     UIUtil.setSliderIsFilled(myComponent.myAlphaModeRatioSlider, Boolean.TRUE);
103     myComponent.myAlphaModeRatioSlider.setPaintLabels(true);
104     myComponent.myAlphaModeRatioSlider.setPaintTicks(true);
105     myComponent.myAlphaModeRatioSlider.setPaintTrack(true);
106     myComponent.myAlphaModeRatioSlider.setMajorTickSpacing(50);
107     myComponent.myAlphaModeRatioSlider.setMinorTickSpacing(10);
108     myComponent.myAlphaModeRatioSlider.addChangeListener(new ChangeListener() {
109       public void stateChanged(ChangeEvent e) {
110         myComponent.myAlphaModeRatioSlider.setToolTipText(myComponent.myAlphaModeRatioSlider.getValue() + "%");
111       }
112     });
113
114     myComponent.myTransparencyPanel.setVisible(WindowManagerEx.getInstanceEx().isAlphaModeSupported());
115
116     return myComponent.myPanel;
117   }
118
119   public void apply() {
120     initComponent();
121     UISettings settings = UISettings.getInstance();
122     int _fontSize = getIntValue(myComponent.myFontSizeCombo, settings.FONT_SIZE);
123     int _presentationFontSize = getIntValue(myComponent.myPresentationModeFontSize, settings.PRESENTATION_MODE_FONT_SIZE);
124     boolean shouldUpdateUI = false;
125     String _fontFace = (String)myComponent.myFontCombo.getSelectedItem();
126     LafManager lafManager = LafManager.getInstance();
127     if (_fontSize != settings.FONT_SIZE || !settings.FONT_FACE.equals(_fontFace)) {
128       settings.FONT_SIZE = _fontSize;
129       settings.FONT_FACE = _fontFace;
130       shouldUpdateUI = true;
131     }
132
133     if (_presentationFontSize != settings.PRESENTATION_MODE_FONT_SIZE) {
134       settings.PRESENTATION_MODE_FONT_SIZE = _presentationFontSize;
135       shouldUpdateUI = true;
136     }
137
138     settings.ANIMATE_WINDOWS = myComponent.myAnimateWindowsCheckBox.isSelected();
139     boolean update = settings.SHOW_TOOL_WINDOW_NUMBERS != myComponent.myWindowShortcutsCheckBox.isSelected();
140     settings.SHOW_TOOL_WINDOW_NUMBERS = myComponent.myWindowShortcutsCheckBox.isSelected();
141     update |= settings.HIDE_TOOL_STRIPES != !myComponent.myShowToolStripesCheckBox.isSelected();
142     settings.HIDE_TOOL_STRIPES = !myComponent.myShowToolStripesCheckBox.isSelected();
143     update |= settings.SHOW_ICONS_IN_MENUS != myComponent.myCbDisplayIconsInMenu.isSelected();
144     settings.SHOW_ICONS_IN_MENUS = myComponent.myCbDisplayIconsInMenu.isSelected();
145     update |= settings.SHOW_MEMORY_INDICATOR != myComponent.myShowMemoryIndicatorCheckBox.isSelected();
146     settings.SHOW_MEMORY_INDICATOR = myComponent.myShowMemoryIndicatorCheckBox.isSelected();
147     update |= settings.ALLOW_MERGE_BUTTONS != myComponent.myAllowMergeButtons.isSelected();
148     settings.ALLOW_MERGE_BUTTONS = myComponent.myAllowMergeButtons.isSelected();
149     update |= settings.CYCLE_SCROLLING != myComponent.myCycleScrollingCheckBox.isSelected();
150     settings.CYCLE_SCROLLING = myComponent.myCycleScrollingCheckBox.isSelected();
151     if (settings.OVERRIDE_NONIDEA_LAF_FONTS != myComponent.myOverrideLAFFonts.isSelected()) {
152       shouldUpdateUI = true;
153     }
154     settings.OVERRIDE_NONIDEA_LAF_FONTS = myComponent.myOverrideLAFFonts.isSelected();
155     settings.MOVE_MOUSE_ON_DEFAULT_BUTTON = myComponent.myMoveMouseOnDefaultButtonCheckBox.isSelected();
156     settings.HIDE_NAVIGATION_ON_FOCUS_LOSS = myComponent.myHideNavigationPopupsCheckBox.isSelected();
157     settings.DND_WITH_PRESSED_ALT_ONLY = myComponent.myAltDNDCheckBox.isSelected();
158
159     update |= settings.DISABLE_MNEMONICS != myComponent.myDisableMnemonics.isSelected();
160     settings.DISABLE_MNEMONICS = myComponent.myDisableMnemonics.isSelected();
161
162     update |= settings.USE_SMALL_LABELS_ON_TABS != myComponent.myUseSmallLabelsOnTabs.isSelected();
163     settings.USE_SMALL_LABELS_ON_TABS = myComponent.myUseSmallLabelsOnTabs.isSelected();
164
165     update |= settings.WIDESCREEN_SUPPORT != myComponent.myWidescreenLayoutCheckBox.isSelected();
166     settings.WIDESCREEN_SUPPORT = myComponent.myWidescreenLayoutCheckBox.isSelected();
167
168     update |= settings.LEFT_HORIZONTAL_SPLIT != myComponent.myLeftLayoutCheckBox.isSelected();
169     settings.LEFT_HORIZONTAL_SPLIT = myComponent.myLeftLayoutCheckBox.isSelected();
170
171     update |= settings.RIGHT_HORIZONTAL_SPLIT != myComponent.myRightLayoutCheckBox.isSelected();
172     settings.RIGHT_HORIZONTAL_SPLIT = myComponent.myRightLayoutCheckBox.isSelected();
173
174     update |= settings.SHOW_EDITOR_TOOLTIP != myComponent.myEditorTooltipCheckBox.isSelected();
175     settings.SHOW_EDITOR_TOOLTIP = myComponent.myEditorTooltipCheckBox.isSelected();
176
177     update |= settings.DISABLE_MNEMONICS_IN_CONTROLS != myComponent.myDisableMnemonicInControlsCheckBox.isSelected();
178     settings.DISABLE_MNEMONICS_IN_CONTROLS = myComponent.myDisableMnemonicInControlsCheckBox.isSelected();
179
180     update |= settings.SHOW_ICONS_IN_QUICK_NAVIGATION != myComponent.myHideIconsInQuickNavigation.isSelected();
181     settings.SHOW_ICONS_IN_QUICK_NAVIGATION = myComponent.myHideIconsInQuickNavigation.isSelected();
182
183     if (!Comparing.equal(myComponent.myLafComboBox.getSelectedItem(), lafManager.getCurrentLookAndFeel())) {
184       final UIManager.LookAndFeelInfo lafInfo = (UIManager.LookAndFeelInfo)myComponent.myLafComboBox.getSelectedItem();
185       if (lafManager.checkLookAndFeel(lafInfo)) {
186         update = shouldUpdateUI = true;
187         final boolean wasDarcula = UIUtil.isUnderDarcula();
188         lafManager.setCurrentLookAndFeel(lafInfo);
189         //noinspection SSBasedInspection
190         SwingUtilities.invokeLater(new Runnable() {
191           public void run() {
192             if (UIUtil.isUnderDarcula()) {
193               DarculaInstaller.install();
194             } else if (wasDarcula) {
195               DarculaInstaller.uninstall();
196             }
197           }
198         });
199       }
200     }
201
202
203     if (shouldUpdateUI) {
204       lafManager.updateUI();
205     }
206
207     if (WindowManagerEx.getInstanceEx().isAlphaModeSupported()) {
208       int delay = -1;
209       try {
210         delay = Integer.parseInt(myComponent.myAlphaModeDelayTextField.getText());
211       }
212       catch (NumberFormatException ignored) {
213       }
214       float ratio = myComponent.myAlphaModeRatioSlider.getValue() / 100f;
215       if (myComponent.myEnableAlphaModeCheckBox.isSelected() != settings.ENABLE_ALPHA_MODE ||
216           delay != -1 && delay != settings.ALPHA_MODE_DELAY || ratio != settings.ALPHA_MODE_RATIO) {
217         update = true;
218         settings.ENABLE_ALPHA_MODE = myComponent.myEnableAlphaModeCheckBox.isSelected();
219         settings.ALPHA_MODE_DELAY = delay;
220         settings.ALPHA_MODE_RATIO = ratio;
221       }
222     }
223     int tooltipDelay = Math.min(myComponent.myInitialTooltipDelaySlider.getValue(), 5000);
224     if (tooltipDelay != Registry.intValue("ide.tooltip.initialDelay")) {
225       update = true;
226       Registry.get("ide.tooltip.initialDelay").setValue(tooltipDelay);
227     }
228
229     if (update) {
230       settings.fireUISettingsChanged();
231     }
232     myComponent.updateCombo();
233
234     EditorUtil.reinitSettings();
235   }
236
237   private static int getIntValue(JComboBox combo, int defaultValue) {
238     String temp = (String)combo.getEditor().getItem();
239     int value = -1;
240     if (temp != null && temp.trim().length() > 0) {
241       try {
242         value = Integer.parseInt(temp);
243       }
244       catch (NumberFormatException ignore) {
245       }
246       if (value <= 0) {
247         value = defaultValue;
248       }
249     }
250     else {
251       value = defaultValue;
252     }
253     return value;
254   }
255
256   public void reset() {
257     initComponent();
258     UISettings settings = UISettings.getInstance();
259
260     myComponent.myFontCombo.setSelectedItem(settings.FONT_FACE);
261     myComponent.myFontSizeCombo.setSelectedItem(Integer.toString(settings.FONT_SIZE));
262     myComponent.myPresentationModeFontSize.setSelectedItem(Integer.toString(settings.PRESENTATION_MODE_FONT_SIZE));
263     myComponent.myAnimateWindowsCheckBox.setSelected(settings.ANIMATE_WINDOWS);
264     myComponent.myWindowShortcutsCheckBox.setSelected(settings.SHOW_TOOL_WINDOW_NUMBERS);
265     myComponent.myShowToolStripesCheckBox.setSelected(!settings.HIDE_TOOL_STRIPES);
266     myComponent.myCbDisplayIconsInMenu.setSelected(settings.SHOW_ICONS_IN_MENUS);
267     myComponent.myShowMemoryIndicatorCheckBox.setSelected(settings.SHOW_MEMORY_INDICATOR);
268     myComponent.myAllowMergeButtons.setSelected(settings.ALLOW_MERGE_BUTTONS);
269     myComponent.myCycleScrollingCheckBox.setSelected(settings.CYCLE_SCROLLING);
270
271     myComponent.myHideIconsInQuickNavigation.setSelected(settings.SHOW_ICONS_IN_QUICK_NAVIGATION);
272     myComponent.myMoveMouseOnDefaultButtonCheckBox.setSelected(settings.MOVE_MOUSE_ON_DEFAULT_BUTTON);
273     myComponent.myHideNavigationPopupsCheckBox.setSelected(settings.HIDE_NAVIGATION_ON_FOCUS_LOSS);
274     myComponent.myAltDNDCheckBox.setSelected(settings.DND_WITH_PRESSED_ALT_ONLY);
275     myComponent.myLafComboBox.setSelectedItem(LafManager.getInstance().getCurrentLookAndFeel());
276     myComponent.myOverrideLAFFonts.setSelected(settings.OVERRIDE_NONIDEA_LAF_FONTS);
277     myComponent.myDisableMnemonics.setSelected(settings.DISABLE_MNEMONICS);
278     myComponent.myUseSmallLabelsOnTabs.setSelected(settings.USE_SMALL_LABELS_ON_TABS);
279     myComponent.myWidescreenLayoutCheckBox.setSelected(settings.WIDESCREEN_SUPPORT);
280     myComponent.myLeftLayoutCheckBox.setSelected(settings.LEFT_HORIZONTAL_SPLIT);
281     myComponent.myRightLayoutCheckBox.setSelected(settings.RIGHT_HORIZONTAL_SPLIT);
282     myComponent.myEditorTooltipCheckBox.setSelected(settings.SHOW_EDITOR_TOOLTIP);
283     myComponent.myDisableMnemonicInControlsCheckBox.setSelected(settings.DISABLE_MNEMONICS_IN_CONTROLS);
284
285     boolean alphaModeEnabled = WindowManagerEx.getInstanceEx().isAlphaModeSupported();
286     if (alphaModeEnabled) {
287       myComponent.myEnableAlphaModeCheckBox.setSelected(settings.ENABLE_ALPHA_MODE);
288     }
289     else {
290       myComponent.myEnableAlphaModeCheckBox.setSelected(false);
291     }
292     myComponent.myEnableAlphaModeCheckBox.setEnabled(alphaModeEnabled);
293     myComponent.myAlphaModeDelayTextField.setText(Integer.toString(settings.ALPHA_MODE_DELAY));
294     myComponent.myAlphaModeDelayTextField.setEnabled(alphaModeEnabled && settings.ENABLE_ALPHA_MODE);
295     int ratio = (int)(settings.ALPHA_MODE_RATIO * 100f);
296     myComponent.myAlphaModeRatioSlider.setValue(ratio);
297     myComponent.myAlphaModeRatioSlider.setToolTipText(ratio + "%");
298     myComponent.myAlphaModeRatioSlider.setEnabled(alphaModeEnabled && settings.ENABLE_ALPHA_MODE);
299     myComponent.myInitialTooltipDelaySlider.setValue(Registry.intValue("ide.tooltip.initialDelay"));
300     myComponent.updateCombo();
301   }
302
303   public boolean isModified() {
304     initComponent();
305     UISettings settings = UISettings.getInstance();
306
307     boolean isModified = false;
308     isModified |= !Comparing.equal(myComponent.myFontCombo.getSelectedItem(), settings.FONT_FACE);
309     isModified |= !Comparing.equal(myComponent.myFontSizeCombo.getEditor().getItem(), Integer.toString(settings.FONT_SIZE));
310     isModified |= myComponent.myAnimateWindowsCheckBox.isSelected() != settings.ANIMATE_WINDOWS;
311     isModified |= myComponent.myWindowShortcutsCheckBox.isSelected() != settings.SHOW_TOOL_WINDOW_NUMBERS;
312     isModified |= myComponent.myShowToolStripesCheckBox.isSelected() == settings.HIDE_TOOL_STRIPES;
313     isModified |= myComponent.myCbDisplayIconsInMenu.isSelected() != settings.SHOW_ICONS_IN_MENUS;
314     isModified |= myComponent.myShowMemoryIndicatorCheckBox.isSelected() != settings.SHOW_MEMORY_INDICATOR;
315     isModified |= myComponent.myAllowMergeButtons.isSelected() != settings.ALLOW_MERGE_BUTTONS;
316     isModified |= myComponent.myCycleScrollingCheckBox.isSelected() != settings.CYCLE_SCROLLING;
317
318     isModified |= myComponent.myOverrideLAFFonts.isSelected() != settings.OVERRIDE_NONIDEA_LAF_FONTS;
319
320     isModified |= myComponent.myDisableMnemonics.isSelected() != settings.DISABLE_MNEMONICS;
321     isModified |= myComponent.myDisableMnemonicInControlsCheckBox.isSelected() != settings.DISABLE_MNEMONICS_IN_CONTROLS;
322
323     isModified |= myComponent.myUseSmallLabelsOnTabs.isSelected() != settings.USE_SMALL_LABELS_ON_TABS;
324     isModified |= myComponent.myWidescreenLayoutCheckBox.isSelected() != settings.WIDESCREEN_SUPPORT;
325     isModified |= myComponent.myLeftLayoutCheckBox.isSelected() != settings.LEFT_HORIZONTAL_SPLIT;
326     isModified |= myComponent.myRightLayoutCheckBox.isSelected() != settings.RIGHT_HORIZONTAL_SPLIT;
327     isModified |= myComponent.myEditorTooltipCheckBox.isSelected() != settings.SHOW_EDITOR_TOOLTIP;
328
329     isModified |= myComponent.myHideIconsInQuickNavigation.isSelected() != settings.SHOW_ICONS_IN_QUICK_NAVIGATION;
330
331     isModified |= !Comparing.equal(myComponent.myPresentationModeFontSize.getEditor().getItem(), Integer.toString(settings.PRESENTATION_MODE_FONT_SIZE));
332
333     isModified |= myComponent.myMoveMouseOnDefaultButtonCheckBox.isSelected() != settings.MOVE_MOUSE_ON_DEFAULT_BUTTON;
334     isModified |= myComponent.myHideNavigationPopupsCheckBox.isSelected() != settings.HIDE_NAVIGATION_ON_FOCUS_LOSS;
335     isModified |= myComponent.myAltDNDCheckBox.isSelected() != settings.DND_WITH_PRESSED_ALT_ONLY;
336     isModified |= !Comparing.equal(myComponent.myLafComboBox.getSelectedItem(), LafManager.getInstance().getCurrentLookAndFeel());
337     if (WindowManagerEx.getInstanceEx().isAlphaModeSupported()) {
338       isModified |= myComponent.myEnableAlphaModeCheckBox.isSelected() != settings.ENABLE_ALPHA_MODE;
339       int delay = -1;
340       try {
341         delay = Integer.parseInt(myComponent.myAlphaModeDelayTextField.getText());
342       }
343       catch (NumberFormatException ignored) {
344       }
345       if (delay != -1) {
346         isModified |= delay != settings.ALPHA_MODE_DELAY;
347       }
348       float ratio = myComponent.myAlphaModeRatioSlider.getValue() / 100f;
349       isModified |= ratio != settings.ALPHA_MODE_RATIO;
350     }
351     int tooltipDelay = -1;
352     tooltipDelay = myComponent.myInitialTooltipDelaySlider.getValue();
353     isModified |=  tooltipDelay != Registry.intValue("ide.tooltip.initialDelay");
354
355     return isModified;
356   }
357
358   public void disposeUIResources() {
359     myComponent = null;
360   }
361
362   public String getHelpTopic() {
363     return "preferences.lookFeel";
364   }
365
366   private static class MyComponent {
367     private JPanel myPanel;
368     private JComboBox myFontCombo;
369     private JComboBox myFontSizeCombo;
370     private JCheckBox myAnimateWindowsCheckBox;
371     private JCheckBox myWindowShortcutsCheckBox;
372     private JCheckBox myShowToolStripesCheckBox;
373     private JCheckBox myShowMemoryIndicatorCheckBox;
374     private JComboBox myLafComboBox;
375     private JCheckBox myCycleScrollingCheckBox;
376
377     private JCheckBox myMoveMouseOnDefaultButtonCheckBox;
378     private JCheckBox myEnableAlphaModeCheckBox;
379     private JTextField myAlphaModeDelayTextField;
380     private JSlider myAlphaModeRatioSlider;
381     private JLabel myFontSizeLabel;
382     private JLabel myFontNameLabel;
383     private JPanel myTransparencyPanel;
384     private JCheckBox myOverrideLAFFonts;
385
386     private JCheckBox myHideIconsInQuickNavigation;
387     private JCheckBox myCbDisplayIconsInMenu;
388     private JCheckBox myDisableMnemonics;
389     private JCheckBox myDisableMnemonicInControlsCheckBox;
390     private JCheckBox myHideNavigationPopupsCheckBox;
391     private JCheckBox myAltDNDCheckBox;
392     private JCheckBox myAllowMergeButtons;
393     private JBCheckBox myUseSmallLabelsOnTabs;
394     private JBCheckBox myWidescreenLayoutCheckBox;
395     private JCheckBox myLeftLayoutCheckBox;
396     private JCheckBox myRightLayoutCheckBox;
397     private JSlider myInitialTooltipDelaySlider;
398     private ComboBox myPresentationModeFontSize;
399     private JCheckBox myEditorTooltipCheckBox;
400     private JCheckBox myAllowStatusBar;
401     private JCheckBox myAllowLineNumbers;
402     private JCheckBox myAllowAnnotations;
403
404     public MyComponent() {
405       myOverrideLAFFonts.addActionListener( new ActionListener() {
406         public void actionPerformed(ActionEvent e) {
407           updateCombo();
408         }
409       });
410     }
411
412     public void updateCombo() {
413       boolean enableChooser = myOverrideLAFFonts.isSelected();
414
415       myFontCombo.setEnabled(enableChooser);
416       myFontSizeCombo.setEnabled(enableChooser);
417       myFontNameLabel.setEnabled(enableChooser);
418       myFontSizeLabel.setEnabled(enableChooser);
419     }
420
421     private void createUIComponents() {
422       myFontSizeCombo = new ComboBox();
423       myPresentationModeFontSize = new ComboBox();
424     }
425   }
426
427   @NotNull
428   public String getId() {
429     //noinspection ConstantConditions
430     return getHelpTopic();
431   }
432
433   @Nullable
434   public Runnable enableSearch(String option) {
435     return null;
436   }
437 }