001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.xml.axi.impl;
043:
044: import org.netbeans.modules.xml.axi.AXIComponent;
045: import org.netbeans.modules.xml.axi.AXIComponent.ComponentType;
046: import org.netbeans.modules.xml.axi.AXIModel;
047: import org.netbeans.modules.xml.axi.Compositor;
048: import org.netbeans.modules.xml.axi.Compositor.CompositorType;
049: import org.netbeans.modules.xml.axi.Element;
050:
051: /**
052: * Proxy compositor, acts on behalf of an original Compositor.
053: * Delegates all calls to the original Compositor.
054: *
055: * @author Samaresh (Samaresh.Panda@Sun.Com)
056: */
057: public class CompositorProxy extends Compositor implements
058: AXIComponentProxy {
059:
060: /**
061: * Creates a new instance of CompositorProxy
062: */
063: public CompositorProxy(AXIModel model, AXIComponent sharedComponent) {
064: super (model, sharedComponent);
065: }
066:
067: private Compositor getShared() {
068: return (Compositor) getSharedComponent();
069: }
070:
071: public ComponentType getComponentType() {
072: return ComponentType.PROXY;
073: }
074:
075: /**
076: * Returns the type of this content model.
077: */
078: public CompositorType getType() {
079: return getShared().getType();
080: }
081:
082: /**
083: * Returns the type of this content model.
084: */
085: public void setType(CompositorType value) {
086: getShared().setType(value);
087: }
088:
089: /**
090: * Returns the min occurs.
091: */
092: public String getMinOccurs() {
093: return getShared().getMinOccurs();
094: }
095:
096: public void setMinOccurs(String value) {
097: getShared().setMinOccurs(value);
098: }
099:
100: /**
101: * Returns the max occurs.
102: */
103: public String getMaxOccurs() {
104: return getShared().getMaxOccurs();
105: }
106:
107: public void setMaxOccurs(String value) {
108: getShared().setMaxOccurs(value);
109: }
110:
111: /**
112: * Adds a Compositor as its child.
113: */
114: public void addCompositor(CompositorProxy compositor) {
115: getShared().addCompositor(compositor);
116: }
117:
118: /**
119: * Removes an Compositor.
120: */
121: public void removeCompositor(CompositorProxy compositor) {
122: getShared().removeCompositor(compositor);
123: }
124:
125: /**
126: * Adds an Element as its child.
127: */
128: public void addElement(Element element) {
129: getShared().addElement(element);
130: }
131:
132: /**
133: * Removes an Element.
134: */
135: public void removeElement(Element element) {
136: getShared().removeElement(element);
137: }
138:
139: public String toString() {
140: return getShared().toString();
141: }
142:
143: }
|