View Javadoc

1   /*
2    * $Id: SchemaFactoryPreferencesPanel.java,v 1.5 2007/03/07 21:56:23 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 - 2006s 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 java.util.List;
26  
27  import javax.swing.JFrame;
28  
29  import org.xmlhammer.model.jaxp.JAXPSchemaFactory;
30  import org.xmlhammer.model.jaxp.SchemaFactoryProperty;
31  
32  /***
33   * Schema Factory Settings Panel ...
34   * 
35   * @version $Revision: 1.5 $, $Date: 2007/03/07 21:56:23 $
36   * @author Edwin Dankert <edankert@gmail.com>
37   */
38  
39  public class SchemaFactoryPreferencesPanel extends PreferencesPanel {
40  	private static final long serialVersionUID = 1L;
41      
42  	private SchemaLanguagesPanel schemaLanguages = null;
43  	
44  	/***
45  	 * @param name
46  	 */
47  	public SchemaFactoryPreferencesPanel(JFrame parent) {
48  		this(parent, false);
49  	}
50  
51  	/***
52  	 * @param name
53  	 */
54  	public SchemaFactoryPreferencesPanel(JFrame parent, boolean project) {
55  		super("javax.xml.validation.SchemaFactory", "preferences.schema", project);
56  
57          setLabel("SchemaFactory");
58  
59          schemaLanguages = new SchemaLanguagesPanel(parent, "Schema Languages");
60          
61          setCenterPane( schemaLanguages);
62      }
63  
64  	public void setJAXPSchemaFactorySettings( JAXPSchemaFactory.Settings settings) {
65  	}
66  	
67      public void setProperties( List<SchemaFactoryProperty> properties) {
68          schemaLanguages.setProperties( properties);
69      }
70  
71      public List<SchemaFactoryProperty> getProperties() {
72          return schemaLanguages.getProperties();
73      }
74  
75      public JAXPSchemaFactory.Settings getJAXPSchemaFactorySettings() {
76  		JAXPSchemaFactory.Settings settings = new JAXPSchemaFactory.Settings();
77  		
78  		return settings;
79  	}
80  	
81  	public void reset() {
82  		setJAXPSchemaFactorySettings( new JAXPSchemaFactory.Settings());
83  	}
84  
85  	public void setEnabled( boolean enabled) {
86          schemaLanguages.setEnabled( enabled);
87  	}
88  }