PageRenderTime 41ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/jEdit/tags/jedit-4-1-pre5/jars/MacOS/MacOSOptionPane.java

#
Java | 85 lines | 43 code | 15 blank | 27 comment | 0 complexity | f399bd2e6a54fb9e5520a215b6e92573 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. * :tabSize=4:indentSize=4:noTabs=false:
  3. * :folding=explicit:collapseFolds=1:
  4. *
  5. * MacOSOptionPane.java - options pane for Mac OS Plugin
  6. * Copyright (C) 2002 Kris Kopicki
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. import java.awt.*;
  23. import javax.swing.*;
  24. import org.gjt.sp.jedit.*;
  25. public class MacOSOptionPane extends AbstractOptionPane
  26. {
  27. //{{{ Variables
  28. private JCheckBox menuBox;
  29. private JCheckBox preserveBox;
  30. private JCheckBox liveResizeBox;
  31. //}}}
  32. //{{{ Constructor
  33. public MacOSOptionPane()
  34. {
  35. super("MacOSPlugin");
  36. }//}}}
  37. //{{{ _init() method
  38. public void _init()
  39. {
  40. Dimension d = new Dimension(7,7);
  41. menuBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.menubar.label"));
  42. addComponent(menuBox);
  43. addComponent(new JLabel("(Requires restart for changes to take effect)"));
  44. addComponent(new Box.Filler(d,d,d));
  45. preserveBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.preserve.label"));
  46. addComponent(preserveBox);
  47. addComponent(new Box.Filler(d,d,d));
  48. liveResizeBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.liveResize.label"));
  49. addComponent(liveResizeBox);
  50. addComponent(new JLabel("(Requires restart for changes to take effect)"));
  51. getSettings();
  52. }//}}}
  53. //{{{ _save() method
  54. public void _save()
  55. {
  56. jEdit.setBooleanProperty("MacOSPlugin.useScreenMenuBar", menuBox.isSelected());
  57. jEdit.setBooleanProperty("MacOSPlugin.preserveCodes", preserveBox.isSelected());
  58. jEdit.setBooleanProperty("MacOSPlugin.liveResize", liveResizeBox.isSelected());
  59. }//}}}
  60. //{{{ getSettings() method
  61. public void getSettings()
  62. {
  63. menuBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.useScreenMenuBar",
  64. jEdit.getBooleanProperty("MacOSPlugin.default.useScreenMenuBar")));
  65. preserveBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.preserveCodes",
  66. jEdit.getBooleanProperty("MacOSPlugin.default.preserveCodes")));
  67. liveResizeBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.liveResize",
  68. jEdit.getBooleanProperty("MacOSPlugin.default.liveResize")));
  69. }//}}}
  70. }