PageRenderTime 61ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Java | 86 lines | 44 code | 13 blank | 29 comment | 0 complexity | d71eaf3fd4147c81459bdef37488c3b8 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 selectionBox;
  34. //}}}
  35. //{{{ Constructor
  36. public MacOSOptionPane()
  37. {
  38. super("MacOSPlugin");
  39. }//}}}
  40. //{{{ _init() method
  41. public void _init()
  42. {
  43. Dimension d = new Dimension(7,7);
  44. Dimension d_2 = new Dimension(20,20);
  45. menuBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.menubar.label"));
  46. addComponent(menuBox);
  47. addComponent(new JLabel("(Requires restart for changes to take effect)"));
  48. addComponent(new Box.Filler(d,d,d));
  49. preserveBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.preserve.label"));
  50. addComponent(preserveBox);
  51. addComponent(new Box.Filler(d,d,d));
  52. selectionBox = new JCheckBox(jEdit.getProperty("options.MacOSPlugin.useSelection.label"));
  53. addComponent(selectionBox);
  54. getSettings();
  55. }//}}}
  56. //{{{ _save() method
  57. public void _save()
  58. {
  59. jEdit.setBooleanProperty("MacOSPlugin.useScreenMenuBar", menuBox.isSelected());
  60. jEdit.setBooleanProperty("MacOSPlugin.preserveCodes", preserveBox.isSelected());
  61. jEdit.setBooleanProperty("MacOSPlugin.useSelection", selectionBox.isSelected());
  62. }//}}}
  63. //{{{ getSettings() method
  64. public void getSettings()
  65. {
  66. menuBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.useScreenMenuBar",
  67. jEdit.getBooleanProperty("MacOSPlugin.default.useScreenMenuBar")));
  68. preserveBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.preserveCodes",
  69. jEdit.getBooleanProperty("MacOSPlugin.default.preserveCodes")));
  70. selectionBox.setSelected(jEdit.getBooleanProperty("MacOSPlugin.useSelection",
  71. jEdit.getBooleanProperty("MacOSPlugin.default.useSelection")));
  72. }//}}}
  73. }