001: /*
002: * :tabSize=8:indentSize=8:noTabs=false:
003: * :folding=explicit:collapseFolds=1:
004: *
005: * MacOSOptionPane.java - options pane for Mac OS Plugin
006: * Copyright (C) 2002 Kris Kopicki
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: */
022:
023: package macos;
024:
025: //{{{ Imports
026: import java.awt.*;
027: import javax.swing.*;
028: import org.gjt.sp.jedit.*;
029:
030: //}}}
031:
032: public class MacOSOptionPane extends AbstractOptionPane {
033: //{{{ Variables
034: private JCheckBox menuBox;
035: private JCheckBox preserveBox;
036: private JCheckBox selectionBox;
037: private JCheckBox setTypeCreatorBox;
038:
039: //}}}
040:
041: //{{{ Constructor
042: public MacOSOptionPane() {
043: super ("MacOSPlugin");
044: }//}}}
045:
046: //{{{ _init() method
047: public void _init() {
048: Dimension d = new Dimension(7, 7);
049: Dimension d_2 = new Dimension(20, 20);
050:
051: menuBox = new JCheckBox(jEdit
052: .getProperty("options.MacOSPlugin.menubar.label"));
053: addComponent(menuBox);
054: addComponent(new JLabel(
055: "(Requires restart for changes to take effect)"));
056:
057: addComponent(new Box.Filler(d, d, d));
058:
059: preserveBox = new JCheckBox(jEdit
060: .getProperty("options.MacOSPlugin.preserve.label"));
061: addComponent(preserveBox);
062:
063: addComponent(new Box.Filler(d, d, d));
064:
065: selectionBox = new JCheckBox(jEdit
066: .getProperty("options.MacOSPlugin.useSelection.label"));
067: addComponent(selectionBox);
068:
069: setTypeCreatorBox = new JCheckBox(
070: jEdit
071: .getProperty("options.MacOSPlugin.setTypeCreator.label"));
072: addComponent(setTypeCreatorBox);
073:
074: getSettings();
075: }//}}}
076:
077: //{{{ _save() method
078: public void _save() {
079: jEdit.setBooleanProperty("MacOSPlugin.useScreenMenuBar",
080: menuBox.isSelected());
081: jEdit.setBooleanProperty("MacOSPlugin.preserveCodes",
082: preserveBox.isSelected());
083: jEdit.setBooleanProperty("MacOSPlugin.useSelection",
084: selectionBox.isSelected());
085: jEdit.setBooleanProperty("MacOSPlugin.setTypeCreator",
086: setTypeCreatorBox.isSelected());
087: }//}}}
088:
089: //{{{ getSettings() method
090: public void getSettings() {
091: menuBox
092: .setSelected(jEdit
093: .getBooleanProperty(
094: "MacOSPlugin.useScreenMenuBar",
095: jEdit
096: .getBooleanProperty("MacOSPlugin.default.useScreenMenuBar")));
097: preserveBox
098: .setSelected(jEdit
099: .getBooleanProperty(
100: "MacOSPlugin.preserveCodes",
101: jEdit
102: .getBooleanProperty("MacOSPlugin.default.preserveCodes")));
103: selectionBox
104: .setSelected(jEdit
105: .getBooleanProperty(
106: "MacOSPlugin.useSelection",
107: jEdit
108: .getBooleanProperty("MacOSPlugin.default.useSelection")));
109: setTypeCreatorBox
110: .setSelected(jEdit
111: .getBooleanProperty(
112: "MacOSPlugin.setTypeCreator",
113: jEdit
114: .getBooleanProperty("MacOSPlugin.default.setTypeCreator")));
115: }//}}}
116: }
|