PageRenderTime 48ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre4/jars/MacOS/macos/MacOSOptionPane.java

#
Java | 96 lines | 52 code | 15 blank | 29 comment | 0 complexity | 51977a1ca2784d6f928c6480bbf672fd 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=8:indentSize=8: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. package macos;
  23. //{{{ Imports
  24. import java.awt.*;
  25. import javax.swing.*;
  26. import org.gjt.sp.jedit.*;
  27. //}}}
  28. public class MacOSOptionPane extends AbstractOptionPane
  29. {
  30. //{{{ Variables
  31. private JCheckBox menuBox;
  32. private JCheckBox preserveBox;
  33. private JCheckBox liveResizeBox;
  34. private JCheckBox selectionBox;
  35. //}}}
  36. //{{{ Constructor
  37. public MacOSOptionPane()
  38. {
  39. super("MacOSPlugin");
  40. }//}}}
  41. //{{{ _init() method
  42. public void _init()
  43. {
  44. Dimension d = new Dimension(7,7);
  45. Dimension d_2 = new Dimension(20,20);
  46. menuBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.menubar.label"));
  47. addComponent(menuBox);
  48. addComponent(new JLabel("(Requires restart for changes to take effect)"));
  49. addComponent(new Box.Filler(d,d,d));
  50. preserveBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.preserve.label"));
  51. addComponent(preserveBox);
  52. addComponent(new Box.Filler(d,d,d));
  53. liveResizeBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.liveResize.label"));
  54. addComponent(liveResizeBox);
  55. addComponent(new JLabel("(Requires restart for changes to take effect)"));
  56. addComponent(new Box.Filler(d,d,d));
  57. selectionBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.useSelection.label"));
  58. addComponent(selectionBox);
  59. getSettings();
  60. }//}}}
  61. //{{{ _save() method
  62. public void _save()
  63. {
  64. jEdit.setBooleanProperty("MacOSPlugin.useScreenMenuBar", menuBox.isSelected());
  65. jEdit.setBooleanProperty("MacOSPlugin.preserveCodes", preserveBox.isSelected());
  66. jEdit.setBooleanProperty("MacOSPlugin.liveResize", liveResizeBox.isSelected());
  67. jEdit.setBooleanProperty("MacOSPlugin.useSelection", selectionBox.isSelected());
  68. }//}}}
  69. //{{{ getSettings() method
  70. public void getSettings()
  71. {
  72. menuBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.useScreenMenuBar",
  73. jEdit.getBooleanProperty("MacOSPlugin.default.useScreenMenuBar")));
  74. preserveBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.preserveCodes",
  75. jEdit.getBooleanProperty("MacOSPlugin.default.preserveCodes")));
  76. liveResizeBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.liveResize",
  77. jEdit.getBooleanProperty("MacOSPlugin.default.liveResize")));
  78. selectionBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.useSelection",
  79. jEdit.getBooleanProperty("MacOSPlugin.default.useSelection")));
  80. }//}}}
  81. }