1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.xmlhammer.gui.preferences;
24
25 import java.awt.Frame;
26
27 import javax.swing.JFrame;
28 import javax.swing.event.TreeSelectionListener;
29
30 import org.xmlhammer.PreferencesHandler;
31 import org.xmlhammer.gui.util.preferences.HelpEnabledPreferencesDialog;
32 import org.xmlhammer.model.preferences.Preferences;
33
34 /***
35 * JAXP Properties ...
36 *
37 * @version $Revision: 1.14 $, $Date: 2007/07/04 19:42:50 $
38 * @author Edwin Dankert <edankert@gmail.com>
39 */
40
41 public class JAXPPropertiesDialog extends HelpEnabledPreferencesDialog implements TreeSelectionListener {
42 private static final long serialVersionUID = -7403432397234000652L;
43
44 private Preferences preferences = null;
45
46 protected SAXParserFactoryPreferencesPanel saxParserFactoryPreferencesPanel = null;
47 protected PropertiesPanel saxParserFactoryPropertiesPanel = null;
48 protected FeaturesPanel saxParserFactoryFeaturesPanel = null;
49 protected AttributesPanel documentBuilderFactoryAttributesPanel = null;
50 protected FeaturesPanel documentBuilderFactoryFeaturesPanel = null;
51 protected FeaturesPanel xpathFactoryFeaturesPanel = null;
52 protected XPathFactoryPreferencesPanel xpathFactoryPreferencesPanel = null;
53 protected PrefixNamespaceMappingsPanel prefixNamespaceMappingsPanel = null;
54 protected TransformerFactoryPreferencesPanel transformerFactoryPreferencesPanel = null;
55 protected AttributesPanel transformerFactoryAttributesPanel = null;
56 protected FeaturesPanel transformerFactoryFeaturesPanel = null;
57 protected DocumentBuilderFactoryPreferencesPanel documentBuilderFactoryPreferencesPanel = null;
58 protected SchemaFactoryPreferencesPanel schemaFactoryPreferencesPanel = null;
59 protected PropertiesPanel schemaFactoryPropertiesPanel = null;
60 protected FeaturesPanel schemaFactoryFeaturesPanel = null;
61
62 /***
63 * @param parent
64 * @throws java.awt.HeadlessException
65 */
66 public JAXPPropertiesDialog(Frame parent, String title) {
67 super(parent, title);
68
69 this.preferences = PreferencesHandler.getInstance().getPreferences();
70 }
71
72 public Preferences getPreferences() {
73 return preferences;
74 }
75
76 protected SAXParserFactoryPreferencesPanel getSAXParserFactoryPreferencesPanel() {
77 if ( saxParserFactoryPreferencesPanel == null) {
78 saxParserFactoryPreferencesPanel = new SAXParserFactoryPreferencesPanel();
79 }
80
81 return saxParserFactoryPreferencesPanel;
82 }
83
84 protected PropertiesPanel getSAXParserFactoryPropertiesPanel() {
85 if ( saxParserFactoryPropertiesPanel == null) {
86 saxParserFactoryPropertiesPanel = new PropertiesPanel((JFrame)getParent(), "Properties", "preferences.sax.properties");
87 }
88
89 return saxParserFactoryPropertiesPanel;
90 }
91
92 protected FeaturesPanel getSAXParserFactoryFeaturesPanel() {
93 if ( saxParserFactoryFeaturesPanel == null) {
94 saxParserFactoryFeaturesPanel = new FeaturesPanel((JFrame)getParent(), "Features", "preferences.sax.features");
95 }
96
97 return saxParserFactoryFeaturesPanel;
98 }
99
100 protected DocumentBuilderFactoryPreferencesPanel getDocumentBuilderFactoryPreferencesPanel() {
101 if ( documentBuilderFactoryPreferencesPanel == null) {
102 documentBuilderFactoryPreferencesPanel = new DocumentBuilderFactoryPreferencesPanel();
103 }
104
105 return documentBuilderFactoryPreferencesPanel;
106 }
107
108 protected AttributesPanel getDocumentBuilderFactoryAttributesPanel() {
109 if ( documentBuilderFactoryAttributesPanel == null) {
110 documentBuilderFactoryAttributesPanel = new AttributesPanel((JFrame)getParent(), "Attributes", "preferences.dom.attributes");
111 }
112
113 return documentBuilderFactoryAttributesPanel;
114 }
115
116 protected FeaturesPanel getDocumentBuilderFactoryFeaturesPanel() {
117 if ( documentBuilderFactoryFeaturesPanel == null) {
118 documentBuilderFactoryFeaturesPanel = new FeaturesPanel((JFrame)getParent(), "Features", "preferences.dom.features");
119 }
120
121 return documentBuilderFactoryFeaturesPanel;
122 }
123
124 protected TransformerFactoryPreferencesPanel getTransformerFactoryPreferencesPanel() {
125 if ( transformerFactoryPreferencesPanel == null) {
126 transformerFactoryPreferencesPanel = new TransformerFactoryPreferencesPanel();
127 }
128
129 return transformerFactoryPreferencesPanel;
130 }
131
132 protected AttributesPanel getTransformerFactoryAttributesPanel() {
133 if ( transformerFactoryAttributesPanel == null) {
134 transformerFactoryAttributesPanel = new AttributesPanel((JFrame)getParent(), "Attributes", "preferences.trax.attributes");
135 }
136
137 return transformerFactoryAttributesPanel;
138 }
139
140 protected FeaturesPanel getTransformerFactoryFeaturesPanel() {
141 if ( transformerFactoryFeaturesPanel == null) {
142 transformerFactoryFeaturesPanel = new FeaturesPanel((JFrame)getParent(), "Features", "preferences.trax.features");
143 }
144
145 return transformerFactoryFeaturesPanel;
146 }
147
148 protected XPathFactoryPreferencesPanel getXPathFactoryPreferencesPanel() {
149 if ( xpathFactoryPreferencesPanel == null) {
150 xpathFactoryPreferencesPanel = new XPathFactoryPreferencesPanel();
151 }
152
153 return xpathFactoryPreferencesPanel;
154 }
155
156 protected FeaturesPanel getXPathFactoryFeaturesPanel() {
157 if ( xpathFactoryFeaturesPanel == null) {
158 xpathFactoryFeaturesPanel = new FeaturesPanel((JFrame)getParent(), "Features", "preferences.xpath.features");
159 }
160
161 return xpathFactoryFeaturesPanel;
162 }
163
164 protected PrefixNamespaceMappingsPanel getPrefixNamespaceMappingsPanel() {
165 if ( prefixNamespaceMappingsPanel == null) {
166 prefixNamespaceMappingsPanel = new PrefixNamespaceMappingsPanel((JFrame)getParent(), "Mappings", "preferences.xpath.mappings");
167 }
168
169 return prefixNamespaceMappingsPanel;
170 }
171
172 protected SchemaFactoryPreferencesPanel getSchemaFactoryPreferencesPanel() {
173 if ( schemaFactoryPreferencesPanel == null) {
174 schemaFactoryPreferencesPanel = new SchemaFactoryPreferencesPanel((JFrame)getParent());
175 }
176
177 return schemaFactoryPreferencesPanel;
178 }
179
180 protected PropertiesPanel getSchemaFactoryPropertiesPanel() {
181 if ( schemaFactoryPropertiesPanel == null) {
182 schemaFactoryPropertiesPanel = new PropertiesPanel((JFrame)getParent(), "Properties", "preferences.schema.properties");
183 }
184
185 return schemaFactoryPropertiesPanel;
186 }
187
188 protected FeaturesPanel getSchemaFactoryFeaturesPanel() {
189 if ( schemaFactoryFeaturesPanel == null) {
190 schemaFactoryFeaturesPanel = new FeaturesPanel((JFrame)getParent(), "Features", "preferences.schema.features");
191 }
192
193 return schemaFactoryFeaturesPanel;
194 }
195 }