KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > options > GlobalOptions


1 /*
2  * GlobalOptions.java - Global options dialog
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 2002 Slava Pestov
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
23 package org.gjt.sp.jedit.options;
24
25 //{{{ Imports
26
import java.awt.Dialog JavaDoc;
27 import java.awt.Frame JavaDoc;
28 import org.gjt.sp.jedit.gui.OptionsDialog;
29 import org.gjt.sp.jedit.msg.PropertiesChanging;
30 import org.gjt.sp.jedit.options.*;
31 import org.gjt.sp.jedit.*;
32 import org.gjt.sp.util.Log;
33 //}}}
34

35 public class GlobalOptions extends OptionsDialog
36 {
37     //{{{ GlobalOptions constructor
38
public GlobalOptions(Frame JavaDoc frame)
39     {
40         super(frame,"options",jEdit.getProperty("options.last"));
41     } //}}}
42

43     //{{{ GlobalOptions constructor
44
public GlobalOptions(Frame JavaDoc frame, String JavaDoc pane)
45     {
46         super(frame,"options",pane);
47     } //}}}
48

49     //{{{ GlobalOptions constructor
50
public GlobalOptions(Dialog JavaDoc dialog)
51     {
52         super(dialog,"options",jEdit.getProperty("options.last"));
53     } //}}}
54

55     //{{{ GlobalOptions constructor
56
public GlobalOptions(Dialog JavaDoc dialog, String JavaDoc pane)
57     {
58         super(dialog,"options",pane);
59     } //}}}
60

61     //{{{ createOptionTreeModel() method
62
protected OptionTreeModel createOptionTreeModel()
63     {
64         OptionTreeModel paneTreeModel = new OptionTreeModel();
65         OptionGroup rootGroup = (OptionGroup) paneTreeModel.getRoot();
66
67         // initialize the jEdit branch of the options tree
68
jEditGroup = new OptionGroup("jedit");
69
70         jEditGroup.addOptionPane("general");
71         jEditGroup.addOptionPane("abbrevs");
72         jEditGroup.addOptionPane("appearance");
73         jEditGroup.addOptionPane("context");
74         jEditGroup.addOptionPane("docking");
75         jEditGroup.addOptionPane("editing");
76         jEditGroup.addOptionPane("encodings");
77         jEditGroup.addOptionPane("gutter");
78         jEditGroup.addOptionPane("mouse");
79         jEditGroup.addOptionPane("plugin-manager");
80         jEditGroup.addOptionPane("print");
81         jEditGroup.addOptionPane("firewall");
82         jEditGroup.addOptionPane("save-back");
83         jEditGroup.addOptionPane("shortcuts");
84         jEditGroup.addOptionPane("status");
85         jEditGroup.addOptionPane("syntax");
86         jEditGroup.addOptionPane("textarea");
87         jEditGroup.addOptionPane("toolbar");
88         jEditGroup.addOptionPane("view");
89         rootGroup.addOptionGroup(jEditGroup);
90
91         browserGroup = new OptionGroup("browser");
92         browserGroup.addOptionPane("browser.general");
93         browserGroup.addOptionPane("browser.colors");
94         rootGroup.addOptionGroup(browserGroup);
95
96         return paneTreeModel;
97     } //}}}
98

99     //{{{ cancel() method
100
public void cancel()
101     {
102         EditBus.send(
103             new PropertiesChanging(null,
104                 PropertiesChanging.State.CANCELED));
105         super.cancel();
106     } //}}}
107

108     //{{{ init() method
109
protected void init(String JavaDoc name, String JavaDoc pane)
110     {
111         EditBus.send(
112             new PropertiesChanging(null,
113                 PropertiesChanging.State.LOADING));
114         super.init(name, pane);
115     } //}}}
116

117     //{{{ getDefaultGroup() method
118
protected OptionGroup getDefaultGroup()
119     {
120         return null;
121     } //}}}
122

123     //{{{ Private members
124
private OptionGroup jEditGroup;
125     private OptionGroup browserGroup;
126     //}}}
127
}
128
Popular Tags