PageRenderTime 276ms CodeModel.GetById 89ms app.highlight 6ms RepoModel.GetById 179ms app.codeStats 0ms

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