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: /*
043: * Created on Jul 15, 2003
044: *
045: */
046: package org.netbeans.modules.uml.ui.controls.newdialog;
047:
048: import java.util.Vector;
049:
050: import org.netbeans.modules.uml.core.metamodel.core.foundation.INamespace;
051: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
052: import org.netbeans.modules.uml.core.metamodel.diagrams.IDiagramKind;
053:
054: /**
055: * @author sumitabhk
056: *
057: */
058: public class NewDialogDiagramDetails implements
059: INewDialogDiagramDetails {
060: private String m_Name;
061: private INamespace m_Namespace;
062: private Vector<IElement> m_AdditionalNamespaces;
063: private int /*DiagramKind*/m_DiagramKind;
064: private int m_lAvailableDiagramKinds;
065:
066: /**
067: *
068: */
069: public NewDialogDiagramDetails() {
070: super ();
071: m_DiagramKind = IDiagramKind.DK_UNKNOWN;
072: m_lAvailableDiagramKinds = IDiagramKind.DK_ALL;
073: }
074:
075: /**
076: * Name of the diagram.
077: *
078: * @param pVal[out]
079: *
080: * @return HRESULT
081: */
082: public String getName() {
083: return m_Name;
084: }
085:
086: /**
087: * Name of the diagram.
088: *
089: * @param newVal[in]
090: *
091: * @return HRESULT
092: */
093: public void setName(String value) {
094: m_Name = value;
095: }
096:
097: /**
098: * The selected namespace.
099: *
100: * @param pVal[out]
101: *
102: * @return HRESULT
103: */
104: public INamespace getNamespace() {
105: return m_Namespace;
106: }
107:
108: /**
109: * The selected namespace.
110: *
111: * @param pVal[in]
112: *
113: * @return HRESULT
114: */
115: public void setNamespace(INamespace value) {
116: m_Namespace = value;
117: }
118:
119: /**
120: * Adds an additional namespace to our list of possible namespaces.
121: *
122: * @param pNamespace[in]
123: *
124: * @return HRESULT
125: */
126: public long addNamespace(INamespace pNamespace) {
127: if (pNamespace instanceof IElement) {
128: if (m_AdditionalNamespaces == null) {
129: m_AdditionalNamespaces = new Vector<IElement>();
130: }
131: if (m_AdditionalNamespaces != null) {
132: IElement pElement = (IElement) pNamespace;
133: m_AdditionalNamespaces.add(pElement);
134: }
135: }
136: return 0;
137: }
138:
139: /**
140: * The selected diagram kind.
141: *
142: * @param pVal[out]
143: *
144: * @return HRESULT
145: */
146: public int getDiagramKind() {
147: return m_DiagramKind;
148: }
149:
150: /**
151: * The selected diagram kind.
152: *
153: * @param pVal[in]
154: *
155: * @return HRESULT
156: */
157: public void setDiagramKind(int value) {
158: m_DiagramKind = value;
159: }
160:
161: /**
162: * The diagram kinds that are available for selection in the dialog.
163: *
164: * @param pVal[out]
165: *
166: * @return HRESULT
167: */
168: public int getAvailableDiagramKinds() {
169: return m_lAvailableDiagramKinds;
170: }
171:
172: /**
173: * The diagram kinds that are available for selection in the dialog.
174: *
175: * @param pVal[in]
176: *
177: * @return HRESULT
178: */
179: public void setAvailableDiagramKinds(int value) {
180: m_lAvailableDiagramKinds = value;
181: }
182:
183: }
|