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