01: /*
02: * Copyright (C) 2005 Jeff Tassin
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package com.jeta.swingbuilder.gui.export;
20:
21: import java.awt.BorderLayout;
22:
23: import com.jeta.forms.components.panel.FormPanel;
24: import com.jeta.open.gui.framework.JETAPanel;
25: import com.jeta.swingbuilder.interfaces.userprops.TSUserPropertiesUtils;
26:
27: /**
28: * This view allows the user to configure how all the component names for a
29: * given panel will be exported.
30: *
31: * @author Jeff Tassin
32: */
33: public class ExportNamesView extends JETAPanel {
34: private FormPanel m_view;
35:
36: public static final String ID_DECORATOR_FIELD = "export.names.decorator";
37: public static final String ID_INCLUDE_LINKED_FORMS = "include.linked.forms";
38: public static final String ID_INCLUDE_EMBEDDED_FORMS = "include.embedded.forms"; // javax.swing.JCheckBox
39: public static final String ID_INCLUDE_LABELS = "include.labels"; // javax.swing.JCheckBox
40:
41: /**
42: * ctor
43: */
44: public ExportNamesView() {
45: m_view = new FormPanel(
46: "com/jeta/swingbuilder/gui/export/exportNames.frm");
47: setLayout(new BorderLayout());
48: add(m_view, BorderLayout.CENTER);
49: setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10,
50: 10, 10));
51:
52: m_view
53: .setText(
54: ID_DECORATOR_FIELD,
55: TSUserPropertiesUtils
56: .getString(ID_DECORATOR_FIELD,
57: "public static final String ID_$identifier = \"$name\"; //$type"));
58: }
59:
60: /**
61: * @return the decorator for value
62: */
63: public String getDecorator() {
64: return m_view.getText(ID_DECORATOR_FIELD);
65: }
66:
67: /**
68: * @return true if linked forms should be included.
69: */
70: public boolean isIncludeLinkedForms() {
71: return m_view.getBoolean(ID_INCLUDE_LINKED_FORMS);
72: }
73:
74: /**
75: * @return true if embedded forms should be included.
76: */
77: public boolean isIncludeEmbeddedForms() {
78: return m_view.getBoolean(ID_INCLUDE_EMBEDDED_FORMS);
79: }
80:
81: /**
82: * @return true if lables forms should be included.
83: */
84: public boolean isIncludeLabels() {
85: return m_view.getBoolean(ID_INCLUDE_LABELS);
86: }
87:
88: /**
89: * Saves the view settings
90: */
91: public void saveToModel() {
92: TSUserPropertiesUtils.setString(ID_DECORATOR_FIELD, m_view
93: .getText(ID_DECORATOR_FIELD));
94: }
95: }
|