KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > axi > impl > CompositorProxy


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.axi.impl;
21
22 import org.netbeans.modules.xml.axi.AXIComponent;
23 import org.netbeans.modules.xml.axi.AXIComponent.ComponentType;
24 import org.netbeans.modules.xml.axi.AXIModel;
25 import org.netbeans.modules.xml.axi.Compositor;
26 import org.netbeans.modules.xml.axi.Compositor.CompositorType;
27 import org.netbeans.modules.xml.axi.Element;
28
29 /**
30  * Proxy compositor, acts on behalf of an original Compositor.
31  * Delegates all calls to the original Compositor.
32  *
33  * @author Samaresh (Samaresh.Panda@Sun.Com)
34  */

35 public class CompositorProxy extends Compositor implements AXIComponentProxy {
36             
37     
38     /**
39      * Creates a new instance of CompositorProxy
40      */

41     public CompositorProxy(AXIModel model, AXIComponent sharedComponent) {
42         super(model, sharedComponent);
43     }
44             
45     private Compositor getShared() {
46         return (Compositor)getSharedComponent();
47     }
48     
49     public ComponentType getComponentType() {
50         return ComponentType.PROXY;
51     }
52     
53     /**
54      * Returns the type of this content model.
55      */

56     public CompositorType getType() {
57         return getShared().getType();
58     }
59     
60     /**
61      * Returns the type of this content model.
62      */

63     public void setType(CompositorType value) {
64         getShared().setType(value);
65     }
66     
67     /**
68      * Returns the min occurs.
69      */

70     public String JavaDoc getMinOccurs() {
71         return getShared().getMinOccurs();
72     }
73     
74     public void setMinOccurs(String JavaDoc value) {
75         getShared().setMinOccurs(value);
76     }
77     
78     /**
79      * Returns the max occurs.
80      */

81     public String JavaDoc getMaxOccurs() {
82         return getShared().getMaxOccurs();
83     }
84     
85     public void setMaxOccurs(String JavaDoc value) {
86         getShared().setMaxOccurs(value);
87     }
88         
89     /**
90      * Adds a Compositor as its child.
91      */

92     public void addCompositor(CompositorProxy compositor) {
93         getShared().addCompositor(compositor);
94     }
95     
96     /**
97      * Removes an Compositor.
98      */

99     public void removeCompositor(CompositorProxy compositor) {
100         getShared().removeCompositor(compositor);
101     }
102     
103     /**
104      * Adds an Element as its child.
105      */

106     public void addElement(Element element) {
107         getShared().addElement(element);
108     }
109         
110     /**
111      * Removes an Element.
112      */

113     public void removeElement(Element element) {
114         getShared().removeElement(element);
115     }
116     
117     public String JavaDoc toString() {
118         return getShared().toString();
119     }
120     
121 }
122
Popular Tags