KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > xam > ui > customizer > ExternalReferenceDecorator


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.xam.ui.customizer;
21
22 import org.netbeans.modules.xml.retriever.catalog.Utilities;
23 import org.netbeans.modules.xml.xam.Model;
24 import org.openide.nodes.Node;
25
26 /**
27  * An ExternalReferenceDecorator is used to control the appearance of the
28  * nodes in the ExternalReferenceCustomizer.
29  *
30  * @author Nathan Fiedler
31  */

32 public interface ExternalReferenceDecorator {
33
34     /**
35      * Create an ExternalReferenceNode with the given delegate node.
36      * Implementors may wish to delegate to the customizer.
37      *
38      * @param node delegate Node.
39      * @return new ExternalReferenceNode.
40      */

41     ExternalReferenceDataNode createExternalReferenceNode(Node original);
42
43     /**
44      * Generate a unique prefix value for the document containing the
45      * customized component. The selected node is provided, which permits
46      * customizing the prefix based on the model represented by the node.
47      *
48      * @param node the currently selected node.
49      * @return unique prefix value (e.g. "ns1"); must not be null.
50      */

51     String JavaDoc generatePrefix(ExternalReferenceNode node);
52
53     /**
54      * Return the document type that this decorator wants to show in the
55      * file chooser.
56      *
57      * @return the desired document type.
58      */

59     Utilities.DocumentTypesEnum getDocumentType();
60
61     /**
62      * Generate the HTML display name for the node.
63      *
64      * @param name original display name (may be HTML form).
65      * @param node external reference node to decorate.
66      */

67     String JavaDoc getHtmlDisplayName(String JavaDoc name, ExternalReferenceNode node);
68
69     /**
70      * Return the namespace appropriate for the model.
71      *
72      * @param model the Model from which to acquire the namespace.
73      * @return the namespace value, or null if none.
74      */

75     String JavaDoc getNamespace(Model model);
76
77     /**
78      * Validate the given node, returning a non-null value if the node
79      * is not a valid selection. Otherwise, return null if it is valid.
80      *
81      * @param node external reference node to validate.
82      * @return message describing the issue; null if valid.
83      */

84     String JavaDoc validate(ExternalReferenceNode node);
85 }
86
Popular Tags