PageRenderTime 83ms CodeModel.GetById 40ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 0ms

/bundles/plugins-trunk/XML/sidekick/css/CssSideKickOptionPane.java

#
Java | 82 lines | 38 code | 17 blank | 27 comment | 0 complexity | ad58fa3ff12b5cc626a4b201b91b535f MD5 | raw file
 1/**
 2 * CssSideKickOptionPane.java
 3 * :folding=explicit:collapseFolds=1:
 4 *
 5 * Copyright (C) 2006 Jakub Roztocil
 6 *
 7 * This program is free software; you can redistribute it and/or
 8 * modify it under the terms of the GNU General Public License
 9 * as published by the Free Software Foundation; either version 2
10 * of the License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 */
21
22package sidekick.css;
23
24//{{{ Imports
25import javax.swing.JCheckBox;
26import org.gjt.sp.jedit.AbstractOptionPane;
27import org.gjt.sp.jedit.jEdit;
28//}}}
29
30public class CssSideKickOptionPane extends AbstractOptionPane  {
31
32    // formatting options
33    private JCheckBox quote;
34    private JCheckBox colon;
35    private JCheckBox spaceAfterColon;
36
37    // display options
38    private JCheckBox showProprietaryAsError;
39
40
41    //{{{ CssSideKickOptionPane constructor
42    public CssSideKickOptionPane() {
43        super("sidekick.css");
44    } //}}}
45
46    //{{{ _init() method
47    public void _init() {
48        addSeparator("Formatting Options");
49
50        quote = new JCheckBox(jEdit.getProperty(CssSideKickPlugin.OPTION_PREFIX + "quote.title"));
51        quote.setSelected(jEdit.getProperty(CssSideKickPlugin.OPTION_PREFIX + "quote").equals("'"));
52        addComponent(quote);
53
54        colon = new JCheckBox(jEdit.getProperty(CssSideKickPlugin.OPTION_PREFIX + "colon.title"));
55        colon.setSelected(jEdit.getBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "colon"));
56        addComponent(colon);
57
58        spaceAfterColon = new JCheckBox(jEdit.getProperty(CssSideKickPlugin.OPTION_PREFIX + "space-after-colon.title"));
59        spaceAfterColon.setSelected(jEdit.getBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "space-after-colon"));
60        addComponent(spaceAfterColon);
61
62        addSeparator("Display Options");
63
64        showProprietaryAsError = new JCheckBox(jEdit.getProperty(CssSideKickPlugin.OPTION_PREFIX + "showProprietaryAsError.title"));
65        showProprietaryAsError.setSelected(jEdit.getBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "showProprietaryAsError"));
66        addComponent(showProprietaryAsError);
67
68
69    } //}}}
70
71    //{{{ _save() method
72    public void _save() {
73        jEdit.setProperty(CssSideKickPlugin.OPTION_PREFIX + "quote", quote.isSelected()
74                                        ? "'"
75                                        : "\"");
76        jEdit.setBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "colon", colon.isSelected());
77        jEdit.setBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "space-after-colon", spaceAfterColon.isSelected());
78        jEdit.setBooleanProperty(CssSideKickPlugin.OPTION_PREFIX + "showProprietaryAsError", showProprietaryAsError.isSelected());
79        CssSideKickCompletion.readConfig();
80    } //}}}
81
82}