View Javadoc

1   /*
2    * $Id: PropertiesDialog.java,v 1.12 2007/07/04 19:42:50 edankert Exp $
3    *
4    * The contents of this file are subject to the Mozilla Public License 
5    * Version 1.1 (the "License"); you may not use this file except in 
6    * compliance with the License. You may obtain a copy of the License at 
7    * http://www.mozilla.org/MPL/ 
8    *
9    * Software distributed under the License is distributed on an "AS IS" basis, 
10   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
11   * for the specific language governing rights and limitations under the License.
12   *
13   * The Original Code is XML Hammer code. (org.xmlhammer.*)
14   *
15   * The Initial Developer of the Original Code is Edwin Dankert. Portions created 
16   * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. 
17   * All Rights Reserved.
18   *
19   * Contributor(s): Edwin Dankert <edankert@gmail.com>
20   */
21  
22  
23  package org.xmlhammer.gui.preferences;
24  
25  import javax.swing.JFrame;
26  import javax.swing.event.TreeSelectionListener;
27  
28  import org.xmlhammer.gui.util.preferences.HelpEnabledPreferencesPage;
29  import org.xmlhammer.model.jaxp.Attributes;
30  import org.xmlhammer.model.jaxp.Features;
31  import org.xmlhammer.model.jaxp.JAXPDocumentBuilderFactory;
32  import org.xmlhammer.model.jaxp.JAXPSAXParserFactory;
33  import org.xmlhammer.model.jaxp.JAXPSchemaFactory;
34  import org.xmlhammer.model.jaxp.JAXPTransformerFactory;
35  import org.xmlhammer.model.jaxp.JAXPXPathFactory;
36  import org.xmlhammer.model.jaxp.Mappings;
37  import org.xmlhammer.model.jaxp.Properties;
38  import org.xmlhammer.model.jaxp.SchemaFactoryProperties;
39  
40  /***
41   * Put comment...
42   * 
43   * @version $Revision: 1.12 $, $Date: 2007/07/04 19:42:50 $
44   * @author Edwin Dankert <edankert@gmail.com>
45   */
46  
47  public class PropertiesDialog extends JAXPPropertiesDialog implements TreeSelectionListener {
48  	private static final long serialVersionUID = 3258133544156017203L;
49  	
50  	/***
51  	 * @param parent the underlying frame
52  	 * @param saxParserFactory the SAXParserFactory settings to display.
53  	 * @param documentBuilderFactory the DocumentBuilderFactory settings to display.
54  	 * @param xpathFactory the XPathFactory settings to display.
55  	 * @param transformerFactory the TransformerFactory settings to display.
56  	 * @param schemaFactory the SchemaFactorySettings to display.
57  	 */
58  	public PropertiesDialog(JFrame parent, boolean saxParserFactory, boolean documentBuilderFactory, boolean xpathFactory, boolean transformerFactory, boolean schemaFactory) {
59  		super( parent, "Properties");
60  
61  		if ( saxParserFactory) {
62  			add((HelpEnabledPreferencesPage)null, getSAXParserFactoryPreferencesPanel());
63  			add(getSAXParserFactoryPreferencesPanel(), getSAXParserFactoryPropertiesPanel());
64  			add(getSAXParserFactoryPreferencesPanel(), getSAXParserFactoryFeaturesPanel());
65  		}
66  		
67  		if ( documentBuilderFactory) {
68  			add((HelpEnabledPreferencesPage)null, getDocumentBuilderFactoryPreferencesPanel());
69  			add(getDocumentBuilderFactoryPreferencesPanel(), getDocumentBuilderFactoryAttributesPanel());
70  			add(getDocumentBuilderFactoryPreferencesPanel(), getDocumentBuilderFactoryFeaturesPanel());
71  		}
72  		
73  		if ( transformerFactory) {
74  			add((HelpEnabledPreferencesPage)null, getTransformerFactoryPreferencesPanel());
75  			add(getTransformerFactoryPreferencesPanel(), getTransformerFactoryAttributesPanel());
76  			add(getTransformerFactoryPreferencesPanel(), getTransformerFactoryFeaturesPanel());
77  		} 
78  		
79  		if ( xpathFactory) {
80  			add((HelpEnabledPreferencesPage)null, getXPathFactoryPreferencesPanel());
81              add(getXPathFactoryPreferencesPanel(), getPrefixNamespaceMappingsPanel());
82  			add(getXPathFactoryPreferencesPanel(), getXPathFactoryFeaturesPanel());
83  		}
84  
85  		if ( schemaFactory) {
86  			add((HelpEnabledPreferencesPage)null, getSchemaFactoryPreferencesPanel());
87  			add(getSchemaFactoryPreferencesPanel(), getSchemaFactoryPropertiesPanel());
88  			add(getSchemaFactoryPreferencesPanel(), getSchemaFactoryFeaturesPanel());
89  		}
90  	}
91  	
92  	protected SAXParserFactoryPreferencesPanel getSAXParserFactoryPreferencesPanel() {
93  		if ( saxParserFactoryPreferencesPanel == null) {
94  			saxParserFactoryPreferencesPanel = new SAXParserFactoryPreferencesPanel( true);
95  		}
96  		
97  		return saxParserFactoryPreferencesPanel;
98  	}
99  		
100 	protected PropertiesPanel getSAXParserFactoryPropertiesPanel() {
101 		if ( saxParserFactoryPropertiesPanel == null) {
102 			saxParserFactoryPropertiesPanel = new PropertiesPanel(null, "Properties", "preferences.sax.properties", true);
103 		}
104 
105 		return saxParserFactoryPropertiesPanel;
106 	}
107 
108 	protected FeaturesPanel getSAXParserFactoryFeaturesPanel() {
109 		if ( saxParserFactoryFeaturesPanel == null) {
110 			saxParserFactoryFeaturesPanel = new FeaturesPanel(null, "Features", "preferences.sax.features", true);
111 		}
112 
113 		return saxParserFactoryFeaturesPanel;
114 	}
115 
116 	protected DocumentBuilderFactoryPreferencesPanel getDocumentBuilderFactoryPreferencesPanel() {
117 		if ( documentBuilderFactoryPreferencesPanel == null) {
118 			documentBuilderFactoryPreferencesPanel = new DocumentBuilderFactoryPreferencesPanel( true);
119 		}
120 
121 		return documentBuilderFactoryPreferencesPanel;
122 	}
123 
124 	protected AttributesPanel getDocumentBuilderFactoryAttributesPanel() {
125 		if ( documentBuilderFactoryAttributesPanel == null) {
126 			documentBuilderFactoryAttributesPanel = new AttributesPanel(null, "Attributes", "preferences.dom.attributes", true);
127 		}
128 
129 		return documentBuilderFactoryAttributesPanel;
130 	}
131 
132 	protected FeaturesPanel getDocumentBuilderFactoryFeaturesPanel() {
133 		if ( documentBuilderFactoryFeaturesPanel == null) {
134 			documentBuilderFactoryFeaturesPanel = new FeaturesPanel(null, "Features", "preferences.dom.features", true);
135 		}
136 
137 		return documentBuilderFactoryFeaturesPanel;
138 	}
139 
140 	protected TransformerFactoryPreferencesPanel getTransformerFactoryPreferencesPanel() {
141 		if ( transformerFactoryPreferencesPanel == null) {
142 			transformerFactoryPreferencesPanel = new TransformerFactoryPreferencesPanel( true);
143 		}
144 
145 		return transformerFactoryPreferencesPanel;
146 	}
147 
148 	protected AttributesPanel getTransformerFactoryAttributesPanel() {
149 		if ( transformerFactoryAttributesPanel == null) {
150 			transformerFactoryAttributesPanel = new AttributesPanel(null, "Attributes", "preferences.trax.attributes", true);
151 		}
152 
153 		return transformerFactoryAttributesPanel;
154 	}
155 
156 	protected FeaturesPanel getTransformerFactoryFeaturesPanel() {
157 		if ( transformerFactoryFeaturesPanel == null) {
158 			transformerFactoryFeaturesPanel = new FeaturesPanel(null, "Features", "preferences.trax.features", true);
159 		}
160 
161 		return transformerFactoryFeaturesPanel;
162 	}
163 
164 	protected XPathFactoryPreferencesPanel getXPathFactoryPreferencesPanel() {
165 		if ( xpathFactoryPreferencesPanel == null) {
166 			xpathFactoryPreferencesPanel = new XPathFactoryPreferencesPanel( true);
167 		}
168 
169 		return xpathFactoryPreferencesPanel;
170 	}
171 
172     protected PrefixNamespaceMappingsPanel getPrefixNamespaceMappingsPanel() {
173         if ( prefixNamespaceMappingsPanel == null) {
174             prefixNamespaceMappingsPanel = new PrefixNamespaceMappingsPanel(null, "Mappings", "preferences.xpath.mappings", true);
175         }
176 
177         return prefixNamespaceMappingsPanel;
178     }
179 
180     protected FeaturesPanel getXPathFactoryFeaturesPanel() {
181 		if ( xpathFactoryFeaturesPanel == null) {
182 			xpathFactoryFeaturesPanel = new FeaturesPanel(null, "Features", "preferences.xpath.features", true);
183 		}
184 
185 		return xpathFactoryFeaturesPanel;
186 	}
187 
188 	protected SchemaFactoryPreferencesPanel getSchemaFactoryPreferencesPanel() {
189 		if ( schemaFactoryPreferencesPanel == null) {
190 			schemaFactoryPreferencesPanel = new SchemaFactoryPreferencesPanel((JFrame)getParent(), true);
191 		}
192 		
193 		return schemaFactoryPreferencesPanel;
194 	}
195 		
196 	protected PropertiesPanel getSchemaFactoryPropertiesPanel() {
197 		if ( schemaFactoryPropertiesPanel == null) {
198 			schemaFactoryPropertiesPanel = new PropertiesPanel(null, "Properties", "preferences.schema.properties", true);
199 		}
200 
201 		return schemaFactoryPropertiesPanel;
202 	}
203 
204 	protected FeaturesPanel getSchemaFactoryFeaturesPanel() {
205 		if ( schemaFactoryFeaturesPanel == null) {
206 			schemaFactoryFeaturesPanel = new FeaturesPanel(null, "Features", "preferences.schema.features", true);
207 		}
208 
209 		return schemaFactoryFeaturesPanel;
210 	}
211 
212 	/***
213 	 * @return the SAXParserfactory settings, 
214 	 * 		   null if global settings should be used.
215 	 */
216 	public JAXPSAXParserFactory getSAXParserFactory( ) {
217 		JAXPSAXParserFactory factory = new JAXPSAXParserFactory();
218 		
219 		if ( getSAXParserFactoryPreferencesPanel().isProjectSpecific()) {
220 			factory.setSettings( getSAXParserFactoryPreferencesPanel().getJAXPSAXParserFactorySettings());
221 		}
222 		
223 		if ( getSAXParserFactoryPropertiesPanel().isProjectSpecific()) {
224 			Properties properties = new Properties();
225 			properties.getProperty().addAll( getSAXParserFactoryPropertiesPanel().getProperties());
226 
227 			factory.setProperties( properties);
228 		}
229 
230 		if ( getSAXParserFactoryFeaturesPanel().isProjectSpecific()) {
231 			Features features = new Features();
232 			features.getFeature().addAll( getSAXParserFactoryFeaturesPanel().getFeatures());
233 
234 			factory.setFeatures( features);
235 		}
236 		
237 		return factory;
238 	}
239 	
240 	/***
241 	 * @param factory the SAXParserFactory settings.
242 	 */
243 	public void setSAXParserFactory( JAXPSAXParserFactory factory) {
244 		if ( factory != null && factory.getSettings() != null) {
245 			getSAXParserFactoryPreferencesPanel().setJAXPSAXParserFactorySettings( factory.getSettings());
246 			getSAXParserFactoryPreferencesPanel().setProjectSpecific( true);
247 		} else {
248 			getSAXParserFactoryPreferencesPanel().setJAXPSAXParserFactorySettings( getPreferences().getJAXPSettings().getJAXPSAXParserFactory().getSettings());
249 			getSAXParserFactoryPreferencesPanel().setProjectSpecific( false);
250 		}
251 
252 		if ( factory != null && factory.getProperties() != null) {
253 			getSAXParserFactoryPropertiesPanel().setProperties( factory.getProperties().getProperty());
254 			getSAXParserFactoryPropertiesPanel().setProjectSpecific( true);
255 		} else {
256 			getSAXParserFactoryPropertiesPanel().setProperties( getPreferences().getJAXPSettings().getJAXPSAXParserFactory().getProperties().getProperty());
257 			getSAXParserFactoryPropertiesPanel().setProjectSpecific( false);
258 		}
259 
260 		if ( factory != null && factory.getFeatures() != null) {
261 			getSAXParserFactoryFeaturesPanel().setFeatures( factory.getFeatures().getFeature());
262 			getSAXParserFactoryFeaturesPanel().setProjectSpecific( true);
263 		} else {
264 			getSAXParserFactoryFeaturesPanel().setFeatures( getPreferences().getJAXPSettings().getJAXPSAXParserFactory().getFeatures().getFeature());
265 			getSAXParserFactoryFeaturesPanel().setProjectSpecific( false);
266 		}
267 	}
268 
269 	/***
270 	 * @param factory the DocumentBuilderFactory settings.
271 	 */
272 	public void setDocumentBuilderFactory( JAXPDocumentBuilderFactory factory) {
273 		if ( factory != null && factory.getSettings() != null) {
274 			getDocumentBuilderFactoryPreferencesPanel().setJAXPDocumentBuilderFactorySettings( factory.getSettings());
275 			getDocumentBuilderFactoryPreferencesPanel().setProjectSpecific( true);
276 		} else {
277 			getDocumentBuilderFactoryPreferencesPanel().setJAXPDocumentBuilderFactorySettings( getPreferences().getJAXPSettings().getJAXPDocumentBuilderFactory().getSettings());
278 			getDocumentBuilderFactoryPreferencesPanel().setProjectSpecific( false);
279 		}
280 
281 		if ( factory != null && factory.getAttributes() != null) {
282 			getDocumentBuilderFactoryAttributesPanel().setAttributes( factory.getAttributes().getAttribute());
283 			getDocumentBuilderFactoryAttributesPanel().setProjectSpecific( true);
284 		} else {
285 			getDocumentBuilderFactoryAttributesPanel().setAttributes( getPreferences().getJAXPSettings().getJAXPDocumentBuilderFactory().getAttributes().getAttribute());
286 			getDocumentBuilderFactoryAttributesPanel().setProjectSpecific( false);
287 		}
288 
289 		if ( factory != null && factory.getFeatures() != null) {
290 			getDocumentBuilderFactoryFeaturesPanel().setFeatures( factory.getFeatures().getFeature());
291 			getDocumentBuilderFactoryFeaturesPanel().setProjectSpecific( true);
292 		} else {
293 			getDocumentBuilderFactoryFeaturesPanel().setFeatures( getPreferences().getJAXPSettings().getJAXPDocumentBuilderFactory().getFeatures().getFeature());
294 			getDocumentBuilderFactoryFeaturesPanel().setProjectSpecific( false);
295 		}
296 	}
297 
298 	/***
299 	 * @return the DocumentBuilderFactory settings, 
300 	 * 		   null if global settings should be used.
301 	 */
302 	public JAXPDocumentBuilderFactory getDocumentBuilderFactory( ) {
303 		JAXPDocumentBuilderFactory factory = new JAXPDocumentBuilderFactory();
304 		
305 		if ( getDocumentBuilderFactoryPreferencesPanel().isProjectSpecific()) {
306 			factory.setSettings( getDocumentBuilderFactoryPreferencesPanel().getJAXPDocumentBuilderFactorySettings());
307 		}
308 		
309 		if ( getDocumentBuilderFactoryAttributesPanel().isProjectSpecific()) {
310 			Attributes attributes = new Attributes();
311 			attributes.getAttribute().addAll( getDocumentBuilderFactoryAttributesPanel().getAttributes());
312 
313 			factory.setAttributes( attributes);
314 		}
315 
316 		if ( getDocumentBuilderFactoryFeaturesPanel().isProjectSpecific()) {
317 			Features features = new Features();
318 			features.getFeature().addAll( getDocumentBuilderFactoryFeaturesPanel().getFeatures());
319 
320 			factory.setFeatures( features);
321 		}
322 
323 		return factory;
324 	}
325 
326 	/***
327 	 * @param factory the TransformerFactory settings.
328 	 */
329 	public void setTransformerFactory( JAXPTransformerFactory factory) {
330 		if ( factory != null && factory.getSettings() != null) {
331 			getTransformerFactoryPreferencesPanel().setJAXPTransformerFactorySettings( factory.getSettings());
332 			getTransformerFactoryPreferencesPanel().setProjectSpecific( true);
333 		} else {
334 			getTransformerFactoryPreferencesPanel().setJAXPTransformerFactorySettings( getPreferences().getJAXPSettings().getJAXPTransformerFactory().getSettings());
335 			getTransformerFactoryPreferencesPanel().setProjectSpecific( false);
336 		}
337 
338 		if ( factory != null && factory.getAttributes() != null) {
339 			getTransformerFactoryAttributesPanel().setAttributes( factory.getAttributes().getAttribute());
340 			getTransformerFactoryAttributesPanel().setProjectSpecific( true);
341 		} else {
342 			getTransformerFactoryAttributesPanel().setAttributes( getPreferences().getJAXPSettings().getJAXPTransformerFactory().getAttributes().getAttribute());
343 			getTransformerFactoryAttributesPanel().setProjectSpecific( false);
344 		}
345 
346 		if ( factory != null && factory.getFeatures() != null) {
347 			getTransformerFactoryFeaturesPanel().setFeatures( factory.getFeatures().getFeature());
348 			getTransformerFactoryFeaturesPanel().setProjectSpecific( true);
349 		} else {
350 			getTransformerFactoryFeaturesPanel().setFeatures( getPreferences().getJAXPSettings().getJAXPTransformerFactory().getFeatures().getFeature());
351 			getTransformerFactoryFeaturesPanel().setProjectSpecific( false);
352 		}
353 	}
354 
355 	/***
356 	 * @return the TransformerFactory settings, 
357 	 * 		   null if global settings should be used.
358 	 */
359 	public JAXPTransformerFactory getTransformerFactory( ) {
360 		JAXPTransformerFactory factory = new JAXPTransformerFactory();;
361 		
362 		if ( getTransformerFactoryPreferencesPanel().isProjectSpecific()) {
363 			factory.setSettings( getTransformerFactoryPreferencesPanel().getJAXPTransfomerFactory());
364 		}
365 		
366 		if ( getTransformerFactoryAttributesPanel().isProjectSpecific()) {
367 			Attributes attributes = new Attributes();
368 			attributes.getAttribute().addAll( getTransformerFactoryAttributesPanel().getAttributes());
369 
370 			factory.setAttributes( attributes);
371 		}
372 
373 		if ( getTransformerFactoryFeaturesPanel().isProjectSpecific()) {
374 			Features features = new Features();
375 			features.getFeature().addAll( getTransformerFactoryFeaturesPanel().getFeatures());
376 
377 			factory.setFeatures( features);
378 		}
379 
380 		return factory;
381 	}
382 
383 	/***
384 	 * @param factory the XPathFactory settings.
385 	 */
386 	public void setXPathFactory( JAXPXPathFactory factory) {
387 		if ( factory != null && factory.getSettings() != null) {
388 			getXPathFactoryPreferencesPanel().setJAXPXPathFactorySettings( factory.getSettings());
389 			getXPathFactoryPreferencesPanel().setProjectSpecific( true);
390 		} else {
391 			getXPathFactoryPreferencesPanel().setJAXPXPathFactorySettings( getPreferences().getJAXPSettings().getJAXPXPathFactory().getSettings());
392 			getXPathFactoryPreferencesPanel().setProjectSpecific( false);
393 		}
394 
395 		if ( factory != null && factory.getMappings() != null) {
396 			getPrefixNamespaceMappingsPanel().setMappings( factory.getMappings().getMapping());
397             getPrefixNamespaceMappingsPanel().setProjectSpecific( true);
398 		} else {
399             getPrefixNamespaceMappingsPanel().setMappings( getPreferences().getJAXPSettings().getJAXPXPathFactory().getMappings().getMapping());
400             getPrefixNamespaceMappingsPanel().setProjectSpecific( false);
401 		}
402 
403 		if ( factory != null && factory.getFeatures() != null) {
404 			getXPathFactoryFeaturesPanel().setFeatures( factory.getFeatures().getFeature());
405 			getXPathFactoryFeaturesPanel().setProjectSpecific( true);
406 		} else {
407 			getXPathFactoryFeaturesPanel().setFeatures( getPreferences().getJAXPSettings().getJAXPXPathFactory().getFeatures().getFeature());
408 			getXPathFactoryFeaturesPanel().setProjectSpecific( false);
409 		}
410 	}
411 
412 	/***
413 	 * @return the XPathFactory settings, 
414 	 * 		   null if global settings should be used.
415 	 */
416 	public JAXPXPathFactory getXPathFactory( ) {
417 		JAXPXPathFactory factory = new JAXPXPathFactory();
418 		
419 		if (getXPathFactoryPreferencesPanel().isProjectSpecific()) {
420 			factory.setSettings( getXPathFactoryPreferencesPanel().getJAXPXPathFactorySettings());
421 		}
422 		
423 		if (getPrefixNamespaceMappingsPanel().isProjectSpecific()) {
424 			Mappings mappings = new Mappings();
425 			mappings.getMapping().addAll( getPrefixNamespaceMappingsPanel().getMappings());
426 
427 			factory.setMappings( mappings);
428 		}
429 
430 		if (getXPathFactoryFeaturesPanel().isProjectSpecific()) {
431 			Features features = new Features();
432 			features.getFeature().addAll( getXPathFactoryFeaturesPanel().getFeatures());
433 
434 			factory.setFeatures( features);
435 		}
436 
437 		return factory;
438 	}
439 
440 	/***
441 	 * @return the SchemaFactory settings, 
442 	 * 		   null if global settings should be used.
443 	 */
444 	public JAXPSchemaFactory getSchemaFactory( ) {
445 		JAXPSchemaFactory factory = new JAXPSchemaFactory();
446 		
447 		if ( getSchemaFactoryPreferencesPanel().isProjectSpecific()) {
448 			factory.setSettings( getSchemaFactoryPreferencesPanel().getJAXPSchemaFactorySettings());
449 
450             SchemaFactoryProperties properties = new SchemaFactoryProperties();
451             properties.getSchemaFactoryProperty().addAll( getSchemaFactoryPreferencesPanel().getProperties());
452             factory.setSchemaFactoryProperties( properties);
453 		}
454 		
455 		if ( getSchemaFactoryPropertiesPanel().isProjectSpecific()) {
456 			Properties properties = new Properties();
457 			properties.getProperty().addAll( getSchemaFactoryPropertiesPanel().getProperties());
458 
459 			factory.setProperties( properties);
460 		}
461 
462 		if ( getSchemaFactoryFeaturesPanel().isProjectSpecific()) {
463 			Features features = new Features();
464 			features.getFeature().addAll( getSchemaFactoryFeaturesPanel().getFeatures());
465 
466 			factory.setFeatures( features);
467 		}
468 		
469 		return factory;
470 	}
471 	
472 	/***
473 	 * @param factory the SAXParserFactory settings.
474 	 */
475 	public void setSchemaFactory( JAXPSchemaFactory factory) {
476 		if ( factory != null && factory.getSettings() != null) {
477 			getSchemaFactoryPreferencesPanel().setJAXPSchemaFactorySettings( factory.getSettings());
478 			getSchemaFactoryPreferencesPanel().setProjectSpecific( true);
479 		} else {
480 			getSchemaFactoryPreferencesPanel().setJAXPSchemaFactorySettings( getPreferences().getJAXPSettings().getJAXPSchemaFactory().getSettings());
481 			getSchemaFactoryPreferencesPanel().setProjectSpecific( false);
482 		}
483 
484         if ( factory != null && factory.getSchemaFactoryProperties() != null) {
485             getSchemaFactoryPreferencesPanel().setProperties( factory.getSchemaFactoryProperties().getSchemaFactoryProperty());
486             getSchemaFactoryPreferencesPanel().setProjectSpecific( true);
487         } else {
488             getSchemaFactoryPreferencesPanel().setProperties( getPreferences().getJAXPSettings().getJAXPSchemaFactory().getSchemaFactoryProperties().getSchemaFactoryProperty());
489             getSchemaFactoryPreferencesPanel().setProjectSpecific( false);
490         }
491 
492         if ( factory != null && factory.getProperties() != null) {
493 			getSchemaFactoryPropertiesPanel().setProperties( factory.getProperties().getProperty());
494 			getSchemaFactoryPropertiesPanel().setProjectSpecific( true);
495 		} else {
496 			getSchemaFactoryPropertiesPanel().setProperties( getPreferences().getJAXPSettings().getJAXPSchemaFactory().getProperties().getProperty());
497 			getSchemaFactoryPropertiesPanel().setProjectSpecific( false);
498 		}
499 
500 		if ( factory != null && factory.getFeatures() != null) {
501 			getSchemaFactoryFeaturesPanel().setFeatures( factory.getFeatures().getFeature());
502 			getSchemaFactoryFeaturesPanel().setProjectSpecific( true);
503 		} else {
504 			getSchemaFactoryFeaturesPanel().setFeatures( getPreferences().getJAXPSettings().getJAXPSchemaFactory().getFeatures().getFeature());
505 			getSchemaFactoryFeaturesPanel().setProjectSpecific( false);
506 		}
507 	}
508 
509 	//	private void setProject( Project project) {
510 //		Settings jaxpSettings = project.getJAXPSettings();
511 //		if ( jaxpSettings == null) {
512 //			jaxpSettings = new Settings();
513 //		}
514 //		
515 //	}
516 //	
517 //	public void update( Project project) {
518 //		Settings jaxpSettings = project.getJAXPSettings();
519 //		if ( jaxpSettings == null) {
520 //			jaxpSettings = new Settings();
521 //		}
522 //
523 //		project.setJAXPSettings( jaxpSettings);
524 //	}
525 }