01: /*
02: JSmooth: a VM wrapper toolkit for Windows
03: Copyright (C) 2003-2007 Rodrigo Reyes <reyes@charabia.net>
04:
05: This program is free software; you can redistribute it and/or modify
06: it under the terms of the GNU General Public License as published by
07: the Free Software Foundation; either version 2 of the License, or
08: (at your option) any later version.
09:
10: This program is distributed in the hope that it will be useful,
11: but WITHOUT ANY WARRANTY; without even the implied warranty of
12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: GNU General Public License for more details.
14:
15: You should have received a copy of the GNU General Public License
16: along with this program; if not, write to the Free Software
17: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18:
19: */
20:
21: package net.charabia.jsmoothgen.application.gui.skeleditors;
22:
23: import javax.swing.*;
24: import javax.swing.event.*;
25: import javax.swing.text.*;
26: import java.util.*;
27: import java.awt.event.*;
28:
29: public class CheckBoxEditor extends SkelPropEditor {
30: JCheckBox m_comp;
31:
32: public CheckBoxEditor() {
33: m_comp = new JCheckBox();
34: }
35:
36: public java.awt.Component getGUI() {
37: return m_comp;
38: }
39:
40: public void valueChanged(String val) {
41: if (val.toString().equals("1"))
42: m_comp.setSelected(true);
43: else
44: m_comp.setSelected(false);
45: }
46:
47: public boolean labelAtLeft() {
48: return false;
49: }
50:
51: public void set(String o) {
52: if ("1".equals(o))
53: m_comp.setSelected(true);
54: else
55: m_comp.setSelected(false);
56: }
57:
58: public String get() {
59: return m_comp.isSelected() ? "1" : "0";
60: }
61:
62: }
|